Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: TypeErasure
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-06-27 12:26:37


On 06/27/12 10:04, Larry Evans wrote:
> On 06/19/12 08:42, Larry Evans wrote:
>> On 05/22/12 15:34, Steven Watanabe wrote:
>> [snip]
>>> The library is available in the Boost Sandbox at
>>> http://svn.boost.org/svn/boost/sandbox/type_erasure/
>>
>> The type_erasure version I have is:
>>
>> ~/prog_dev/boost-svn/ro/boost_1_49_0/sandbox/ro/type_erasure/type_erasure $
>> svn update
>> At revision 79008.
>>
>> However, compiling multi.cpp with gcc4.8 (2012-04-22)
>> gives a uninitialized constexpr error.
>>
>> compilation; default-directory:
>> "~/prog_dev/boost-svn/ro/boost_1_49_0/sandbox/ro/type_erasure/type_erasure/libs/type_erasure/example/"
>> -*-
>> Compilation started at Tue Jun 19 08:36:12
>>
>> bjam multi
>> sh: icpc: not found
>> ...patience...
>> ...found 550 targets...
>> ...updating 4 targets...
>> common.mkdir bin/multi.test/gcc-4.8v
>> common.mkdir bin/multi.test/gcc-4.8v/debug
>> gcc.compile.c++ bin/multi.test/gcc-4.8v/debug/multi.o
>> In file included from ../../../boost/type_erasure/binding.hpp:28:0,
>> from ../../../boost/type_erasure/any.hpp:39,
>> from multi.cpp:11:
>> ../../../boost/type_erasure/detail/vtable.hpp:155:28: error: constexpr
>> static data member 'value' must have an initializer
>> static constexpr Table value;
>> ^
> [snip]
> Changing the vtable.hpp code to:
>
> template<class Table, class... T>
> struct vtable_init
> {
> static constexpr Table value=Table(T::value...);
> };
>
> from:
>
> template<class Table, class... T>
> struct vtable_init
> {
> static constexpr Table value;
> };
>
> template<class Table, class... T>
> constexpr Table vtable_init<Table, T...>::value(T::value...);
>
> may be a solution.
>
Or not.
When the attached is compiled with gcc4.8 with -std=gnu++11,
there's a link error :(

./concept_call_noph.o: In function
`boost::type_erasure::binding<boost::type_erasure::incrementable<int>
>::impl_type::impl_type<boost::mpl::map0<mpl_::na>
>(boost::type_erasure::static_binding<boost::mpl::map0<mpl_::na> > const&)':
concept_call_noph.cpp:(.text._ZN5boost12type_erasure7bindingINS0_13incrementableIiEEE9impl_typeC2INS_3mpl4map0IN4mpl_2naEEEEERKNS0_14static_bindingIT_EE[_ZN5boost12type_erasure7bindingINS0_13incrementableIiEEE9impl_typeC5INS_3mpl4map0IN4mpl_2naEEEEERKNS0_14static_bindingIT_EE]+0x27):
undefined reference to
`boost::type_erasure::detail::vtable_init<boost::type_erasure::detail::vtable_storage<boost::type_erasure::detail::vtable_adapter<boost::type_erasure::incrementable<int>,
void ()(int&)> >,
boost::type_erasure::detail::vtable_adapter<boost::type_erasure::incrementable<int>,
void ()(int&)> >::value'
collect2: error: ld returned 1 exit status

I don't know why :(

-regards,
Larry




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