Opened 8 years ago

Closed 7 years ago

#10295 closed Bugs (fixed)

Boost Type Erasure does't compile on Visual Studio 2013

Reported by: miticodonati@… Owned by: Steven Watanabe
Milestone: To Be Determined Component: type_erasure
Version: Boost 1.56.0 Severity: Problem
Keywords: Type Erasure Visual Studio 2013 Cc:

Description

Even the most trivial example of usage doesn't compile:

http://www.boost.org/doc/libs/1_56_0_b1/libs/type_erasure/example/basic.cpp

The error is "unkown identifier: type" or something like that, and is present in various headers when calling something like "typedef typename ::boost::type_erasure::detail::" .. and obtatining the type via "::type". There may be also other problems

I would gladly help if possible, the library seems good

Attachments (2)

type_erasure.patch (10.7 KB ) - added by Martina Fedyszynová <m.fedyszynova@…> 7 years ago.
type_erasure patch for VS2013 (boost 1.58)
type_erasure.2.patch (10.7 KB ) - added by Martina Fedyszynová <m.fedyszynova@…> 7 years ago.
type_erasure patch for VS2013 (boost 1.58)

Download all attachments as: .zip

Change History (7)

in reply to:  description comment:1 by miticodonati@…, 8 years ago

Replying to miticodonati@…:

Even the most trivial example of usage doesn't compile:

http://www.boost.org/doc/libs/1_56_0_b1/libs/type_erasure/example/basic.cpp

The error is "unkown identifier: type" or something like that, and is present in various headers when calling something like "typedef typename ::boost::type_erasure::detail::" .. and obtatining the type via "::type". There may be also other problems

I would gladly help if possible, the library seems good

EDIT: Adding #define BOOST_NO_CXX11_VARIADIC_TEMPLATES seems to solve the issue

comment:2 by burkhard.daniel@…, 8 years ago

I'm having the same problem. The workaround with BOOST_NO_CXX11_VARIADIC_TEMPLATES is ok-ish, but I'd rather see this work out of the box. Isn't MSVC2013 supposed to fully support variadic templates?

comment:3 by Steven Watanabe, 8 years ago

Support for variadic templates in VS2013 is very buggy. I did fix this, but it appears that I failed to push the merge to master.

by Martina Fedyszynová <m.fedyszynova@…>, 7 years ago

Attachment: type_erasure.patch added

type_erasure patch for VS2013 (boost 1.58)

by Martina Fedyszynová <m.fedyszynova@…>, 7 years ago

Attachment: type_erasure.2.patch added

type_erasure patch for VS2013 (boost 1.58)

comment:4 by Martina Fedyszynová <m.fedyszynova@…>, 7 years ago

I've managed to patch the library for VS2013 to bring back support for variadic templates. Almost all examples and tests build successfully - except for:

  • printf.cpp example - asserts that any_printable needs the relaxed concept (I believe it is a bug in the example)
  • test_free.cpp - this test fails to build. VS2013 compiler seems to require that all overloaded declarations of injected free functions are seen before the first instantiation. Therefore when all the BOOST_TYPE_ERASURE_FREE(...) lines are moved above all the test cases, the test runs ok.

The patched callable.hpp also fixes overloaded callable concepts (multifunction.cpp example) which failed to built in VS2013. A bug in the compiler causes ambiguities between the overloaded function call operators imported via using declarations.

Sorry for double post of the attachment, the upload seemed stuck and the file didn't appear so I tried it again...

comment:5 by Steven Watanabe, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.