[boost.typeof] Using boost::bind with BOOST_AUTO

I have the following code:
#include

I've registered bind:
#include
<snip>
Does BOOST_AUTO supports boost::bind?
In emulation mode, Boost.Typeof only has builtin support for standard and built in types. Other types need to be registered. In Christ, Steven Watanabe

AMDG Roberto Giménez wrote:
I've registered bind:
#include
#include #include <iostream> #include <typeinfo> void test() { }
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::_bi::bind_t, 3);
int main(int argc, char** argv) { typedef BOOST_TYPEOF_TPL(boost::bind(&test)) Type;
std::cout << typeid(Type).name() << std::endl; }
But this prints 'int', but should be: boost::_bi::bind_t
What's wrong?
A few more registrations are missing. Unfortunately, Sun CC
silently substitutes int in some places where template instantiation fails.
#define BOOST_TYPEOF_EMULATION
#include

That solved my problem.
Thanks!
"Steven Watanabe"
I've registered bind:
#include
#include #include <iostream> #include <typeinfo> void test() { }
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::_bi::bind_t, 3);
int main(int argc, char** argv) { typedef BOOST_TYPEOF_TPL(boost::bind(&test)) Type;
std::cout << typeid(Type).name() << std::endl; }
But this prints 'int', but should be: boost::_bi::bind_t
What's wrong?
A few more registrations are missing. Unfortunately, Sun CC
silently substitutes int in some places where template instantiation fails.
#define BOOST_TYPEOF_EMULATION
#include

Hi Steven, Steven Watanabe wrote:
AMDG
Roberto Giménez wrote:
I've registered bind:
[snip typeof support for bind] This looks like a generally useful feature to be included in boost. Can this (with necessary modifications, of course) be added in the form of a new optional header boost/bind/typeof.hpp ? Best Regards, Gevorg

AMDG Gevorg Voskanyan wrote:
Steven Watanabe wrote:
AMDG
Roberto Giménez wrote:
I've registered bind:
[snip typeof support for bind]
This looks like a generally useful feature to be included in boost. Can this (with necessary modifications, of course) be added in the form of a new optional header boost/bind/typeof.hpp ?
You can create a ticket at svn.boost.org. Otherwise, it's likely to get lost. In Christ, Steven Watanabe

Steven Watanabe wrote:
Gevorg Voskanyan wrote:
[snip]
Can this (with necessary modifications, of course) be added in the form of a new optional header boost/bind/typeof.hpp ?
You can create a ticket at svn.boost.org. Otherwise, it's likely to get lost.
Done. https://svn.boost.org/trac/boost/ticket/3139 I added the necessary registrations to support non-nullary functions and placeholders as well. Best Regards, Gevorg
participants (3)
-
Gevorg Voskanyan
-
Roberto Gim�nez
-
Steven Watanabe