|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58396 - in trunk: boost/fusion/adapted boost/fusion/adapted/array boost/fusion/adapted/boost_tuple boost/fusion/adapted/class boost/fusion/adapted/std_pair boost/fusion/adapted/struct libs/fusion/test/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2009-12-15 08:30:04
Author: cschmidt
Date: 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
New Revision: 58396
URL: http://svn.boost.org/trac/boost/changeset/58396
Log:
mpl::sequence_tag specialization for adapted types
Text files modified:
trunk/boost/fusion/adapted/array/tag_of.hpp | 19 ++++++++
trunk/boost/fusion/adapted/boost_tuple/tag_of.hpp | 51 ++++++++++++++++++++++
trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp | 19 ++++++++
trunk/boost/fusion/adapted/class/adapt_class.hpp | 19 ++++++++
trunk/boost/fusion/adapted/class/extension.hpp | 65 +++++++++++++++-------------
trunk/boost/fusion/adapted/std_pair.hpp | 73 ++++++++++++++++++++------------
trunk/boost/fusion/adapted/std_pair/tag_of.hpp | 19 ++++++++
trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 19 ++++++++
trunk/boost/fusion/adapted/struct/adapt_struct.hpp | 19 ++++++++
trunk/boost/fusion/adapted/struct/extension.hpp | 89 +++++++++++++++++++++------------------
trunk/libs/fusion/test/sequence/adapt_assoc_struct.cpp | 11 ++++
trunk/libs/fusion/test/sequence/adapt_class.cpp | 11 ++++
trunk/libs/fusion/test/sequence/adapt_struct.cpp | 12 +++++
trunk/libs/fusion/test/sequence/array.cpp | 7 +++
trunk/libs/fusion/test/sequence/boost_tuple.cpp | 9 ++++
trunk/libs/fusion/test/sequence/std_pair.cpp | 9 ++++
16 files changed, 352 insertions(+), 99 deletions(-)
Modified: trunk/boost/fusion/adapted/array/tag_of.hpp
==============================================================================
--- trunk/boost/fusion/adapted/array/tag_of.hpp (original)
+++ trunk/boost/fusion/adapted/array/tag_of.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -21,6 +21,7 @@
namespace boost { namespace fusion
{
struct array_tag;
+ struct fusion_sequence_tag;
namespace traits
{
@@ -36,4 +37,22 @@
}
}}
+namespace boost { namespace mpl
+{
+ template<typename>
+ struct sequence_tag;
+
+ template<typename T, std::size_t N>
+ struct sequence_tag<array<T,N> >
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template<typename T, std::size_t N>
+ struct sequence_tag<array<T,N> const>
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+}}
+
#endif
Modified: trunk/boost/fusion/adapted/boost_tuple/tag_of.hpp
==============================================================================
--- trunk/boost/fusion/adapted/boost_tuple/tag_of.hpp (original)
+++ trunk/boost/fusion/adapted/boost_tuple/tag_of.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -26,6 +26,7 @@
namespace boost { namespace fusion
{
struct boost_tuple_tag;
+ struct fusion_sequence_tag;
namespace traits
{
@@ -60,4 +61,54 @@
}
}}
+namespace boost { namespace mpl
+{
+ template<typename>
+ struct sequence_tag;
+
+ template <
+ class T0, class T1, class T2, class T3, class T4,
+ class T5, class T6, class T7, class T8, class T9
+ >
+ struct sequence_tag<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template <
+ class T0, class T1, class T2, class T3, class T4,
+ class T5, class T6, class T7, class T8, class T9
+ >
+ struct sequence_tag<
+ tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> const
+ >
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template <class Head, class Tail>
+ struct sequence_tag<tuples::cons<Head, Tail> >
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template <class Head, class Tail>
+ struct sequence_tag<tuples::cons<Head, Tail> const>
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template <>
+ struct sequence_tag<tuples::null_type>
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template <>
+ struct sequence_tag<tuples::null_type const>
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+}}
+
#endif
Modified: trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp (original)
+++ trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -62,6 +62,25 @@
typedef class_tag type; \
}; \
}}} \
+ \
+ namespace boost { namespace mpl \
+ { \
+ template<typename> \
+ struct sequence_tag; \
+ \
+ template<> \
+ struct sequence_tag<name> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ \
+ template<> \
+ struct sequence_tag<name const> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ }} \
+ \
namespace boost { namespace fusion { namespace extension \
{ \
template <> \
Modified: trunk/boost/fusion/adapted/class/adapt_class.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/adapt_class.hpp (original)
+++ trunk/boost/fusion/adapted/class/adapt_class.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -52,6 +52,25 @@
typedef class_tag type; \
}; \
}}} \
+ \
+ namespace boost { namespace mpl \
+ { \
+ template<typename> \
+ struct sequence_tag; \
+ \
+ template<> \
+ struct sequence_tag<name> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ \
+ template<> \
+ struct sequence_tag<name const> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ }} \
+ \
namespace boost { namespace fusion { namespace extension \
{ \
template <> \
Modified: trunk/boost/fusion/adapted/class/extension.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/extension.hpp (original)
+++ trunk/boost/fusion/adapted/class/extension.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -10,46 +10,51 @@
#include <boost/type_traits/add_const.hpp>
-namespace boost { namespace fusion { namespace extension
+namespace boost { namespace fusion
{
- template <typename Class, int N>
- struct class_member;
+ struct fusion_sequence_tag;
- template <typename Class>
- struct class_size;
+ namespace extension
+ {
+ template <typename Class, int N>
+ struct class_member;
- template <typename Class, int N>
- struct class_member<Class const, N> : class_member<Class, N> {};
+ template <typename Class>
+ struct class_size;
- template <typename Class>
- struct class_size<Class const>
- : class_size<Class>
- {};
+ template <typename Class, int N>
+ struct class_member<Class const, N> : class_member<Class, N> {};
- struct no_such_member;
+ template <typename Class>
+ struct class_size<Class const>
+ : class_size<Class>
+ {};
- template<typename Class, typename Key>
- struct class_assoc_member
- {
- typedef no_such_member type;
- };
+ struct no_such_member;
- template<typename Class, typename Key>
- struct class_assoc_member<Class const, Key>
- {
- typedef typename
- add_const<typename class_assoc_member<Class, Key>::type>::type
- type;
+ template<typename Class, typename Key>
+ struct class_assoc_member
+ {
+ typedef no_such_member type;
+ };
- static type&
- call(Class const& class_)
+ template<typename Class, typename Key>
+ struct class_assoc_member<Class const, Key>
{
- return class_assoc_member<Class, Key>::call(
- const_cast<Class&>(class_));
- }
- };
+ typedef typename
+ add_const<typename class_assoc_member<Class, Key>::type>::type
+ type;
+
+ static type&
+ call(Class const& class_)
+ {
+ return class_assoc_member<Class, Key>::call(
+ const_cast<Class&>(class_));
+ }
+ };
-}}}
+ }
+}}
#endif
Modified: trunk/boost/fusion/adapted/std_pair.hpp
==============================================================================
--- trunk/boost/fusion/adapted/std_pair.hpp (original)
+++ trunk/boost/fusion/adapted/std_pair.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -16,6 +16,7 @@
namespace boost { namespace fusion
{
struct struct_tag;
+ struct fusion_sequence_tag;
namespace traits
{
@@ -29,42 +30,60 @@
typedef struct_tag type;
};
}
+}}
+
+namespace boost { namespace mpl
+{
+ template<typename>
+ struct sequence_tag;
- namespace extension
+ template<typename T1, typename T2>
+ struct sequence_tag<std::pair<T1, T2> >
{
- template <typename Struct, int N>
- struct struct_member;
+ typedef fusion::fusion_sequence_tag type;
+ };
- template <typename Struct>
- struct struct_size;
+ template<typename T1, typename T2>
+ struct sequence_tag<std::pair<T1, T2> const>
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+}}
- template <typename T1, typename T2>
- struct struct_member<std::pair<T1, T2>, 0>
- {
- typedef T1 type;
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename Struct, int N>
+ struct struct_member;
- static type& call(std::pair<T1, T2>& pair)
- {
- return pair.first;
- }
- };
+ template <typename Struct>
+ struct struct_size;
- template <typename T1, typename T2>
- struct struct_member<std::pair<T1, T2>, 1>
+ template <typename T1, typename T2>
+ struct struct_member<std::pair<T1, T2>, 0>
+ {
+ typedef T1 type;
+
+ static type& call(std::pair<T1, T2>& pair)
{
- typedef T2 type;
+ return pair.first;
+ }
+ };
- static type& call(std::pair<T1, T2>& pair)
- {
- return pair.second;
- }
- };
+ template <typename T1, typename T2>
+ struct struct_member<std::pair<T1, T2>, 1>
+ {
+ typedef T2 type;
- template <typename T1, typename T2>
- struct struct_size<std::pair<T1, T2> > : mpl::int_<2>
+ static type& call(std::pair<T1, T2>& pair)
{
- };
- }
-}}
+ return pair.second;
+ }
+ };
+
+ template <typename T1, typename T2>
+ struct struct_size<std::pair<T1, T2> > : mpl::int_<2>
+ {
+ };
+}}}
#endif
Modified: trunk/boost/fusion/adapted/std_pair/tag_of.hpp
==============================================================================
--- trunk/boost/fusion/adapted/std_pair/tag_of.hpp (original)
+++ trunk/boost/fusion/adapted/std_pair/tag_of.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -15,6 +15,7 @@
namespace boost { namespace fusion {
struct std_pair_tag;
+ struct fusion_sequence_tag;
namespace traits
{
@@ -26,4 +27,22 @@
}
}}
+namespace boost { namespace mpl
+{
+ template<typename>
+ struct sequence_tag;
+
+ template<typename T1, typename T2>
+ struct sequence_tag<std::pair<T1, T2> >
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+
+ template<typename T1, typename T2>
+ struct sequence_tag<std::pair<T1, T2> const>
+ {
+ typedef fusion::fusion_sequence_tag type;
+ };
+}}
+
#endif
Modified: trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp (original)
+++ trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -62,6 +62,25 @@
typedef struct_tag type; \
}; \
}}} \
+ \
+ namespace boost { namespace mpl \
+ { \
+ template<typename> \
+ struct sequence_tag; \
+ \
+ template<> \
+ struct sequence_tag<name> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ \
+ template<> \
+ struct sequence_tag<name const> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ }} \
+ \
namespace boost { namespace fusion { namespace extension \
{ \
template <> \
Modified: trunk/boost/fusion/adapted/struct/adapt_struct.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/adapt_struct.hpp (original)
+++ trunk/boost/fusion/adapted/struct/adapt_struct.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -52,6 +52,25 @@
typedef struct_tag type; \
}; \
}}} \
+ \
+ namespace boost { namespace mpl \
+ { \
+ template<typename> \
+ struct sequence_tag; \
+ \
+ template<> \
+ struct sequence_tag<name> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ \
+ template<> \
+ struct sequence_tag<name const> \
+ { \
+ typedef fusion::fusion_sequence_tag type; \
+ }; \
+ }} \
+ \
namespace boost { namespace fusion { namespace extension \
{ \
template <> \
Modified: trunk/boost/fusion/adapted/struct/extension.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/extension.hpp (original)
+++ trunk/boost/fusion/adapted/struct/extension.hpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -10,58 +10,63 @@
#include <boost/type_traits/add_const.hpp>
-namespace boost { namespace fusion { namespace extension
+namespace boost { namespace fusion
{
- template <typename Struct, int N>
- struct struct_member;
+ struct fusion_sequence_tag;
- template <typename Struct>
- struct struct_size;
-
- template <typename Struct, int N>
- struct struct_member<Struct const, N>
+ namespace extension
{
- typedef typename
- add_const<typename struct_member<Struct, N>::type>::type
- type;
+ template <typename Struct, int N>
+ struct struct_member;
- static type&
- call(Struct const& struct_)
- {
- return struct_member<Struct, N>::call(
- const_cast<Struct&>(struct_));
- }
- };
-
- template <typename Struct>
- struct struct_size<Struct const>
- : struct_size<Struct>
- {};
+ template <typename Struct>
+ struct struct_size;
- struct no_such_member;
+ template <typename Struct, int N>
+ struct struct_member<Struct const, N>
+ {
+ typedef typename
+ add_const<typename struct_member<Struct, N>::type>::type
+ type;
+
+ static type&
+ call(Struct const& struct_)
+ {
+ return struct_member<Struct, N>::call(
+ const_cast<Struct&>(struct_));
+ }
+ };
+
+ template <typename Struct>
+ struct struct_size<Struct const>
+ : struct_size<Struct>
+ {};
- template<typename Struct, typename Key>
- struct struct_assoc_member
- {
- typedef no_such_member type;
- };
+ struct no_such_member;
- template<typename Struct, typename Key>
- struct struct_assoc_member<Struct const, Key>
- {
- typedef typename
- add_const<typename struct_assoc_member<Struct, Key>::type>::type
- type;
+ template<typename Struct, typename Key>
+ struct struct_assoc_member
+ {
+ typedef no_such_member type;
+ };
- static type&
- call(Struct const& struct_)
+ template<typename Struct, typename Key>
+ struct struct_assoc_member<Struct const, Key>
{
- return struct_assoc_member<Struct, Key>::call(
- const_cast<Struct&>(struct_));
- }
- };
+ typedef typename
+ add_const<typename struct_assoc_member<Struct, Key>::type>::type
+ type;
+
+ static type&
+ call(Struct const& struct_)
+ {
+ return struct_assoc_member<Struct, Key>::call(
+ const_cast<Struct&>(struct_));
+ }
+ };
-}}}
+ }
+}}
#endif
Modified: trunk/libs/fusion/test/sequence/adapt_assoc_struct.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_assoc_struct.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_assoc_struct.cpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -14,6 +14,7 @@
#include <boost/fusion/sequence/intrinsic/back.hpp>
#include <boost/fusion/sequence/intrinsic/has_key.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/container/vector/vector.hpp>
@@ -26,7 +27,10 @@
#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/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/not.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -126,6 +130,13 @@
BOOST_TEST(at_key<ns::y_member>(p) == 3);
}
+ {
+ BOOST_MPL_ASSERT((mpl::is_sequence<ns::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ fusion::result_of::value_at_c<ns::point,0>::type
+ , mpl::front<ns::point>::type>));
+ }
+
return boost::report_errors();
}
Modified: trunk/libs/fusion/test/sequence/adapt_class.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_class.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_class.cpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -11,6 +11,7 @@
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/front.hpp>
#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
@@ -22,7 +23,10 @@
#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/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
#include <string>
@@ -113,6 +117,13 @@
l = p;
}
+ {
+ BOOST_MPL_ASSERT((mpl::is_sequence<ns::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ fusion::result_of::value_at_c<ns::point,0>::type
+ , mpl::front<ns::point>::type>));
+ }
+
return boost::report_errors();
}
Modified: trunk/libs/fusion/test/sequence/adapt_struct.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_struct.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_struct.cpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -11,6 +11,7 @@
#include <boost/fusion/sequence/intrinsic/empty.hpp>
#include <boost/fusion/sequence/intrinsic/front.hpp>
#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/io/out.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
@@ -22,7 +23,10 @@
#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/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
#include <string>
@@ -114,6 +118,14 @@
BOOST_MPL_ASSERT((is_same<result_of::next<b>::type, e>));
}
+
+ {
+ BOOST_MPL_ASSERT((mpl::is_sequence<ns::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ fusion::result_of::value_at_c<ns::point,0>::type
+ , mpl::front<ns::point>::type>));
+ }
+
return boost::report_errors();
}
Modified: trunk/libs/fusion/test/sequence/array.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/array.cpp (original)
+++ trunk/libs/fusion/test/sequence/array.cpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -15,8 +15,12 @@
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/is_view.hpp>
#include <boost/fusion/iterator.hpp>
+#include <boost/fusion/mpl.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/mpl/front.hpp>
#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
int main()
{
@@ -37,5 +41,8 @@
BOOST_TEST(size(arr) == 3);
BOOST_TEST(distance(begin(arr), end(arr)) == 3);
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<array_type>));
+ BOOST_MPL_ASSERT((boost::is_same<int, boost::mpl::front<array_type>::type>));
+
return boost::report_errors();
}
Modified: trunk/libs/fusion/test/sequence/boost_tuple.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/boost_tuple.cpp (original)
+++ trunk/libs/fusion/test/sequence/boost_tuple.cpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -23,8 +23,11 @@
#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/tuple/tuple.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/mpl/front.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
#include <string>
@@ -96,6 +99,12 @@
BOOST_TEST(2u == fusion::distance(fusion::begin(t), fusion::end(t)));
}
+ {
+ typedef boost::tuple<int, std::string> tuple_type;
+ BOOST_MPL_ASSERT((mpl::is_sequence<tuple_type>));
+ BOOST_MPL_ASSERT((boost::is_same<int, mpl::front<tuple_type>::type>));
+ }
+
return boost::report_errors();
}
Modified: trunk/libs/fusion/test/sequence/std_pair.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/std_pair.cpp (original)
+++ trunk/libs/fusion/test/sequence/std_pair.cpp 2009-12-15 08:30:02 EST (Tue, 15 Dec 2009)
@@ -22,7 +22,10 @@
#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/front.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
#include <string>
@@ -86,6 +89,12 @@
l = std::make_pair(123, "Hola!!!");
}
+ {
+ typedef std::pair<int, std::string> pair_type;
+ BOOST_MPL_ASSERT((mpl::is_sequence<pair_type>));
+ BOOST_MPL_ASSERT((boost::is_same<int, mpl::front<pair_type>::type>));
+ }
+
return boost::report_errors();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk