|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61017 - in sandbox/SOC/2009/fusion: boost/fusion/adapted/detail/struct boost/fusion/adapted/struct libs/fusion/test/suite1 libs/fusion/test/suite1/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2010-04-03 09:33:53
Author: cschmidt
Date: 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
New Revision: 61017
URL: http://svn.boost.org/trac/boost/changeset/61017
Log:
added intrusive struct generating macros (2)
Added:
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_assoc_struct.cpp (contents, props changed)
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_assoc_tpl_struct.cpp (contents, props changed)
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_struct.cpp (contents, props changed)
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_tpl_struct.cpp (contents, props changed)
Text files modified:
sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp | 11 +++++------
sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/namespace.hpp | 2 +-
sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_assoc_struct.hpp | 8 ++++----
sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_struct.hpp | 8 ++++----
sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile | 4 ++++
5 files changed, 18 insertions(+), 15 deletions(-)
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/define_struct.hpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -45,9 +45,9 @@
R, DATA, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
- BOOST_PP_TUPLE_ELEM(BOOST_PP_TUPLE_ELEM(3,2,DATA),1,ATTRIBUTE)( \
- static_cast<self_type BOOST_PP_TUPLE_ELEM(3,0,DATA)>(other_self). \
- BOOST_PP_TUPLE_ELEM(BOOST_PP_TUPLE_ELEM(3,2,DATA),1,ATTRIBUTE))
+ BOOST_PP_TUPLE_ELEM(BOOST_PP_TUPLE_ELEM(2,1,DATA),1,ATTRIBUTE)( \
+ static_cast<self_type BOOST_PP_TUPLE_ELEM(2,0,DATA)>(other_self). \
+ BOOST_PP_TUPLE_ELEM(BOOST_PP_TUPLE_ELEM(2,1,DATA),1,ATTRIBUTE))
#define BOOST_FUSION_DEFINE_STRUCT_COPY_MOVE_CTOR(MODIFIER,DATA) \
BOOST_PP_TUPLE_ELEM(3,0,DATA)(self_type MODIFIER other_self) \
@@ -56,7 +56,6 @@
BOOST_FUSION_DEFINE_STRUCT_COPY_MOVE_CTOR_FILLER_I, \
( \
MODIFIER, \
- BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3,1,DATA)), \
BOOST_PP_TUPLE_ELEM(3,2,DATA) \
), \
BOOST_PP_TUPLE_ELEM(3,1,DATA)) \
@@ -144,10 +143,10 @@
, typename boost::disable_if< \
boost::fusion::detail::is_explicitly_convertible< \
BOOST_FUSION_R_ELSE_CLREF(Seq) \
- , BOOST_FUSION_R_ELSE_CLREF(BOOST_PP_TUPLE_ELEM( \
+ , BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \
0, \
- BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))) \
+ BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
> \
>::type* =0
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/namespace.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/namespace.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/namespace.hpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -42,7 +42,7 @@
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
BOOST_PP_SEQ_FOR_EACH_R, \
- BOOST_FUSION_ADAPT_STRUCT_PROXY_DUMMY4)( \
+ BOOST_PP_TUPLE_EAT(4))( \
1, \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I, \
_, \
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_assoc_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_assoc_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_assoc_struct.hpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -18,20 +18,20 @@
TEMPLATE_PARAMS_SEQ, \
(0)NAMESPACE_SEQ, \
NAME, \
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
3) \
\
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, \
(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\
- TEMPLATE_PARAMS_SEQ, \
+ TEMPLATE_PARAMS_SEQ, \
ATTRIBUTES)
-#define BOOST_FUSION_DEFINE_ASSOC_STRUCT(NAMESPACE_SEQ,NAME,ATTRIBUTES) \
+#define BOOST_FUSION_DEFINE_ASSOC_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \
BOOST_FUSION_DEFINE_STRUCT_IMPL( \
(0)NAMESPACE_SEQ, \
NAME, \
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
3) \
\
BOOST_FUSION_ADAPT_ASSOC_STRUCT( \
Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/define_struct.hpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -23,11 +23,11 @@
\
BOOST_FUSION_ADAPT_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, \
- (BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME) \
- TEMPLATE_PARAMS_SEQ, \
+ (BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\
+ TEMPLATE_PARAMS_SEQ, \
ATTRIBUTES)
-#define BOOST_FUSION_DEFINE_STRUCT(NAMESPACE_SEQ,NAME,ATTRIBUTES) \
+#define BOOST_FUSION_DEFINE_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \
BOOST_FUSION_DEFINE_STRUCT_IMPL( \
(0)NAMESPACE_SEQ, \
NAME, \
@@ -35,7 +35,7 @@
2) \
\
BOOST_FUSION_ADAPT_STRUCT( \
- BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \
ATTRIBUTES)
#endif
Modified: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/Jamfile 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -110,6 +110,10 @@
[ run sequence/adapt_struct.cpp : : : : ]
[ run sequence/adapt_tpl_class.cpp : : : : ]
[ run sequence/adapt_tpl_struct.cpp : : : : ]
+ [ run sequence/define_struct.cpp : : : : ]
+ [ run sequence/define_assoc_struct.cpp : : : : ]
+ [ run sequence/define_tpl_struct.cpp : : : : ]
+ [ run sequence/define_assoc_tpl_struct.cpp : : : : ]
[ run functional/fused.cpp : : : : ]
[ run functional/fused_function_object.cpp : : : : ]
Added: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_assoc_struct.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_assoc_struct.cpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -0,0 +1,114 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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/sequence.hpp>
+#include <boost/fusion/container.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
+#include <boost/preprocessor/empty.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+}
+
+BOOST_FUSION_DEFINE_ASSOC_STRUCT(
+ (ns),
+ point,
+ (int, x, ns::x_member)
+ (int, y, ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point>));
+ ns::point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<ns::point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ ns::point v2(5, 3);
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from ns::point to vector
+ ns::point p(5, 3);
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from ns::point to list
+ ns::point p(5, 3);
+ list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<ns::point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::y_member>::type, int>));
+
+ ns::point p(5, 3);
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ {
+ ns::point p = make_list(5,3);
+ BOOST_TEST(p == make_vector(5,3));
+
+ p = make_list(3,5);
+ BOOST_TEST(p == make_vector(3,5));
+ }
+
+ return boost::report_errors();
+}
+
Added: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_assoc_tpl_struct.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_assoc_tpl_struct.cpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -0,0 +1,118 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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/sequence.hpp>
+#include <boost/fusion/container.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+}
+
+BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT(
+ (X)(Y),
+ (ns),
+ point,
+ (int, x, ns::x_member)
+ (int, y, ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ typedef ns::point<int,int> point;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<point>));
+ point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ point v2(5, 3);
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from point to vector
+ point p(5, 3);
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from point to list
+ point p(5, 3);
+ list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::y_member>::type, int>));
+
+ point p(5, 3);
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ {
+ point p = make_list(5,3);
+ BOOST_TEST(p == make_vector(5,3));
+
+ p = make_list(3,5);
+ BOOST_TEST(p == make_vector(3,5));
+ }
+
+ return boost::report_errors();
+}
+
Added: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_struct.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_struct.cpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -0,0 +1,105 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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/sequence.hpp>
+#include <boost/fusion/container.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/adapted/struct/define_struct.hpp>
+#include <boost/preprocessor/empty.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+BOOST_FUSION_DEFINE_STRUCT(
+ (ns),
+ point,
+ (int, x)
+ (int, y)
+)
+
+BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), s, (int, m))
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point>));
+ ns::point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<ns::point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ ns::point v2(5, 3);
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from ns::point to vector
+ ns::point p(5, 3);
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from ns::point to list
+ ns::point p(5, 3);
+ list<int, short> l(p);
+ l = p;
+ }
+
+ { // begin/end
+ using namespace boost::fusion;
+
+ typedef result_of::begin<s>::type b;
+ typedef result_of::end<s>::type e;
+ // this fails
+ BOOST_MPL_ASSERT((boost::is_same<result_of::next<b>::type, e>));
+ }
+
+ {
+ ns::point p = make_list(5,3);
+ BOOST_TEST(p == make_vector(5,3));
+
+ p = make_list(3,5);
+ BOOST_TEST(p == make_vector(3,5));
+ }
+
+ return boost::report_errors();
+}
+
Added: sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_tpl_struct.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/suite1/sequence/define_tpl_struct.cpp 2010-04-03 09:33:51 EDT (Sat, 03 Apr 2010)
@@ -0,0 +1,109 @@
+/*=============================================================================
+ Copyright (c) 2010 Christopher Schmidt
+
+ 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/sequence.hpp>
+#include <boost/fusion/container.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/adapted/struct/define_struct.hpp>
+#include <boost/preprocessor/empty.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+BOOST_FUSION_DEFINE_TPL_STRUCT(
+ (X)(Y),
+ (ns),
+ point,
+ (X, x)
+ (Y, y)
+)
+
+BOOST_FUSION_DEFINE_TPL_STRUCT((M), BOOST_PP_EMPTY(), s, (M, m))
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ typedef ns::point<int, int> point;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<point>));
+ point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ point v2(5, 3);
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from point to vector
+ point p(5, 3);
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from point to list
+ point p(5, 3);
+ list<int, short> l(p);
+ l = p;
+ }
+
+ { // begin/end
+ using namespace boost::fusion;
+
+ typedef result_of::begin<s<int> >::type b;
+ typedef result_of::end<s<int> >::type e;
+ // this fails
+ BOOST_MPL_ASSERT((boost::is_same<result_of::next<b>::type, e>));
+ }
+
+
+ {
+ point p = make_list(5,3);
+ BOOST_TEST(p == make_vector(5,3));
+
+ p = make_list(3,5);
+ BOOST_TEST(p == make_vector(3,5));
+ }
+
+ 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