Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: TypeErasure
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-06-27 11:04:23


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.

-regards,
Larry


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