vendredi 6 juillet 2018

How to use BOOST_MPL_ASSERT

Why the following code fails to compile:

#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/assert.hpp>
#include <string>

int main()
{
    BOOST_MPL_ASSERT(( boost::mpl::is_same<std::string, std::string> ));
    return 0;
}

I get an error for C++11 and C++14:

In file included from 2:0:
 In function 'int main()':
7:5: error: expected primary-expression before 'enum'

I understand it can be something silly, like missing semicolon. The error message is definitely not helpful.

Aucun commentaire:

Enregistrer un commentaire