On 7/25/2015 2:48 AM, Matt Calabrese wrote:
On Fri, Jul 24, 2015 at 7:41 PM, Edward Diener
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.
My latest investigation, using the mpl::size_t code directly in a test,
shows that:
// size_t_bug.cpp
#include <cstddef>
namespace boost { namespace mpl {
struct integral_c_tag { static const int value = 0; };
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_caststd::size_t((value + 1)) >
next;
typedef boost::mpl::size_t< static_caststd::size_t((value - 1)) >
prior;
operator std::size_t() const { return
static_caststd::size_t(this->value); }
};
template< std::size_t N >
std::size_t const boost::mpl::size_t< N >::value;
}}
#include