1
0
forked from boostorg/mp11

Add list_size_mismatch which produces a better error message from mp_transform

This commit is contained in:
Peter Dimov
2017-06-17 19:14:47 +03:00
parent 64d4fb2e4b
commit d9c4308d9d

View File

@@ -117,15 +117,19 @@ template<class... L> struct mp_same_size_2: mp_defer<mp_same_size_1, L...> {};
#endif #endif
struct list_size_mismatch
{
};
} // namespace detail } // namespace detail
#if BOOST_WORKAROUND( BOOST_MSVC, == 1900 ) || BOOST_WORKAROUND( BOOST_GCC, < 40800 ) #if BOOST_WORKAROUND( BOOST_MSVC, == 1900 ) || BOOST_WORKAROUND( BOOST_GCC, < 40800 )
template<template<class...> class F, class... L> using mp_transform = typename mp_if<typename detail::mp_same_size_2<L...>::type, detail::mp_transform_impl<F, L...>>::type; template<template<class...> class F, class... L> using mp_transform = typename mp_if<typename detail::mp_same_size_2<L...>::type, detail::mp_transform_impl<F, L...>, detail::list_size_mismatch>::type;
#else #else
template<template<class...> class F, class... L> using mp_transform = typename mp_if<mp_same<mp_size<L>...>, detail::mp_transform_impl<F, L...>>::type; template<template<class...> class F, class... L> using mp_transform = typename mp_if<mp_same<mp_size<L>...>, detail::mp_transform_impl<F, L...>, detail::list_size_mismatch>::type;
#endif #endif