Boost logo

Boost :

Subject: Re: [boost] [TypeErasure] BOOST_TYPE_ERASURE_MEMBER
From: Julien Nitard (julien.nitard_at_[hidden])
Date: 2012-07-23 11:44:45

>> Isn't this giving the way for hard to find mistakes ?
> Mistakes like what? The signature is
> specified when using the concept.

Well then one need to typedef the "final" concept or risk very strange
errors if some type don't match, due to simple typo.

I have tried something similar to this (shortened but I could provide
a full version):

BOOST_TYPE_ERASURE_MEMBER((connect_), Connect, 1);

template <class Socket>
struct disconnect
    static void apply(Socket& sock)

typedef mpl::vector<connect_<void(const EndPoint&)>,
disconnect<_self>, copy_constructible<> > SockReqs;

typedef any<mpl::vector<connect_<void(const EndPoint)> >, _self&>
AnyConnect; // WOOPS, missed the "&"

void DoConnect(AnyConnect ac)


AnySockRef as2(...);
AnyConnect ac2(as2);

Even with clang I get 50 lines of errors starting with:

clang++ -std=c++0x -c
"/media/win/Projects/type_erasure/type_erasure/main.cpp" -O2 -Wall
-o ./Release/main.o -I. -I/media/win/Projects/boost_trunk
-I/media/win/Projects/type_erasure -I.
In file included from /media/win/Projects/type_erasure/type_erasure/main.cpp:6:
In file included from
In file included from
In file included from
In file included from
error: no matching member function for call to 'lookup'


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