mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-13 04:26:30 +02:00
Compare commits
7 Commits
more-tests
...
boost-1.62
Author | SHA1 | Date | |
---|---|---|---|
904d3c2c01 | |||
0263c75cd8 | |||
53ba3de15a | |||
d6c853f7ad | |||
dc55e5e103 | |||
1646a7252b | |||
dae9964b15 |
@ -25,8 +25,4 @@ boostbook quickbook
|
||||
<format>pdf:<xsl:param>img.src.path=$(images_location)/
|
||||
;
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc ;
|
||||
explicit boostdoc ;
|
||||
alias boostrelease : quickbook ;
|
||||
explicit boostrelease ;
|
||||
|
||||
|
@ -1,23 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY__01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY__01062013_1700
|
||||
|
||||
#include <boost/fusion/adapted/std_array/std_array_iterator.hpp>
|
||||
#include <boost/fusion/adapted/std_array/tag_of.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/category_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/end_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/value_at_impl.hpp>
|
||||
|
||||
#endif
|
@ -1,25 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_ARRAY_SIZE_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_ARRAY_SIZE_01062013_1700
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template<class T>
|
||||
struct std_array_size;
|
||||
|
||||
template<template<typename, std::size_t> class Array, typename T, std::size_t N>
|
||||
struct std_array_size<Array<T, N>> : std::integral_constant<std::size_t, N> {};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,45 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_AT_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_AT_IMPL_01062013_1700
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct at_impl;
|
||||
|
||||
template<>
|
||||
struct at_impl<std_array_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
is_const<Sequence>,
|
||||
typename Sequence::const_reference,
|
||||
typename Sequence::reference>::type type;
|
||||
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return seq[N::value];
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,41 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_BEGIN_OF_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_BEGIN_OF_IMPL_01062013_1700
|
||||
|
||||
#include <boost/fusion/adapted/std_array/std_array_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<std_array_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef std_array_iterator<Sequence, 0> type;
|
||||
|
||||
static type
|
||||
call(Sequence& v)
|
||||
{
|
||||
return type(v);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,35 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_CATEGORY_OF_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_CATEGORY_OF_IMPL_01062013_1700
|
||||
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct category_of_impl;
|
||||
|
||||
template<>
|
||||
struct category_of_impl<std_array_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef random_access_traversal_tag type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,45 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_END_OF_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_END_OF_IMPL_01062013_1700
|
||||
|
||||
#include <boost/fusion/adapted/std_array/std_array_iterator.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<std_array_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename remove_const<Sequence>::type seq_type;
|
||||
static int const size = std_array_size<seq_type>::value;
|
||||
typedef std_array_iterator<Sequence, size> type;
|
||||
|
||||
static type
|
||||
call(Sequence& v)
|
||||
{
|
||||
return type(v);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,32 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_IS_SEQUENCE_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_IS_SEQUENCE_IMPL_01062013_1700
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct is_sequence_impl;
|
||||
|
||||
template<>
|
||||
struct is_sequence_impl<std_array_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply : mpl::true_ {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,33 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_IS_VIEW_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_IS_VIEW_IMPL_01062013_1700
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename Tag>
|
||||
struct is_view_impl;
|
||||
|
||||
template<>
|
||||
struct is_view_impl<std_array_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply : mpl::false_
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,41 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_SIZE_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_SIZE_IMPL_01062013_1700
|
||||
|
||||
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct size_impl;
|
||||
|
||||
template<>
|
||||
struct size_impl<std_array_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
: mpl::int_
|
||||
<
|
||||
std_array_size
|
||||
<
|
||||
typename remove_const<Sequence>::type
|
||||
>::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,32 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_VALUE_AT_IMPL_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_VALUE_AT_IMPL_01062013_1700
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct value_at_impl;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<std_array_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
typedef typename Sequence::value_type type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,109 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013 Mateusz Loskot
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_ARRAY_ITERATOR_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_ARRAY_ITERATOR_01062013_1700
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/fusion/iterator/iterator_facade.hpp>
|
||||
#include <boost/fusion/adapted/std_array/detail/array_size.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
template <typename Array, int Pos>
|
||||
struct std_array_iterator
|
||||
: iterator_facade<std_array_iterator<Array, Pos>, random_access_traversal_tag>
|
||||
{
|
||||
BOOST_MPL_ASSERT_RELATION(Pos, >=, 0);
|
||||
BOOST_MPL_ASSERT_RELATION(Pos, <=, std::tuple_size<Array>::value);
|
||||
|
||||
typedef mpl::int_<Pos> index;
|
||||
typedef Array array_type;
|
||||
|
||||
std_array_iterator(Array& a)
|
||||
: array(a) {}
|
||||
|
||||
Array& array;
|
||||
|
||||
template <typename Iterator>
|
||||
struct value_of
|
||||
{
|
||||
typedef typename Iterator::array_type array_type;
|
||||
typedef typename array_type::value_type type;
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct deref
|
||||
{
|
||||
typedef typename Iterator::array_type array_type;
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_const<array_type>
|
||||
, typename array_type::const_reference
|
||||
, typename array_type::reference
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator const & it)
|
||||
{
|
||||
return it.array[Iterator::index::value];
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator, typename N>
|
||||
struct advance
|
||||
{
|
||||
typedef typename Iterator::index index;
|
||||
typedef typename Iterator::array_type array_type;
|
||||
typedef std_array_iterator<array_type, index::value + N::value> type;
|
||||
|
||||
static type
|
||||
call(Iterator const& i)
|
||||
{
|
||||
return type(i.array);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator>
|
||||
struct next : advance<Iterator, mpl::int_<1> > {};
|
||||
|
||||
template <typename Iterator>
|
||||
struct prior : advance<Iterator, mpl::int_<-1> > {};
|
||||
|
||||
template <typename I1, typename I2>
|
||||
struct distance : mpl::minus<typename I2::index, typename I1::index>
|
||||
{
|
||||
typedef typename
|
||||
mpl::minus<
|
||||
typename I2::index, typename I1::index
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(I1 const&, I2 const&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
std_array_iterator<Array, Pos>& operator=(std_array_iterator<Array, Pos> const&);
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,52 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2011 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_ARRAY_TAG_OF_01062013_1700)
|
||||
#define BOOST_FUSION_STD_ARRAY_TAG_OF_01062013_1700
|
||||
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct std_array_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
namespace traits
|
||||
{
|
||||
template<typename T, std::size_t N>
|
||||
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
|
||||
struct tag_of<std::array<T,N>, void >
|
||||
#else
|
||||
struct tag_of<std::array<T,N> >
|
||||
#endif
|
||||
{
|
||||
typedef std_array_tag type;
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
namespace boost { namespace mpl
|
||||
{
|
||||
template<typename>
|
||||
struct sequence_tag;
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
struct sequence_tag<std::array<T,N> >
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
struct sequence_tag<std::array<T,N> const>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/fusion/iterator/next.hpp>
|
||||
@ -40,8 +39,6 @@
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END
|
||||
|
||||
#ifdef BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \
|
||||
R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
|
||||
\
|
||||
@ -49,54 +46,6 @@
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)( \
|
||||
other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE))
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(self_type const& other_self) \
|
||||
: BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
|
||||
ATTRIBUTE_TUPLE_SIZE, \
|
||||
ATTRIBUTES_SEQ) \
|
||||
{}
|
||||
|
||||
// Use templated version instead.
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_FILLER_I( \
|
||||
R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)= \
|
||||
other.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE);
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
self_type& operator=(self_type const& other) \
|
||||
{ \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_FILLER_I, \
|
||||
ATTRIBUTE_TUPLE_SIZE, \
|
||||
ATTRIBUTES_SEQ) \
|
||||
\
|
||||
return *this; \
|
||||
}
|
||||
|
||||
#else // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED NAME(self_type const&) = default;
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED self_type& operator=(self_type const&) = default;
|
||||
|
||||
#endif // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
|
||||
R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
|
||||
\
|
||||
@ -136,81 +85,6 @@
|
||||
return *this; \
|
||||
}
|
||||
|
||||
#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR(NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
|
||||
|
||||
#else // BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) \
|
||||
|| BOOST_WORKAROUND(BOOST_GCC, < 40500) \
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, == 1800)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR_FILLER_I( \
|
||||
R, ATTRIBUTE_TUPLE_SIZE, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_PP_COMMA_IF(I) \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)(std::move( \
|
||||
other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)))
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(self_type&& other_self) \
|
||||
: BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR_FILLER_I, \
|
||||
ATTRIBUTE_TUPLE_SIZE, \
|
||||
ATTRIBUTES_SEQ) \
|
||||
{}
|
||||
|
||||
#else // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED NAME(self_type&&) = default;
|
||||
|
||||
#endif // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#if defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) \
|
||||
|| BOOST_WORKAROUND(BOOST_GCC, < 40600) \
|
||||
|| BOOST_WORKAROUND(BOOST_MSVC, == 1800)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_FILLER_I( \
|
||||
R, ATTRIBUTE_TUPLE_SIZE, I_, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE)=std::move( \
|
||||
other.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,1,ATTRIBUTE));
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
self_type& operator=(self_type&& other) \
|
||||
{ \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_FILLER_I, \
|
||||
ATTRIBUTE_TUPLE_SIZE, \
|
||||
ATTRIBUTES_SEQ) \
|
||||
\
|
||||
return *this; \
|
||||
}
|
||||
|
||||
#else // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_GPU_ENABLED self_type& operator=(self_type&&) = default;
|
||||
|
||||
#endif // BOOST_NO_CXX11_DEFAULTED_FUNCTIONS
|
||||
|
||||
#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPLE_SIZE, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPLE_SIZE,0,ATTRIBUTE) \
|
||||
@ -261,10 +135,14 @@
|
||||
ATTRIBUTES_SEQ) \
|
||||
{} \
|
||||
\
|
||||
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
BOOST_FUSION_DEFINE_STRUCT_MOVE_CTOR( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(self_type const& other_self) \
|
||||
: BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
|
||||
ATTRIBUTE_TUPLE_SIZE, \
|
||||
ATTRIBUTES_SEQ) \
|
||||
{} \
|
||||
\
|
||||
template<typename Seq> \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
@ -282,10 +160,6 @@
|
||||
ATTRIBUTES_SEQ) \
|
||||
{} \
|
||||
\
|
||||
BOOST_FUSION_DEFINE_STRUCT_COPY_ASSIGN_OP( \
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
BOOST_FUSION_DEFINE_STRUCT_MOVE_ASSIGN_OP( \
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
|
||||
@ -408,7 +282,20 @@
|
||||
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPLE_SIZE)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
template<typename Seq> \
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(Seq const&) \
|
||||
{} \
|
||||
\
|
||||
template<typename Seq> \
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
self_type& \
|
||||
operator=(Seq const& seq) \
|
||||
{ \
|
||||
return *this; \
|
||||
}
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_IMPL( \
|
||||
NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
@ -440,7 +327,10 @@
|
||||
ATTRIBUTE_TUPLE_SIZE)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
|
||||
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPLE_SIZE)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
|
@ -23,7 +23,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
||||
// MSVC variadics at this point in time is not ready yet (ICE!)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1900))
|
||||
# if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
|
||||
# undef BOOST_FUSION_HAS_VARIADIC_DEQUE
|
||||
# endif
|
||||
|
@ -59,7 +59,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element&& rhs)
|
||||
: Rest(rhs.forward_base())
|
||||
: Rest(BOOST_FUSION_FWD_ELEM(Rest, rhs.forward_base()))
|
||||
, value_(BOOST_FUSION_FWD_ELEM(Value, rhs.value_))
|
||||
{}
|
||||
#endif
|
||||
@ -90,7 +90,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
Rest&& forward_base() BOOST_NOEXCEPT
|
||||
{
|
||||
return std::move(*static_cast<Rest*>(this));
|
||||
return BOOST_FUSION_FWD_ELEM(Rest, *static_cast<Rest*>(this));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -116,7 +116,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(Value&& value, Rest&& rest)
|
||||
: Rest(std::move(rest))
|
||||
: Rest(BOOST_FUSION_FWD_ELEM(Rest, rest))
|
||||
, value_(BOOST_FUSION_FWD_ELEM(Value, value))
|
||||
{}
|
||||
#endif
|
||||
@ -147,8 +147,8 @@ namespace boost { namespace fusion { namespace detail
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element& operator=(keyed_element&& rhs)
|
||||
{
|
||||
base::operator=(rhs.forward_base());
|
||||
value_ = std::move(rhs.value_);
|
||||
base::operator=(std::forward<keyed_element>(rhs));
|
||||
value_ = BOOST_FUSION_FWD_ELEM(Value, rhs.value_);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
@ -23,7 +23,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
||||
// MSVC variadics at this point in time is not ready yet (ICE!)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1900))
|
||||
# if defined(BOOST_FUSION_HAS_VARIADIC_MAP)
|
||||
# undef BOOST_FUSION_HAS_VARIADIC_MAP
|
||||
# endif
|
||||
|
@ -15,8 +15,6 @@
|
||||
|| defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|
||||
|| defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) \
|
||||
|| defined(BOOST_NO_CXX11_DECLTYPE)) \
|
||||
|| defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
|
||||
|| defined(BOOST_FUSION_DISABLE_VARIADIC_VECTOR) \
|
||||
|| (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
|
||||
@ -27,7 +25,8 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
|
||||
// Sometimes, MSVC 12 shows compile error with std::size_t of template parameter.
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
|
||||
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
|
||||
# endif
|
||||
|
@ -24,21 +24,23 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/fusion/support/detail/and.hpp>
|
||||
#include <boost/fusion/support/void.hpp>
|
||||
#include <boost/fusion/support/detail/enabler.hpp>
|
||||
#include <boost/fusion/support/detail/index_sequence.hpp>
|
||||
#include <boost/fusion/container/vector/detail/at_impl.hpp>
|
||||
#include <boost/fusion/container/vector/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/container/vector/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/container/vector/detail/end_impl.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/iterator/advance.hpp>
|
||||
#include <boost/fusion/iterator/deref.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
@ -51,48 +53,52 @@ namespace boost { namespace fusion
|
||||
namespace vector_detail
|
||||
{
|
||||
struct each_elem {};
|
||||
struct copy_or_move {};
|
||||
template <typename I> struct from_sequence {};
|
||||
|
||||
template <
|
||||
typename This, typename T, typename T_, std::size_t Size, bool IsSeq
|
||||
template <typename Sequence>
|
||||
struct make_indices_from_seq
|
||||
: detail::make_index_sequence<
|
||||
fusion::result_of::size<typename remove_reference<Sequence>::type>::value
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename T>
|
||||
struct pure : remove_cv<typename remove_reference<T>::type> {};
|
||||
|
||||
template <typename Sequence, typename This, int = result_of::size<This>::value>
|
||||
struct is_convertible_to_first
|
||||
: boost::is_convertible<Sequence, typename result_of::value_at_c<This, 0>::type>
|
||||
{};
|
||||
|
||||
template <typename Sequence, typename This>
|
||||
struct is_convertible_to_first<Sequence, This, 0>
|
||||
: mpl::false_
|
||||
{};
|
||||
|
||||
template <typename This, typename ...T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline each_elem
|
||||
dispatch(T const&...) BOOST_NOEXCEPT { return each_elem(); }
|
||||
|
||||
template <typename This>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline copy_or_move
|
||||
dispatch(This const&) BOOST_NOEXCEPT { return copy_or_move(); }
|
||||
|
||||
template <typename This, typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline from_sequence<
|
||||
typename lazy_enable_if_c<
|
||||
(traits::is_sequence<typename remove_reference<Sequence>::type>::value &&
|
||||
!is_same<This, typename pure<Sequence>::type>::value &&
|
||||
!is_convertible_to_first<Sequence, This>::value)
|
||||
, make_indices_from_seq<Sequence>
|
||||
>::type
|
||||
>
|
||||
struct can_convert_impl : false_type {};
|
||||
dispatch(Sequence&&) BOOST_NOEXCEPT
|
||||
{ return from_sequence<typename make_indices_from_seq<Sequence>::type>(); }
|
||||
|
||||
template <typename This, typename T, typename Sequence, std::size_t Size>
|
||||
struct can_convert_impl<This, T, Sequence, Size, true> : true_type {};
|
||||
|
||||
template <typename This, typename Sequence, typename T>
|
||||
struct can_convert_impl<This, Sequence, T, 1, true>
|
||||
: integral_constant<
|
||||
bool
|
||||
, !is_convertible<
|
||||
Sequence
|
||||
, typename fusion::extension::value_at_impl<vector_tag>::
|
||||
template apply< This, mpl::int_<0> >::type
|
||||
>::value
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename This, typename T, typename T_, std::size_t Size>
|
||||
struct can_convert
|
||||
: can_convert_impl<
|
||||
This, T, T_, Size, traits::is_sequence<T_>::value
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename T, bool IsSeq, std::size_t Size>
|
||||
struct is_longer_sequence_impl : false_type {};
|
||||
|
||||
template <typename Sequence, std::size_t Size>
|
||||
struct is_longer_sequence_impl<Sequence, true, Size>
|
||||
: integral_constant<
|
||||
bool, (fusion::result_of::size<Sequence>::value >= Size)
|
||||
>
|
||||
{};
|
||||
|
||||
template<typename T, std::size_t Size>
|
||||
struct is_longer_sequence
|
||||
: is_longer_sequence_impl<T, traits::is_sequence<T>::value, Size>
|
||||
{};
|
||||
|
||||
// forward_at_c allows to access Nth element even if ForwardSequence
|
||||
// since fusion::at_c requires RandomAccessSequence.
|
||||
@ -157,17 +163,22 @@ namespace boost { namespace fusion
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <
|
||||
typename U
|
||||
, typename = typename boost::disable_if<
|
||||
is_base_of<store, typename remove_reference<U>::type>
|
||||
>::type
|
||||
>
|
||||
template <typename U>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
store(U&& rhs)
|
||||
store(U&& rhs
|
||||
, typename disable_if<is_same<typename pure<U>::type, store>, detail::enabler_>::type = detail::enabler)
|
||||
: elem(std::forward<U>(rhs))
|
||||
{}
|
||||
|
||||
template <typename U>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
typename disable_if<is_same<typename pure<U>::type, store>, store&>::type
|
||||
operator=(U&& rhs)
|
||||
{
|
||||
elem = std::forward<U>(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
T & get() { return elem; }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
@ -195,17 +206,21 @@ namespace boost { namespace fusion
|
||||
vector_data()
|
||||
{}
|
||||
|
||||
template <
|
||||
typename Sequence
|
||||
, typename Sequence_ = typename remove_reference<Sequence>::type
|
||||
, typename = typename boost::enable_if<
|
||||
can_convert<vector_data, Sequence, Sequence_, sizeof...(I)>
|
||||
>::type
|
||||
>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector_data(copy_or_move, vector_data const& rhs)
|
||||
: store<I, T>(static_cast<store<I, T> const&>(rhs))...
|
||||
{}
|
||||
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector_data(copy_or_move, vector_data&& rhs)
|
||||
: store<I, T>(std::forward<store<I, T> >(rhs))...
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
explicit
|
||||
vector_data(each_elem, Sequence&& rhs)
|
||||
: store<I, T>(forward_at_c<I>(std::forward<Sequence>(rhs)))...
|
||||
vector_data(from_sequence<detail::index_sequence<I...> >, Sequence&& rhs)
|
||||
: store<I, T>(forward_at_c<I>(rhs))...
|
||||
{}
|
||||
|
||||
template <typename ...U>
|
||||
@ -215,14 +230,6 @@ namespace boost { namespace fusion
|
||||
: store<I, T>(std::forward<U>(var))...
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
void
|
||||
assign_sequence(Sequence&& seq)
|
||||
{
|
||||
assign(std::forward<Sequence>(seq), detail::index_sequence<I...>());
|
||||
}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
void
|
||||
@ -287,36 +294,15 @@ namespace boost { namespace fusion
|
||||
vector()
|
||||
{}
|
||||
|
||||
template <
|
||||
typename... U
|
||||
, typename = typename boost::enable_if_c<(
|
||||
sizeof...(U) >= 1 &&
|
||||
fusion::detail::and_<is_convertible<U, T>...>::value &&
|
||||
!fusion::detail::and_<
|
||||
is_base_of<vector, typename remove_reference<U>::type>...
|
||||
>::value
|
||||
)>::type
|
||||
>
|
||||
// rvalue-references is required here in order to forward any arguments to
|
||||
// base: vector(T const&...) doesn't work with trailing void_ and
|
||||
// vector(U const&...) cannot forward any arguments to base.
|
||||
template <typename... U>
|
||||
// XXX: constexpr become error due to pull-request #79, booooo!!
|
||||
// In the (near) future release, should be fixed.
|
||||
/* BOOST_CONSTEXPR */ BOOST_FUSION_GPU_ENABLED
|
||||
explicit vector(U&&... u)
|
||||
: base(vector_detail::each_elem(), std::forward<U>(u)...)
|
||||
{}
|
||||
|
||||
template <
|
||||
typename Sequence
|
||||
, typename Sequence_ = typename remove_reference<Sequence>::type
|
||||
, typename = typename boost::enable_if_c<(
|
||||
!is_base_of<vector, Sequence_>::value &&
|
||||
vector_detail::is_longer_sequence<
|
||||
Sequence_, sizeof...(T)
|
||||
>::value
|
||||
)>::type
|
||||
>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
vector(Sequence&& seq)
|
||||
: base(vector_detail::each_elem(), std::forward<Sequence>(seq))
|
||||
vector(U&&... u)
|
||||
: base(vector_detail::dispatch<vector>(std::forward<U>(u)...), std::forward<U>(u)...)
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
@ -324,7 +310,10 @@ namespace boost { namespace fusion
|
||||
vector&
|
||||
operator=(Sequence&& rhs)
|
||||
{
|
||||
base::assign_sequence(std::forward<Sequence>(rhs));
|
||||
typedef typename
|
||||
vector_detail::make_indices_from_seq<Sequence>::type
|
||||
indices;
|
||||
base::assign(std::forward<Sequence>(rhs), indices());
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
@ -1,13 +1,13 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2017 Kohei Takahashi
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(FUSION_INCLUDE_STD_ARRAY)
|
||||
#define FUSION_INCLUDE_STD_ARRAY
|
||||
#if !defined(FUSION_INCLUDE_ADAPT_ADT_NAMED)
|
||||
#define FUSION_INCLUDE_ADAPT_ADT_NAMED
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/adapted/std_array.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt_named.hpp>
|
||||
|
||||
#endif
|
@ -1,39 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
|
||||
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)
|
||||
==============================================================================*/
|
||||
#ifndef FUSION_AND_07152016_1625
|
||||
#define FUSION_AND_07152016_1625
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
#error fusion::detail::and_ requires variadic templates
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace detail {
|
||||
template<typename ...Cond>
|
||||
struct and_impl : false_type {};
|
||||
|
||||
template<typename ...T>
|
||||
struct and_impl<integral_constant<T, true>...> : true_type {};
|
||||
|
||||
// This specialization is necessary to avoid MSVC-12 variadics bug.
|
||||
template<bool ...Cond>
|
||||
struct and_impl1 : and_impl<integral_constant<bool, Cond>...> {};
|
||||
|
||||
/* fusion::detail::and_ differs from mpl::and_ in the following ways:
|
||||
- The empty set is valid and returns true
|
||||
- A single element set is valid and returns the identity
|
||||
- There is no upper bound on the set size
|
||||
- The conditions are evaluated at once, and are not short-circuited. This
|
||||
reduces instantations when returning true; the implementation is not
|
||||
recursive. */
|
||||
template<typename ...Cond>
|
||||
struct and_ : and_impl1<Cond::value...> {};
|
||||
}}}
|
||||
|
||||
#endif // FUSION_AND_07152016_1625
|
@ -20,15 +20,12 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// C++11 interface
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
#include <boost/fusion/sequence/comparison.hpp>
|
||||
#include <boost/fusion/sequence/io.hpp>
|
||||
#include <boost/fusion/support/detail/and.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
@ -42,49 +39,23 @@ namespace boost { namespace fusion
|
||||
tuple()
|
||||
: base_type() {}
|
||||
|
||||
template <
|
||||
typename ...U
|
||||
, typename = typename boost::enable_if_c<
|
||||
sizeof...(U) >= sizeof...(T)
|
||||
>::type
|
||||
>
|
||||
template <typename ...U>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
tuple(tuple<U...> const& other)
|
||||
: base_type(other) {}
|
||||
|
||||
template <
|
||||
typename ...U
|
||||
, typename = typename boost::enable_if_c<
|
||||
sizeof...(U) >= sizeof...(T)
|
||||
>::type
|
||||
>
|
||||
template <typename ...U>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
tuple(tuple<U...>&& other)
|
||||
: base_type(std::move(other)) {}
|
||||
|
||||
template <
|
||||
typename ...U
|
||||
, typename = typename boost::enable_if_c<(
|
||||
fusion::detail::and_<is_convertible<U, T>...>::value &&
|
||||
sizeof...(U) >= 1
|
||||
)>::type
|
||||
>
|
||||
template <typename ...U>
|
||||
/*BOOST_CONSTEXPR*/ BOOST_FUSION_GPU_ENABLED
|
||||
explicit
|
||||
tuple(U&&... args)
|
||||
: base_type(std::forward<U>(args)...) {}
|
||||
|
||||
template<typename U1, typename U2>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
tuple(std::pair<U1, U2> const& other)
|
||||
: base_type(other.first, other.second) {}
|
||||
|
||||
template<typename U1, typename U2>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
tuple(std::pair<U1, U2>&& other)
|
||||
: base_type(std::move(other.first), std::move(other.second)) {}
|
||||
|
||||
template<typename U>
|
||||
template <typename U>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
tuple& operator=(U&& rhs)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ namespace boost { namespace fusion {
|
||||
zip_view(
|
||||
const Sequences& seqs)
|
||||
: sequences_(seqs)
|
||||
{}
|
||||
{};
|
||||
|
||||
sequences sequences_;
|
||||
};
|
||||
|
408
test/Jamfile
408
test/Jamfile
@ -1,7 +1,5 @@
|
||||
##==============================================================================
|
||||
# Copyright (c) 2003-2006 Joel de Guzman
|
||||
# Copyright (c) 2013 Mateusz Loskot
|
||||
# Copyright (c) 2014-2017 Kohei Takahashi
|
||||
#
|
||||
# Use, modification and distribution is subject to the Boost Software
|
||||
# License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -9,7 +7,6 @@
|
||||
#==============================================================================
|
||||
# bring in rules for testing
|
||||
import testing ;
|
||||
import ../../config/checks/config : requires ;
|
||||
|
||||
project
|
||||
: requirements
|
||||
@ -18,237 +15,190 @@ project
|
||||
{
|
||||
test-suite fusion :
|
||||
|
||||
[ run algorithm/all.cpp ]
|
||||
[ run algorithm/any.cpp ]
|
||||
[ run algorithm/clear.cpp ]
|
||||
[ run algorithm/copy.cpp ]
|
||||
[ run algorithm/count.cpp ]
|
||||
[ run algorithm/count_if.cpp ]
|
||||
[ run algorithm/erase.cpp ]
|
||||
[ run algorithm/erase_key.cpp ]
|
||||
[ run algorithm/filter.cpp ]
|
||||
[ run algorithm/filter_if.cpp ]
|
||||
[ run algorithm/find.cpp ]
|
||||
[ run algorithm/find_if.cpp ]
|
||||
[ run algorithm/fold.cpp ]
|
||||
[ run algorithm/for_each.cpp ]
|
||||
[ run algorithm/insert.cpp ]
|
||||
[ run algorithm/insert_range.cpp ]
|
||||
[ run algorithm/iter_fold.cpp ]
|
||||
[ run algorithm/move.cpp ]
|
||||
[ run algorithm/none.cpp ]
|
||||
[ run algorithm/pop_back.cpp ]
|
||||
[ run algorithm/pop_front.cpp ]
|
||||
[ run algorithm/push_back.cpp ]
|
||||
[ run algorithm/push_front.cpp ]
|
||||
[ run algorithm/remove.cpp ]
|
||||
[ run algorithm/remove_if.cpp ]
|
||||
[ run algorithm/replace.cpp ]
|
||||
[ run algorithm/replace_if.cpp ]
|
||||
[ run algorithm/reverse_fold.cpp ]
|
||||
[ run algorithm/reverse_iter_fold.cpp ]
|
||||
[ run algorithm/reverse.cpp ]
|
||||
[ run algorithm/segmented_for_each.cpp ]
|
||||
[ run algorithm/segmented_find.cpp ]
|
||||
[ run algorithm/segmented_find_if.cpp ]
|
||||
[ run algorithm/segmented_fold.cpp ]
|
||||
[ run algorithm/transform.cpp ]
|
||||
[ run algorithm/join.cpp ]
|
||||
[ run algorithm/zip.cpp ]
|
||||
[ run algorithm/zip2.cpp ]
|
||||
[ run algorithm/zip_ignore.cpp ]
|
||||
[ run algorithm/flatten.cpp ]
|
||||
[ run algorithm/all.cpp : : : : ]
|
||||
[ run algorithm/any.cpp : : : : ]
|
||||
[ run algorithm/clear.cpp : : : : ]
|
||||
[ run algorithm/copy.cpp : : : : ]
|
||||
[ run algorithm/count.cpp : : : : ]
|
||||
[ run algorithm/count_if.cpp : : : : ]
|
||||
[ run algorithm/erase.cpp : : : : ]
|
||||
[ run algorithm/erase_key.cpp : : : : ]
|
||||
[ run algorithm/filter.cpp : : : : ]
|
||||
[ run algorithm/filter_if.cpp : : : : ]
|
||||
[ run algorithm/find.cpp : : : : ]
|
||||
[ run algorithm/find_if.cpp : : : : ]
|
||||
[ run algorithm/fold.cpp : : : : ]
|
||||
[ run algorithm/for_each.cpp : : : : ]
|
||||
[ run algorithm/insert.cpp : : : : ]
|
||||
[ run algorithm/insert_range.cpp : : : : ]
|
||||
[ run algorithm/iter_fold.cpp : : : : ]
|
||||
[ run algorithm/move.cpp : : : : ]
|
||||
[ run algorithm/none.cpp : : : : ]
|
||||
[ run algorithm/pop_back.cpp : : : : ]
|
||||
[ run algorithm/pop_front.cpp : : : : ]
|
||||
[ run algorithm/push_back.cpp : : : : ]
|
||||
[ run algorithm/push_front.cpp : : : : ]
|
||||
[ run algorithm/remove.cpp : : : : ]
|
||||
[ run algorithm/remove_if.cpp : : : : ]
|
||||
[ run algorithm/replace.cpp : : : : ]
|
||||
[ run algorithm/replace_if.cpp : : : : ]
|
||||
[ run algorithm/reverse_fold.cpp : : : : ]
|
||||
[ run algorithm/reverse_iter_fold.cpp : : : : ]
|
||||
[ run algorithm/reverse.cpp : : : : ]
|
||||
[ run algorithm/segmented_for_each.cpp : : : : ]
|
||||
[ run algorithm/segmented_find.cpp : : : : ]
|
||||
[ run algorithm/segmented_find_if.cpp : : : : ]
|
||||
[ run algorithm/segmented_fold.cpp : : : : ]
|
||||
[ run algorithm/transform.cpp : : : : ]
|
||||
[ run algorithm/join.cpp : : : : ]
|
||||
[ run algorithm/zip.cpp : : : : ]
|
||||
[ run algorithm/zip2.cpp : : : : ]
|
||||
[ run algorithm/zip_ignore.cpp : : : : ]
|
||||
[ run algorithm/flatten.cpp : : : : ]
|
||||
|
||||
[ run sequence/as_deque.cpp ]
|
||||
[ run sequence/as_list.cpp ]
|
||||
[ run sequence/as_map.cpp ]
|
||||
[ run sequence/as_map_assoc.cpp ]
|
||||
[ run sequence/as_set.cpp ]
|
||||
[ run sequence/as_vector.cpp ]
|
||||
[ run sequence/boost_tuple.cpp ]
|
||||
[ run sequence/boost_tuple_iterator.cpp ]
|
||||
[ run sequence/cons.cpp ]
|
||||
[ run sequence/convert_boost_tuple.cpp ]
|
||||
[ run sequence/convert_deque.cpp ]
|
||||
[ run sequence/convert_list.cpp ]
|
||||
[ run sequence/convert_std_pair.cpp ]
|
||||
[ run sequence/convert_std_tuple.cpp : :
|
||||
: [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ]
|
||||
[ run sequence/convert_vector.cpp ]
|
||||
[ run sequence/filter_view.cpp ]
|
||||
[ 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 ]
|
||||
[ run sequence/list_copy.cpp ]
|
||||
[ run sequence/list_iterator.cpp ]
|
||||
[ run sequence/list_hash.cpp ]
|
||||
[ run sequence/list_make.cpp ]
|
||||
[ run sequence/list_misc.cpp ]
|
||||
[ run sequence/list_mutate.cpp ]
|
||||
[ run sequence/list_nest.cpp ]
|
||||
[ run sequence/list_tie.cpp ]
|
||||
[ run sequence/list_value_at.cpp ]
|
||||
[ run sequence/deque_comparison.cpp ]
|
||||
[ run sequence/deque_construction.cpp ]
|
||||
[ run sequence/deque_copy.cpp ]
|
||||
[ run sequence/deque_iterator.cpp ]
|
||||
[ run sequence/deque_hash.cpp ]
|
||||
[ compile sequence/deque_is_constructible.cpp ]
|
||||
[ run sequence/deque_make.cpp ]
|
||||
[ run sequence/deque_misc.cpp ]
|
||||
[ run sequence/deque_move.cpp ]
|
||||
[ run sequence/deque_mutate.cpp ]
|
||||
[ run sequence/deque_nest.cpp ]
|
||||
[ run sequence/deque_tie.cpp ]
|
||||
[ run sequence/deque_value_at.cpp ]
|
||||
[ run sequence/front_extended_deque.cpp ]
|
||||
[ run sequence/back_extended_deque.cpp ]
|
||||
[ run sequence/make_list.cpp ]
|
||||
[ run sequence/make_vector.cpp ]
|
||||
[ run sequence/map.cpp ]
|
||||
[ run sequence/map_comparison.cpp ]
|
||||
[ run sequence/map_construction.cpp ]
|
||||
[ run sequence/map_copy.cpp ]
|
||||
[ 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 ]
|
||||
[ run sequence/array.cpp ]
|
||||
[ run sequence/std_array.cpp : :
|
||||
: [ requires cxx11_hdr_array ] ]
|
||||
[ run sequence/tuple_comparison.cpp ]
|
||||
[ run sequence/tuple_construction.cpp ]
|
||||
[ run sequence/tuple_conversion.cpp ]
|
||||
[ run sequence/tuple_copy.cpp ]
|
||||
[ run sequence/tuple_element.cpp ]
|
||||
[ run sequence/tuple_make.cpp ]
|
||||
[ run sequence/tuple_misc.cpp ]
|
||||
[ run sequence/tuple_mutate.cpp ]
|
||||
[ run sequence/tuple_nest.cpp ]
|
||||
[ run sequence/tuple_hash.cpp ]
|
||||
[ run sequence/tuple_tie.cpp ]
|
||||
[ run sequence/tuple_traits.cpp : :
|
||||
:
|
||||
: tuple_traits__maybe_variadic ]
|
||||
[ run sequence/tuple_traits.cpp : :
|
||||
: <define>BOOST_FUSION_DISABLE_VARIADIC_VECTOR
|
||||
: tuple_traits__no_variadic ]
|
||||
[ run sequence/transform_view.cpp ]
|
||||
[ run sequence/vector_comparison.cpp ]
|
||||
[ run sequence/vector_construction.cpp ]
|
||||
[ run sequence/vector_conversion.cpp ]
|
||||
[ run sequence/vector_copy.cpp ]
|
||||
[ run sequence/vector_iterator.cpp ]
|
||||
[ run sequence/vector_make.cpp ]
|
||||
[ run sequence/vector_misc.cpp ]
|
||||
[ run sequence/vector_move.cpp ]
|
||||
[ run sequence/vector_mutate.cpp ]
|
||||
[ run sequence/vector_n.cpp ]
|
||||
[ run sequence/vector_nest.cpp ]
|
||||
[ run sequence/vector_hash.cpp ]
|
||||
[ run sequence/vector_tie.cpp ]
|
||||
[ run sequence/vector_traits.cpp : :
|
||||
:
|
||||
: vector_traits__maybe_variadic ]
|
||||
[ run sequence/vector_traits.cpp : :
|
||||
: <define>BOOST_FUSION_DISABLE_VARIADIC_VECTOR
|
||||
: vector_traits__no_variadic ]
|
||||
[ run sequence/vector_value_at.cpp ]
|
||||
[ run sequence/zip_view.cpp ]
|
||||
[ run sequence/zip_view2.cpp ]
|
||||
[ run sequence/zip_view_ignore.cpp ]
|
||||
[ run sequence/repetitive_view.cpp ]
|
||||
[ run sequence/deduce_sequence.cpp ]
|
||||
[ run sequence/adapt_adt_named.cpp ]
|
||||
[ run sequence/adapt_adt_named_empty.cpp ]
|
||||
[ run sequence/adapt_adt.cpp ]
|
||||
[ run sequence/adapt_adt_empty.cpp ]
|
||||
[ run sequence/adapt_assoc_adt_named.cpp ]
|
||||
[ run sequence/adapt_assoc_adt_named_empty.cpp ]
|
||||
[ run sequence/adapt_assoc_adt.cpp ]
|
||||
[ run sequence/adapt_assoc_adt_empty.cpp ]
|
||||
[ run sequence/adapt_assoc_struct_named.cpp ]
|
||||
[ run sequence/adapt_assoc_struct_named_empty.cpp ]
|
||||
[ run sequence/adapt_assoc_struct.cpp ]
|
||||
[ run sequence/adapt_assoc_struct_empty.cpp ]
|
||||
[ run sequence/adapt_assoc_tpl_adt.cpp ]
|
||||
[ run sequence/adapt_assoc_tpl_adt_empty.cpp ]
|
||||
[ run sequence/adapt_assoc_tpl_struct.cpp ]
|
||||
[ run sequence/adapt_assoc_tpl_struct_empty.cpp ]
|
||||
[ run sequence/adapt_struct_named.cpp ]
|
||||
[ run sequence/adapt_struct_named_empty.cpp ]
|
||||
[ run sequence/adapt_struct.cpp ]
|
||||
[ run sequence/adapt_struct_empty.cpp ]
|
||||
[ run sequence/adapt_tpl_adt.cpp ]
|
||||
[ run sequence/adapt_tpl_adt_empty.cpp ]
|
||||
[ run sequence/adapt_tpl_struct.cpp ]
|
||||
[ run sequence/adapt_tpl_struct_empty.cpp ]
|
||||
[ run sequence/adt_attribute_proxy.cpp ]
|
||||
[ run sequence/define_struct.cpp ]
|
||||
[ run sequence/define_struct_empty.cpp ]
|
||||
[ run sequence/define_struct_move.cpp ]
|
||||
[ run sequence/define_struct_inline.cpp ]
|
||||
[ run sequence/define_struct_inline_empty.cpp ]
|
||||
[ run sequence/define_struct_inline_move.cpp ]
|
||||
[ run sequence/define_assoc_struct.cpp ]
|
||||
[ run sequence/define_assoc_struct_empty.cpp ]
|
||||
[ run sequence/define_assoc_struct_move.cpp ]
|
||||
[ run sequence/define_tpl_struct.cpp ]
|
||||
[ run sequence/define_tpl_struct_empty.cpp ]
|
||||
[ run sequence/define_tpl_struct_move.cpp ]
|
||||
[ run sequence/define_tpl_struct_inline.cpp ]
|
||||
[ run sequence/define_tpl_struct_inline_empty.cpp ]
|
||||
[ run sequence/define_tpl_struct_inline_move.cpp ]
|
||||
[ run sequence/define_assoc_tpl_struct.cpp ]
|
||||
[ run sequence/define_assoc_tpl_struct_empty.cpp ]
|
||||
[ run sequence/define_assoc_tpl_struct_move.cpp ]
|
||||
[ run sequence/std_tuple.cpp : :
|
||||
: [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ]
|
||||
[ run sequence/std_tuple_iterator.cpp : :
|
||||
: [ requires cxx11_variadic_templates cxx11_hdr_tuple ] ]
|
||||
[ run sequence/ref_vector.cpp ]
|
||||
[ run sequence/flatten_view.cpp ]
|
||||
[ run sequence/as_deque.cpp : : : : ]
|
||||
[ run sequence/as_list.cpp : : : : ]
|
||||
[ run sequence/as_map.cpp : : : : ]
|
||||
[ run sequence/as_map_assoc.cpp : : : : ]
|
||||
[ run sequence/as_set.cpp : : : : ]
|
||||
[ run sequence/as_vector.cpp : : : : ]
|
||||
[ run sequence/boost_tuple.cpp : : : : ]
|
||||
[ run sequence/boost_tuple_iterator.cpp : : : : ]
|
||||
[ run sequence/cons.cpp : : : : ]
|
||||
[ run sequence/convert_boost_tuple.cpp : : : : ]
|
||||
[ run sequence/convert_deque.cpp : : : : ]
|
||||
[ run sequence/convert_list.cpp : : : : ]
|
||||
[ run sequence/convert_std_pair.cpp : : : : ]
|
||||
[ run sequence/convert_std_tuple.cpp : : : : ]
|
||||
[ run sequence/convert_vector.cpp : : : : ]
|
||||
[ run sequence/filter_view.cpp : : : : ]
|
||||
[ run sequence/hash.cpp : : : : ]
|
||||
[ run sequence/io.cpp : : : : ]
|
||||
[ run sequence/iterator_range.cpp : : : : ]
|
||||
[ run sequence/joint_view.cpp : : : : ]
|
||||
[ run sequence/list_comparison.cpp : : : : ]
|
||||
[ run sequence/list_construction.cpp : : : : ]
|
||||
[ run sequence/list_copy.cpp : : : : ]
|
||||
[ run sequence/list_iterator.cpp : : : : ]
|
||||
[ run sequence/list_hash.cpp : : : : ]
|
||||
[ run sequence/list_make.cpp : : : : ]
|
||||
[ run sequence/list_misc.cpp : : : : ]
|
||||
[ run sequence/list_mutate.cpp : : : : ]
|
||||
[ run sequence/list_nest.cpp : : : : ]
|
||||
[ run sequence/list_tie.cpp : : : : ]
|
||||
[ run sequence/list_value_at.cpp : : : : ]
|
||||
[ run sequence/deque_comparison.cpp : : : : ]
|
||||
[ run sequence/deque_construction.cpp : : : : ]
|
||||
[ run sequence/deque_copy.cpp : : : : ]
|
||||
[ run sequence/deque_iterator.cpp : : : : ]
|
||||
[ run sequence/deque_hash.cpp : : : : ]
|
||||
[ compile sequence/deque_is_constructible.cpp : : : : ]
|
||||
[ run sequence/deque_make.cpp : : : : ]
|
||||
[ run sequence/deque_misc.cpp : : : : ]
|
||||
[ run sequence/deque_move.cpp : : : : ]
|
||||
[ run sequence/deque_mutate.cpp : : : : ]
|
||||
[ run sequence/deque_nest.cpp : : : : ]
|
||||
[ run sequence/deque_tie.cpp : : : : ]
|
||||
[ run sequence/deque_value_at.cpp : : : : ]
|
||||
[ run sequence/front_extended_deque.cpp : : : : ]
|
||||
[ run sequence/back_extended_deque.cpp : : : : ]
|
||||
[ run sequence/make_list.cpp : : : : ]
|
||||
[ run sequence/make_vector.cpp : : : : ]
|
||||
[ run sequence/map.cpp : : : : ]
|
||||
[ run sequence/map_comparison.cpp : : : : ]
|
||||
[ run sequence/map_construction.cpp : : : : ]
|
||||
[ run sequence/map_copy.cpp : : : : ]
|
||||
[ run sequence/map_misc.cpp : : : : ]
|
||||
[ run sequence/map_move.cpp : : : : ]
|
||||
[ run sequence/map_mutate.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/single_view.cpp : : : : ]
|
||||
[ run sequence/std_pair.cpp : : : : ]
|
||||
[ run sequence/boost_array.cpp : : : : ]
|
||||
[ run sequence/array.cpp : : : : ]
|
||||
[ run sequence/tuple_comparison.cpp : : : : ]
|
||||
[ run sequence/tuple_construction.cpp : : : : ]
|
||||
[ run sequence/tuple_copy.cpp : : : : ]
|
||||
[ run sequence/tuple_element.cpp : : : : ]
|
||||
[ run sequence/tuple_make.cpp : : : : ]
|
||||
[ run sequence/tuple_misc.cpp : : : : ]
|
||||
[ run sequence/tuple_mutate.cpp : : : : ]
|
||||
[ run sequence/tuple_nest.cpp : : : : ]
|
||||
[ run sequence/tuple_hash.cpp : : : : ]
|
||||
[ run sequence/tuple_tie.cpp : : : : ]
|
||||
[ run sequence/transform_view.cpp : : : : ]
|
||||
[ run sequence/vector_comparison.cpp : : : : ]
|
||||
[ run sequence/vector_construction.cpp : : : : ]
|
||||
[ run sequence/vector_copy.cpp : : : : ]
|
||||
[ run sequence/vector_iterator.cpp : : : : ]
|
||||
[ run sequence/vector_make.cpp : : : : ]
|
||||
[ run sequence/vector_misc.cpp : : : : ]
|
||||
[ run sequence/vector_move.cpp : : : : ]
|
||||
[ run sequence/vector_mutate.cpp : : : : ]
|
||||
[ run sequence/vector_n.cpp : : : : ]
|
||||
[ run sequence/vector_nest.cpp : : : : ]
|
||||
[ run sequence/vector_hash.cpp : : : : ]
|
||||
[ run sequence/vector_tie.cpp : : : : ]
|
||||
[ run sequence/vector_value_at.cpp : : : : ]
|
||||
[ run sequence/zip_view.cpp : : : : ]
|
||||
[ run sequence/zip_view2.cpp : : : : ]
|
||||
[ run sequence/zip_view_ignore.cpp : : : : ]
|
||||
[ run sequence/repetitive_view.cpp : : : : ]
|
||||
[ run sequence/deduce_sequence.cpp : : : : ]
|
||||
[ run sequence/adapt_adt_named.cpp : : : : ]
|
||||
[ run sequence/adapt_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_adt_named.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_struct_named.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_tpl_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_assoc_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_struct_named.cpp : : : : ]
|
||||
[ run sequence/adapt_struct.cpp : : : : ]
|
||||
[ run sequence/adapt_tpl_adt.cpp : : : : ]
|
||||
[ run sequence/adapt_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/adt_attribute_proxy.cpp : : : : ]
|
||||
[ run sequence/define_struct.cpp : : : : ]
|
||||
[ run sequence/define_struct_inline.cpp : : : : ]
|
||||
[ run sequence/define_assoc_struct.cpp : : : : ]
|
||||
[ run sequence/define_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/define_tpl_struct_inline.cpp : : : : ]
|
||||
[ run sequence/define_assoc_tpl_struct.cpp : : : : ]
|
||||
[ run sequence/std_tuple.cpp : : : : ]
|
||||
[ run sequence/std_tuple_iterator.cpp : : : : ]
|
||||
[ run sequence/ref_vector.cpp : : : : ]
|
||||
[ run sequence/flatten_view.cpp : : : : ]
|
||||
|
||||
[ compile sequence/size.cpp ]
|
||||
[ compile sequence/size.cpp : : : : ]
|
||||
|
||||
[ run functional/fused.cpp ]
|
||||
[ run functional/fused_function_object.cpp ]
|
||||
[ run functional/fused_procedure.cpp ]
|
||||
[ run functional/unfused.cpp ]
|
||||
[ run functional/unfused_typed.cpp ]
|
||||
[ run functional/make_fused.cpp ]
|
||||
[ run functional/make_fused_function_object.cpp ]
|
||||
[ run functional/make_fused_procedure.cpp ]
|
||||
[ run functional/make_unfused.cpp ]
|
||||
[ run functional/invoke.cpp ]
|
||||
[ run functional/invoke_function_object.cpp ]
|
||||
[ run functional/invoke_procedure.cpp ]
|
||||
[ run sequence/swap.cpp ]
|
||||
[ run functional/fused.cpp : : : : ]
|
||||
[ run functional/fused_function_object.cpp : : : : ]
|
||||
[ run functional/fused_procedure.cpp : : : : ]
|
||||
[ run functional/unfused.cpp : : : : ]
|
||||
[ run functional/unfused_typed.cpp : : : : ]
|
||||
[ run functional/make_fused.cpp : : : : ]
|
||||
[ run functional/make_fused_function_object.cpp : : : : ]
|
||||
[ run functional/make_fused_procedure.cpp : : : : ]
|
||||
[ run functional/make_unfused.cpp : : : : ]
|
||||
[ run functional/invoke.cpp : : : : ]
|
||||
[ run functional/invoke_function_object.cpp : : : : ]
|
||||
[ run functional/invoke_procedure.cpp : : : : ]
|
||||
[ run sequence/swap.cpp : : : : ]
|
||||
|
||||
[ compile support/pair_deque.cpp ]
|
||||
[ compile support/pair_list.cpp ]
|
||||
[ compile support/pair_map.cpp ]
|
||||
[ compile support/pair_set.cpp ]
|
||||
[ compile support/pair_vector.cpp ]
|
||||
[ compile support/pair_nest.cpp ]
|
||||
[ compile support/index_sequence.cpp ]
|
||||
[ compile support/and.cpp ]
|
||||
[ compile support/pair_deque.cpp : : : : ]
|
||||
[ compile support/pair_list.cpp : : : : ]
|
||||
[ compile support/pair_map.cpp : : : : ]
|
||||
[ compile support/pair_set.cpp : : : : ]
|
||||
[ compile support/pair_vector.cpp : : : : ]
|
||||
[ compile support/pair_nest.cpp : : : : ]
|
||||
[ compile support/index_sequence.cpp : : : : ]
|
||||
|
||||
# [ compile-fail xxx.cpp ]
|
||||
# [ compile-fail xxx.cpp : : : : ]
|
||||
|
||||
;
|
||||
}
|
||||
|
@ -9,36 +9,28 @@
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/adapted/mpl.hpp>
|
||||
#include <boost/fusion/algorithm/query/count_if.hpp>
|
||||
#include <boost/lambda/lambda.hpp>
|
||||
#include <boost/mpl/vector_c.hpp>
|
||||
#include <functional>
|
||||
|
||||
template <typename F> struct bind1st;
|
||||
template <template <typename> class F, typename T>
|
||||
struct bind1st<F<T> > : public F<T>
|
||||
{
|
||||
T n;
|
||||
bind1st(T n) : n(n) { }
|
||||
bool operator()(T v) const { return F<T>::operator()(n, v); }
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
{
|
||||
boost::fusion::vector<int, short, double> t(1, 2, 3.3);
|
||||
BOOST_TEST(boost::fusion::count_if(t, bind1st<std::equal_to<double> >(2)) == 1);
|
||||
BOOST_TEST(boost::fusion::count_if(t, boost::lambda::_1 == 2) == 1);
|
||||
}
|
||||
|
||||
{
|
||||
boost::fusion::vector<int, short, double> t(1, 2, 3.3);
|
||||
BOOST_TEST(boost::fusion::count_if(t, bind1st<std::equal_to<double> >(3)) == 0);
|
||||
BOOST_TEST(boost::fusion::count_if(t, boost::lambda::_1 == 3) == 0);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::mpl::vector_c<int, 1, 2, 3> mpl_vec;
|
||||
// Cannot use lambda here as mpl iterators return rvalues and lambda needs lvalues
|
||||
BOOST_TEST(boost::fusion::count_if(mpl_vec(), bind1st<std::greater_equal<int> >(2)) == 2);
|
||||
BOOST_TEST(boost::fusion::count_if(mpl_vec(), bind1st<std::less<int> >(2)) == 1);
|
||||
BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::less_equal<int>(), 2)) == 2);
|
||||
BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::greater<int>(), 2)) == 1);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
|
@ -1,86 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt>));
|
||||
empty_adt e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt>::type,
|
||||
fusion::result_of::end<empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT_NAMED(::empty_adt,empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_adt empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_adt>));
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_adt>::type,
|
||||
fusion::result_of::end<adapted::empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_adt e(empty);
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_adt>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,88 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt>));
|
||||
empty_adt e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt>::type,
|
||||
fusion::result_of::end<empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(::empty_adt,empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_adt empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_adt>));
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_adt>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_adt>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_adt>::type,
|
||||
fusion::result_of::end<adapted::empty_adt>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_adt e(empty);
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_adt e(empty);
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_adt>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_adt, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_adt, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,88 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct>::type,
|
||||
fusion::result_of::end<empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(::empty_struct,empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_struct empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_struct>));
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_struct>::type,
|
||||
fusion::result_of::end<adapted::empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_struct e(empty);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_struct>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_struct, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<adapted::empty_struct, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_ADT((T), (empty_adt)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt<void> >));
|
||||
empty_adt<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt<void> >::type,
|
||||
fusion::result_of::end<empty_adt<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt<void> e;
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt<void> e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt<void> >));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt<void>, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_adt<void>, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT((T), (empty_struct)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct<void> >::type,
|
||||
fusion::result_of::end<empty_struct<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,86 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_STRUCT(empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct>::type,
|
||||
fusion::result_of::end<empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED(::empty_struct,empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
empty_struct empty;
|
||||
{
|
||||
BOOST_MPL_ASSERT((traits::is_view<adapted::empty_struct>));
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<adapted::empty_struct>::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<adapted::empty_struct>));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<adapted::empty_struct>::type,
|
||||
fusion::result_of::end<adapted::empty_struct>::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
adapted::empty_struct e(empty);
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(e != v);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
adapted::empty_struct e(empty);
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<adapted::empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_TPL_ADT((T), (empty_adt)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_adt<void> >));
|
||||
empty_adt<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_adt<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_adt<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_adt<void> >::type,
|
||||
fusion::result_of::end<empty_adt<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_adt<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(e > v);
|
||||
BOOST_TEST(e >= v);
|
||||
}
|
||||
|
||||
{
|
||||
empty_adt<void> e;
|
||||
|
||||
// conversion from empty_adt to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_adt to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_adt<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,87 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/empty.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/fusion/container/generation/make_vector.hpp>
|
||||
#include <boost/fusion/sequence/comparison/equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less.hpp>
|
||||
#include <boost/fusion/sequence/comparison/less_equal.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater.hpp>
|
||||
#include <boost/fusion/sequence/comparison/greater_equal.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
template <typename T>
|
||||
class empty_struct{};
|
||||
BOOST_FUSION_ADAPT_TPL_STRUCT((T), (empty_struct)(T),)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_MPL_ASSERT((fusion::result_of::empty<empty_struct<void> >));
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<
|
||||
fusion::result_of::begin<empty_struct<void> >::type,
|
||||
fusion::result_of::end<empty_struct<void> >::type>));
|
||||
}
|
||||
|
||||
{
|
||||
fusion::vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
fusion::vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// FIXME
|
||||
// conversion from empty_struct to list
|
||||
//fusion::list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,322 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
|
||||
Use modification and distribution are subject to the Boost Software
|
||||
License, Version 1.0. (See accompanyintg file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt).
|
||||
==============================================================================*/
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/boost_tuple.hpp>
|
||||
#include <boost/fusion/adapted/std_pair.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) \
|
||||
&& !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
# include <boost/fusion/adapted/std_tuple.hpp>
|
||||
#endif
|
||||
#include <boost/fusion/container/deque.hpp>
|
||||
#include <boost/fusion/container/list.hpp>
|
||||
#include <boost/fusion/tuple.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
|
||||
#include "fixture.hpp"
|
||||
|
||||
template <template <typename> class Scenario>
|
||||
void test()
|
||||
{
|
||||
using namespace test_detail;
|
||||
|
||||
// Note the trunction conversion tests from each containter
|
||||
// ... bug or feature?
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(FUSION_SEQUENCE<int>(300), 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::push_back(FUSION_SEQUENCE<int>(200), 400)
|
||||
, FUSION_SEQUENCE<convertible>(200)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((run<Scenario<FUSION_SEQUENCE<> > >(boost::fusion::vector<>())));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<> > >(
|
||||
boost::fusion::vector<int>(100), boost::fusion::vector<>()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::vector<int>(110)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::vector<int, int>(200, 100)
|
||||
, boost::fusion::vector<convertible>(200)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::vector<int, int>(200, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::vector<int, int, int>(500, 400, 100)
|
||||
, boost::fusion::vector<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::vector<int>(500), 400
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::vector<int, int>(500, 400), 100
|
||||
)
|
||||
, boost::fusion::vector<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((run<Scenario< FUSION_SEQUENCE<> > >(boost::fusion::deque<>())));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<> > >(
|
||||
boost::fusion::deque<int>(100), boost::fusion::deque<>()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::deque<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::deque<int, int>(500, 100)
|
||||
, boost::fusion::deque<convertible>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::deque<int, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::deque<int, int, int>(500, 400, 100)
|
||||
, boost::fusion::deque<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::deque<int>(500), 400
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::deque<int, int>(500, 400), 100
|
||||
)
|
||||
, boost::fusion::deque<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(boost::fusion::list<>())));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<> > >(
|
||||
boost::fusion::list<int>(100), boost::fusion::list<>()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::list<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::list<int, int>(500, 100)
|
||||
, boost::fusion::list<convertible>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::list<int, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::list<int, int, int>(500, 400, 100)
|
||||
, boost::fusion::list<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::list<int>(500), 400
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::list<int, int>(500, 400), 100
|
||||
)
|
||||
, boost::fusion::list<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((run<Scenario< FUSION_SEQUENCE<> > >(boost::fusion::tuple<>())));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<> > >(
|
||||
boost::fusion::tuple<int>(100), boost::fusion::tuple<>()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::tuple<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::fusion::tuple<int, int>(500, 100)
|
||||
, boost::fusion::tuple<convertible>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::tuple<int, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::tuple<int, int, int>(500, 400, 100)
|
||||
, boost::fusion::tuple<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::tuple<int>(500), 400
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::fusion::tuple<int, int>(500, 400), 100
|
||||
)
|
||||
, boost::fusion::tuple<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(boost::tuple<>())));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<> > >(
|
||||
boost::tuple<int>(100), boost::tuple<>()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::tuple<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
boost::tuple<int, int>(500, 100)
|
||||
, boost::tuple<convertible>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::tuple<int, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::tuple<int, int, int>(500, 400, 100)
|
||||
, boost::tuple<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(boost::tuple<int>(500), 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
boost::tuple<int, int>(500, 400), 100
|
||||
)
|
||||
, boost::tuple<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) \
|
||||
&& !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(std::tuple<>())));
|
||||
BOOST_TEST((
|
||||
run<Scenario<FUSION_SEQUENCE<> > >(std::tuple<int>(100), std::tuple<>())
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
std::tuple<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
std::tuple<int, int>(500, 100)
|
||||
, std::tuple<convertible>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
std::tuple<int, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
std::tuple<int, int, int>(500, 400, 100)
|
||||
, std::tuple<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(std::tuple<int>(500), 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
boost::fusion::push_back(
|
||||
std::tuple<int, int>(500, 400), 100
|
||||
)
|
||||
, std::tuple<convertible, int>(500, 400)
|
||||
)
|
||||
));
|
||||
#endif
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
std::pair<int, int>(500, 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<> > >(
|
||||
std::pair<int, int>(500, 400)
|
||||
, boost::fusion::vector<>()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
std::pair<int, int>(500, 400)
|
||||
, boost::fusion::vector<convertible>(500)
|
||||
)
|
||||
));
|
||||
}
|
@ -8,13 +8,18 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
|
||||
defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
# error "does not meet requirements"
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#include <tuple>
|
||||
#include <boost/fusion/include/std_tuple.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE std::tuple
|
||||
#include "convert.hpp"
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -5,8 +5,6 @@
|
||||
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 <string>
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
@ -17,8 +15,6 @@
|
||||
#include <boost/mpl/equal.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include "fixture.hpp"
|
||||
|
||||
#if !defined(FUSION_AT)
|
||||
#define FUSION_AT at_c
|
||||
#endif
|
||||
@ -40,6 +36,12 @@ namespace test_detail
|
||||
struct DD { operator CC() const { return CC(); }; };
|
||||
}
|
||||
|
||||
boost::fusion::FUSION_SEQUENCE<double, double, double, double>
|
||||
foo(int i)
|
||||
{
|
||||
return boost::fusion::FUSION_MAKE(i, i+1, i+2, i+3);
|
||||
}
|
||||
|
||||
void test_mpl()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
@ -58,7 +60,6 @@ void test_mpl()
|
||||
BOOST_STATIC_ASSERT(equal::value);
|
||||
}
|
||||
|
||||
template <template <typename> class Scenario>
|
||||
void
|
||||
test()
|
||||
{
|
||||
@ -76,9 +77,6 @@ test()
|
||||
BOOST_TEST((double)FUSION_AT<0>(t1) == FUSION_AT<0>(t3));
|
||||
BOOST_TEST(FUSION_AT<1>(t1) == FUSION_AT<1>(t3)[0]);
|
||||
|
||||
BOOST_TEST(FUSION_AT<0>(t1) == 4);
|
||||
BOOST_TEST(FUSION_AT<1>(t1) == 'a');
|
||||
|
||||
// testing copy and assignment with implicit conversions
|
||||
// between elements testing tie
|
||||
|
||||
@ -93,62 +91,8 @@ test()
|
||||
BOOST_TEST(c=='a');
|
||||
BOOST_TEST(d>5.4 && d<5.6);
|
||||
|
||||
// returning a tuple with conversion
|
||||
foo(2);
|
||||
|
||||
test_mpl();
|
||||
|
||||
|
||||
BOOST_TEST((run< Scenario< FUSION_SEQUENCE<> > >(FUSION_SEQUENCE<>())));
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int> > >(FUSION_SEQUENCE<int>(500))
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
FUSION_SEQUENCE<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int> > >(
|
||||
FUSION_SEQUENCE<int, int>(500, 100)
|
||||
, FUSION_SEQUENCE<int>(500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible> > >(
|
||||
FUSION_SEQUENCE<int, int>(500, 100)
|
||||
, FUSION_SEQUENCE<convertible>(500)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, int> > >(
|
||||
FUSION_SEQUENCE<int, int>(500, 600)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, int> > >(
|
||||
FUSION_SEQUENCE<convertible, int>(100, 500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, convertible> > >(
|
||||
FUSION_SEQUENCE<int, convertible>(500, 600)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, convertible> > >(
|
||||
FUSION_SEQUENCE<int, int>(400, 500)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, int> > >(
|
||||
FUSION_SEQUENCE<int, int, int>(500, 100, 323)
|
||||
, FUSION_SEQUENCE<int, int>(500, 100)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<convertible, convertible> > >(
|
||||
FUSION_SEQUENCE<int, int, int>(500, 600, 100)
|
||||
, FUSION_SEQUENCE<convertible, convertible>(500, 600)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
@ -29,8 +29,6 @@ BOOST_FUSION_DEFINE_ASSOC_STRUCT(
|
||||
(int, y, ns::y_member)
|
||||
)
|
||||
|
||||
BOOST_FUSION_DEFINE_ASSOC_STRUCT(BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -1,77 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_ASSOC_STRUCT(BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct>::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct>::type b;
|
||||
typedef fusion::result_of::end<empty_struct>::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
/*=============================================================================
|
||||
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>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct key_type;
|
||||
struct wrapper
|
||||
{
|
||||
int value;
|
||||
|
||||
wrapper() : value(42) {}
|
||||
wrapper(wrapper&& other) : value(other.value) { other.value = 0; }
|
||||
wrapper(wrapper const& other) : value(other.value) {}
|
||||
|
||||
wrapper& operator=(wrapper&& other) { value = other.value; other.value = 0; return *this; }
|
||||
wrapper& operator=(wrapper const& other) { value = other.value; return *this; }
|
||||
};
|
||||
BOOST_FUSION_DEFINE_ASSOC_STRUCT((ns), value, (wrapper, w, key_type))
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
{
|
||||
ns::value x;
|
||||
ns::value y(x); // copy
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = x; // copy assign
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
}
|
||||
|
||||
{
|
||||
ns::value x;
|
||||
ns::value y(std::move(x)); // move
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = std::move(x); // move assign
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 0);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -31,8 +31,6 @@ BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT(
|
||||
(int, y, ns::y_member)
|
||||
)
|
||||
|
||||
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -1,77 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct<void> >::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct<void> >::type b;
|
||||
typedef fusion::result_of::end<empty_struct<void> >::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, void>));
|
||||
BOOST_MPL_ASSERT_NOT((fusion::result_of::has_key<empty_struct<void>, int>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
/*=============================================================================
|
||||
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>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct key_type;
|
||||
struct wrapper
|
||||
{
|
||||
int value;
|
||||
|
||||
wrapper() : value(42) {}
|
||||
wrapper(wrapper&& other) : value(other.value) { other.value = 0; }
|
||||
wrapper(wrapper const& other) : value(other.value) {}
|
||||
|
||||
wrapper& operator=(wrapper&& other) { value = other.value; other.value = 0; return *this; }
|
||||
wrapper& operator=(wrapper const& other) { value = other.value; return *this; }
|
||||
};
|
||||
BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT((W), (ns), value, (W, w, key_type))
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
{
|
||||
ns::value<wrapper> x;
|
||||
ns::value<wrapper> y(x); // copy
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = x; // copy assign
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
}
|
||||
|
||||
{
|
||||
ns::value<wrapper> x;
|
||||
ns::value<wrapper> y(std::move(x)); // move
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = std::move(x); // move assign
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 0);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -33,8 +33,6 @@ BOOST_FUSION_DEFINE_STRUCT(
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), s, (int, m))
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
// Testing non-constexpr compatible types
|
||||
BOOST_FUSION_DEFINE_STRUCT(
|
||||
(ns),
|
||||
|
@ -1,75 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct>::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct>::type b;
|
||||
typedef fusion::result_of::end<empty_struct>::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct>));
|
||||
empty_struct e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct>::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct>::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct>::type b;
|
||||
typedef fusion::result_of::end<empty_struct>::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct>));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*=============================================================================
|
||||
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>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct wrapper
|
||||
{
|
||||
int value;
|
||||
|
||||
wrapper() : value(42) {}
|
||||
wrapper(wrapper&& other) : value(other.value) { other.value = 0; }
|
||||
wrapper(wrapper const& other) : value(other.value) {}
|
||||
|
||||
wrapper& operator=(wrapper&& other) { value = other.value; other.value = 0; return *this; }
|
||||
wrapper& operator=(wrapper const& other) { value = other.value; return *this; }
|
||||
};
|
||||
|
||||
namespace ns
|
||||
{
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(value, (wrapper, w))
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
{
|
||||
ns::value x;
|
||||
ns::value y(x); // copy
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = x; // copy assign
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
}
|
||||
|
||||
{
|
||||
ns::value x;
|
||||
ns::value y(std::move(x)); // move
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = std::move(x); // move assign
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 0);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -1,77 +0,0 @@
|
||||
/*=============================================================================
|
||||
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>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct wrapper
|
||||
{
|
||||
int value;
|
||||
|
||||
wrapper() : value(42) {}
|
||||
wrapper(wrapper&& other) : value(other.value) { other.value = 0; }
|
||||
wrapper(wrapper const& other) : value(other.value) {}
|
||||
|
||||
wrapper& operator=(wrapper&& other) { value = other.value; other.value = 0; return *this; }
|
||||
wrapper& operator=(wrapper const& other) { value = other.value; return *this; }
|
||||
};
|
||||
BOOST_FUSION_DEFINE_STRUCT((ns), value, (wrapper, w))
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
{
|
||||
ns::value x;
|
||||
ns::value y(x); // copy
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = x; // copy assign
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
}
|
||||
|
||||
{
|
||||
ns::value x;
|
||||
ns::value y(std::move(x)); // move
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = std::move(x); // move assign
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 0);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -27,8 +27,6 @@ BOOST_FUSION_DEFINE_TPL_STRUCT(
|
||||
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT((M), BOOST_PP_EMPTY(), s, (M, m))
|
||||
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -1,75 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT((M), BOOST_PP_EMPTY(), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct<void> >::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct<void> >::type b;
|
||||
typedef fusion::result_of::end<empty_struct<void> >::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/*=============================================================================
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container.hpp>
|
||||
#include <boost/fusion/sequence.hpp>
|
||||
#include <boost/fusion/sequence/io/out.hpp>
|
||||
#include <boost/fusion/iterator/equal_to.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/is_sequence.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE((M), empty_struct, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
using namespace boost::fusion;
|
||||
|
||||
std::cout << tuple_open('[');
|
||||
std::cout << tuple_close(']');
|
||||
std::cout << tuple_delimiter(", ");
|
||||
|
||||
{
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<empty_struct<void> >));
|
||||
empty_struct<void> e;
|
||||
|
||||
std::cout << e << std::endl;
|
||||
BOOST_TEST(e == make_vector());
|
||||
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::size<empty_struct<void> >::value == 0);
|
||||
BOOST_STATIC_ASSERT(fusion::result_of::empty<empty_struct<void> >::value);
|
||||
}
|
||||
|
||||
{
|
||||
vector<> v;
|
||||
empty_struct<void> e;
|
||||
BOOST_TEST(v == e);
|
||||
BOOST_TEST_NOT(v != e);
|
||||
BOOST_TEST_NOT(v < e);
|
||||
BOOST_TEST(v <= e);
|
||||
BOOST_TEST_NOT(v > e);
|
||||
BOOST_TEST(v >= e);
|
||||
}
|
||||
|
||||
{
|
||||
empty_struct<void> e;
|
||||
|
||||
// conversion from empty_struct to vector
|
||||
vector<> v(e);
|
||||
v = e;
|
||||
|
||||
// conversion from empty_struct to list
|
||||
//list<> l(e);
|
||||
//l = e;
|
||||
}
|
||||
|
||||
{ // begin/end
|
||||
typedef fusion::result_of::begin<empty_struct<void> >::type b;
|
||||
typedef fusion::result_of::end<empty_struct<void> >::type e;
|
||||
|
||||
BOOST_MPL_ASSERT((fusion::result_of::equal_to<b, e>));
|
||||
}
|
||||
|
||||
BOOST_MPL_ASSERT((mpl::is_sequence<empty_struct<void> >));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
/*=============================================================================
|
||||
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>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct_inline.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct wrapper
|
||||
{
|
||||
int value;
|
||||
|
||||
wrapper() : value(42) {}
|
||||
wrapper(wrapper&& other) : value(other.value) { other.value = 0; }
|
||||
wrapper(wrapper const& other) : value(other.value) {}
|
||||
|
||||
wrapper& operator=(wrapper&& other) { value = other.value; other.value = 0; return *this; }
|
||||
wrapper& operator=(wrapper const& other) { value = other.value; return *this; }
|
||||
};
|
||||
|
||||
namespace ns
|
||||
{
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE((W), value, (W, w))
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
{
|
||||
ns::value<wrapper> x;
|
||||
ns::value<wrapper> y(x); // copy
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = x; // copy assign
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
}
|
||||
|
||||
{
|
||||
ns::value<wrapper> x;
|
||||
ns::value<wrapper> y(std::move(x)); // move
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = std::move(x); // move assign
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 0);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -1,77 +0,0 @@
|
||||
/*=============================================================================
|
||||
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>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
#include <utility>
|
||||
|
||||
struct wrapper
|
||||
{
|
||||
int value;
|
||||
|
||||
wrapper() : value(42) {}
|
||||
wrapper(wrapper&& other) : value(other.value) { other.value = 0; }
|
||||
wrapper(wrapper const& other) : value(other.value) {}
|
||||
|
||||
wrapper& operator=(wrapper&& other) { value = other.value; other.value = 0; return *this; }
|
||||
wrapper& operator=(wrapper const& other) { value = other.value; return *this; }
|
||||
};
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT((W), (ns), value, (W, w))
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
{
|
||||
ns::value<wrapper> x;
|
||||
ns::value<wrapper> y(x); // copy
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = x; // copy assign
|
||||
|
||||
BOOST_TEST(x.w.value == 42);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
}
|
||||
|
||||
{
|
||||
ns::value<wrapper> x;
|
||||
ns::value<wrapper> y(std::move(x)); // move
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 42);
|
||||
|
||||
++y.w.value;
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 43);
|
||||
|
||||
y = std::move(x); // move assign
|
||||
|
||||
BOOST_TEST(x.w.value == 0);
|
||||
BOOST_TEST(y.w.value == 0);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
@ -13,30 +13,10 @@
|
||||
#define FUSION_SEQUENCE deque
|
||||
#include "copy.hpp"
|
||||
|
||||
using namespace test_detail;
|
||||
|
||||
// c++11 deque has bug, cannot properly copy-assign from a const value
|
||||
template <typename T>
|
||||
struct skip_const_lvalue_assignment
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return
|
||||
run< can_implicit_construct<T> >(source, expected) &&
|
||||
run< can_construct<T> >(source, expected) &&
|
||||
run< can_rvalue_assign<T> >(source, expected) &&
|
||||
run< can_lvalue_assign<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
|
||||
test<skip_const_lvalue_assignment>();
|
||||
#else
|
||||
test<can_copy>();
|
||||
#endif
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -7,37 +7,13 @@
|
||||
#include <boost/fusion/container/deque/deque.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::deque
|
||||
#define FUSION_SEQUENCE deque
|
||||
#include "nest.hpp"
|
||||
|
||||
/* deque has a few issues:
|
||||
- sequence conversion constructor is explicit
|
||||
- assignment sequence conversion has bug in base class
|
||||
- c++11 direct assignment from lvalue has bug */
|
||||
template <typename T>
|
||||
struct skip_issues
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
using namespace test_detail;
|
||||
return
|
||||
#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE)
|
||||
run< can_construct<T> >(source, expected) &&
|
||||
run< can_implicit_construct<T> >(source, expected) &&
|
||||
run< can_rvalue_assign<T> >(source, expected) &&
|
||||
run< can_convert_using<can_construct>::to<T> >(source, expected) &&
|
||||
#else
|
||||
run< can_copy<T> >(source, expected) &&
|
||||
#endif
|
||||
run< can_construct_from_elements<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<skip_issues>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -1,216 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
|
||||
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/fusion/sequence/comparison.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace test_detail
|
||||
{
|
||||
struct convertible
|
||||
{
|
||||
convertible() : value_() {}
|
||||
convertible(int value) : value_(value) {}
|
||||
int value_;
|
||||
};
|
||||
|
||||
bool operator==(convertible const& lhs, convertible const& rhs)
|
||||
{
|
||||
return lhs.value_ == rhs.value_;
|
||||
}
|
||||
|
||||
bool operator!=(convertible const& lhs, convertible const& rhs)
|
||||
{
|
||||
return lhs.value_ != rhs.value_;
|
||||
}
|
||||
|
||||
// Testing conversion at function call allows for testing mutable lvalue,
|
||||
// const lvalue, and rvalue as the source. mpl::identity prevents deduction
|
||||
template <typename T>
|
||||
T implicit_construct(typename boost::mpl::identity<T>::type source)
|
||||
{
|
||||
return source;
|
||||
}
|
||||
|
||||
template <typename F, typename Source, typename Expected>
|
||||
bool run(Source const& source, Expected const& expected)
|
||||
{
|
||||
return F()(source, expected);
|
||||
}
|
||||
|
||||
template <typename F, typename Source>
|
||||
bool run(Source const& source)
|
||||
{
|
||||
return run<F>(source, source);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
struct can_rvalue_implicit_construct
|
||||
{
|
||||
template<typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return expected == implicit_construct<T>(implicit_construct<Source>(source));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_lvalue_implicit_construct
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source source, Expected const& expected) const
|
||||
{
|
||||
return expected == implicit_construct<T>(source);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_const_lvalue_implicit_construct
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return expected == implicit_construct<T>(source);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_implicit_construct
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return
|
||||
run< can_rvalue_implicit_construct<T> >(source, expected) &&
|
||||
run< can_lvalue_implicit_construct<T> >(source, expected) &&
|
||||
run< can_const_lvalue_implicit_construct<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_rvalue_construct
|
||||
{
|
||||
template<typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return expected == T(implicit_construct<Source>(source));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_lvalue_construct
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source source, Expected const& expected) const
|
||||
{
|
||||
return expected == T(source);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_const_lvalue_construct
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return expected == T(source);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_construct
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return
|
||||
run< can_rvalue_construct<T> >(source, expected) &&
|
||||
run< can_lvalue_construct<T> >(source, expected) &&
|
||||
run< can_const_lvalue_construct<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_rvalue_assign
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
bool result = true;
|
||||
{
|
||||
T seq;
|
||||
result &= (seq == expected || seq != expected);
|
||||
|
||||
seq = implicit_construct<Source>(source);
|
||||
result &= (seq == expected);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_lvalue_assign
|
||||
{
|
||||
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source source, Expected const& expected) const
|
||||
{
|
||||
bool result = true;
|
||||
{
|
||||
T seq;
|
||||
result &= (seq == expected || seq != expected);
|
||||
|
||||
seq = source;
|
||||
result &= (seq == expected);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_const_lvalue_assign
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
bool result = true;
|
||||
{
|
||||
T seq;
|
||||
result &= (seq == expected || seq != expected);
|
||||
|
||||
seq = source;
|
||||
result &= (seq == expected);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_assign
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return
|
||||
run< can_rvalue_assign<T> >(source, expected) &&
|
||||
run< can_lvalue_assign<T> >(source, expected) &&
|
||||
run< can_const_lvalue_assign<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_copy
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
return
|
||||
run< can_construct<T> >(source, expected) &&
|
||||
run< can_implicit_construct<T> >(source, expected) &&
|
||||
run< can_assign<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
} // test_detail
|
@ -1,46 +0,0 @@
|
||||
/*=============================================================================
|
||||
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
|
@ -15,7 +15,7 @@
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<test_detail::can_copy>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -7,30 +7,13 @@
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::list
|
||||
#define FUSION_SEQUENCE list
|
||||
#include "nest.hpp"
|
||||
|
||||
/* list has a few issues:
|
||||
- sequence conversion constructor has bug when first element is a sequence
|
||||
- assignment sequence conversion has bug in base class */
|
||||
template <typename T>
|
||||
struct skip_issues
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
using namespace test_detail;
|
||||
return
|
||||
run< can_copy<T> >(source, expected) &&
|
||||
run< can_construct_from_elements<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<skip_issues>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -1,71 +0,0 @@
|
||||
/*=============================================================================
|
||||
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();
|
||||
}
|
||||
|
@ -7,315 +7,52 @@
|
||||
|
||||
#include <utility>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/fusion/include/adapt_struct.hpp>
|
||||
#include <boost/fusion/include/as_deque.hpp>
|
||||
#include <boost/fusion/include/as_list.hpp>
|
||||
#include <boost/fusion/include/as_vector.hpp>
|
||||
#include <boost/fusion/include/begin.hpp>
|
||||
#include <boost/fusion/include/is_sequence.hpp>
|
||||
#include <boost/fusion/include/size.hpp>
|
||||
#include <boost/fusion/include/value_of.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#include "fixture.hpp"
|
||||
|
||||
namespace test_detail
|
||||
template <typename C>
|
||||
void test_copy()
|
||||
{
|
||||
struct adapted_sequence
|
||||
{
|
||||
adapted_sequence() : value_() {}
|
||||
explicit adapted_sequence(int value) : value_(value) {}
|
||||
int value_;
|
||||
};
|
||||
C src;
|
||||
C dst = src;
|
||||
(void)dst;
|
||||
}
|
||||
|
||||
bool operator==(adapted_sequence const& lhs, adapted_sequence const& rhs)
|
||||
{
|
||||
return lhs.value_ == rhs.value_;
|
||||
}
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <typename C>
|
||||
void test_move()
|
||||
{
|
||||
C src;
|
||||
C dst = std::move(src);
|
||||
(void)dst;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool operator!=(adapted_sequence const& lhs, adapted_sequence const& rhs)
|
||||
{
|
||||
return lhs.value_ != rhs.value_;
|
||||
}
|
||||
template <typename C>
|
||||
void test_all()
|
||||
{
|
||||
test_copy<C>();
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
test_move<C>();
|
||||
#endif
|
||||
}
|
||||
|
||||
template <template <typename> class Scenario>
|
||||
struct can_convert_using
|
||||
{
|
||||
template <typename T>
|
||||
struct to
|
||||
{
|
||||
static bool can_convert_(boost::true_type /* skip */)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool can_convert_(boost::false_type /* skip */)
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
return
|
||||
run<Scenario<T> >(typename result_of::as_deque<T>::type()) &&
|
||||
run<Scenario<T> >(typename result_of::as_list<T>::type()) &&
|
||||
run<Scenario<T> >(typename result_of::as_vector<T>::type());
|
||||
}
|
||||
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const&, Expected const&) const
|
||||
{
|
||||
// bug when converting single element sequences in C++03 and
|
||||
// C++11...
|
||||
// not_<not_<is_convertible<sequence<sequence<int>>, int >
|
||||
// is invalid check
|
||||
typedef typename ::boost::fusion::result_of::size<T>::type seq_size;
|
||||
return can_convert_(
|
||||
boost::integral_constant<bool, seq_size::value == 1>()
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_construct_from_elements
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const&, Expected const&) const
|
||||
{
|
||||
// constructing a nested sequence of one is the complicated case to
|
||||
// disambiguate from a conversion-copy, so focus on that
|
||||
typedef typename boost::fusion::result_of::size<T>::type seq_size;
|
||||
return can_construct_(
|
||||
boost::integral_constant<int, seq_size::value>()
|
||||
);
|
||||
}
|
||||
|
||||
template <int Size>
|
||||
static bool can_construct_(boost::integral_constant<int, Size>)
|
||||
{
|
||||
return Size == 0 || Size == 2 || Size == 3;
|
||||
}
|
||||
|
||||
static bool can_construct_(boost::integral_constant<int, 1>)
|
||||
{
|
||||
typedef typename ::boost::remove_reference<
|
||||
typename ::boost::remove_const<
|
||||
typename ::boost::fusion::result_of::value_of<
|
||||
typename ::boost::fusion::result_of::begin<T>::type
|
||||
>::type
|
||||
>::type
|
||||
>::type element;
|
||||
|
||||
return run< can_construct<T> >(element(), T());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct can_nest
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected)
|
||||
{
|
||||
return
|
||||
run< can_copy<T> >(source, expected);
|
||||
run< can_convert_using<can_copy>::to<T> >(source, expected) &&
|
||||
run< can_construct_from_elements<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
} // test_detail
|
||||
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT(test_detail::adapted_sequence, (int, data))
|
||||
|
||||
template <template <typename> class Scenario>
|
||||
void
|
||||
test()
|
||||
{
|
||||
using namespace test_detail;
|
||||
using namespace boost::fusion;
|
||||
|
||||
BOOST_TEST(boost::fusion::traits::is_sequence<adapted_sequence>::value);
|
||||
BOOST_TEST(boost::fusion::size(adapted_sequence()) == 1);
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<> > >();
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<>, int> >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<> > >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<>, float> >();
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE< FUSION_SEQUENCE<> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<> >()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<FUSION_SEQUENCE<FUSION_SEQUENCE<>, int> > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<>, int>(FUSION_SEQUENCE<>(), 325)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, FUSION_SEQUENCE<> > > >(
|
||||
FUSION_SEQUENCE< int, FUSION_SEQUENCE<> >(325, FUSION_SEQUENCE<>())
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<FUSION_SEQUENCE<int, FUSION_SEQUENCE<>, float> > >(
|
||||
FUSION_SEQUENCE<int, FUSION_SEQUENCE<> , float>(
|
||||
325, FUSION_SEQUENCE<>(), 2.0f
|
||||
)
|
||||
)
|
||||
));
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int> > >();
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int>, int> >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int> > >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int>, float> >();
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE< FUSION_SEQUENCE<int> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int> >(FUSION_SEQUENCE<int>(400))
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<adapted_sequence> > >(
|
||||
FUSION_SEQUENCE<adapted_sequence>(adapted_sequence(400))
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<FUSION_SEQUENCE<FUSION_SEQUENCE<int>, int> > >(
|
||||
FUSION_SEQUENCE<FUSION_SEQUENCE<int>, int>(
|
||||
FUSION_SEQUENCE<int>(325), 400
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<FUSION_SEQUENCE<adapted_sequence, int> > >(
|
||||
FUSION_SEQUENCE<adapted_sequence, int>(adapted_sequence(325), 400)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE< int, FUSION_SEQUENCE<int> > > >(
|
||||
FUSION_SEQUENCE< int, FUSION_SEQUENCE<int> >(
|
||||
325, FUSION_SEQUENCE<int>(400)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, adapted_sequence> > >(
|
||||
FUSION_SEQUENCE<int, adapted_sequence>(325, adapted_sequence(450))
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, FUSION_SEQUENCE<int>, int> > >(
|
||||
FUSION_SEQUENCE<int, FUSION_SEQUENCE<int>, int>(
|
||||
500, FUSION_SEQUENCE<int>(350), 200
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<int, adapted_sequence, int> > >(
|
||||
FUSION_SEQUENCE<int, adapted_sequence, int>(
|
||||
300, adapted_sequence(500), 400)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE< FUSION_SEQUENCE<int, int> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int, int> >(
|
||||
FUSION_SEQUENCE<int, int>(450, 500)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE<FUSION_SEQUENCE<int, int>, int> > >(
|
||||
FUSION_SEQUENCE<FUSION_SEQUENCE<int, int>, int>(
|
||||
FUSION_SEQUENCE<int, int>(450, 500), 150
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario< FUSION_SEQUENCE< int, FUSION_SEQUENCE<int, int> > > >(
|
||||
FUSION_SEQUENCE< int, FUSION_SEQUENCE<int, int> >(
|
||||
450, FUSION_SEQUENCE<int, int>(500, 150)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run<Scenario< FUSION_SEQUENCE<int, FUSION_SEQUENCE<int, int>, int> > >(
|
||||
FUSION_SEQUENCE<int, FUSION_SEQUENCE<int, int>, int>(
|
||||
150, FUSION_SEQUENCE<int, int>(250, 350), 450
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
run<Scenario<FUSION_SEQUENCE<FUSION_SEQUENCE<>, FUSION_SEQUENCE<> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<>, FUSION_SEQUENCE<> >(
|
||||
FUSION_SEQUENCE<>(), FUSION_SEQUENCE<>()
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run<Scenario<FUSION_SEQUENCE<FUSION_SEQUENCE<int>, FUSION_SEQUENCE<> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int>, FUSION_SEQUENCE<> >(
|
||||
FUSION_SEQUENCE<int>(150), FUSION_SEQUENCE<>()
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run<Scenario<FUSION_SEQUENCE<FUSION_SEQUENCE<>, FUSION_SEQUENCE<int> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<>, FUSION_SEQUENCE<int> >(
|
||||
FUSION_SEQUENCE<>(), FUSION_SEQUENCE<int>(500)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run<Scenario<FUSION_SEQUENCE<FUSION_SEQUENCE<int>, FUSION_SEQUENCE<int> > > >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int>, FUSION_SEQUENCE<int> >(
|
||||
FUSION_SEQUENCE<int>(155), FUSION_SEQUENCE<int>(255)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<int> >
|
||||
> >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<int> >(
|
||||
FUSION_SEQUENCE<int, int>(222, 333), FUSION_SEQUENCE<int>(444)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int>, FUSION_SEQUENCE<int, int> >
|
||||
> >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int>, FUSION_SEQUENCE<int, int> >(
|
||||
FUSION_SEQUENCE<int>(100), FUSION_SEQUENCE<int, int>(300, 400)
|
||||
)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< Scenario<
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<int, int> >
|
||||
> >(
|
||||
FUSION_SEQUENCE< FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<int, int> >(
|
||||
FUSION_SEQUENCE<int, int>(600, 700)
|
||||
, FUSION_SEQUENCE<int, int>(800, 900)
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
// Ignore desired scenario, and cheat to make these work
|
||||
BOOST_TEST((
|
||||
run< can_lvalue_construct< FUSION_SEQUENCE<FUSION_SEQUENCE<>&> > >(
|
||||
FUSION_SEQUENCE<>()
|
||||
, FUSION_SEQUENCE< FUSION_SEQUENCE<> >()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< can_construct< FUSION_SEQUENCE<const FUSION_SEQUENCE<>&> > >(
|
||||
FUSION_SEQUENCE<>()
|
||||
, FUSION_SEQUENCE< FUSION_SEQUENCE<> >()
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< can_lvalue_construct< FUSION_SEQUENCE<FUSION_SEQUENCE<int>&> > >(
|
||||
FUSION_SEQUENCE<int>(300)
|
||||
, FUSION_SEQUENCE< FUSION_SEQUENCE<int> >(FUSION_SEQUENCE<int>(300))
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< can_construct< FUSION_SEQUENCE<const FUSION_SEQUENCE<int>&> > >(
|
||||
FUSION_SEQUENCE<int>(400)
|
||||
, FUSION_SEQUENCE< FUSION_SEQUENCE<int> >(FUSION_SEQUENCE<int>(400))
|
||||
)
|
||||
));
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int, float> > >();
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int, float>, int> >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int, float> > >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int, float>, float> >();
|
||||
}
|
||||
|
||||
|
@ -1,64 +0,0 @@
|
||||
/*=============================================================================
|
||||
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();
|
||||
}
|
||||
|
@ -1,49 +0,0 @@
|
||||
//
|
||||
// Copyright (C) 2013 Mateusz Loskot <mateusz@loskot.net>
|
||||
//
|
||||
// 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>
|
||||
|
||||
#ifdef BOOST_NO_CXX11_HDR_ARRAY
|
||||
# error "does not meet requirements"
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4180)
|
||||
#endif
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
#include <boost/fusion/adapted/std_array.hpp>
|
||||
#include <array>
|
||||
|
||||
#include <boost/fusion/sequence/intrinsic.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
#include <boost/fusion/support/is_view.hpp>
|
||||
#include <boost/fusion/iterator.hpp>
|
||||
|
||||
#include <boost/mpl/assert.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
typedef std::array<int,3> array_type;
|
||||
|
||||
BOOST_MPL_ASSERT((traits::is_sequence<array_type>));
|
||||
BOOST_MPL_ASSERT_NOT((traits::is_view<array_type>));
|
||||
|
||||
array_type arr = {{1,2,3}};
|
||||
|
||||
BOOST_TEST(*boost::fusion::begin(arr) == 1);
|
||||
BOOST_TEST(*boost::fusion::next(boost::fusion::begin(arr)) == 2);
|
||||
BOOST_TEST(*advance_c<2>(boost::fusion::begin(arr)) == 3);
|
||||
BOOST_TEST(prior(boost::fusion::next(boost::fusion::begin(arr))) == boost::fusion::begin(arr));
|
||||
BOOST_TEST(*prior(boost::fusion::end(arr)) == 3);
|
||||
BOOST_TEST(at_c<2>(arr) == 3);
|
||||
BOOST_TEST(boost::fusion::size(arr) == 3);
|
||||
BOOST_TEST(distance(boost::fusion::begin(arr), boost::fusion::end(arr)) == 3);
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -8,10 +8,8 @@
|
||||
#include <boost/config.hpp>
|
||||
|
||||
// adapted/std_tuple.hpp only supports implementations using variadic templates
|
||||
#if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
|
||||
defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
# error "does not meet requirements"
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/adapted/std_tuple.hpp>
|
||||
@ -21,7 +19,8 @@
|
||||
#include <tuple>
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
using namespace boost;
|
||||
@ -35,3 +34,13 @@ int main()
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -8,10 +8,8 @@
|
||||
|
||||
// The std_tuple_iterator adaptor only supports implementations
|
||||
// using variadic templates
|
||||
#if defined(BOOST_NO_CXX11_HDR_TUPLE) || \
|
||||
defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
# error "does not meet requirements"
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TUPLE) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#include <boost/fusion/adapted/std_tuple.hpp>
|
||||
|
||||
@ -19,8 +17,20 @@
|
||||
#define FUSION_TRAVERSAL_TAG random_access_traversal_tag
|
||||
#include "./iterator.hpp"
|
||||
|
||||
int main()
|
||||
int
|
||||
main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,251 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (C) 2016 Lee Clagett
|
||||
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container/list.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
struct convertible
|
||||
{
|
||||
convertible(int) {}
|
||||
};
|
||||
|
||||
template <typename From, typename To>
|
||||
bool is_convertible(bool has_conversion)
|
||||
{
|
||||
typedef typename boost::remove_reference<
|
||||
typename boost::remove_const<From>::type
|
||||
>::type from_rvalue;
|
||||
typedef typename boost::add_reference<from_rvalue>::type from_lvalue;
|
||||
typedef typename boost::add_const<from_lvalue>::type from_const_lvalue;
|
||||
|
||||
return
|
||||
boost::is_convertible<from_rvalue, To>::value == has_conversion &&
|
||||
boost::is_convertible<from_lvalue, To>::value == has_conversion &&
|
||||
boost::is_convertible<from_const_lvalue, To>::value == has_conversion;
|
||||
}
|
||||
|
||||
// is_constructible has a few requirements
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && \
|
||||
!defined(BOOST_NO_CXX11_TEMPLATES) && \
|
||||
!defined(BOOST_NO_SFINAE_EXPR)
|
||||
|
||||
#define FUSION_TEST_HAS_CONSTRUCTIBLE
|
||||
|
||||
template <typename To, typename... Args>
|
||||
bool is_lvalue_constructible(bool has_constructor)
|
||||
{
|
||||
return has_constructor ==
|
||||
boost::is_constructible<
|
||||
To
|
||||
, typename boost::add_reference<Args>::type...
|
||||
>::value;
|
||||
}
|
||||
|
||||
template <typename To, typename... Args>
|
||||
bool is_constructible_impl(bool has_constructor)
|
||||
{
|
||||
return
|
||||
boost::is_constructible<To, Args...>::value == has_constructor &&
|
||||
is_lvalue_constructible<To, Args...>(has_constructor) &&
|
||||
is_lvalue_constructible<
|
||||
To, typename boost::add_const<Args>::type...
|
||||
>(has_constructor);
|
||||
}
|
||||
|
||||
template <typename To, typename... Args>
|
||||
bool is_constructible(bool has_constructor)
|
||||
{
|
||||
return
|
||||
is_constructible_impl<
|
||||
To
|
||||
, typename boost::remove_reference<
|
||||
typename boost::remove_const<Args>::type
|
||||
>::type...
|
||||
>(has_constructor);
|
||||
}
|
||||
|
||||
void test_constructible()
|
||||
{
|
||||
BOOST_TEST((is_constructible< FUSION_SEQUENCE<> >(true)));
|
||||
|
||||
BOOST_TEST((is_constructible< FUSION_SEQUENCE<int> >(true)));
|
||||
BOOST_TEST((is_constructible<FUSION_SEQUENCE<int>, int>(true)));
|
||||
|
||||
BOOST_TEST((is_constructible<FUSION_SEQUENCE<convertible>, int>(true)));
|
||||
BOOST_TEST((
|
||||
is_constructible<FUSION_SEQUENCE<convertible>, convertible>(true)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
is_constructible<FUSION_SEQUENCE<int, int>, int, int>(true)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
is_constructible<FUSION_SEQUENCE<convertible, int>, int, int>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_constructible<
|
||||
FUSION_SEQUENCE<convertible, int>, convertible, int
|
||||
>(true)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
is_constructible<FUSION_SEQUENCE<int, convertible>, int, int>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_constructible<
|
||||
FUSION_SEQUENCE<int, convertible>, int, convertible
|
||||
>(true)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
is_constructible<
|
||||
FUSION_SEQUENCE<convertible, convertible>, int, int
|
||||
>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_constructible<
|
||||
FUSION_SEQUENCE<convertible, convertible>, convertible, int
|
||||
>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_constructible<
|
||||
FUSION_SEQUENCE<convertible, convertible>, int, convertible
|
||||
>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_constructible<
|
||||
FUSION_SEQUENCE<convertible, convertible>, convertible, convertible
|
||||
>(true)
|
||||
));
|
||||
}
|
||||
|
||||
#endif // is_constructible is available
|
||||
|
||||
void test_convertible(bool has_seq_conversion)
|
||||
{
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<> >(false)));
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<int> >(false)));
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<const int&> >(false)));
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<convertible> >(false)));
|
||||
BOOST_TEST((
|
||||
is_convertible<int, FUSION_SEQUENCE<const convertible&> >(false)
|
||||
));
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<int, int> >(false)));
|
||||
BOOST_TEST((
|
||||
is_convertible<int, FUSION_SEQUENCE<const int&, const int&> >(false)
|
||||
));
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<convertible, int> >(false)));
|
||||
BOOST_TEST((
|
||||
is_convertible<int, FUSION_SEQUENCE<const convertible&, const int&> >(false)
|
||||
));
|
||||
BOOST_TEST((is_convertible<int, FUSION_SEQUENCE<int, convertible> >(false)));
|
||||
BOOST_TEST((
|
||||
is_convertible<int, FUSION_SEQUENCE<const int&, const convertible&> >(false)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<int, FUSION_SEQUENCE<convertible, convertible> >(false)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
int, FUSION_SEQUENCE<const convertible&, const convertible&>
|
||||
>(false)
|
||||
));
|
||||
|
||||
BOOST_TEST((is_convertible<FUSION_SEQUENCE<>, FUSION_SEQUENCE<> >(true)));
|
||||
BOOST_TEST((
|
||||
is_convertible<FUSION_SEQUENCE<int>, FUSION_SEQUENCE<int> >(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<FUSION_SEQUENCE<int>, FUSION_SEQUENCE<const int&> >(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<FUSION_SEQUENCE<int>, FUSION_SEQUENCE<convertible> >(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<int, int> >(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<const int&, const int&>
|
||||
>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<convertible, int>
|
||||
>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_SEQUENCE<int, int>, FUSION_SEQUENCE<int, convertible>
|
||||
>(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_SEQUENCE<int, int>
|
||||
, FUSION_SEQUENCE<convertible, convertible>
|
||||
>(true)
|
||||
));
|
||||
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<>, FUSION_SEQUENCE<>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int>, FUSION_SEQUENCE<int>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int>, FUSION_SEQUENCE<const int&>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int>, FUSION_SEQUENCE<convertible>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int, int>, FUSION_SEQUENCE<int, int>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int, int>
|
||||
, FUSION_SEQUENCE<const int&, const int&>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int, int>, FUSION_SEQUENCE<convertible, int>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int, int>, FUSION_SEQUENCE<int, convertible>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
FUSION_ALT_SEQUENCE<int, int>
|
||||
, FUSION_SEQUENCE<convertible, convertible>
|
||||
>(has_seq_conversion)
|
||||
));
|
||||
}
|
||||
|
@ -13,37 +13,9 @@
|
||||
#define FUSION_AT get
|
||||
#include "construction.hpp"
|
||||
|
||||
// Bug in C++03 tuple? Cannot construct from a std::pair without including
|
||||
// std::pair fusion adaption
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
|
||||
# include <boost/fusion/adapted/std_pair.hpp>
|
||||
#endif
|
||||
|
||||
struct test_conversion
|
||||
{
|
||||
test_conversion(int value) : value_(value) {}
|
||||
|
||||
int value_;
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test();
|
||||
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
const tuple<int, test_conversion> instance(std::pair<int, int>(1, 9));
|
||||
BOOST_TEST(boost::fusion::get<0>(instance) == 1);
|
||||
BOOST_TEST(boost::fusion::get<1>(instance).value_ == 9);
|
||||
}
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
const std::pair<int, int> init(16, 4);
|
||||
const tuple<int, test_conversion> instance(init);
|
||||
BOOST_TEST(boost::fusion::get<0>(instance) == 16);
|
||||
BOOST_TEST(boost::fusion::get<1>(instance).value_ == 4);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -1,51 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
|
||||
Use modification and distribution are subject to 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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/tuple.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::tuple
|
||||
#include "conversion.hpp"
|
||||
|
||||
// Bug in C++03 tuple? Cannot construct from a std::pair without including
|
||||
// std::pair fusion adaption
|
||||
#if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
|
||||
# include <boost/fusion/adapted/std_pair.hpp>
|
||||
#endif
|
||||
|
||||
using namespace test_detail;
|
||||
|
||||
void test_tuple()
|
||||
{
|
||||
BOOST_TEST((
|
||||
run< can_copy< boost::fusion::tuple<int, int> > >(
|
||||
std::pair<int, int>(1, 9)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< can_copy< boost::fusion::tuple<int, convertible> > >(
|
||||
std::pair<int, int>(1, 9)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< can_copy< boost::fusion::tuple<convertible, int> > >(
|
||||
std::pair<int, int>(1, 9)
|
||||
)
|
||||
));
|
||||
BOOST_TEST((
|
||||
run< can_copy< boost::fusion::tuple<convertible, convertible> > >(
|
||||
std::pair<int, int>(1, 9)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test<can_assign>(); // conversion construction not supported
|
||||
test_tuple();
|
||||
return boost::report_errors();
|
||||
}
|
@ -16,7 +16,7 @@
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<test_detail::can_copy>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -7,29 +7,13 @@
|
||||
#include <boost/fusion/tuple/tuple.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::tuple
|
||||
#define FUSION_SEQUENCE tuple
|
||||
#include "nest.hpp"
|
||||
|
||||
|
||||
// tuple does not support conversion construction from sequence by design
|
||||
template <typename T>
|
||||
struct skip_constructor_conversion
|
||||
{
|
||||
template <typename Source, typename Expected>
|
||||
bool operator()(Source const& source, Expected const& expected) const
|
||||
{
|
||||
using namespace test_detail;
|
||||
return
|
||||
run< can_copy<T> >(source, expected) &&
|
||||
run< can_convert_using<can_assign>::to<T> >(source, expected) &&
|
||||
run< can_construct_from_elements<T> >(source, expected);
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<skip_constructor_conversion>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -1,86 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/fusion/tuple/tuple.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::tuple
|
||||
#define FUSION_ALT_SEQUENCE boost::fusion::vector
|
||||
#include "traits.hpp"
|
||||
|
||||
struct not_convertible {};
|
||||
|
||||
/* Some construction differences in fusion::tuple from std::tuple:
|
||||
- Construction from elements cannot call an explicit constructor.
|
||||
- There is no implicit construction from elements.
|
||||
- Construction from std::pair is _enabled_ when tuple is not of size 2.
|
||||
- Construction from tuple is _enabled_ when destination tuple is of
|
||||
different size.
|
||||
- Implicit construction from std::pair can call explicit constructors on
|
||||
elements.
|
||||
- Implicit construction from tuple can call explicit constructors on
|
||||
elements.
|
||||
|
||||
These differences are historical. Matching the behavior of std::tuple
|
||||
could break existing code, however, switching to fusion::vector would
|
||||
restore the historical behavior. */
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
test_convertible(false /* no conversion construction */ );
|
||||
|
||||
BOOST_TEST((is_convertible<std::pair<int, int>, tuple<int, int> >(true)));
|
||||
BOOST_TEST((
|
||||
is_convertible<std::pair<int, int>, tuple<convertible, int> >(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<std::pair<int, int>, tuple<int, convertible> >(true)
|
||||
));
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
std::pair<int, int>, tuple<convertible, convertible>
|
||||
>(true)
|
||||
));
|
||||
|
||||
#if defined(FUSION_TEST_HAS_CONSTRUCTIBLE)
|
||||
test_constructible();
|
||||
|
||||
BOOST_TEST((is_constructible< tuple<> >(true)));
|
||||
BOOST_TEST((is_constructible<tuple<>, int>(false)));
|
||||
|
||||
BOOST_TEST((is_constructible< tuple<int> >(true)));
|
||||
BOOST_TEST((is_constructible<tuple<int>, int>(true)));
|
||||
BOOST_TEST((is_constructible<tuple<convertible>, int>(true)));
|
||||
BOOST_TEST((is_constructible<tuple<not_convertible>, int>(false)));
|
||||
BOOST_TEST((is_constructible< tuple<int>, vector<int> >(false)));
|
||||
BOOST_TEST((is_constructible<tuple<int>, int, int>(false)));
|
||||
|
||||
BOOST_TEST((is_constructible< tuple<int, int> >(true)));
|
||||
BOOST_TEST((is_constructible<tuple<int, int>, int, int>(true)));
|
||||
BOOST_TEST((
|
||||
is_constructible<tuple<convertible, convertible>, int, int>(true)
|
||||
));
|
||||
BOOST_TEST((is_constructible<tuple<int, not_convertible>, int, int>(false)));
|
||||
BOOST_TEST((is_constructible<tuple<not_convertible, int>, int, int>(false)));
|
||||
BOOST_TEST((
|
||||
is_constructible<tuple<not_convertible, not_convertible>, int, int>(false)
|
||||
));
|
||||
#if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
|
||||
// C++03 fusion::tuple has constructors that can never be used
|
||||
BOOST_TEST((is_constructible<tuple<int, int>, int>(false)));
|
||||
#endif
|
||||
BOOST_TEST((is_constructible<tuple<int, int>, int, int, int>(false)));
|
||||
|
||||
#endif // FUSION_TEST_HAS_CONSTRUCTIBLE
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
|
||||
Use modification and distribution are subject to 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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::vector
|
||||
#include "conversion.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
test<test_detail::can_copy>();
|
||||
return boost::report_errors();
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<test_detail::can_copy>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -7,13 +7,13 @@
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::vector
|
||||
#define FUSION_SEQUENCE vector
|
||||
#include "nest.hpp"
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test<test_detail::can_nest>();
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (C) 2016 Lee Clagett
|
||||
|
||||
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/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/container/list.hpp>
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE boost::fusion::vector
|
||||
#define FUSION_ALT_SEQUENCE boost::fusion::list
|
||||
#include "traits.hpp"
|
||||
|
||||
int main() {
|
||||
test_convertible(true /* has conversion construction */ );
|
||||
|
||||
// C++11 models overly aggressive (bug) implicit conversion from C++03
|
||||
BOOST_TEST((
|
||||
is_convertible<
|
||||
boost::fusion::list<int>
|
||||
, boost::fusion::vector< boost::fusion::list<int> >
|
||||
>(true)
|
||||
));
|
||||
|
||||
#if defined(FUSION_TEST_HAS_CONSTRUCTIBLE)
|
||||
test_constructible();
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2016 Lee Clagett
|
||||
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>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/fusion/support/detail/and.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
int main() {
|
||||
using namespace boost;
|
||||
using namespace boost::fusion::detail;
|
||||
|
||||
BOOST_TEST((and_<>::value));
|
||||
BOOST_TEST(!(and_<false_type>::value));
|
||||
BOOST_TEST((and_<true_type>::value));
|
||||
BOOST_TEST(!(and_<true_type, false_type>::value));
|
||||
BOOST_TEST((and_<true_type, true_type>::value));
|
||||
BOOST_TEST(!(and_<true_type, true_type, false_type>::value));
|
||||
BOOST_TEST((and_<true_type, true_type, true_type>::value));
|
||||
BOOST_TEST((and_<true_type, mpl::true_>::value));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user