
Fernando Pelliccioni wrote:
On Wed, Jul 20, 2011 at 1:36 PM, Vicente Botet <vicente.botet@wanadoo.fr>wrote:
Hi Vicente,
Can Boost.Opaque supports something like this ... ?
void test_iostream_concept() { typedef ?????????? any_type; //define any_type using boost.opaque with meta-mixins
typedef std::vector<any_type> ostr_vec; ostr_vec vec;
io::stream<sink_x> writer1; //boost iostreams std::ofstream f1("test.txt");
vec.push_back( any_type(writer1) ); vec.push_back( any_type(std::cout) ); vec.push_back( any_type(f1) );
ostr_vec::const_iterator it = vec.begin(); ostr_vec::const_iterator end = vec.end();
for ( ; it != end; ++it ) { //(*it) << "hello " << "world!"; //(1) compile-time error. any_type do not support operator<< } }
Hi, Boost.Opaque is intended to define types that different from others. What I think you are looking for is provided by Boost.TypeErasure (from Steave Watanave). I pretend to adapt Boost.Opaque to the design of Boost.TypeErasure (as I missed some features (, as multiple overloadings) that can not be provided with the current design). Best, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/Opaque-Request-for-interest-in-Opaque-typ... Sent from the Boost - Dev mailing list archive at Nabble.com.