Boost logo

Boost :

Subject: Re: [boost] [mpl] Problem with VC++14 and boost::mpl::size_t
From: Edward Diener (eldiener_at_[hidden])
Date: 2015-07-25 08:35:12

On 7/25/2015 2:48 AM, Matt Calabrese wrote:
> On Fri, Jul 24, 2015 at 7:41 PM, Edward Diener <eldiener_at_[hidden]>
> wrote:
>> pointing to the line after it encounters 'struct size_t' as far as I can
>> make out ( you need to preprocess the size_t.cpp test, comment out the
>> #line directives and run the test against the preprocessed result to see
>> what the compiler is objecting to ). It therefore fails a number of mpl
>> tests which all prior versions of VC++ pass.
>> It flags this error in 5 mpl tests which use the boost::mpl::size_t
>> integral wrapper, among which the easiest to analyze is the size_t.cpp test
>> itself.
>> Anybody have any idea what is going on here with the compiler, or whether
>> it can be fixed somehow in VC++14 for the mpl code ?
> I don't have the compiler, but my guess is it's probably actually confused
> on the line:
> typedef size_t type;
> A simple workaround to try could be to change the typedef to:
> typedef mpl::size_t<N> type;
> If that fix works, I'd be surprised if such a change would break any other
> compilers. This is all just a guess, though.

Unfortunately that does not fix the problem. It appears that VC++14
thinks that the designation:

namespace boost { namespace mpl {
template< std::size_t N >
struct size_t

is ambiguous because somehow it has determined that 'size_t' is a
predefined C++ type, like 'int', and therefore cannot be used
altogether. What a compiler regression !

If I can get all the #line directives and empty lines out of the
preprocess source I will report it to Microsoft. It is just a really bad
failure of the just-released VC++14 compiler. I am a bit surprised that
the VC++ developers did not try to run the compiler against some of the
key Boost libraries, like MPL, just to get out the kinks, before they
released the product. As is VC++14 is broken with any library that uses
the boost::mpl::size_t integral wrapper for std::size_t. The only
workaround I can think of is to change the name for VC++14 to something
like boost::mpl::size_t_.

Boost list run by bdawes at, gregod at, cpdaniel at, john at