Boost logo

Boost :

Subject: [boost] [mpl] Problem with VC++14 and boost::mpl::size_t
From: Edward Diener (eldiener_at_[hidden])
Date: 2015-07-24 22:41:10


The just released VC++14 has a problem with the boost::mpl::size_t
template. After preprocessing it sees:

namespace boost { namespace mpl {
template< std::size_t N >
struct size_t
{
     static const std::size_t value = N;
     typedef size_t type;
     typedef std::size_t value_type;
     typedef integral_c_tag tag;
     typedef boost::mpl::size_t< static_cast<std::size_t>((value + 1)) >
next;
     typedef boost::mpl::size_t< static_cast<std::size_t>((value - 1)) >
prior;
      operator std::size_t() const { return
static_cast<std::size_t>(this->value); }
};
template< std::size_t N >
std::size_t const boost::mpl::size_t< N >::value;
}}

and gives the error message:

size_t.cpp(nnn): error C2872: 'size_t': ambiguous symbol
predefined C++ types (compiler internal)(16): note: could be 'unsigned
int size_t'
size_t.cpp(nnn): note: or 'boost::mpl::size_t'

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 ?


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