Skip to content

Commit 19a4a07

Browse files
fix mp_replace_at with msvc-12
1 parent 49d6270 commit 19a4a07

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

include/boost/mp11/algorithm.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,6 +1047,8 @@ template<class L, class Q> using mp_any_of_q = mp_any_of<L, Q::template fn>;
10471047
namespace detail
10481048
{
10491049

1050+
#if ! BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1900 )
1051+
10501052
template<class I> struct mp_replace_at_impl_p
10511053
{
10521054
template<class T1, class T2> using _p = std::is_same<T2, I>;
@@ -1057,12 +1059,24 @@ template<class W> struct mp_replace_at_impl_f
10571059
template<class T1, class T2> using _f = W;
10581060
};
10591061

1062+
#endif
1063+
10601064
template<class L, class I, class W> struct mp_replace_at_impl
10611065
{
10621066
static_assert( I::value >= 0, "mp_replace_at<L, I, W>: I must not be negative" );
10631067

1068+
#if ! BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, < 1900 )
1069+
1070+
template<class T1, class T2> using _p = std::is_same<T2, mp_size_t<I::value>>;
1071+
template<class T1, class T2> using _f = W;
1072+
1073+
using type = mp_transform_if<_p, _f, L, mp_iota<mp_size<L> > >;
1074+
1075+
#else
10641076

10651077
using type = mp_transform_if<mp_replace_at_impl_p<mp_size_t<I::value>>::template _p, mp_replace_at_impl_f<W>::template _f, L, mp_iota<mp_size<L> > >;
1078+
1079+
#endif
10661080
};
10671081

10681082
} // namespace detail

0 commit comments

Comments
 (0)