Compare commits

...

2 Commits

4 changed files with 184 additions and 0 deletions

View File

@ -79,6 +79,7 @@ project
[ run sequence/hash.cpp ]
[ run sequence/io.cpp ]
[ run sequence/iterator_range.cpp ]
[ compile sequence/issue11932.cpp ]
[ run sequence/joint_view.cpp ]
[ run sequence/list_comparison.cpp ]
[ run sequence/list_construction.cpp ]
@ -115,12 +116,14 @@ project
[ run sequence/map_misc.cpp ]
[ run sequence/map_move.cpp ]
[ run sequence/map_mutate.cpp ]
[ run sequence/map_nest.cpp ]
[ run sequence/map_tie.cpp ]
[ run sequence/nil.cpp ]
[ run sequence/nview.cpp ]
[ run sequence/reverse_view.cpp ]
[ run sequence/segmented_iterator_range.cpp ]
[ run sequence/set.cpp ]
[ run sequence/set_nest.cpp ]
[ run sequence/single_view.cpp ]
[ run sequence/std_pair.cpp ]
[ run sequence/boost_array.cpp ]

View File

@ -0,0 +1,46 @@
/*=============================================================================
Copyright (c) 2016 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/config.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/list.hpp>
#include <boost/fusion/include/deque.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#ifndef BOOST_NO_CXX11_HDR_TUPLE
#include <tuple>
#include <boost/fusion/include/std_tuple.hpp>
#endif
#include <boost/fusion/include/mpl.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/assert.hpp>
struct left
{
template <typename L, typename> struct apply { typedef L type; };
};
template <typename Seq> struct test
{
typedef typename boost::mpl::transform<Seq, Seq, left>::type type;
};
using namespace boost::fusion;
BOOST_MPL_ASSERT((boost::is_same<test<boost::fusion::vector<> >::type, boost::fusion::vector<> >));
BOOST_MPL_ASSERT((boost::is_same<test<boost::fusion::list<> >::type, boost::fusion::list<> >));
BOOST_MPL_ASSERT((boost::is_same<test<boost::fusion::deque<> >::type, boost::fusion::deque<> >));
BOOST_MPL_ASSERT((boost::is_same<test<boost::tuples::tuple<> >::type, boost::tuples::tuple<> >));
#ifndef BOOST_NO_CXX11_HDR_TUPLE
BOOST_MPL_ASSERT((boost::is_same<test<std::tuple<> >::type, std::tuple<> >));
#endif

View File

@ -0,0 +1,71 @@
/*=============================================================================
Copyright (C) 2016 Kohei Takahshi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <utility>
#include <boost/config.hpp>
#include <boost/fusion/container/map/map.hpp>
#include <boost/core/lightweight_test.hpp>
template <typename C>
void test_copy()
{
C src;
C dst = src;
(void)dst;
}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename C>
void test_move()
{
C src;
C dst = std::move(src);
(void)dst;
}
#endif
template <typename C>
void test_all()
{
test_copy<C>();
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
test_move<C>();
#endif
}
struct k1;
struct k2;
struct k3;
struct k4;
void
test()
{
using namespace boost::fusion;
test_all<map<pair<k1, map<> > > >();
test_all<map<pair<k1, map<> >, pair<k2, int> > >();
test_all<map<pair<k1, int>, pair<k2, map<> > > >();
test_all<map<pair<k1, int>, pair<k2, map<> >, pair<k3, float> > >();
test_all<map<pair<k1, map<pair<k2, int> > > > >();
test_all<map<pair<k1, map<pair<k2, int> > >, pair<k3, int> > >();
test_all<map<pair<k1, int>, pair<k2, map<pair<k3, int> > > > >();
test_all<map<pair<k1, int>, pair<k2, map<pair<k3, int> > >, pair<k4, float> > >();
test_all<map<pair<k1, map<pair<k2, int>, pair<k3, float> > > > >();
test_all<map<pair<k1, map<pair<k2, int>, pair<k3, float> > >, pair<k4, int> > >();
test_all<map<pair<k1, int>, map<pair<k2, int>, pair<k3, float> > > >();
test_all<map<pair<k1, int>, map<pair<k2, int>, pair<k3, float> >, pair<k4, float> > >();
}
int
main()
{
test();
return boost::report_errors();
}

View File

@ -0,0 +1,64 @@
/*=============================================================================
Copyright (C) 2016 Kohei Takahshi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <utility>
#include <boost/config.hpp>
#include <boost/fusion/container/set/set.hpp>
#include <boost/core/lightweight_test.hpp>
template <typename C>
void test_copy()
{
C src;
C dst = src;
(void)dst;
}
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <typename C>
void test_move()
{
C src;
C dst = std::move(src);
(void)dst;
}
#endif
template <typename C>
void test_all()
{
test_copy<C>();
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
test_move<C>();
#endif
}
void
test()
{
using namespace boost::fusion;
test_all<set<set<> > >();
test_all<set<set<>, int> >();
test_all<set<int, set<> > >();
test_all<set<int, set<>, float> >();
test_all<set<set<int> > >();
test_all<set<set<int>, int> >();
test_all<set<int, set<int> > >();
test_all<set<int, set<int>, float> >();
test_all<set<set<int>, float> >();
test_all<set<set<int>, float, int> >();
}
int
main()
{
test();
return boost::report_errors();
}