[type_erasure] overloading macro

Hi all, I played a bit more with overloading and it started being annoying and error-prone to add more overloads of concept_map (with more arguments) so I wrote a small macro to 1) generate my overloads and 2) save myself the time reading compiler errors when I use BOOST_TYPE_ERASURE_MEMBER and make a mistake in the number of arguments. It's for C++11 (argument pack) as it's all I need at the moment but I suppose that with Boost.Preprocessor, it'd be for C++03 doable. Well, in case it'd be of any use to someone, here it is, with a small test (tested with g+ 4.5 with -std=c++0x). #include <boost/type_erasure/concept_interface.hpp> #include <boost/type_erasure/rebind_any.hpp> #include <boost/type_erasure/derived.hpp> #include <boost/type_erasure/is_placeholder.hpp> #include <boost/type_erasure/constructible.hpp> #include <boost/type_erasure/relaxed_match.hpp> #include <boost/type_erasure/any.hpp> #include <boost/type_erasure/builtin.hpp> #include <boost/type_erasure/any_cast.hpp> #include <boost/type_erasure/detail/macro.hpp> #include <boost/mpl/vector.hpp> #include <iostream> #ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_TYPE_ERASURE_MEMBER_VARIADIC_I(qualname,concept_name,member) \ BOOST_TYPE_ERASURE_OPEN_NAMESPACE(qualname) \ template <typename T, typename... Args> \ struct concept_name{ \ static void apply(const T& t, const Args... a) { t.member(a...); } }; \ BOOST_TYPE_ERASURE_CLOSE_NAMESPACE(qualname) \ namespace boost { namespace type_erasure { \ template<class T, typename... U, class Base, class Enable> \ struct concept_interface< BOOST_TYPE_ERASURE_QUALIFIED_NAME(qualname)<T, U... >, Base, T, Enable> : Base { \ typedef void _fun_defined; \ void member(typename rebind_any<Base, U>::type... arg)const \ {call(BOOST_TYPE_ERASURE_QUALIFIED_NAME(qualname)<T, U...>(), *this, arg...);} }; \ template<class T, typename... U, class Base> \ struct concept_interface< BOOST_TYPE_ERASURE_QUALIFIED_NAME(qualname)<T, U...>, Base, T, typename Base::_fun_defined> : Base{ \ using Base::member; void member(typename rebind_any<Base, U
::type... arg)const \ {call(BOOST_TYPE_ERASURE_QUALIFIED_NAME(qualname)<T, U...>(), *this, arg...);} }; \ }} #endif
#define BOOST_TYPE_ERASURE_MEMBER_VARIADIC(qualified_name,member) \ BOOST_TYPE_ERASURE_MEMBER_VARIADIC_I( \ qualified_name, \ BOOST_PP_SEQ_ELEM(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(qualified_name)), qualified_name), \ member) // supports overloading, does not require any number of arguments BOOST_TYPE_ERASURE_MEMBER_VARIADIC((n1)(n2)(foo),foo) namespace mpl = boost::mpl; using namespace boost::type_erasure; struct Test { void foo()const { std::cout << "foo() called" << std::endl; } void foo(int i)const { std::cout << "foo(int) called with: " << i << std::endl; } void foo(int i,char c)const { std::cout << "foo(int,char) called with: " << i << "," << c << std::endl; } void foo(double d)const { std::cout << "foo(double) called with: " << d << std::endl; } void foo(int i,double d)const { std::cout << "foo(int,double) called with: " << i << "," << d << std::endl; } void foo(int i,double d,char c)const { std::cout << "foo(int,double,char) called with: " << i << "," << d << "," << c << std::endl; } }; int main() { Test t; any< mpl::vector< n1::n2::foo<_self>, n1::n2::foo<_self, int>, n1::n2::foo<_self, double>, n1::n2::foo<_self, int, double>, n1::n2::foo<_self, int, char>, n1::n2::foo<_self, int, double, char>, copy_constructible<> > > x (t); x.foo(); // calls foo() x.foo(1); // calls foo(int) x.foo(1.0); // calls foo(double) x.foo(1,1.0); // calls foo(int, double) x.foo(1,'a'); // calls foo(int, char) x.foo(1,1.0,'a'); // calls foo(int, double,char) return 0; }

AMDG On 02/19/2013 09:11 AM, Christophe Henry wrote:
Hi all,
I played a bit more with overloading and it started being annoying and error-prone to add more overloads of concept_map (with more arguments) so I wrote a small macro to 1) generate my overloads and 2) save myself the time reading compiler errors when I use BOOST_TYPE_ERASURE_MEMBER and make a mistake in the number of arguments.
Indeed. I just committed an update a couple of days ago to BOOST_TYPE_ERASURE_MEMBER to use variadic templates under C++11. In Christ, Steven Watanabe

I played a bit more with overloading and it started being annoying and error-prone to add more overloads of concept_map (with more arguments) so I wrote a small macro to 1) generate my overloads and 2) save myself the time reading compiler errors when I use BOOST_TYPE_ERASURE_MEMBER and make a mistake in the number of arguments.
Indeed. I just committed an update a couple of days ago to BOOST_TYPE_ERASURE_MEMBER to use variadic templates under C++11.
Oh I missed this :( I just tried your newer version and it works. Do you plan to support this also for C++03? Before I plan another useless workaround, do you plan to support anytime soon rvalue references in the concept map definition? It'd be something useful. Thanks, Christophe

AMDG On 02/19/2013 12:32 PM, Christophe Henry wrote:
I played a bit more with overloading and it started being annoying and error-prone to add more overloads of concept_map (with more arguments) so I wrote a small macro to 1) generate my overloads and 2) save myself the time reading compiler errors when I use BOOST_TYPE_ERASURE_MEMBER and make a mistake in the number of arguments.
Indeed. I just committed an update a couple of days ago to BOOST_TYPE_ERASURE_MEMBER to use variadic templates under C++11.
Oh I missed this :( I just tried your newer version and it works. Do you plan to support this also for C++03?
No.
Before I plan another useless workaround, do you plan to support anytime soon rvalue references in the concept map definition? It'd be something useful.
I don't know exactly what you're referring to. I don't remember off hand how complete my rvalue reference support is. I'll try to finish it off after I implement a variadic BOOST_TYPE_ERASURE_FREE. In Christ, Steven Watanabe

Oh I missed this :( I just tried your newer version and it works. Do you plan to support this also for C++03?
No.
I'm pretty bad with Boost.Preprocessor but I suppose it'd be doable with a max number of arguments, right?
Before I plan another useless workaround, do you plan to support anytime soon rvalue references in the concept map definition? It'd be something useful.
I don't know exactly what you're referring to. I don't remember off hand how complete my rvalue reference support is. I'll try to finish it off after I implement a variadic BOOST_TYPE_ERASURE_FREE.
I mean something like this in a concept map: struct any_foo: ::boost::mpl::vector< has_foo<void(Something&&), const boost::type_erasure::_a> ...> {}; This would avoid some very dirty workaround I am seriously considering.
In Christ, Steven Watanabe
Thanks, Christophe

AMDG On 02/19/2013 02:08 PM, Christophe Henry wrote:
Oh I missed this :( I just tried your newer version and it works. Do you plan to support this also for C++03?
No.
I'm pretty bad with Boost.Preprocessor but I suppose it'd be doable with a max number of arguments, right?
It is doable, but I don't think I want to expend the effort on something that will be obsolete in a few years.
Before I plan another useless workaround, do you plan to support anytime soon rvalue references in the concept map definition? It'd be something useful.
I don't know exactly what you're referring to. I don't remember off hand how complete my rvalue reference support is. I'll try to finish it off after I implement a variadic BOOST_TYPE_ERASURE_FREE.
I mean something like this in a concept map: struct any_foo: ::boost::mpl::vector< has_foo<void(Something&&), const boost::type_erasure::_a> ...> {};
This would avoid some very dirty workaround I am seriously considering.
It may or may not work. I've implemented most of what's necessary, but I might have missed a few things. I should get around to it within a few weeks. In Christ, Steven Watanabe

Oh I missed this :( I just tried your newer version and it works. Do you plan to support this also for C++03?
No.
I'm pretty bad with Boost.Preprocessor but I suppose it'd be doable with a max number of arguments, right?
It is doable, but I don't think I want to expend the effort on something that will be obsolete in a few years.
I understand this as I have the same problem.
I mean something like this in a concept map: struct any_foo: ::boost::mpl::vector< has_foo<void(Something&&), const boost::type_erasure::_a> ...> {};
This would avoid some very dirty workaround I am seriously considering.
It may or may not work. I've implemented most of what's necessary, but I might have missed a few things. I should get around to it within a few weeks.
I'll be happy to test it when you have something working.
In Christ, Steven Watanabe
Thanks, Christophe

AMDG On 02/19/2013 02:42 PM, Christophe Henry wrote:
I mean something like this in a concept map: struct any_foo: ::boost::mpl::vector< has_foo<void(Something&&), const boost::type_erasure::_a> ...> {};
This would avoid some very dirty workaround I am seriously considering.
It may or may not work. I've implemented most of what's necessary, but I might have missed a few things. I should get around to it within a few weeks.
I'll be happy to test it when you have something working.
BOOST_TYPE_ERASURE_MEMBER now supports rvalue references. In Christ, Steven Watanabe

It may or may not work. I've implemented most of what's necessary, but I might have missed a few things. I should get around to it within a few weeks.
I'll be happy to test it when you have something working.
BOOST_TYPE_ERASURE_MEMBER now supports rvalue references.
In Christ, Steven Watanabe
Hi Steven, I don't manage to get it to work, am I missing something? I get a "no matching function call" (gcc 4.7.2). BOOST_TYPE_ERASURE_MEMBER((n1)(has_foo), foo); struct Data{}; struct Test { void foo(Data&&)const { std::cout << "foo(Data&&) called" << std::endl; } void foo(int,double)const { std::cout << "foo(int,double) called" << std::endl; } }; int main() { Test t; any< mpl::vector< n1::has_foo<void(Data&&),const _self>, n1::has_foo<void(int, double),const _self>, copy_constructible<> > > x (t); //x.foo(Data()); // ===> this will not compile x.foo(1,1.0); // calls foo(int, double) return 0; } Thanks, Christophe

AMDG On 02/26/2013 01:24 PM, Christophe Henry wrote:
BOOST_TYPE_ERASURE_MEMBER now supports rvalue references.
I don't manage to get it to work, am I missing something? I get a "no matching function call" (gcc 4.7.2).
Works for me: $ /usr/local/gcc-4.7.2/bin/g++ -c -std=c++11 scratch.cpp -Itrunk -Itype_erasure (I just added #includes and using directives) sandbox@83160, trunk@83162 Can you give me the complete test case, svn revision numbers and error messages?
BOOST_TYPE_ERASURE_MEMBER((n1)(has_foo), foo);
struct Data{};
struct Test { void foo(Data&&)const { std::cout << "foo(Data&&) called" << std::endl; } void foo(int,double)const { std::cout << "foo(int,double) called" << std::endl; } };
int main() { Test t; any< mpl::vector< n1::has_foo<void(Data&&),const _self>, n1::has_foo<void(int, double),const _self>, copy_constructible<> > > x (t); //x.foo(Data()); // ===> this will not compile x.foo(1,1.0); // calls foo(int, double) return 0; }
In Christ, Steven Watanabe

I'm using mingw 4.7.2 -c -std=c++11, sandbox (83160). I'll try tomorrow with a linux gcc 4.5. Complete code: #include <boost/type_erasure/concept_interface.hpp> #include <boost/type_erasure/rebind_any.hpp> #include <boost/type_erasure/derived.hpp> #include <boost/type_erasure/is_placeholder.hpp> #include <boost/type_erasure/constructible.hpp> #include <boost/type_erasure/relaxed_match.hpp> #include <boost/type_erasure/any.hpp> #include <boost/type_erasure/builtin.hpp> #include <boost/type_erasure/any_cast.hpp> #include <boost/type_erasure/member.hpp> #include <boost/mpl/vector.hpp> #include <iostream> namespace mpl = boost::mpl; using namespace boost::type_erasure; BOOST_TYPE_ERASURE_MEMBER((n1)(has_foo), foo); struct Data{}; struct Test { void foo(Data&&)const { std::cout << "foo(Data&&) called" << std::endl; } void foo(int,double)const { std::cout << "foo(int,double) called" << std::endl; } }; int main() { Test t; any< mpl::vector< n1::has_foo<void(Data&&),const _self>, n1::has_foo<void(int, double),const _self>, copy_constructible<> > > x (t); x.foo(Data()); x.foo(1,1.0); // calls foo(int, double) return 0; } Error message: ..\testtyperasure\main.cpp: In instantiation of 'typename boost::type_erasure::rebind_any<Base, R>::type boost::type_erasure::concept_interface<n1::has_foo<R(A ...), T>, Base, typename boost::enable_if<boost::type_erasure::detail::should_be_const<T, Base>, typename boost::remove_const<T>::type>::type, typename Base::_boost_type_erasure_has_memberfoo>::foo(typename boost::type_erasure::as_param<Base, A>::type ...) const [with R = void; A = {Data&&}; T = const boost::type_erasure::_self; Base = boost::type_erasure::concept_interface<n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::copy_constructible<>, boost::type_erasure::concept_interface<boost::type_erasure::constructible<boost::type_erasure::_self(const boost::type_erasure::_self&)>, boost::type_erasure::concept_interface<boost::type_erasure::destructible<boost::type_erasure::_self>, boost::type_erasure::any_base<boost::type_erasure::any<boost::mpl::vector<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::copy_constructible<> > >
, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>; typename Base::_boost_type_erasure_has_memberfoo = void; typename boost::enable_if<boost::type_erasure::detail::should_be_const<T, Base>, typename boost::remove_const<T>::type>::type = boost::type_erasure::_self; typename boost::type_erasure::rebind_any<Base, R>::type = void; typename boost::type_erasure::as_param<Base, A>::type = <type error>]': ..\testtyperasure\main.cpp:45:17: required from here ..\testtyperasure\main.cpp:19:1: error: no matching function for call to 'call(n1::has_foo<void(Data&&), const boost::type_erasure::_self>, const boost::type_erasure::concept_interface<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::copy_constructible<>, boost::type_erasure::concept_interface<boost::type_erasure::constructible<boost::type_erasure::_self(const boost::type_erasure::_self&)>, boost::type_erasure::concept_interface<boost::type_erasure::destructible<boost::type_erasure::_self>, boost::type_erasure::any_base<boost::type_erasure::any<boost::mpl::vector<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::copy_constructible<> > > , boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>&, Data)' ..\testtyperasure\main.cpp:19:1: note: candidates are: In file included from ..\..\boost_1_52_0/boost/type_erasure/constructible.hpp:21:0, from ..\testtyperasure\main.cpp:5: ..\..\boost_1_52_0/boost/type_erasure/call.hpp:333:1: note: template<class Concept, class Op, class ... U> typename boost::type_erasure::detail::call_result<Op, void(U&& ...), Concept>::type boost::type_erasure::call(const boost::type_erasure::binding<Concept>&, const Op&, U&& ...) ..\..\boost_1_52_0/boost/type_erasure/call.hpp:333:1: note: template argument deduction/substitution failed: ..\testtyperasure\main.cpp:19:1: note: 'n1::has_foo<void(Data&&), const boost::type_erasure::_self>' is not derived from 'const boost::type_erasure::binding<Concept>' In file included from ..\..\boost_1_52_0/boost/type_erasure/constructible.hpp:21:0, from ..\testtyperasure\main.cpp:5: ..\..\boost_1_52_0/boost/type_erasure/call.hpp:366:1: note: template<class Op, class ... U> typename boost::type_erasure::detail::call_result<Op, void(U&& ...)>::type boost::type_erasure::call(const Op&, U&& ...) ..\..\boost_1_52_0/boost/type_erasure/call.hpp:366:1: note: template argument deduction/substitution failed: ..\..\boost_1_52_0/boost/type_erasure/call.hpp: In substitution of 'template<class Op, class ... U> typename boost::type_erasure::detail::call_result<Op, void(U&& ...)>::type boost::type_erasure::call(const Op&, U&& ...) [with Op = n1::has_foo<void(Data&&), const boost::type_erasure::_self>; U = {const boost::type_erasure::concept_interface<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::copy_constructible<boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::constructible<boost::type_erasure::_self(const boost::type_erasure::_self&)>, boost::type_erasure::concept_interface<boost::type_erasure::destructible<boost::type_erasure::_self>, boost::type_erasure::any_base<boost::type_erasure::any<boost::mpl::vector<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::copy_constructible<boost::type_erasure::_self>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::type_erasure::_self> >, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>&, Data}]': ..\testtyperasure\main.cpp:19:1: required from 'typename boost::type_erasure::rebind_any<Base, R>::type boost::type_erasure::concept_interface<n1::has_foo<R(A ...), T>, Base, typename boost::enable_if<boost::type_erasure::detail::should_be_const<T, Base>, typename boost::remove_const<T>::type>::type, typename Base::_boost_type_erasure_has_memberfoo>::foo(typename boost::type_erasure::as_param<Base, A>::type ...) const [with R = void; A = {Data&&}; T = const boost::type_erasure::_self; Base = boost::type_erasure::concept_interface<n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::copy_constructible<>, boost::type_erasure::concept_interface<boost::type_erasure::constructible<boost::type_erasure::_self(const boost::type_erasure::_self&)>, boost::type_erasure::concept_interface<boost::type_erasure::destructible<boost::type_erasure::_self>, boost::type_erasure::any_base<boost::type_erasure::any<boost::mpl::vector<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::copy_constructible<> > > , boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>; typename Base::_boost_type_erasure_has_memberfoo = void; typename boost::enable_if<boost::type_erasure::detail::should_be_const<T, Base>, typename boost::remove_const<T>::type>::type = boost::type_erasure::_self; typename boost::type_erasure::rebind_any<Base, R>::type = void; typename boost::type_erasure::as_param<Base, A>::type = <type error>]' ..\testtyperasure\main.cpp:45:17: required from here ..\..\boost_1_52_0/boost/type_erasure/call.hpp:366:1: error: no type named 'type' in 'struct boost::type_erasure::detail::call_result<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, void(const boost::type_erasure::concept_interface<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::copy_constructible<>, boost::type_erasure::concept_interface<boost::type_erasure::constructible<boost::type_erasure::_self(const boost::type_erasure::_self&)>, boost::type_erasure::concept_interface<boost::type_erasure::destructible<boost::type_erasure::_self>, boost::type_erasure::any_base<boost::type_erasure::any<boost::mpl::vector<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::copy_constructible<> > > , boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>&, Data&&), void>' ..\testtyperasure\main.cpp: In instantiation of 'typename boost::type_erasure::rebind_any<Base, R>::type boost::type_erasure::concept_interface<n1::has_foo<R(A ...), T>, Base, typename boost::enable_if<boost::type_erasure::detail::should_be_const<T, Base>, typename boost::remove_const<T>::type>::type, typename Base::_boost_type_erasure_has_memberfoo>::foo(typename boost::type_erasure::as_param<Base, A>::type ...) const [with R = void; A = {Data&&}; T = const boost::type_erasure::_self; Base = boost::type_erasure::concept_interface<n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::concept_interface<boost::type_erasure::copy_constructible<>, boost::type_erasure::concept_interface<boost::type_erasure::constructible<boost::type_erasure::_self(const boost::type_erasure::_self&)>, boost::type_erasure::concept_interface<boost::type_erasure::destructible<boost::type_erasure::_self>, boost::type_erasure::any_base<boost::type_erasure::any<boost::mpl::vector<n1::has_foo<void(Data&&), const boost::type_erasure::_self>, n1::has_foo<void(int, double), const boost::type_erasure::_self>, boost::type_erasure::copy_constructible<> > > , boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>, boost::type_erasure::_self, void>; typename Base::_boost_type_erasure_has_memberfoo = void; typename boost::enable_if<boost::type_erasure::detail::should_be_const<T, Base>, typename boost::remove_const<T>::type>::type = boost::type_erasure::_self; typename boost::type_erasure::rebind_any<Base, R>::type = void; typename boost::type_erasure::as_param<Base, A>::type = <type error>]': ..\testtyperasure\main.cpp:45:17: required from here ..\testtyperasure\main.cpp:19:1: error: return-statement with a value, in function returning 'void' [-fpermissive]

AMDG
On 02/26/2013 01:59 PM, Christophe Henry wrote:
I'm using mingw 4.7.2 -c -std=c++11, sandbox (83160). I'll try tomorrow with a linux gcc 4.5.
Sorry, 4.7.1
gcc 4.7.1 also passes. I'm testing on linux right now, so maybe this is a mingw issue.
In Christ, Steven Watanabe
linux + clang (from trunk) => pass linux + gcc 4.5 => does not pass Maybe some gcc issue? This is sad. Worse, I cannot use BOOST_NO_RVALUE_REFERENCES because all these compilers advertise supporting rvalue refs. Christophe

AMDG On 02/27/2013 07:56 AM, Christophe Henry wrote:
On 02/26/2013 01:59 PM, Christophe Henry wrote:
I'm using mingw 4.7.2 -c -std=c++11, sandbox (83160). I'll try tomorrow with a linux gcc 4.5.
Sorry, 4.7.1
gcc 4.7.1 also passes. I'm testing on linux right now, so maybe this is a mingw issue.
In Christ, Steven Watanabe
linux + clang (from trunk) => pass linux + gcc 4.5 => does not pass
Maybe some gcc issue? This is sad. Worse, I cannot use BOOST_NO_RVALUE_REFERENCES because all these compilers advertise supporting rvalue refs.
I can reproduce this with linux + gcc 4.5.1 -std=c++0x. In Christ, Steven Watanabe

AMDG On 02/27/2013 07:56 AM, Christophe Henry wrote:
linux + clang (from trunk) => pass linux + gcc 4.5 => does not pass
Maybe some gcc issue? This is sad. Worse, I cannot use BOOST_NO_RVALUE_REFERENCES because all these compilers advertise supporting rvalue refs.
Okay, I've traced the problem: BOOST_MPL_ASSERT((boost::is_convertible<Data&&, Data&&>)); // fails Not quite sure how to solve it though... In Christ, Steven Watanabe

AMDG On 02/27/2013 12:41 PM, Christophe Henry wrote:
Okay, I've traced the problem:
BOOST_MPL_ASSERT((boost::is_convertible<Data&&, Data&&>)); // fails
Yes, it also fails on my mingw 4.7.1. Looks like you found the culprit.
Not quite sure how to solve it though...
Hmmm no idea :(
Does std::is_convertible work? In Christ, Steven Watanabe

Okay, I've traced the problem:
BOOST_MPL_ASSERT((boost::is_convertible<Data&&, Data&&>)); // fails
Yes, it also fails on my mingw 4.7.1. Looks like you found the culprit.
Not quite sure how to solve it though...
Hmmm no idea :(
Does std::is_convertible work?
In Christ, Steven Watanabe
Oh! Surprisingly, yes. Thanks, Christophe

AMDG On 02/27/2013 01:48 PM, Christophe Henry wrote:
Okay, I've traced the problem:
BOOST_MPL_ASSERT((boost::is_convertible<Data&&, Data&&>)); // fails
Yes, it also fails on my mingw 4.7.1. Looks like you found the culprit.
Not quite sure how to solve it though...
Hmmm no idea :(
Does std::is_convertible work?
Oh! Surprisingly, yes.
I'm guessing that std::is_convertible has some other problem which is the reason that boost::is_convertible is not implemented in the same way. So, I'm just disabling the test. This probably won't catch mingw. Would you mind fiddling with the condition at detail/check_call.cpp:118 to make it work. In Christ, Steven Watanabe

----- Original Message ----- From: "Steven Watanabe" <watanabesj@gmail.com> Newsgroups: gmane.comp.lib.boost.devel To: <boost@lists.boost.org> Sent: Thursday, February 28, 2013 5:42 PM Subject: Re: [type_erasure] overloading macro
AMDG
On 02/27/2013 01:48 PM, Christophe Henry wrote:
Okay, I've traced the problem:
BOOST_MPL_ASSERT((boost::is_convertible<Data&&, Data&&>)); // fails
Yes, it also fails on my mingw 4.7.1. Looks like you found the culprit.
Not quite sure how to solve it though...
Hmmm no idea :(
Does std::is_convertible work?
Oh! Surprisingly, yes.
I'm guessing that std::is_convertible has some other problem which is the reason that boost::is_convertible is not implemented in the same way. So, I'm just disabling the test. This probably won't catch mingw.
True, it doesn't ;-)
Would you mind fiddling with the condition at detail/check_call.cpp:118 to make it work.
Why not add to this line an if defined _WIN32 && defined __GNUC__ until the first mingw version where this is solved? Thanks, Christophe
In Christ, Steven Watanabe
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Christophe Henry
-
Steven Watanabe