mpark / variant

C++17 `std::variant` for C++11/14/17
https://mpark.github.io/variant
Boost Software License 1.0
664 stars 87 forks source link

No longer works with Visual Studio 2017 #35

Closed emptyVoid closed 6 years ago

emptyVoid commented 6 years ago

I've just updated to VS 15.5 (toolset 14.12), and no longer able to build projects which use the variant. Here're the errors (in case it helps):

C3528   'Is': the number of elements in this pack expansion does not match the number of elements in 'Js'   ...\mpark\variant.hpp   575
C2672   'mpark::detail::visitation::base::make_farray': no matching overloaded function found   cvtest  ...\mpark\variant.hpp   574
C2893   Failed to specialize function template 'mpark::lib::cpp14::array<std::common_type<std::decay<Fs>::type...>::type,sizeof...(Fs)> mpark::detail::visitation::base::make_farray(Fs &&...)' ...\mpark\variant.hpp   575
C2672   'mpark::detail::visitation::base::at': no matching overloaded function found    ...\mpark\variant.hpp   629
C2784   'const remove_all_extents<T>::type &mpark::detail::visitation::base::at(const mpark::lib::cpp14::array<T,N> &,::size_t,Is...)': could not deduce template argument for 'const mpark::lib::cpp14::array<T,N> &' from 'void'  ...\mpark\variant.hpp   633
C2780   'const T &mpark::detail::visitation::base::at(const T &)': expects 1 arguments - 2 provided ...\mpark\variant.hpp   633
mpark commented 6 years ago

Thanks for the report! I'll look into this today.

ltjax commented 6 years ago

I got the same error! Any idea what's causing this? I tried with Tag v1.2.0 and today's master

mpark commented 6 years ago

It seems like it's having trouble with the cartesian product generation here: https://github.com/mpark/variant/blob/master/include/mpark/variant.hpp#L574-L575

I'll have to play with whether I need to reformulate this for MSVC or if there's some way to coax it to understand it.

mpark commented 6 years ago

Closed by 2bb35f1