1
0
forked from boostorg/mp11

Update mp11_single.hpp

This commit is contained in:
Peter Dimov
2017-06-02 19:25:52 +03:00
parent 07d8856b38
commit 592a4706a6

View File

@@ -1100,8 +1100,8 @@ template<class M, class K> using mp_map_find = typename detail::mp_map_find_impl
} // namespace boost
#endif // #ifndef BOOST_MP11_DETAIL_MP_MAP_FIND_HPP_INCLUDED
#ifndef BOOST_MP11_DETAIL_MP_FOR_INDEX_HPP_INCLUDED
#define BOOST_MP11_DETAIL_MP_FOR_INDEX_HPP_INCLUDED
#ifndef BOOST_MP11_DETAIL_MP_WITH_INDEX_HPP_INCLUDED
#define BOOST_MP11_DETAIL_MP_WITH_INDEX_HPP_INCLUDED
// Copyright 2017 Peter Dimov.
//
@@ -1129,7 +1129,7 @@ namespace mp11
namespace detail
{
template<std::size_t N> struct mp_for_index_impl_
template<std::size_t N> struct mp_with_index_impl_
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1153,15 +1153,15 @@ template<std::size_t N> struct mp_for_index_impl_
case 15: return std::forward<F>(f)( mp_size_t<K+15>() );
}
return mp_for_index_impl_<N-16>::template call<K+16>( i-16, std::forward<F>(f) );
return mp_with_index_impl_<N-16>::template call<K+16>( i-16, std::forward<F>(f) );
}
};
template<> struct mp_for_index_impl_<0>
template<> struct mp_with_index_impl_<0>
{
};
template<> struct mp_for_index_impl_<1>
template<> struct mp_with_index_impl_<1>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t /*i*/, F && f )
{
@@ -1169,7 +1169,7 @@ template<> struct mp_for_index_impl_<1>
}
};
template<> struct mp_for_index_impl_<2>
template<> struct mp_with_index_impl_<2>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1181,7 +1181,7 @@ template<> struct mp_for_index_impl_<2>
}
};
template<> struct mp_for_index_impl_<3>
template<> struct mp_with_index_impl_<3>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1194,7 +1194,7 @@ template<> struct mp_for_index_impl_<3>
}
};
template<> struct mp_for_index_impl_<4>
template<> struct mp_with_index_impl_<4>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1208,7 +1208,7 @@ template<> struct mp_for_index_impl_<4>
}
};
template<> struct mp_for_index_impl_<5>
template<> struct mp_with_index_impl_<5>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1223,7 +1223,7 @@ template<> struct mp_for_index_impl_<5>
}
};
template<> struct mp_for_index_impl_<6>
template<> struct mp_with_index_impl_<6>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1239,7 +1239,7 @@ template<> struct mp_for_index_impl_<6>
}
};
template<> struct mp_for_index_impl_<7>
template<> struct mp_with_index_impl_<7>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1256,7 +1256,7 @@ template<> struct mp_for_index_impl_<7>
}
};
template<> struct mp_for_index_impl_<8>
template<> struct mp_with_index_impl_<8>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1274,7 +1274,7 @@ template<> struct mp_for_index_impl_<8>
}
};
template<> struct mp_for_index_impl_<9>
template<> struct mp_with_index_impl_<9>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1293,7 +1293,7 @@ template<> struct mp_for_index_impl_<9>
}
};
template<> struct mp_for_index_impl_<10>
template<> struct mp_with_index_impl_<10>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1313,7 +1313,7 @@ template<> struct mp_for_index_impl_<10>
}
};
template<> struct mp_for_index_impl_<11>
template<> struct mp_with_index_impl_<11>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1334,7 +1334,7 @@ template<> struct mp_for_index_impl_<11>
}
};
template<> struct mp_for_index_impl_<12>
template<> struct mp_with_index_impl_<12>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1356,7 +1356,7 @@ template<> struct mp_for_index_impl_<12>
}
};
template<> struct mp_for_index_impl_<13>
template<> struct mp_with_index_impl_<13>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1379,7 +1379,7 @@ template<> struct mp_for_index_impl_<13>
}
};
template<> struct mp_for_index_impl_<14>
template<> struct mp_with_index_impl_<14>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1403,7 +1403,7 @@ template<> struct mp_for_index_impl_<14>
}
};
template<> struct mp_for_index_impl_<15>
template<> struct mp_with_index_impl_<15>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1428,7 +1428,7 @@ template<> struct mp_for_index_impl_<15>
}
};
template<> struct mp_for_index_impl_<16>
template<> struct mp_with_index_impl_<16>
{
template<std::size_t K, class F> static BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) call( std::size_t i, F && f )
{
@@ -1456,15 +1456,15 @@ template<> struct mp_for_index_impl_<16>
} // namespace detail
template<std::size_t N, class F> inline BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) mp_for_index( std::size_t i, F && f )
template<std::size_t N, class F> inline BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) mp_with_index( std::size_t i, F && f )
{
assert( i < N );
return detail::mp_for_index_impl_<N>::template call<0>( i, std::forward<F>(f) );
return detail::mp_with_index_impl_<N>::template call<0>( i, std::forward<F>(f) );
}
template<class N, class F> inline BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) mp_for_index( std::size_t i, F && f )
template<class N, class F> inline BOOST_MP11_CONSTEXPR14 decltype(std::declval<F>()(std::declval<mp_size_t<0>>())) mp_with_index( std::size_t i, F && f )
{
return mp_for_index<N::value>( i, std::forward<F>(f) );
return mp_with_index<std::size_t{N::value}>( i, std::forward<F>(f) );
}
#undef BOOST_MP11_CONSTEXPR14
@@ -1472,7 +1472,7 @@ template<class N, class F> inline BOOST_MP11_CONSTEXPR14 decltype(std::declval<F
} // namespace mp11
} // namespace boost
#endif // #ifndef BOOST_MP11_DETAIL_MP_FIND_INDEX_HPP_INCLUDED
#endif // #ifndef BOOST_MP11_DETAIL_MP_WITH_INDEX_HPP_INCLUDED
#ifndef BOOST_MP11_INTEGER_SEQUENCE_HPP_INCLUDED
#define BOOST_MP11_INTEGER_SEQUENCE_HPP_INCLUDED