Boost logo

Boost :

Subject: Re: [boost] [TypeErasure] Forward constructors and binded types
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-07-19 08:06:30


On 07/19/12 06:08, Larry Evans wrote:
> On 07/18/12 01:29, Vicente J. Botet Escriba wrote:
>> Hi,,
>>
>> In the example from the doc
>>
>> typedef mpl::vector<
>> copy_constructible<_a>,
>> copy_constructible<_b>,
>> copy_constructible<_c>,
>> constructible<_a(const _b&, const _c&)>
>> > construct;
>>
>> std::vector<double> vec;
>> int i = 10;
>> double d = 2.5;
>> tuple<construct, _a&, _b, _c> t(vec, i, d);
>> any<construct, _a> v(get<1>(t), get<2>(t));
>>
> [snip]
> The 1st attachment, composed from above, doesn't compile,
> giving errors in 2nd attachment.
>
> svn update shows:
>
> Updated to revision 79597.
>
> How should the code be changed to allow compilation?
>
It compiles OK when the -std=gnu++11 option is removed.
However, it's still producing warnings like:

../../../boost/type_erasure/detail/adapt_to_vtable.hpp: In static member
function 'static R
boost::type_erasure::detail::vtable_adapter<PrimitiveConcept,
R()>::value()':
../../../boost/type_erasure/detail/adapt_to_vtable.hpp:236:11: warning:
typedef 'traits' locally defined but not used [-Wunused-local-typedefs]
> traits;
           ^
In file included from botet_construct.cpp:6:0:
../../../boost/type_erasure/any_cast.hpp: In function 'T
boost::type_erasure::any_cast(const boost::type_erasure::any<Concept,
Tag>&)':
../../../boost/type_erasure/any_cast.hpp:132:13: warning: typedef
'tag_type' locally defined but not used [-Wunused-local-typedefs]
>::type tag_type;
             ^

This is with compiler:

ftp://gcc.gnu.org/pub/gcc/snapshots/4.8-20120624/gcc-4.8-20120624.tar.bz2

-regards,
Larry


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