[type_erasure] Using BOOST_TYPE_ERASURE_MEMBER
Hi, I need some help with using BOOST_TYPE_ERASURE_MEMBER. The example in the tutorial works as described. But the interface binds to object by reference. But if I change it to bind by value, I get a compile-time error. BOOST_TYPE_ERASURE_MEMBER((has_push_back), push_back, 1) void append_many(any<has_push_back<void(int)>> container) { for(int i = 0; i < 10; ++i) container.push_back(i);} How can I fix it? I do want to bind by value. Regards, &rzej
Right, copy_constructible<>, I forgot. Steve, did you consider adding copy_constructible<> to relaxed? Regards, &rzej 2013/12/6 Andrzej Krzemienski <akrzemi1@gmail.com>
Hi, I need some help with using BOOST_TYPE_ERASURE_MEMBER. The example in the tutorial works as described. But the interface binds to object by reference. But if I change it to bind by value, I get a compile-time error.
BOOST_TYPE_ERASURE_MEMBER((has_push_back), push_back, 1) void append_many(any<has_push_back<void(int)>> container) { for(int i = 0; i < 10; ++i) container.push_back(i);}
How can I fix it? I do want to bind by value.
Regards, &rzej
participants (1)
-
Andrzej Krzemienski