forked from boostorg/mp11
Work around msvc-12.0 failures in mp_sliding_fold tests
This commit is contained in:
@@ -5,7 +5,9 @@
|
|||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/mp11.hpp>
|
#include <boost/mp11/algorithm.hpp>
|
||||||
|
#include <boost/mp11/integral.hpp>
|
||||||
|
#include <boost/mp11/function.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -16,13 +18,24 @@ struct X3 {};
|
|||||||
struct X4 {};
|
struct X4 {};
|
||||||
struct X5 {};
|
struct X5 {};
|
||||||
|
|
||||||
template<class... C> using average = boost::mp11::mp_int<boost::mp11::mp_plus<C...>::value / sizeof...(C)>;
|
using boost::mp11::mp_plus;
|
||||||
|
using boost::mp11::mp_int;
|
||||||
|
|
||||||
|
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||||
|
|
||||||
|
template<class... C> using average = mp_int<mp_plus<C...>::value / sizeof...(C)>;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
template<class... C> struct average_impl: mp_int<mp_plus<C...>::value / sizeof...(C)> {};
|
||||||
|
template<class... C> using average = typename average_impl<C...>::type;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using boost::mp11::mp_list;
|
using boost::mp11::mp_list;
|
||||||
using boost::mp11::mp_list_c;
|
using boost::mp11::mp_list_c;
|
||||||
using boost::mp11::mp_plus;
|
|
||||||
using boost::mp11::mp_size_t;
|
using boost::mp11::mp_size_t;
|
||||||
using boost::mp11::mp_sliding_fold;
|
using boost::mp11::mp_sliding_fold;
|
||||||
|
|
||||||
|
@@ -5,7 +5,9 @@
|
|||||||
// See accompanying file LICENSE_1_0.txt or copy at
|
// See accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
#include <boost/mp11.hpp>
|
#include <boost/mp11/algorithm.hpp>
|
||||||
|
#include <boost/mp11/integral.hpp>
|
||||||
|
#include <boost/mp11/function.hpp>
|
||||||
#include <boost/core/lightweight_test_trait.hpp>
|
#include <boost/core/lightweight_test_trait.hpp>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -16,16 +18,31 @@ struct X3 {};
|
|||||||
struct X4 {};
|
struct X4 {};
|
||||||
struct X5 {};
|
struct X5 {};
|
||||||
|
|
||||||
|
using boost::mp11::mp_plus;
|
||||||
|
using boost::mp11::mp_int;
|
||||||
|
|
||||||
|
#if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
|
||||||
|
|
||||||
struct average
|
struct average
|
||||||
{
|
{
|
||||||
template<class... C> using fn = boost::mp11::mp_int<boost::mp11::mp_plus<C...>::value / sizeof...(C)>;
|
template<class... C> using fn = mp_int<mp_plus<C...>::value / sizeof...(C)>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
template<class... C> struct average_impl: mp_int<mp_plus<C...>::value / sizeof...(C)> {};
|
||||||
|
|
||||||
|
struct average
|
||||||
|
{
|
||||||
|
template<class... C> using fn = typename average_impl<C...>::type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
using boost::mp11::mp_list;
|
using boost::mp11::mp_list;
|
||||||
using boost::mp11::mp_list_c;
|
using boost::mp11::mp_list_c;
|
||||||
using boost::mp11::mp_plus;
|
|
||||||
using boost::mp11::mp_quote;
|
using boost::mp11::mp_quote;
|
||||||
using boost::mp11::mp_size_t;
|
using boost::mp11::mp_size_t;
|
||||||
using boost::mp11::mp_sliding_fold_q;
|
using boost::mp11::mp_sliding_fold_q;
|
||||||
|
Reference in New Issue
Block a user