boostorg / mpl

Boost.org mpl module
http://boost.org/libs/mpl
Boost Software License 1.0
49 stars 78 forks source link

`push_back<vector20<...>, X>::type` on MSVC triggers static assert #43

Open Kojoley opened 5 years ago

Kojoley commented 5 years ago

The following code is fine on GCC and Clang, but fails on MSVC and ICC.

#include <boost/mpl/vector.hpp>
#include <boost/mpl/push_back.hpp>

struct X;

using vec = boost::mpl::vector<X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X>;
using test = boost::mpl::push_back<vec, X>::type;

https://godbolt.org/z/w-yTto

This inconsistency confuses people: 1) https://stackoverflow.com/questions/55900932/issue-with-x3-and-ms-vs2017 2) https://github.com/boostorg/spirit/issues/515

jeking3 commented 2 years ago

@Kojoley could you add a test for this? CI will run it against a lot of different platforms now.