Boost logo

Boost :

Subject: Re: [boost] [Opaque] Request for interest in Opaque typedefs library emulation
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-07-27 07:37:25


Fernando Pelliccioni wrote:
>
> On Wed, Jul 20, 2011 at 1:36 PM, Vicente Botet
> <vicente.botet_at_[hidden]>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-typedefs-library-emulation-tp2668541p3698208.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk