Boost logo

Boost :

Subject: [boost] [type_erasure] Using BOOST_TYPE_ERASURE_MEMBER
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2013-12-06 03:16:42

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)

How can I fix it? I do want to bind by value.


Boost list run by bdawes at, gregod at, cpdaniel at, john at