diff --git a/fusion/readme.txt b/fusion/readme.txt deleted file mode 100644 index 22f8d633e..000000000 --- a/fusion/readme.txt +++ /dev/null @@ -1,133 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -Fusion Tuples Library - -This is a re-implementation of the TR tuples with iterators, views and -algorithms. The structure is somewhat modeled after MPL. It is code-named -"fusion" because the library is the "fusion" of compile time -metaprogramming with runtime programming. - -Overall structure: - - The library is composed of three sub-modules. Iterators, Sequences and - Views and Algorithms. - -Iterators: - - Generic iteration for heterogeneous types. The library is based on - iterators. - - filter_view_iterator - filtering iterator. Given an MPL predicate, skips elements to - present only the items that passes the predicate. See filter_view - below. - - joint_view_iterator - Holds four iterators (two begin/end pairs). Iterates over the - first pair then switches over to the next pair to present - a contiguous whole. See joint_view below. - - single_view_iterator - A single element iterator. See single_view below. - - cons_iterator - An iterator into a cons list. See cons below. - - transform_view_iterator - Given a transform-function, transforms the elements being - iterated. See transform_view below. - -Sequences and Views: - - Holds a begin/end iterator. Sequences and views may be composed to form - more complex sequences and views. View/sequence composition is a very - nice concept. These are extremely lighweight classes and can be passed - around by value quite inexpensively. For instance, rather than working - directly on tuples, the algorithms work on sequences and return - sequences. - - tuple - The basic tuple structure - - tupleN - Fixed sized tuples (where N = 0 to a predefined limit) - - filter_view - Given an MPL predicate, filters the view to present only the items - that passes the predicate. - - single_view - A single element view - - joint_view - A two-sequence view (concatenates two sequences) - - cons - A cons-cell that can be used to build a singly-linked list. - - range - Holds an iterator pair that represents a begin/end range. - - transform_view - Transforms a sequence given a transform-function - - MPL sequences are also, automatically, fusion sequences. All algorithms - and fusion functions that work on fusion sequences can also take in - MPL seqneces. - -Basic functions and meta_functions on sequences: - - I/O : TR1-tuples compatible I/O routines - operator : tuple operators ==, !=, <, >, <=, >= - begin : start of sequence - end : end of sequence - make_tuple : make a tuple - tie : make a tuple of references - generate : given a fusion sequence, generate a tuple - get : get the nth element of a tuple - is_sequence : checks if a type is a fusion sequence - tuple_element : get the nth type in a tuple - tuple_size : get the number of elements in a tuple - -Algorithms: - - With very complex composition of algorithms, it is not desirable to - work directly on tuples. Like MPL, and unlike STL, the algorithms take - in sequences/views and *return* the result by value; the algorithms are - purely functional and do not (cannot) have side effects. We cannot have - an out parameter that is passed by reference where the result is - placed. The algorithms, instead, work on sequences and views and - generate views. - - This strategy is very efficient. You can think of the algorithms as - "lazy". The values are generated only wnen it is needed -for example - when generating a tuple. When you are sure that you need a tuple, you - can "generate" it from the sequence: generate(sequence); - - erase - filter - find - find_if - fold - for_each - insert - push_back - push_front - remove - remove_if - replace - transform - any - -TODO: - iteration is limited to input_iterator - fusion sequences to mpl mapping is not complete - some relational operators are missing <, <=, >, >= - some algorithms are missing (reverse, count, count_if, contains, append, etc.) - some views are missing (reverse_view, set, map) - get should also work for all random access sequences, not only tuples diff --git a/fusion/test/Jamfile b/fusion/test/Jamfile deleted file mode 100644 index d178151fe..000000000 --- a/fusion/test/Jamfile +++ /dev/null @@ -1,218 +0,0 @@ -#============================================================================== -# Copyright (c) 2003 Joel de Guzman -# -# Use, modification and distribution is 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) -#============================================================================== - -subproject libs/spirit/fusion/test ; - -unit-test fixed_tuple_tests - : fixed_tuple_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tuple_construction_tests - : tuple_construction_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tuple_element_access_tests - : tuple_element_access_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tuple_copy_tests - : tuple_copy_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tuple_comparison_tests - : tuple_comparison_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test vc6_bug_001 - : vc6_bug_001.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tuple_mutate_tests - : tuple_mutate_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test misc_tuple_tests - : misc_tuple_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test make_tuple_tests - : make_tuple_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tie_tests - : tie_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test tuple_iterator_tests - : tuple_iterator_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test io_tests - : io_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test single_view_tests - : single_view_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test type_sequence_tests - : type_sequence_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test joint_view_tests - : joint_view_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test push_back_tests - : push_back_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test push_front_tests - : push_front_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test find_tests - : find_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test find_if_tests - : find_if_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test filter_view_tests - : filter_view_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test filter_tests - : filter_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test range_tests - : range_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test erase_tests - : erase_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test for_each_tests - : for_each_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test fold_tests - : fold_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test insert_tests - : insert_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test remove_tests - : remove_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test remove_if_tests - : remove_if_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test replace_tests - : replace_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test transform_view_tests - : transform_view_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test transform_tests - : transform_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test cons_tests - : cons_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test any_tests - : any_tests.cpp - : $(BOOST_ROOT) - : - ; - -unit-test pair_tests - : pair_tests.cpp - : $(BOOST_ROOT) - : - ; - - - - - diff --git a/fusion/test/any_tests.cpp b/fusion/test/any_tests.cpp deleted file mode 100755 index d4d119ed5..000000000 --- a/fusion/test/any_tests.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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 -#include -#include -#include -#include - -int -main() -{ -/// Testing any - - { - boost::fusion::tuple t(1, 2, 3.3); - BOOST_TEST((boost::fusion::any(t, boost::lambda::_1 == 2))); - } - - { - boost::fusion::tuple t(1, 2, 3.3); - BOOST_TEST((!boost::fusion::any(t, boost::lambda::_1 == 3))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/cons_tests.cpp b/fusion/test/cons_tests.cpp deleted file mode 100755 index 43a893870..000000000 --- a/fusion/test/cons_tests.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - std::cout << boost::fusion::tuple_open('['); - std::cout << boost::fusion::tuple_close(']'); - std::cout << boost::fusion::tuple_delimiter(", "); - -/// Testing cons - - { - std::string hello("hello"); - boost::fusion::cons > ns = - boost::fusion::make_cons(1, boost::fusion::make_cons(hello)); - - BOOST_TEST((*boost::fusion::begin(ns) == 1)); - BOOST_TEST((*boost::fusion::next(boost::fusion::begin(ns)) == hello)); - - *boost::fusion::begin(ns) += 1; - *boost::fusion::next(boost::fusion::begin(ns)) += ' '; - - BOOST_TEST((*boost::fusion::begin(ns) == 2)); - BOOST_TEST((*boost::fusion::next(boost::fusion::begin(ns)) == hello + ' ')); - - boost::fusion::for_each(ns, boost::lambda::_1 += ' '); - - BOOST_TEST((*boost::fusion::begin(ns) == 2 + ' ')); - BOOST_TEST((*boost::fusion::next(boost::fusion::begin(ns)) == hello + ' ' + ' ')); - } - - { - boost::fusion::tuple t(1, 1.1f); - boost::fusion::cons > nf = - boost::fusion::make_cons(1, boost::fusion::make_cons(1.1f)); - - BOOST_TEST((t == nf)); - BOOST_TEST((boost::fusion::tuple(1) == boost::fusion::filter(nf, boost::is_same()))); - - std::cout << nf << std::endl; - std::cout << boost::fusion::filter(nf, boost::is_same()) << std::endl; - } - - return boost::report_errors(); -} - diff --git a/fusion/test/erase_tests.cpp b/fusion/test/erase_tests.cpp deleted file mode 100644 index 7f1f16d21..000000000 --- a/fusion/test/erase_tests.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector_c; - using boost::mpl::begin; - using boost::mpl::advance; - using boost::mpl::int_; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing erase - - { - char const* s = "Ruby"; - typedef tuple tuple_type; - tuple_type t1(1, 'x', 3.3, s); - tuple_iterator<2, tuple_type> pos(t1); - - std::cout << erase(t1, pos) << std::endl; - BOOST_TEST((erase(t1, pos) == make_tuple(1, 'x', s))); - } - - { - typedef vector_c mpl_vec; - typedef boost::mpl::begin::type mpl_vec_begin; - typedef boost::mpl::advance >::type mpl_vec_at3; - - std::cout << erase(mpl_vec(), mpl_vec_at3()) << std::endl; - BOOST_TEST((erase(mpl_vec(), mpl_vec_at3()) - == make_tuple(1, 2, 3, 5))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/filter_tests.cpp b/fusion/test/filter_tests.cpp deleted file mode 100644 index db44084be..000000000 --- a/fusion/test/filter_tests.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -struct Y -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - - using boost::mpl::_; - using boost::mpl::not_; - using boost::is_class; - using boost::mpl::vector; - using boost::is_same; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing filter - - X x; Y y; - typedef tuple tuple_type; - tuple_type t(y, '@', 987654, x, true, 6.6); - - { - std::cout << filter(t, not_ >()) << std::endl; - BOOST_TEST((filter(t, not_ >()) - == make_tuple('@', 987654, true, 6.6))); - } - - { - std::cout << filter(t, is_class<_>()) << std::endl; - BOOST_TEST((filter(t, is_class<_>()) - == make_tuple(y, x))); - } - - { - typedef vector mpl_vec; - BOOST_TEST((filter(mpl_vec(), not_ >()) - == make_tuple('\0', 0, false, 0.0))); - BOOST_TEST((filter(mpl_vec(), is_class<_>()) - == make_tuple(y, x))); - } - - { - typedef tuple tuple_type; - typedef meta::filter >::type none_remain_type; - BOOST_MPL_ASSERT((meta::equal_to::type, meta::end::type>)); - typedef meta::filter > >::type some_remain_type; - BOOST_MPL_ASSERT_NOT((meta::equal_to::type, meta::end::type>)); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/filter_view_tests.cpp b/fusion/test/filter_view_tests.cpp deleted file mode 100644 index ba6207561..000000000 --- a/fusion/test/filter_view_tests.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -struct Y -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - - using boost::mpl::_; - using boost::mpl::not_; - using boost::is_class; - using boost::is_same; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing filter_view - - { // Testing the static find_if (internal function) - - typedef tuple tuple_type; - - tuple_type t(1, 'x', 987654, X()); - typedef tuple_iterator<0, tuple_type> begin; - typedef tuple_iterator<4, tuple_type> end; - typedef detail::static_find_if > filter; - typedef filter::type type; - - BOOST_TEST(*type(t) == 987654); - std::cout << *type(t) << std::endl; - std::cout << *filter::call(begin(t)) << std::endl; - BOOST_TEST(*type(t) == *filter::call(begin(t))); - } - - { - typedef tuple tuple_type; - - X x; Y y; - tuple_type t(y, '@', 987654, x, true, 6.6); - filter_view > > view(t); - std::cout << view << std::endl; - BOOST_TEST(view == make_tuple('@', 987654, true, 6.6)); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/find_if_tests.cpp b/fusion/test/find_if_tests.cpp deleted file mode 100644 index c042a2019..000000000 --- a/fusion/test/find_if_tests.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include - -struct X -{ - operator int() const - { - return 12345; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::is_same; - using boost::mpl::_; - using boost::mpl::vector; - -/// Testing find_if - - { - typedef tuple tuple_type; - tuple_type t(12345, 'x', 678910, 3.36); - - std::cout << *find_if(t, is_same<_, char>()) << std::endl; -// BOOST_TEST((*find_if(t, is_same<_, char>()) == 'x')); - - std::cout << *find_if(t, is_same<_, int>()) << std::endl; -// BOOST_TEST((*find_if(t, is_same<_, int>()) == 12345)); - - std::cout << *find_if(t, is_same<_, double>()) << std::endl; -// BOOST_TEST((*find_if(t, is_same<_, double>()) == 3.36)); - } - - { - typedef vector mpl_vec; -// BOOST_TEST((*find_if(mpl_vec(), is_same<_, X>()) == 12345)); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/find_tests.cpp b/fusion/test/find_tests.cpp deleted file mode 100644 index 0634ff826..000000000 --- a/fusion/test/find_tests.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -struct X -{ - operator int() const - { - return 12345; - } -}; -int -main() -{ - using namespace boost::fusion; - using boost::mpl::identity; - using boost::mpl::vector; - -/// Testing find - - { - typedef tuple tuple_type; - tuple_type t(12345, 'x', 678910, 3.36); - - std::cout << *boost::fusion::find(t, identity()) << std::endl; - BOOST_TEST(*boost::fusion::find(t, identity()) == 'x'); - - std::cout << *boost::fusion::find(t, identity()) << std::endl; - BOOST_TEST(*boost::fusion::find(t, identity()) == 12345); - - std::cout << *boost::fusion::find(t, identity()) << std::endl; - BOOST_TEST(*boost::fusion::find(t, identity()) == 3.36); - } - - { - typedef vector mpl_vec; - BOOST_TEST((*boost::fusion::find(mpl_vec(), identity()) == 12345)); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/fixed_tuple_tests.cpp b/fusion/test/fixed_tuple_tests.cpp deleted file mode 100644 index 98f1faf02..000000000 --- a/fusion/test/fixed_tuple_tests.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -#ifndef __COMO_VERSION__ -// comeau is too slow for these big tuples -# include -# include -#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x551) -// borland chokes on very big tuples -# include -# include -#endif -#endif - -#include -#include -#include -#include // for std::pair - -int -main() -{ - using namespace boost::fusion; - using namespace boost; - using namespace std; - - { - tuple0 t; - (void) t; - cout << "(): " << sizeof(t) << endl; - } - - { - typedef tuple1 type; - type t; - BOOST_STATIC_ASSERT(tuple_size::value == 1); - - BOOST_TEST(get<0>(t) == 0); - BOOST_STATIC_ASSERT((is_same::type>::value)); - } - - { - typedef tuple1 type; - type t(123); - BOOST_TEST(get<0>(t) == 123); - cout << "(int): " << sizeof(t) << endl; - } - - { - tuple1 t1(123L); // try conversion from long to int - tuple1 t2(t1); // try copy - (void)t2; - } - - { - typedef tuple2 type; - type t; - BOOST_STATIC_ASSERT(tuple_size::value == 2); - - BOOST_TEST(get<0>(t) == 0); - BOOST_TEST(get<1>(t) == char()); - - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - } - - { - typedef tuple2 type; - type t(123, 'x'); - BOOST_TEST(get<0>(t) == 123); - BOOST_TEST(get<1>(t) == 'x'); - cout << "(int, char): " << sizeof(t) << endl; - } - - { - tuple2 t1(123, 456); - tuple2 t2(t1); // try copy - tuple2 t3(std::make_pair(123, 456)); // try copy from pair - (void)t2; - (void)t3; - } - - { - typedef tuple3 type; - type t; - BOOST_STATIC_ASSERT(tuple_size::value == 3); - - BOOST_TEST(get<0>(t) == 0); - BOOST_TEST(get<1>(t) == char()); - BOOST_TEST(get<2>(t) == double()); - - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - } - - { - typedef tuple3 type; - type t(123, 'x', 123.456); - BOOST_TEST(get<0>(t) == 123); - BOOST_TEST(get<1>(t) == 'x'); - BOOST_TEST(get<2>(t) >= 123.455 && get<2>(t) <= 123.457); - cout << "(int, char, double): " << sizeof(t) << endl; - } - - { - typedef tuple4 type; - type t(123, 'x', 123.456, true); - cout << "(int, char, double, bool): " << sizeof(t) << endl; - } - - { - typedef tuple4 type; - type t(123, 'x', true, 123.456); - cout << "(int, char, bool, double): " << sizeof(t) << endl; - } - - { - typedef tuple7 type; - type t(false, 'x', 3, 4, 5, 6.0, 7.0); - - BOOST_TEST(get<0>(t) == false); - BOOST_TEST(get<1>(t) == 'x'); - BOOST_TEST(get<2>(t) == 3); - BOOST_TEST(get<3>(t) == 4); - BOOST_TEST(get<4>(t) == 5); - BOOST_TEST(get<5>(t) >= 5.9 && get<5>(t) <= 6.1); - BOOST_TEST(get<6>(t) >= 6.9 && get<6>(t) <= 7.1); - - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - BOOST_STATIC_ASSERT((is_same::type>::value)); - cout << "(bool, char, short, int, long, float, double): " << sizeof(t) << endl; - } - - { - typedef tuple10 type; - type t; // compile check only - cout << "tuple10 of int: " << sizeof(t) << endl; - } - -#ifndef __COMO_VERSION__ -// comeau is too slow for these big tuples - { - typedef tuple20< - int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int> type; - - type t; // compile check only - cout << "tuple20 of int: " << sizeof(t) << endl; - } - - { - typedef tuple30< - int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int> type; - - type t; // compile check only - cout << "tuple30 of int: " << sizeof(t) << endl; - } - -#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x551) -// borland chokes on very big tuples - { - typedef tuple40< - int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int> type; - - type t; // compile check only - cout << "tuple40 of int: " << sizeof(t) << endl; - } - - { - typedef tuple50< - int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int - , int, int, int, int, int, int, int, int, int, int> type; - - type t; // compile check only - cout << "tuple50 of int: " << sizeof(t) << endl; - } -#endif -#endif - - return boost::report_errors(); -} - diff --git a/fusion/test/fold_tests.cpp b/fusion/test/fold_tests.cpp deleted file mode 100644 index 021323b4c..000000000 --- a/fusion/test/fold_tests.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include - -using boost::mpl::if_; -using boost::mpl::int_; -using boost::is_same; - -struct add_ints_only -{ - template - struct apply - { - typedef State type; - }; - - template - State const& - operator()(T const& x, State const& state) const - { - return state; - } - - int - operator()(int x, int state) const - { - return x + state; - } -}; - -struct count_ints -{ - template - struct apply - { - typedef typename - if_< - is_same - , typename boost::mpl::next::type - , CountT - >::type - type; - }; - - template - typename apply::type - operator()(T const&, CountT const&) const - { - typedef typename apply::type result; - return result(); - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector; - namespace fusion = boost::fusion; - -/// Testing fold - - { - typedef tuple tuple_type; - tuple_type t(12345, 'x', 678910, 3.36); - int result = fold(t, 0, add_ints_only()); - std::cout << result << std::endl; - BOOST_TEST(result == 12345+678910); - } - - { - typedef tuple tuple_type; - tuple_type t(12345); - - int n = fusion::fold(t, FUSION_INT(0)(), count_ints()); - std::cout << n << std::endl; - BOOST_TEST(n == 1); - } - - { - typedef tuple tuple_type; - tuple_type t(12345, 'x', 678910, 3.36, 8756); - - int n = fusion::fold(t, FUSION_INT(0)(), count_ints()); - std::cout << n << std::endl; - BOOST_TEST(n == 3); - } - - { - typedef vector mpl_vec; - int n = fusion::fold(mpl_vec(), FUSION_INT(0)(), count_ints()); - std::cout << n << std::endl; - BOOST_TEST(n == 3); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/for_each_tests.cpp b/fusion/test/for_each_tests.cpp deleted file mode 100644 index 3410b8669..000000000 --- a/fusion/test/for_each_tests.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -struct print -{ - template - void operator()(T const& v) const - { - std::cout << "[ " << v << " ] "; - } -}; - -struct increment -{ - template - void operator()(T& v) const - { - ++v; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector_c; - namespace fusion = boost::fusion; - -/// Testing for_each - - { - typedef tuple tuple_type; - tuple_type t(1, 'x', 3.3, "Ruby"); - for_each(t, print()); - std::cout << std::endl; - } - - { - typedef tuple tuple_type; - tuple_type t(1, 'x', 3.3, "Ruby"); - for_each(t, increment()); - std::cout << t << std::endl; - } - - { - typedef vector_c mpl_vec; - fusion::for_each(mpl_vec(), print()); - std::cout << std::endl; - } - - return boost::report_errors(); -} - diff --git a/fusion/test/fusion_to_mpl.cpp b/fusion/test/fusion_to_mpl.cpp deleted file mode 100644 index b8fd1bced..000000000 --- a/fusion/test/fusion_to_mpl.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - Copyright (c) 2004 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -template -struct test_sequence -{ - typedef typename boost::mpl::begin::type first; - typedef typename boost::mpl::next::type second; - typedef typename boost::mpl::next::type third; - typedef typename boost::mpl::next::type fourth; - typedef typename boost::mpl::end::type last; - - BOOST_STATIC_ASSERT((boost::is_same< - typename boost::mpl::deref::type, int>::value)); - - BOOST_STATIC_ASSERT((boost::is_same< - typename boost::mpl::deref::type, float>::value)); - - BOOST_STATIC_ASSERT((boost::is_same< - typename boost::mpl::deref::type, bool>::value)); - - BOOST_STATIC_ASSERT((boost::is_same< - typename boost::mpl::deref::type, char>::value)); -}; - -int -main() -{ - using namespace boost::fusion; - - typedef tuple tuple_type; - test_sequence tuple_test; - - return boost::report_errors(); -} diff --git a/fusion/test/insert_tests.cpp b/fusion/test/insert_tests.cpp deleted file mode 100644 index a348828ae..000000000 --- a/fusion/test/insert_tests.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector_c; - using boost::mpl::advance; - using boost::mpl::int_; - namespace fusion = boost::fusion; - namespace mpl = boost::mpl; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing insert - - { - char const* s = "Ruby"; - typedef tuple tuple_type; - tuple_type t1(1, 'x', 3.3, s); - tuple_iterator<2, tuple_type> pos(t1); - - std::cout << insert(t1, pos, 123456) << std::endl; - BOOST_TEST((insert(t1, pos, 123456) - == make_tuple(1, 'x', 123456, 3.3, s))); - - std::cout << insert(t1, end(t1), 123456) << std::endl; - BOOST_TEST((insert(t1, end(t1), 123456) - == make_tuple(1, 'x', 3.3, s, 123456))); - - std::cout << insert(t1, begin(t1), "glad") << std::endl; - BOOST_TEST((insert(t1, begin(t1), "glad") - == make_tuple(std::string("glad"), 1, 'x', 3.3, s))); - } - - { - typedef vector_c mpl_vec; - typedef mpl::begin::type mpl_vec_begin; - typedef advance >::type mpl_vec_at3; - - std::cout << fusion::insert(mpl_vec(), mpl_vec_at3(), int_<66>()) << std::endl; - BOOST_TEST((fusion::insert(mpl_vec(), mpl_vec_at3(), int_<66>()) - == make_tuple(1, 2, 3, 66, 4, 5))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/insert_tests_mpl.cpp b/fusion/test/insert_tests_mpl.cpp deleted file mode 100644 index 1a672864d..000000000 --- a/fusion/test/insert_tests_mpl.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; -/* using boost::mpl::vector_c; - using boost::mpl::advance; - using boost::mpl::int_;*/ - namespace fusion = boost::fusion; - namespace mpl = boost::mpl; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing insert - - //Needed to split insert_tests.cpp because of compiler limit in MSVC 6.5 - - { - typedef mpl::vector_c mpl_vec; - typedef mpl::begin::type mpl_vec_begin; - typedef mpl::advance >::type mpl_vec_at3; - - std::cout << fusion::insert(mpl_vec(), mpl_vec_at3(), mpl::int_<66>()) << std::endl; - BOOST_TEST((fusion::insert(mpl_vec(), mpl_vec_at3(), mpl::int_<66>()) - == make_tuple(1, 2, 3, 66, 4, 5))); - } - - return boost::report_errors(); -} \ No newline at end of file diff --git a/fusion/test/io_tests.cpp b/fusion/test/io_tests.cpp deleted file mode 100644 index eaa16f79d..000000000 --- a/fusion/test/io_tests.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - - Use, modification and distribution is 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 -#include -#include -#include -#include - -#include -#include -#include -#include - -#if defined BOOST_NO_STRINGSTREAM -# include -#else -# include -#endif - -using boost::fusion::tuple; -using boost::fusion::make_tuple; -using boost::fusion::tuple_close; -using boost::fusion::tuple_open; -using boost::fusion::tuple_delimiter; - -#if defined BOOST_NO_STRINGSTREAM - using std::ostrstream; - using std::istrstream; - typedef ostrstream useThisOStringStream; - typedef istrstream useThisIStringStream; -#else - using std::ostringstream; - using std::istringstream; - typedef ostringstream useThisOStringStream; - typedef istringstream useThisIStringStream; -#endif - -using std::endl; -using std::ofstream; -using std::ifstream; -using std::string; - -int -main() -{ - using boost::fusion::tuple_close; - using boost::fusion::tuple_open; - using boost::fusion::tuple_delimiter; - - useThisOStringStream os1; - - // Set format [a, b, c] for os1 - os1 << tuple_open('['); - os1 << tuple_close(']'); - os1 << tuple_delimiter(','); - os1 << make_tuple(1, 2, 3); - - BOOST_TEST (os1.str() == std::string("[1,2,3]") ); - - { - useThisOStringStream os2; - // Set format (a:b:c) for os2; - os2 << tuple_open('('); - os2 << tuple_close(')'); - os2 << tuple_delimiter(':'); - - // this code now works with VC6/7 - os2 << make_tuple("TUPU", "HUPU", "LUPU", 4.5); - BOOST_TEST (os2.str() == std::string("(TUPU:HUPU:LUPU:4.5)") ); - } - - // The format is still [a, b, c] for os1 - os1 << make_tuple(1, 2, 3); - BOOST_TEST (os1.str() == std::string("[1,2,3][1,2,3]") ); - - std::ofstream tmp("temp.tmp"); - -#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - tmp << make_tuple("One", "Two", 3); -#endif - tmp << tuple_delimiter(':'); - tmp << make_tuple(1000, 2000, 3000) << endl; - - tmp.close(); - - // When teading tuples from a stream, manipulators must be set correctly: - ifstream tmp3("temp.tmp"); - tuple j; - -#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - tmp3 >> j; - BOOST_TEST (tmp3.good() ); -#endif - - tmp3 >> tuple_delimiter(':'); - tuple i; - tmp3 >> i; - BOOST_TEST (tmp3.good() ); - - tmp3.close(); - - // reading tuple in format (a b c); - useThisIStringStream is("(100 200 300)"); - - tuple ti; - BOOST_TEST(bool((is >> ti) != 0)); - BOOST_TEST(ti == make_tuple(100, 200, 300)); - - // Note that strings are problematic: - // writing a tuple on a stream and reading it back doesn't work in - // general. If this is wanted, some kind of a parseable string class - // should be used. - - return boost::report_errors(); -} - diff --git a/fusion/test/joint_view_tests.cpp b/fusion/test/joint_view_tests.cpp deleted file mode 100644 index 56f9a6662..000000000 --- a/fusion/test/joint_view_tests.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing joint_view - - { - tuple t1(3); - tuple t2; - typedef joint_view, tuple > view_type; - view_type view(t1, t2); - - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(3, X()))); - } - - { - tuple t1(3, 'x'); - tuple t2; - typedef joint_view, tuple > view_type; - view_type view(t1, t2); - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(3, 'x', X()))); - - *begin(view) = 4; - BOOST_TEST(get<0>(t1) == 4); - } - - { - tuple t1(3, 'x'); - tuple t2; - typedef joint_view, tuple > view_type; - view_type view(t1, t2); - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(3, 'x', X(), 0))); - } - - { - typedef tuple t1_type; - t1_type t1(777); - typedef tuple t2_type; - t2_type t2(1, 'x', 3.3); - - { - typedef joint_view view_type; - view_type view(t1, t2); - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(777, 1, 'x', 3.3))); - } - - { - typedef joint_view view_type; - view_type view(t2, t1); - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(1, 'x', 3.3, 777))); - } - - { - typedef joint_view jv_type; - typedef joint_view jv2_type; - - jv_type jv(t2, t1); - jv2_type jv2(jv, jv); - - std::cout << jv << std::endl; - std::cout << jv2 << std::endl; - - BOOST_TEST(jv2 - == make_tuple(1, 'x', 3.3, 777, 1, 'x', 3.3, 777)); - } - - { - typedef joint_view jt_type; - typedef joint_view jv2_type; - typedef joint_view jv3_type; - - jt_type jt(t2, t1); - jv2_type jv2(t1, t2); - jv3_type jv3(jt, jv2); - - std::cout << jt << std::endl; - std::cout << jv2 << std::endl; - std::cout << jv3 << std::endl; - - BOOST_TEST(jv3 - == make_tuple(1, 'x', 3.3, 777, 777, 1, 'x', 3.3)); - } - - { - typedef joint_view, t1_type> jt_type; - tuple<> empty; - jt_type jt(empty, t1); - std::cout << generate(jt) << std::endl; - BOOST_TEST(generate(jt) == make_tuple(777)); - } - - { - typedef joint_view > jt_type; - tuple<> empty; - jt_type jt(t1, empty); - std::cout << generate(jt) << std::endl; - BOOST_TEST(generate(jt) == make_tuple(777)); - } - - { - typedef joint_view, tuple<> > jt_type; - tuple<> empty; - jt_type jt(empty, empty); - std::cout << generate(jt) << std::endl; - BOOST_TEST(generate(jt) == make_tuple()); - } - } - - return boost::report_errors(); -} - diff --git a/fusion/test/joint_view_tests_2.cpp b/fusion/test/joint_view_tests_2.cpp deleted file mode 100644 index 1dfce7276..000000000 --- a/fusion/test/joint_view_tests_2.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing joint_view - { - typedef tuple t1_type; - t1_type t1(777); - typedef tuple t2_type; - t2_type t2(1, 'x', 3.3); - - { - typedef joint_view view_type; - view_type view(t1, t2); - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(777, 1, 'x', 3.3))); - } - - { - typedef joint_view view_type; - view_type view(t2, t1); - std::cout << view << std::endl; - BOOST_TEST((view == make_tuple(1, 'x', 3.3, 777))); - } - - { - typedef joint_view jv_type; - typedef joint_view jv2_type; - - jv_type jv(t2, t1); - jv2_type jv2(jv, jv); - - std::cout << jv << std::endl; - std::cout << jv2 << std::endl; - - BOOST_TEST(jv2 - == make_tuple(1, 'x', 3.3, 777, 1, 'x', 3.3, 777)); - } - - { - typedef joint_view jt_type; - typedef joint_view jv2_type; - typedef joint_view jv3_type; - - jt_type jt(t2, t1); - jv2_type jv2(t1, t2); - jv3_type jv3(jt, jv2); - - std::cout << jt << std::endl; - std::cout << jv2 << std::endl; - std::cout << jv3 << std::endl; - - BOOST_TEST(jv3 - == make_tuple(1, 'x', 3.3, 777, 777, 1, 'x', 3.3)); - } - - { - typedef joint_view, t1_type> jt_type; - tuple<> empty; - jt_type jt(empty, t1); - std::cout << generate(jt) << std::endl; - BOOST_TEST(generate(jt) == make_tuple(777)); - } - - { - typedef joint_view > jt_type; - tuple<> empty; - jt_type jt(t1, empty); - std::cout << generate(jt) << std::endl; - BOOST_TEST(generate(jt) == make_tuple(777)); - } - - } - - return boost::report_errors(); -} - diff --git a/fusion/test/make_tuple_tests.cpp b/fusion/test/make_tuple_tests.cpp deleted file mode 100644 index 86641fe33..000000000 --- a/fusion/test/make_tuple_tests.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include - -namespace -{ - // something to prevent warnings for unused variables - template void dummy(const T&) {} - - class A {}; - class B {}; -} - -void make_tuple_test() {} - -int -main() -{ - using namespace boost::fusion; - - { - tuple t1 = make_tuple(5, 'a'); - BOOST_TEST(get<0>(t1) == 5); - BOOST_TEST(get<1>(t1) == 'a'); - - tuple t2; - t2 = make_tuple((short int)2, std::string("Hi")); - BOOST_TEST(get<0>(t2) == 2); - BOOST_TEST(get<1>(t2) == "Hi"); - } - - { // This test was previously disallowed for non-PTS compilers. - A a = A(); B b; - const A ca = a; - make_tuple(boost::cref(a), b); - make_tuple(boost::ref(a), b); - make_tuple(boost::ref(a), boost::cref(b)); - make_tuple(boost::ref(ca)); - } - - { // the result of make_tuple is assignable: - BOOST_TEST(make_tuple(2, 4, 6) == - (make_tuple(1, 2, 3) = make_tuple(2, 4, 6))); - } - - { // This test was previously disallowed for non-PTS compilers. - make_tuple("Donald", "Daisy"); // should work; - // std::make_pair("Doesn't","Work"); // fails - } - -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) - { // This test works on VC7 now, only VC6 fails - // You can store a reference to a function in a tuple - tuple adf(make_tuple_test); - dummy(adf); // avoid warning for unused variable - } -#endif - - { - // But make_tuple doesn't work - // with function references, since it creates a const - // qualified function type - - // make_tuple(make_tuple_test); - } - - { - // With function pointers, make_tuple works just fine - // This test works on Borland now - - make_tuple(&make_tuple_test); - } - -// NOTE: -// -// wrapping the function reference with ref helps on gcc 2.95.2. -// on edg 2.43. it results in a catastrophic error? - -// make_tuple(ref(foo3)); - -// It seems that edg can't use implicitly the ref's conversion operator, e.g.: -// typedef void (&func_t) (void); -// func_t fref = static_cast(ref(make_tuple_test)); // works fine -// func_t fref = ref(make_tuple_test); // error - -// This is probably not a very common situation, so currently -// I don't know how which compiler is right (JJ) - - return boost::report_errors(); -} diff --git a/fusion/test/misc_tuple_tests.cpp b/fusion/test/misc_tuple_tests.cpp deleted file mode 100644 index a0469382f..000000000 --- a/fusion/test/misc_tuple_tests.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - - { // testing const tuples - - const tuple t1(5, 3.3f); - BOOST_TEST(get<0>(t1) == 5); - BOOST_TEST(get<1>(t1) == 3.3f); - } - - { // testing length - - typedef tuple t1; - typedef tuple<> t2; - - BOOST_STATIC_ASSERT(tuple_size::value == 3); - BOOST_STATIC_ASSERT(tuple_size::value == 0); - } - - { // testing is_sequence - - typedef tuple t1; - typedef tuple<> t2; - typedef tuple t3; - - BOOST_STATIC_ASSERT(is_sequence::value); - BOOST_STATIC_ASSERT(is_sequence::value); - BOOST_STATIC_ASSERT(is_sequence::value); - BOOST_STATIC_ASSERT(!is_sequence::value); - BOOST_STATIC_ASSERT(!is_sequence::value); - } - - return boost::report_errors(); -} diff --git a/fusion/test/pair_tests.cpp b/fusion/test/pair_tests.cpp deleted file mode 100644 index 5790c4cac..000000000 --- a/fusion/test/pair_tests.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -int main() -{ - using namespace boost::fusion; - BOOST_MPL_ASSERT_RELATION((tuple_size >::value),==,2); - - BOOST_MPL_ASSERT((boost::is_same >::type, int>)); - BOOST_MPL_ASSERT((boost::is_same >::type, float>)); - - std::pair pr(1, "hello"); - BOOST_TEST(get<0>(pr) == 1); - BOOST_TEST(get<1>(pr) == "hello"); - - get<0>(pr) = 2; - get<1>(pr) = "world"; - BOOST_TEST(get<0>(pr) == 2); - BOOST_TEST(get<1>(pr) == "world"); - - const std::pair pr2(pr); - BOOST_TEST(get<0>(pr2) == 2); - BOOST_TEST(get<1>(pr2) == "world"); - - return 0; -} diff --git a/fusion/test/push_back_tests.cpp b/fusion/test/push_back_tests.cpp deleted file mode 100644 index 2d440cdaa..000000000 --- a/fusion/test/push_back_tests.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct plus_one -{ - template - void operator()(T& v) const - { - v += 1; - } -}; - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing push_back - - { - char const* s = "Ruby"; - typedef tuple tuple_type; - tuple_type t1(1, 'x', 3.3, s); - - { - std::cout << push_back(t1, 123456) << std::endl; - BOOST_TEST((push_back(t1, 123456) - == make_tuple(1, 'x', 3.3, s, 123456))); - } - - { - std::cout << push_back(t1, "funny") << std::endl; - BOOST_TEST((push_back(t1, "funny") - == make_tuple(1, 'x', 3.3, s, std::string("funny")))); - } - - { - std::cout << push_back(t1, t1) << std::endl; - BOOST_TEST((push_back(t1, t1) - == make_tuple(1, 'x', 3.3, s, t1))); - } - } - - { - // This is OK -- can modify a tuple in place - tuple i(1,2,3); - std::cout << i << '\n'; - for_each(i, plus_one()); - std::cout << i << '\n'; - - // This should also be OK -- can modify a fusion sequence in place - typedef tuple<> T1; - typedef meta::push_back::type T2; - typedef meta::push_back::type T3; - typedef meta::push_back::type T4; - - T1 t1 = T1(); - T2 t2 = push_back(t1, 1); - T3 t3 = push_back(t2, 2); - T4 t4 = push_back(t3, 3); - - std::cout << "=============\n"; - std::cout << t4 << std::endl; - for_each(t4, plus_one()); - std::cout << "=============\n"; - std::cout << t4 << std::endl; - - BOOST_TEST(t4 == make_tuple(2, 3, 4)); - } - - { - typedef boost::mpl::vector_c mpl_vec; - std::cout << boost::fusion::push_back(mpl_vec(), boost::mpl::int_<6>()) << std::endl; - BOOST_TEST((boost::fusion::push_back(mpl_vec(), boost::mpl::int_<6>()) - == make_tuple(1, 2, 3, 4, 5, 6))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/push_back_tests_mpl.cpp b/fusion/test/push_back_tests_mpl.cpp deleted file mode 100644 index 0ede433c1..000000000 --- a/fusion/test/push_back_tests_mpl.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing push_back - - - { - typedef boost::mpl::vector_c mpl_vec; - std::cout << boost::fusion::push_back(mpl_vec(), boost::mpl::int_<6>()) << std::endl; - BOOST_TEST((boost::fusion::push_back(mpl_vec(), boost::mpl::int_<6>()) - == make_tuple(1, 2, 3, 4, 5, 6))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/push_front_tests.cpp b/fusion/test/push_front_tests.cpp deleted file mode 100644 index 163207bd4..000000000 --- a/fusion/test/push_front_tests.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing push_front - - { - char const* s = "Ruby"; - typedef tuple tuple_type; - tuple_type t1(1, 'x', 3.3, s); - - { - std::cout << push_front(t1, 123456) << std::endl; - BOOST_TEST((push_front(t1, 123456) - == make_tuple(123456, 1, 'x', 3.3, s))); - } - - { - std::cout << push_front(t1, "lively") << std::endl; - BOOST_TEST((push_front(t1, "lively") - == make_tuple(std::string("lively"), 1, 'x', 3.3, s))); - } - } - - { - typedef boost::mpl::vector_c mpl_vec; - std::cout << boost::fusion::push_front(mpl_vec(), boost::mpl::int_<1>()) << std::endl; - BOOST_TEST((boost::fusion::push_front(mpl_vec(), boost::mpl::int_<1>()) - == make_tuple(1, 2, 3, 4, 5, 6))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/range_tests.cpp b/fusion/test/range_tests.cpp deleted file mode 100644 index 0309e6fdd..000000000 --- a/fusion/test/range_tests.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing range - - { - char const* s = "Ruby"; - typedef tuple tuple_type; - tuple_type t1(1, 'x', 3.3, s); - - { - typedef tuple_iterator<1, tuple_type> i1t; - typedef tuple_iterator<3, tuple_type> i3t; - - i1t i1(t1); - i3t i3(t1); - - range slice(i1, i3); - std::cout << slice << std::endl; - BOOST_TEST(slice == make_tuple('x', 3.3)); - } - - { - typedef tuple_iterator<0, tuple_type> i1t; - typedef tuple_iterator<0, tuple_type> i3t; - - i1t i1(t1); - i3t i3(t1); - - range slice(i1, i3); - std::cout << slice << std::endl; - BOOST_TEST(slice == tuple<>()); - } - } - - return boost::report_errors(); -} - diff --git a/fusion/test/remove_if_tests.cpp b/fusion/test/remove_if_tests.cpp deleted file mode 100644 index 10afd1369..000000000 --- a/fusion/test/remove_if_tests.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -struct Y -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector; - using boost::mpl::_; - using boost::mpl::not_; - using boost::is_class; - using boost::is_same; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing remove_if - - X x; Y y; - typedef tuple tuple_type; - tuple_type t(y, '@', 987654, x, true, 6.6); - - { - std::cout << remove_if(t, not_ >()) << std::endl; - BOOST_TEST((remove_if(t, not_ >()) - == make_tuple(y, x))); - } - - { - std::cout << remove_if(t, is_class<_>()) << std::endl; - BOOST_TEST((remove_if(t, is_class<_>()) - == make_tuple('@', 987654, true, 6.6))); - } - - { - typedef vector mpl_vec; - BOOST_TEST((remove_if(mpl_vec(), not_ >()) - == tuple())); - BOOST_TEST((remove_if(mpl_vec(), is_class<_>()) - == tuple())); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/remove_tests.cpp b/fusion/test/remove_tests.cpp deleted file mode 100644 index 5eab6e9f1..000000000 --- a/fusion/test/remove_tests.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -struct Y -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::identity; - using boost::mpl::vector; - namespace fusion = boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing remove - - X x; Y y; - typedef tuple tuple_type; - tuple_type t(y, '@', 987654, x, true, 6.6); - - { - std::cout << fusion::remove(t, identity()) << std::endl; - BOOST_TEST((fusion::remove(t, identity()) - == make_tuple(y, '@', 987654, true, 6.6))); - } - - { - std::cout << fusion::remove(t, identity()) << std::endl; - BOOST_TEST((fusion::remove(t, identity()) - == make_tuple('@', 987654, x, true, 6.6))); - } - - { - std::cout << fusion::remove(t, identity()) << std::endl; - BOOST_TEST((fusion::remove(t, identity()) - == make_tuple(y, '@', x, true, 6.6))); - } - - { - typedef vector mpl_vec; - BOOST_TEST((fusion::remove(mpl_vec(), identity()) - == tuple())); - BOOST_TEST((fusion::remove(mpl_vec(), identity()) - == tuple())); - BOOST_TEST((fusion::remove(mpl_vec(), identity()) - == tuple())); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/remove_tests_mpl.cpp b/fusion/test/remove_tests_mpl.cpp deleted file mode 100644 index 1c419d103..000000000 --- a/fusion/test/remove_tests_mpl.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -struct Y -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::identity; - using boost::mpl::vector; - namespace fusion = boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing remove - - { - typedef vector mpl_vec; - BOOST_TEST((fusion::remove(mpl_vec(), identity()) - == tuple())); - BOOST_TEST((fusion::remove(mpl_vec(), identity()) - == tuple())); - BOOST_TEST((fusion::remove(mpl_vec(), identity()) - == tuple())); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/replace_tests.cpp b/fusion/test/replace_tests.cpp deleted file mode 100644 index 0f1fc4dc5..000000000 --- a/fusion/test/replace_tests.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector_c; - using boost::mpl::advance; - using boost::mpl::int_; - namespace mpl = boost::mpl; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing replace - - { - char const* s = "Ruby"; - typedef tuple tuple_type; - tuple_type t(1, 'x', 3.3, s); - tuple_iterator<2, tuple_type> pos(t); - - std::cout << replace(t, pos, 123456) << std::endl; - BOOST_TEST((replace(t, pos, 123456) - == make_tuple(1, 'x', 123456, s))); - - std::cout << replace(t, begin(t), "happy") << std::endl; - BOOST_TEST((replace(t, begin(t), "happy") - == make_tuple(std::string("happy"), 'x', 3.3, s))); - } - - { - typedef vector_c mpl_vec; - typedef mpl::begin::type mpl_vec_begin; - typedef advance >::type mpl_vec_at3; - - std::cout << replace(mpl_vec(), mpl_vec_at3(), int_<66>()) << std::endl; - BOOST_TEST((replace(mpl_vec(), mpl_vec_at3(), int_<66>()) - == make_tuple(1, 2, 3, 66, 5))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/single_view_tests.cpp b/fusion/test/single_view_tests.cpp deleted file mode 100644 index 553044fe6..000000000 --- a/fusion/test/single_view_tests.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -struct X {}; - -template -OS& operator<<(OS& os, X const&) -{ - os << ""; - return os; -} - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing single_view - - { - single_view view1(3); - std::cout << view1 << std::endl; - - // allow single_view element to be modified - *begin(view1) += 4; - std::cout << view1 << std::endl; - BOOST_TEST(*begin(view1) == 7); - BOOST_TEST(view1.val == 7); - - single_view view2; - std::cout << view2 << std::endl; - } - - return boost::report_errors(); -} - diff --git a/fusion/test/tie_tests.cpp b/fusion/test/tie_tests.cpp deleted file mode 100644 index 62cd84a73..000000000 --- a/fusion/test/tie_tests.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -namespace -{ - // something to prevent warnings for unused variables - template void dummy(const T&) {} - - // no public default constructor - class foo - { - public: - - explicit foo(int v) : val(v) {} - - bool operator==(const foo& other) const - { - return val == other.val; - } - - private: - - foo() {} - int val; - }; -} - -int -main() -{ - using namespace boost::fusion; - - int a; - char b; - foo c(5); - - tie(a, b, c) = make_tuple(2, 'a', foo(3)); - BOOST_TEST(a == 2); - BOOST_TEST(b == 'a'); - BOOST_TEST(c == foo(3)); - - tie(a, ignore, c) = make_tuple((short int)5, false, foo(5)); - BOOST_TEST(a == 5); - BOOST_TEST(b == 'a'); - BOOST_TEST(c == foo(5)); - - // testing assignment from std::pair - int i, j; - tie (i, j) = std::make_pair(1, 2); - BOOST_TEST(i == 1 && j == 2); - - tuple ta; - -#ifdef E11 - ta = std::make_pair(1, 2); // should fail, tuple is of length 3, not 2 -#endif - - dummy(ta); - - // ties cannot be rebound - int d = 3; - tuple ti(a); - BOOST_TEST(&get<0>(ti) == &a); - ti = tuple(d); - BOOST_TEST(&get<0>(ti) == &a); - - return boost::report_errors(); -} diff --git a/fusion/test/transform_tests.cpp b/fusion/test/transform_tests.cpp deleted file mode 100644 index de8517a3f..000000000 --- a/fusion/test/transform_tests.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -struct square -{ - - template - struct apply - { - BOOST_STATIC_ASSERT(!boost::is_reference::value); - typedef int type; - }; - - template - int operator()(T x) const - { - return x * x; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::range_c; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing the transform - - { - typedef range_c mpl_list1; - typedef type_sequence sequence_type; - sequence_type sequence; - - std::cout << transform(sequence, square()) << std::endl; - BOOST_TEST((transform(sequence, square()) == make_tuple(25, 36, 49, 64))); - } - - { - typedef range_c mpl_list1; - std::cout << transform(mpl_list1(), square()) << std::endl; - BOOST_TEST((transform(mpl_list1(), square()) == make_tuple(25, 36, 49, 64))); - } - - { - tuple tup(1, 2, 3); - std::cout << transform(tup, square()) << std::endl; - BOOST_TEST((transform(tup, square()) == make_tuple(1, 4, 9))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/transform_view_tests.cpp b/fusion/test/transform_view_tests.cpp deleted file mode 100644 index 9942e99a8..000000000 --- a/fusion/test/transform_view_tests.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include - -struct square -{ - template - struct apply - { - typedef int type; - }; - - template - int operator()(T x) const - { - return x * x; - } -}; - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing the transform_view - - { - typedef boost::mpl::range_c mpl_list1; - typedef type_sequence sequence_type; - sequence_type sequence; - transform_view xform(sequence, square()); - - std::cout << xform << std::endl; - BOOST_TEST((xform == make_tuple(25, 36, 49, 64))); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/tuple_comparison_tests.cpp b/fusion/test/tuple_comparison_tests.cpp deleted file mode 100644 index 4ba6a3a0d..000000000 --- a/fusion/test/tuple_comparison_tests.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include - -void -equality_test() -{ - using namespace boost::fusion; - - tuple t1(5, 'a'); - tuple t2(5, 'a'); - BOOST_TEST(t1 == t2); - - tuple t3(5, 'b'); - tuple t4(2, 'a'); - BOOST_TEST(t1 != t3); - BOOST_TEST(t1 != t4); - BOOST_TEST(!(t1 != t2)); -} - -void -ordering_test() -{ - using namespace boost::fusion; - - tuple t1(4, 3.3f); - tuple t2(5, 3.3f); - tuple t3(5, 4.4); - BOOST_TEST(t1 < t2); - BOOST_TEST(t1 <= t2); - BOOST_TEST(t2 > t1); - BOOST_TEST(t2 >= t1); - BOOST_TEST(t2 < t3); - BOOST_TEST(t2 <= t3); - BOOST_TEST(t3 > t2); - BOOST_TEST(t3 >= t2); -} - -void extended_tests() -{ - using namespace boost::fusion; - typedef tuple test_tuple; - const test_tuple a0('a',0), a1('a',1), a2('a',2), - b0('b',0), b1('b',1), b2('b',2), - c0('c',0), c1('c',1), c2('c',2); - - BOOST_TEST(b1 == b1); - BOOST_TEST(!(b1 == a0)); - BOOST_TEST(!(b1 == a1)); - BOOST_TEST(!(b1 == a2)); - BOOST_TEST(!(b1 == b0)); - BOOST_TEST(!(b1 == b2)); - BOOST_TEST(!(b1 == c0)); - BOOST_TEST(!(b1 == c1)); - BOOST_TEST(!(b1 == c2)); - BOOST_TEST(!(a0 == b1)); - BOOST_TEST(!(a1 == b1)); - BOOST_TEST(!(a2 == b1)); - BOOST_TEST(!(b0 == b1)); - BOOST_TEST(!(b2 == b1)); - BOOST_TEST(!(c0 == b1)); - BOOST_TEST(!(c1 == b1)); - BOOST_TEST(!(c2 == b1)); - - BOOST_TEST(!(b1 != b1)); - BOOST_TEST(b1 != a0); - BOOST_TEST(b1 != a1); - BOOST_TEST(b1 != a2); - BOOST_TEST(b1 != b0); - BOOST_TEST(b1 != b2); - BOOST_TEST(b1 != c0); - BOOST_TEST(b1 != c1); - BOOST_TEST(b1 != c2); - BOOST_TEST(a0 != b1); - BOOST_TEST(a1 != b1); - BOOST_TEST(a2 != b1); - BOOST_TEST(b0 != b1); - BOOST_TEST(b2 != b1); - BOOST_TEST(c0 != b1); - BOOST_TEST(c1 != b1); - BOOST_TEST(c2 != b1); - - BOOST_TEST(!(b1 < b1)); - BOOST_TEST(!(b1 < a0)); - BOOST_TEST(!(b1 < a1)); - BOOST_TEST(!(b1 < a2)); - BOOST_TEST(!(b1 < b0)); - BOOST_TEST(b1 < b2); - BOOST_TEST(b1 < c0); - BOOST_TEST(b1 < c1); - BOOST_TEST(b1 < c2); - BOOST_TEST(a0 < b1); - BOOST_TEST(a1 < b1); - BOOST_TEST(a2 < b1); - BOOST_TEST(b0 < b1); - BOOST_TEST(!(b2 < b1)); - BOOST_TEST(!(c0 < b1)); - BOOST_TEST(!(c1 < b1)); - BOOST_TEST(!(c2 < b1)); - - BOOST_TEST(b1 <= b1); - BOOST_TEST(!(b1 <= a0)); - BOOST_TEST(!(b1 <= a1)); - BOOST_TEST(!(b1 <= a2)); - BOOST_TEST(!(b1 <= b0)); - BOOST_TEST(b1 <= b2); - BOOST_TEST(b1 <= c0); - BOOST_TEST(b1 <= c1); - BOOST_TEST(b1 <= c2); - BOOST_TEST(a0 <= b1); - BOOST_TEST(a1 <= b1); - BOOST_TEST(a2 <= b1); - BOOST_TEST(b0 <= b1); - BOOST_TEST(!(b2 <= b1)); - BOOST_TEST(!(c0 <= b1)); - BOOST_TEST(!(c1 <= b1)); - BOOST_TEST(!(c2 <= b1)); - - BOOST_TEST(!(b1 > b1)); - BOOST_TEST(b1 > a0); - BOOST_TEST(b1 > a1); - BOOST_TEST(b1 > a2); - BOOST_TEST(b1 > b0); - BOOST_TEST(!(b1 > b2)); - BOOST_TEST(!(b1 > c0)); - BOOST_TEST(!(b1 > c1)); - BOOST_TEST(!(b1 > c2)); - BOOST_TEST(!(a0 > b1)); - BOOST_TEST(!(a1 > b1)); - BOOST_TEST(!(a2 > b1)); - BOOST_TEST(!(b0 > b1)); - BOOST_TEST(b2 > b1); - BOOST_TEST(c0 > b1); - BOOST_TEST(c1 > b1); - BOOST_TEST(c2 > b1); - - BOOST_TEST(b1 >= b1); - BOOST_TEST(b1 >= a0); - BOOST_TEST(b1 >= a1); - BOOST_TEST(b1 >= a2); - BOOST_TEST(b1 >= b0); - BOOST_TEST(!(b1 >= b2)); - BOOST_TEST(!(b1 >= c0)); - BOOST_TEST(!(b1 >= c1)); - BOOST_TEST(!(b1 >= c2)); - BOOST_TEST(!(a0 >= b1)); - BOOST_TEST(!(a1 >= b1)); - BOOST_TEST(!(a2 >= b1)); - BOOST_TEST(!(b0 >= b1)); - BOOST_TEST(b2 >= b1); - BOOST_TEST(c0 >= b1); - BOOST_TEST(c1 >= b1); - BOOST_TEST(c2 >= b1); - - return; -} - -int -main() -{ - equality_test(); - ordering_test(); - extended_tests(); - return boost::report_errors(); -} diff --git a/fusion/test/tuple_construction_tests.cpp b/fusion/test/tuple_construction_tests.cpp deleted file mode 100644 index b2bdb0990..000000000 --- a/fusion/test/tuple_construction_tests.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include - -namespace -{ - // something to prevent warnings for unused variables - template void dummy(const T&) {} - - // no public default constructor - class foo - { - public: - - explicit foo(int v) : val(v) {} - - bool operator==(const foo& other) const - { - return val == other.val; - } - - private: - - foo() {} - int val; - }; - - // another class without a public default constructor - class no_def_constructor - { - no_def_constructor() {} - - public: - - no_def_constructor(std::string) {} - }; -} - -int -main() -{ - using namespace boost::fusion; - - tuple t1; - BOOST_TEST(get<0>(t1) == int()); - - tuple t2(5.5f); - BOOST_TEST(get<0>(t2) > 5.4f && get<0>(t2) < 5.6f); - - tuple t3(foo(12)); - BOOST_TEST(get<0>(t3) == foo(12)); - - tuple t4(t2); - BOOST_TEST(get<0>(t4) > 5.4 && get<0>(t4) < 5.6); - - tuple t5; - BOOST_TEST(get<0>(t5) == int()); - BOOST_TEST(get<1>(t5) == float()); - - tuple t6(12, 5.5f); - BOOST_TEST(get<0>(t6) == 12); - BOOST_TEST(get<1>(t6) > 5.4f && get<1>(t6) < 5.6f); - - tuple t7(t6); - BOOST_TEST(get<0>(t7) == 12); - BOOST_TEST(get<1>(t7) > 5.4f && get<1>(t7) < 5.6f); - - tuple t8(t6); - BOOST_TEST(get<0>(t8) == 12); - BOOST_TEST(get<1>(t8) > 5.4f && get<1>(t8) < 5.6f); - - dummy - ( - tuple( - std::string("Jaba"), // ok, since the default - std::string("Daba"), // constructor is not used - std::string("Doo") - ) - ); - - dummy(tuple()); - dummy(tuple(1,3.14)); - -// dummy(tuple()); // should fail, no defaults for references -// dummy(tuple()); // likewise - - { // JDG 10-21-2003: previously not availiable without - // partial template specialization. Now OK with VC6/7 - - double dd = 5; - dummy(tuple(dd)); // ok - dummy(tuple(dd+3.14)); // ok, but dangerous - } - -// dummy(tuple(dd+3.14)); // should fail, -// // temporary to non-const reference - return boost::report_errors(); -} diff --git a/fusion/test/tuple_copy_tests.cpp b/fusion/test/tuple_copy_tests.cpp deleted file mode 100644 index 0653ede75..000000000 --- a/fusion/test/tuple_copy_tests.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include - -namespace -{ - // classes with different kinds of conversions - class AA {}; - class BB : public AA {}; - struct CC { CC() {} CC(const BB&) {} }; - struct DD { operator CC() const { return CC(); }; }; -} - -int -main() -{ - using namespace boost::fusion; - - tuple t1(4, 'a'); - tuple t2(5, 'b'); - t2 = t1; - BOOST_TEST(get<0>(t1) == get<0>(t2)); - BOOST_TEST(get<1>(t1) == get<1>(t2)); - - tuple t3(2, "a"); - t3 = t1; - BOOST_TEST((double)get<0>(t1) == get<0>(t3)); - BOOST_TEST(get<1>(t1) == get<1>(t3)[0]); - - // testing copy and assignment with implicit conversions - // between elements testing tie - - tuple t; - tuple a(t); - a = t; - - int i; char c; double d; - tuple(i, c, d) = tuple(1, 'a', 5.5); - - BOOST_TEST(i==1); - BOOST_TEST(c=='a'); - BOOST_TEST(d>5.4 && d<5.6); - - return boost::report_errors(); -} diff --git a/fusion/test/tuple_element_access_tests.cpp b/fusion/test/tuple_element_access_tests.cpp deleted file mode 100644 index 8cb3cd8c7..000000000 --- a/fusion/test/tuple_element_access_tests.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include - -namespace -{ - // something to prevent warnings for unused variables - template void dummy(const T&) {} - - class A {}; -} - -int -main() -{ - using namespace boost::fusion; - - // JDG 10-21-2003: previously not availiable without - // partial template specialization. Now OK with VC6/7 - - double d = 2.7; - A a; - tuple t(1, d, a, 2); - const tuple ct(t); - - int i = get<0>(t); - int i2 = get<3>(t); - - BOOST_TEST(i == 1 && i2 == 2); - - int j = get<0>(ct); - BOOST_TEST(j == 1); - - get<0>(t) = 5; - BOOST_TEST(get<0>(t) == 5); - -// get<0>(ct) = 5; // can't assign to const - - double e = get<1>(t); - BOOST_TEST(e > 2.69 && e < 2.71); - - get<1>(t) = 3.14+i; - BOOST_TEST(get<1>(t) > 4.13 && get<1>(t) < 4.15); - -// get<4>(t) = A(); // can't assign to const -// dummy(get<5>(ct)); // illegal index - - ++get<0>(t); - BOOST_TEST(get<0>(t) == 6); - - BOOST_STATIC_ASSERT(!( - boost::is_const >::type>::value)); - - // constness should not affect - BOOST_STATIC_ASSERT(!( - boost::is_const >::type>::value)); - - BOOST_STATIC_ASSERT(!( - boost::is_const >::type>::value)); - - // constness should not affect - BOOST_STATIC_ASSERT(!( - boost::is_const >::type>::value)); - - dummy(i); dummy(i2); dummy(j); dummy(e); // avoid warns for unused variables - - return boost::report_errors(); -} diff --git a/fusion/test/tuple_iterator_tests.cpp b/fusion/test/tuple_iterator_tests.cpp deleted file mode 100644 index 2dc621fb9..000000000 --- a/fusion/test/tuple_iterator_tests.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include - -int -main() -{ - using namespace boost::fusion; - using namespace boost; - -/// Testing the tuple_iterator - - { // testing deref, next, prior, begin, end - - char const* s = "Hello"; - typedef tuple tuple_type; - tuple_type t(1, 'x', 3.3, s); - tuple_iterator<0, tuple_type> i(t); - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) - // ?%$# VC6 I don't know why this is needed! $$$LOOK$$$ - //This is no longer needed... - //next(i); -#endif - - BOOST_TEST(*i == 1); - BOOST_TEST(*next(i) == 'x'); - BOOST_TEST(*next(next(i)) == 3.3); - BOOST_TEST(*next(next(next(i))) == s); - - next(next(next(next(i)))); // end - -#ifdef FUSION_TEST_COMPILE_FAIL - next(next(next(next(next(i))))); // past the end: must not compile -#endif - - BOOST_TEST(*prior(next(next(next(i)))) == 3.3); - BOOST_TEST(*prior(prior(next(next(next(i))))) == 'x'); - BOOST_TEST(*prior(prior(prior(next(next(next(i)))))) == 1); - - BOOST_TEST(*begin(t) == 1); - BOOST_TEST(*prior(end(t)) == s); - - *i = 3; - BOOST_TEST(*i == 3); - BOOST_TEST(*i == get<0>(t)); - } - - { // Testing const tuple and const tuple_iterator - - char const* s = "Hello"; - typedef tuple const tuple_type; - tuple_type t(1, 'x', 3.3, s); - tuple_iterator<0, tuple_type> i(t); - - BOOST_TEST(*i == 1); - BOOST_TEST(*next(i) == 'x'); - BOOST_TEST(*begin(t) == 1); - BOOST_TEST(*prior(end(t)) == s); - -#ifdef FUSION_TEST_COMPILE_FAIL - *i = 3; // must not compile -#endif - } - - { // Testing tuple equality - - typedef tuple tuple_type; - typedef tuple_iterator<0, tuple_type> ti1; - typedef tuple_iterator<0, tuple_type const> ti2; - BOOST_STATIC_ASSERT((meta::equal_to::value)); - BOOST_STATIC_ASSERT((meta::equal_to::value)); - BOOST_STATIC_ASSERT((meta::equal_to::value)); - BOOST_STATIC_ASSERT((meta::equal_to::value)); - BOOST_STATIC_ASSERT((meta::equal_to::value)); - BOOST_STATIC_ASSERT((meta::equal_to::value)); - } -// -// { // Testing distance -// -// typedef tuple tuple_type; -// tuple_type t(1, 'x', 3.3, "Hello"); -// -// BOOST_STATIC_ASSERT((result_of_distance< -// tuple_iterator<0, tuple_type> -// , tuple_iterator<4, tuple_type> >::type::value == 4)); -// -// BOOST_TEST(distance(begin(t), end(t)).value == 4); -// } -// -// { // Testing advance -// -// typedef tuple tuple_type; -// tuple_type t(1, 'x', 3.3, "Hello"); -// -// BOOST_TEST(*advance<0>(begin(t)) == get<0>(t)); -// BOOST_TEST(*advance<1>(begin(t)) == get<1>(t)); -// BOOST_TEST(*advance<2>(begin(t)) == get<2>(t)); -// BOOST_TEST(*advance<3>(begin(t)) == get<3>(t)); -// -// BOOST_TEST(*advance<-1>(end(t)) == get<3>(t)); -// BOOST_TEST(*advance<-2>(end(t)) == get<2>(t)); -// BOOST_TEST(*advance<-3>(end(t)) == get<1>(t)); -// BOOST_TEST(*advance<-4>(end(t)) == get<0>(t)); -// -// BOOST_TEST(&*advance<0>(begin(t)) == &get<0>(t)); -// BOOST_TEST(&*advance<1>(begin(t)) == &get<1>(t)); -// BOOST_TEST(&*advance<2>(begin(t)) == &get<2>(t)); -// BOOST_TEST(&*advance<3>(begin(t)) == &get<3>(t)); -// } -// - -#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -// #$%&@ Borland IS SO DUMB!!! #$%&@ - { - typedef tuple tuple_type; - typedef meta::begin::type begin_type; - typedef meta::end::type end_type; - typedef meta::next::type i1; - typedef meta::next::type i2; - - BOOST_STATIC_ASSERT((is_same::value)); - } -#endif - - { // Testing constructing tuples from iterators - - tuple t1(1, 'x', 3.3); - - tuple t2(begin(t1)); - BOOST_TEST(get<0>(t2) == get<0>(t1)); - BOOST_TEST(get<1>(t2) == get<1>(t1)); - BOOST_TEST(get<2>(t2) == get<2>(t1)); - - tuple t3(next(begin(t1))); - BOOST_TEST(get<0>(t3) == get<1>(t1)); - BOOST_TEST(get<1>(t3) == get<2>(t1)); - - tuple t4(prior(end(t1))); - BOOST_TEST(get<0>(t4) == get<2>(t1)); - - tuple t5; - tuple t6(begin(t5)); - (void)t6; - } - - { // Testing tuple iterator value, reference, pointer, is_readable, - // is_writable, meta::deref, result_of_get_pointer - - typedef tuple tuple_type; - typedef tuple_iterator<0, tuple_type> i0; - typedef tuple_iterator<1, tuple_type> i1; - typedef tuple_iterator<1, tuple_type const> i2; - - BOOST_STATIC_ASSERT(( - is_same::type, int>::value)); - - BOOST_STATIC_ASSERT(( - is_same::type, char&>::value)); - -// BOOST_STATIC_ASSERT(( -// is_same::type, random_access_traversal_tag>::value)); -// -// BOOST_STATIC_ASSERT(is_readable::value); -// BOOST_STATIC_ASSERT(is_writable::value); -// BOOST_STATIC_ASSERT(is_readable::value); -// BOOST_STATIC_ASSERT(!is_writable::value); - - BOOST_STATIC_ASSERT((is_same::type, int&>::value)); - BOOST_STATIC_ASSERT((is_same::type, char&>::value)); - -// BOOST_STATIC_ASSERT((is_same::type, int*>::value)); -// BOOST_STATIC_ASSERT((is_same::type, char*>::value)); -// -// BOOST_STATIC_ASSERT((is_same::type, int>::value)); -// BOOST_STATIC_ASSERT((is_same::type, char&>::value)); -// -// BOOST_STATIC_ASSERT((is_same::type, int&>::value)); -// BOOST_STATIC_ASSERT((is_same::type, char&>::value)); -// -// BOOST_STATIC_ASSERT((is_same::type, int*>::value)); -// BOOST_STATIC_ASSERT((is_same::type, char*>::value)); - } - - return boost::report_errors(); -} - diff --git a/fusion/test/tuple_mutate_tests.cpp b/fusion/test/tuple_mutate_tests.cpp deleted file mode 100644 index ecccb2764..000000000 --- a/fusion/test/tuple_mutate_tests.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (C) 1999-2003 Jaakko Järvi - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include - -namespace -{ - // no public default constructor - class foo - { - public: - - explicit foo(int v) : val(v) {} - - bool operator==(const foo& other) const - { - return val == other.val; - } - - private: - - foo() {} - int val; - }; -} - -int -main() -{ - using namespace boost::fusion; - - tuple t1(5, 12.2f, true, foo(4)); - get<0>(t1) = 6; - get<1>(t1) = 2.2f; - get<2>(t1) = false; - get<3>(t1) = foo(5); - - BOOST_TEST(get<0>(t1) == 6); - BOOST_TEST(get<1>(t1) > 2.1f && get<1>(t1) < 2.3f); - BOOST_TEST(get<2>(t1) == false); - BOOST_TEST(get<3>(t1) == foo(5)); - - return boost::report_errors(); -} diff --git a/fusion/test/type_sequence_tests.cpp b/fusion/test/type_sequence_tests.cpp deleted file mode 100644 index 066954e88..000000000 --- a/fusion/test/type_sequence_tests.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include -#include -#include -#include -#include -#include -#include - -struct X -{ - operator char const*() const - { - return ""; - } -}; - -int -main() -{ - using namespace boost::fusion; - using boost::mpl::vector_c; - using boost::mpl::int_; - using boost::mpl::list; - namespace mpl = boost::mpl; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - -/// Testing type_sequence - - { - typedef list mpl_list1; - typedef mpl::begin::type begin_type; - typedef mpl::end::type end_type; - typedef tuple tuple_type; - - type_sequence_iterator iter; - tuple_type t1(iter); - std::cout << t1 << std::endl; - - BOOST_TEST(t1 == tuple_type()); - } - - { - typedef list mpl_list1; - type_sequence view; - std::cout << generate(view) << std::endl; - - BOOST_TEST((generate(view) == tuple())); - } - - { // MPL constant integer vector - - typedef vector_c mpl_vec; - type_sequence view; - std::cout << generate(view) << std::endl; - - BOOST_TEST((generate(view) == - tuple< - int_<1> - , int_<2> - , int_<3> - , int_<4> - , int_<5> >())); - } - -#ifdef FUSION_COMFORMING_COMPILER - - { // Direct MPL sequence operations - - typedef vector_c mpl_vec; - std::cout << generate(mpl_vec()) << std::endl; - - tuple< - int_<1> - , int_<2> - , int_<3> - , int_<4> - , int_<5> > - expected; - - BOOST_TEST((generate(mpl_vec()) == expected)); - BOOST_TEST((mpl_vec() == expected)); - BOOST_TEST((expected == mpl_vec())); - - boost::fusion::begin(mpl_vec()); // compile check only - boost::fusion::end(mpl_vec()); // compile check only - - { // Testing a VC7.1 bug (see note on deref.hpp) - - typedef vector_c v1_type; - v1_type v1; - int i = *boost::fusion::begin(v1); - (void)i; - } - } - -#endif - - return boost::report_errors(); -} - diff --git a/fusion/test/vc6_bug_001.cpp b/fusion/test/vc6_bug_001.cpp deleted file mode 100644 index facfe5aeb..000000000 --- a/fusion/test/vc6_bug_001.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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 -#include -#include - -struct nontrivial -{ - ~nontrivial() {} -}; - -int -main() -{ - using namespace boost::fusion; - - tuple t1(4, 'a'); - get<1>(t1); - - nontrivial nt; - tuple t3(nt); - return boost::report_errors(); -} - diff --git a/include/boost/spirit/fusion/algorithm/any.hpp b/include/boost/spirit/fusion/algorithm/any.hpp deleted file mode 100755 index 0a13d236c..000000000 --- a/include/boost/spirit/fusion/algorithm/any.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_ANY_HPP) -#define FUSION_ALGORITHM_ANY_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct any - { - typedef bool type; - }; - } - - namespace function - { - struct any - { - template - struct apply - { - typedef bool type; - }; - - template - inline bool - operator()(Sequence const& seq, F const& f) const - { - return detail::any( - fusion::begin(seq) - , fusion::end(seq) - , f - , meta::equal_to< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type>()); - } - - template - inline bool - operator()(Sequence& seq, F const& f) const - { - return detail::any( - fusion::begin(seq) - , fusion::end(seq) - , f - , meta::equal_to< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type>()); - } - }; - } - - function::any const any = function::any(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/detail/any.ipp b/include/boost/spirit/fusion/algorithm/detail/any.ipp deleted file mode 100755 index 5da0dfaf5..000000000 --- a/include/boost/spirit/fusion/algorithm/detail/any.ipp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_DETAIL_ANY_IPP) -#define FUSION_ALGORITHM_DETAIL_ANY_IPP - -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - inline bool - any(First const&, Last const&, F const&, mpl::true_) - { - return false; - } - - template - inline bool - any(First const& first, Last const& last, F const& f, mpl::false_) - { - if(f(*first)) - return true; - return detail::any(fusion::next(first), last, f - , meta::equal_to::type, Last>()); - } -}}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/detail/find_if.ipp b/include/boost/spirit/fusion/algorithm/detail/find_if.ipp deleted file mode 100644 index 930da51a9..000000000 --- a/include/boost/spirit/fusion/algorithm/detail/find_if.ipp +++ /dev/null @@ -1,118 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_DETAIL_FIND_IF_HPP) -#define FUSION_ALGORITHM_DETAIL_FIND_IF_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - struct apply_filter - { - typedef typename - mpl::apply1< - Pred - , typename meta::value_of::type - >::type - type; - }; - - template - struct main_find_if; - - template - struct recursive_find_if - { - typedef typename - main_find_if< - typename meta::next::type, Last, Pred - >::type - type; - }; - - template - struct main_find_if - { - typedef mpl::or_< - meta::equal_to - , apply_filter > - filter; - - typedef typename - mpl::eval_if< - filter - , mpl::identity - , recursive_find_if - >::type - type; - }; - - template - struct static_find_if; - - namespace static_find_if_detail { - template - typename main_find_if::type>::type - call(static_find_if const& obj,Iterator const& iter); - } - - template - struct static_find_if - { - typedef typename - main_find_if< - First - , Last - , typename mpl::lambda::type - >::type - type; - - //Workaround to please MSVC - template - static type - call(Iterator const& iter) - { - return static_find_if_detail::call(static_find_if(),iter); - } - }; - - namespace static_find_if_detail { - template - typename static_find_if::type - call(static_find_if const&, Iterator const& iter, mpl::true_) - { - return iter; - }; - - template - typename static_find_if::type - call(static_find_if const& obj,Iterator const& iter, mpl::false_) - { - return call(obj,fusion::next(iter)); - }; - - template - typename main_find_if::type>::type - call(static_find_if const& obj,Iterator const& iter) - { - typedef meta::equal_to::type> found; - return call(obj,iter, found()); - }; - } - -}}} - -#endif diff --git a/include/boost/spirit/fusion/algorithm/detail/fold.ipp b/include/boost/spirit/fusion/algorithm/detail/fold.ipp deleted file mode 100644 index 93580421e..000000000 --- a/include/boost/spirit/fusion/algorithm/detail/fold.ipp +++ /dev/null @@ -1,88 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_DETAIL_FOLD_IPP) -#define FUSION_ALGORITHM_DETAIL_FOLD_IPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - struct fold_apply - { - typedef typename fusion_apply2::type, State - >::type type; - }; - - template - struct static_fold; - - template - struct next_result_of_fold - { - typedef typename - static_fold< - typename meta::next::type - , Last - , typename fold_apply::type - , F - >::type - type; - }; - - template - struct static_fold - { - typedef typename - mpl::if_< - is_same - , mpl::identity - , next_result_of_fold - >::type - result; - - typedef typename result::type type; - }; - - // terminal case - template - inline State const& - fold(First const&, Last const&, State const& state, F const&, mpl::true_) - { - return state; - } - - // non-terminal case - template - inline typename static_fold::type - fold( - First const& first - , Last const& last - , State const& state - , F const& f - , mpl::false_) - { - return detail::fold( - fusion::next(first) - , last - , f(*first, state) - , f - , is_same::type, Last>() - ); - } -}}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/detail/for_each.ipp b/include/boost/spirit/fusion/algorithm/detail/for_each.ipp deleted file mode 100644 index 19a7561ca..000000000 --- a/include/boost/spirit/fusion/algorithm/detail/for_each.ipp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_DETAIL_FOR_EACH_IPP) -#define FUSION_ALGORITHM_DETAIL_FOR_EACH_IPP - -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - inline void - for_each(First const&, Last const&, F const&, mpl::true_) - { - } - - template - inline void - for_each(First const& first, Last const& last, F const& f, mpl::false_) - { - f(*first); - detail::for_each(fusion::next(first), last, f - , meta::equal_to::type, Last>()); - } -}}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/erase.hpp b/include/boost/spirit/fusion/algorithm/erase.hpp deleted file mode 100644 index b8558bdf0..000000000 --- a/include/boost/spirit/fusion/algorithm/erase.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_ERASE_HPP) -#define FUSION_ALGORITHM_ERASE_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct erase - { - typedef typename meta::begin::type first_type; - typedef typename meta::end::type last_type; -#if! BOOST_WORKAROUND(BOOST_MSVC,<=1300) - BOOST_STATIC_ASSERT((!meta::equal_to::value)); -#endif - - typedef typename meta::next::type next_type; - typedef range left_type; - typedef range right_type; - typedef joint_view type; - }; - } - - namespace function - { - struct erase - { - template - struct apply : meta::erase {}; - - template - typename apply::type - operator()(Sequence const& seq, Position const& pos) const - { - typedef apply meta_type; - typedef typename meta_type::left_type left_type; - typedef typename meta_type::right_type right_type; - typedef typename meta_type::type result_type; - - left_type left(fusion::begin(seq), pos); - right_type right(fusion::next(pos), fusion::end(seq)); - return result_type(left, right); - } - -// template -// typename apply::type -// operator()(Sequence& seq, Position const& pos) const -// { -// typedef apply meta; -// typedef typename meta::left_type left_type; -// typedef typename meta::right_type right_type; -// typedef typename meta::type result_type; -// -// left_type left(fusion::begin(seq), pos); -// right_type right(fusion::next(pos), fusion::end(seq)); -// return result_type(left, right); -// } - }; - } - - function::erase const erase = function::erase(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/filter.hpp b/include/boost/spirit/fusion/algorithm/filter.hpp deleted file mode 100644 index cf1faeefa..000000000 --- a/include/boost/spirit/fusion/algorithm/filter.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_FILTER_HPP) -#define FUSION_ALGORITHM_FILTER_HPP - -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct filter - { - typedef filter_view type; - }; - } - - namespace function - { - struct filter - { - template - struct apply : meta::filter {}; - - template - typename apply::type - operator()(Sequence const& seq, Pred) const - { - return filter_view(seq); - } - - template - typename apply::type - operator()(Sequence& seq, Pred) const - { - return filter_view(seq); - } - }; - } - - function::filter const filter = function::filter(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/find.hpp b/include/boost/spirit/fusion/algorithm/find.hpp deleted file mode 100644 index a95cd3e9c..000000000 --- a/include/boost/spirit/fusion/algorithm/find.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_FIND_HPP) -#define FUSION_ALGORITHM_FIND_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct find - { - typedef typename - detail::static_find_if< - typename meta::begin::type - , typename meta::end::type - , is_same - >::type - type; - }; - } - - namespace function - { - struct find - { - template - struct apply : meta::find {}; - - template - typename apply::type - operator()(Sequence const& seq, T) const - { - typedef - detail::static_find_if< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type - , is_same - > - filter; - - return filter::call(fusion::begin(seq)); - } - - template - typename apply::type - operator()(Sequence& seq, T) const - { - typedef - detail::static_find_if< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type - , is_same - > - filter; - - return filter::call(fusion::begin(seq)); - } - }; - } - - function::find const find = function::find(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/find_if.hpp b/include/boost/spirit/fusion/algorithm/find_if.hpp deleted file mode 100644 index e134a8c2c..000000000 --- a/include/boost/spirit/fusion/algorithm/find_if.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_FIND_IF_HPP) -#define FUSION_ALGORITHM_FIND_IF_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct find_if - { - typedef typename - detail::static_find_if< - typename meta::begin::type - , typename meta::end::type - , Pred - >::type - type; - }; - } - - namespace function - { - struct find_if - { - template - struct apply : meta::find_if {}; - - template - inline typename apply::type - operator()(Sequence const& seq, Pred) const - { - typedef - detail::static_find_if< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type - , Pred - > - filter; - - return filter::call(fusion::begin(seq)); - } - - template - inline typename apply::type - operator()(Sequence& seq, Pred) const - { - typedef - detail::static_find_if< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type - , Pred - > - filter; - - return filter::call(fusion::begin(seq)); - } - }; - } - - function::find_if const find_if = function::find_if(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/fold.hpp b/include/boost/spirit/fusion/algorithm/fold.hpp deleted file mode 100644 index 59bb0b877..000000000 --- a/include/boost/spirit/fusion/algorithm/fold.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_FOLD_HPP) -#define FUSION_ALGORITHM_FOLD_HPP - -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct fold - { - typedef typename - detail::static_fold< - typename meta::begin::type - , typename meta::end::type - , State - , F - >::type - type; - }; - } - - namespace function - { - struct fold - { - template - struct apply : meta::fold {}; - - template - inline typename apply::type - operator()(Sequence const& seq, State const& state, F const& f) const - { - return detail::fold( - fusion::begin(seq) - , fusion::end(seq) - , state - , f - , is_same< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type>() - ); - } - - template - inline typename apply::type - operator()(Sequence& seq, State const& state, F const& f) const - { - return detail::fold( - fusion::begin(seq) - , fusion::end(seq) - , state - , f - , is_same< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type>() - ); - } - }; - } - - function::fold const fold = function::fold(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/for_each.hpp b/include/boost/spirit/fusion/algorithm/for_each.hpp deleted file mode 100644 index a8b7aa796..000000000 --- a/include/boost/spirit/fusion/algorithm/for_each.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_FOR_EACH_HPP) -#define FUSION_ALGORITHM_FOR_EACH_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct for_each - { - typedef void type; - }; - } - - namespace function - { - struct for_each - { - template - struct apply - { - typedef void type; - }; - - template - inline void - operator()(Sequence const& seq, F const& f) const - { - detail::for_each( - fusion::begin(seq) - , fusion::end(seq) - , f - , meta::equal_to< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type>()); - } - - template - inline void - operator()(Sequence& seq, F const& f) const - { - detail::for_each( - fusion::begin(seq) - , fusion::end(seq) - , f - , meta::equal_to< - BOOST_DEDUCED_TYPENAME meta::begin::type - , BOOST_DEDUCED_TYPENAME meta::end::type>()); - } - }; - } - - function::for_each const for_each = function::for_each(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/insert.hpp b/include/boost/spirit/fusion/algorithm/insert.hpp deleted file mode 100644 index 4deff9304..000000000 --- a/include/boost/spirit/fusion/algorithm/insert.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_INSERT_HPP) -#define FUSION_ALGORITHM_INSERT_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct insert - { - typedef typename meta::begin::type first_type; - typedef typename meta::end::type last_type; - - typedef const single_view insert_type; - typedef range left_type; - typedef range right_type; - typedef joint_view left_insert_type; - typedef joint_view type; - }; - } - - namespace function - { - struct insert - { - template - struct apply : meta::insert {}; - - template - inline typename apply::type - operator()(Sequence const& seq, Position const& pos, T const& x) const - { - typedef apply meta; - typedef typename meta::left_type left_type; - typedef typename meta::right_type right_type; - typedef typename meta::left_insert_type left_insert_type; - typedef typename meta::insert_type insert_type; - typedef typename meta::type result; - - left_type left(fusion::begin(seq), pos); - right_type right(pos, fusion::end(seq)); - insert_type ins(x); - left_insert_type left_insert(left, ins); - return result(left_insert, right); - } - - template - inline typename apply::type - operator()(Sequence& seq, Position const& pos, T const& x) const - { - typedef apply meta_type; - typedef typename meta_type::left_type left_type; - typedef typename meta_type::right_type right_type; - typedef typename meta_type::left_insert_type left_insert_type; - typedef typename meta_type::insert_type insert_type; - typedef typename meta_type::type result; - - left_type left(fusion::begin(seq), pos); - right_type right(pos, fusion::end(seq)); - insert_type ins(x); - left_insert_type left_insert(left, ins); - return result(left_insert, right); - } - }; - } - - function::insert const insert = function::insert(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/push_back.hpp b/include/boost/spirit/fusion/algorithm/push_back.hpp deleted file mode 100644 index 92efff45a..000000000 --- a/include/boost/spirit/fusion/algorithm/push_back.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_PUSH_BACK_HPP) -#define FUSION_ALGORITHM_PUSH_BACK_HPP - -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct push_back - { - typedef append_view type; - }; - } - - namespace function - { - struct push_back - { - template - struct apply : meta::push_back {}; - - template - inline typename apply::type - operator()(Sequence const& seq, T const& x) const - { - typedef append_view result; - return result(seq, x); - } - - template - inline typename apply::type - operator()(Sequence& seq, T const& x) const - { - typedef append_view result; - return result(seq, x); - } - }; - } - - function::push_back const push_back = function::push_back(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/push_front.hpp b/include/boost/spirit/fusion/algorithm/push_front.hpp deleted file mode 100644 index 08e9dcf47..000000000 --- a/include/boost/spirit/fusion/algorithm/push_front.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_PUSH_FRONT_HPP) -#define FUSION_ALGORITHM_PUSH_FRONT_HPP - -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct push_front - { - typedef prepend_view type; - }; - } - - namespace function - { - struct push_front - { - template - struct apply : meta::push_front {}; - - template - inline typename apply::type - operator()(Sequence const& seq, T const& x) const - { - typedef prepend_view result; - return result(seq, x); - } - - template - inline typename apply::type - operator()(Sequence& seq, T const& x) const - { - typedef prepend_view result; - return result(seq, x); - } - }; - } - - function::push_front const push_front = function::push_front(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/remove.hpp b/include/boost/spirit/fusion/algorithm/remove.hpp deleted file mode 100644 index f01082c13..000000000 --- a/include/boost/spirit/fusion/algorithm/remove.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_REMOVE_HPP) -#define FUSION_ALGORITHM_REMOVE_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct remove - { - typedef filter_view > > type; - }; - } - - namespace function - { - struct remove - { - template - struct apply : meta::remove {}; - - template - inline filter_view< - Sequence const - , mpl::not_ > > - operator()(Sequence const& seq, T) const - { - return filter_view< - Sequence const - , mpl::not_ - > >(seq); - } - - template - inline filter_view< - Sequence - , mpl::not_ > > - operator()(Sequence& seq, T) const - { - return filter_view< - Sequence - , mpl::not_ - > >(seq); - } - }; - } - - function::remove const remove = function::remove(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/remove_if.hpp b/include/boost/spirit/fusion/algorithm/remove_if.hpp deleted file mode 100644 index 211d88674..000000000 --- a/include/boost/spirit/fusion/algorithm/remove_if.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_REMOVE_IF_HPP) -#define FUSION_ALGORITHM_REMOVE_IF_HPP - -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct remove_if - { - typedef filter_view > type; - }; - } - - namespace function - { - struct remove_if - { - template - struct apply : meta::remove_if {}; - - template - inline typename apply::type - operator()(Sequence const& seq, Pred) const - { - return filter_view >(seq); - } - - template - inline typename apply::type - operator()(Sequence& seq, Pred) const - { - return filter_view >(seq); - } - }; - } - - function::remove_if const remove_if = function::remove_if(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/replace.hpp b/include/boost/spirit/fusion/algorithm/replace.hpp deleted file mode 100644 index bb4610f26..000000000 --- a/include/boost/spirit/fusion/algorithm/replace.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_REPLACE_HPP) -#define FUSION_ALGORITHM_REPLACE_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct replace - { - typedef typename meta::begin::type first_type; - typedef typename meta::end::type last_type; - typedef typename meta::next::type next_type; -#if! BOOST_WORKAROUND(BOOST_MSVC,<=1300) - BOOST_STATIC_ASSERT((!meta::equal_to::value)); -#endif - typedef const single_view insert_type; - typedef range left_type; - typedef range right_type; - typedef joint_view left_replace_type; - typedef joint_view type; - }; - } - - namespace function - { - struct replace - { - template - struct apply : meta::replace {}; - - template - typename apply::type - operator()(Sequence const& seq, Position const& pos, T const& x) const - { - typedef apply replacer; - - typedef typename replacer::left_type left_type; - typedef typename replacer::right_type right_type; - typedef typename replacer::left_replace_type left_replace_type; - typedef typename replacer::insert_type insert_type; - typedef typename replacer::type result; - - left_type left(fusion::begin(seq), pos); - right_type right(fusion::next(pos), fusion::end(seq)); - insert_type ins(x); - left_replace_type left_replace(left, ins); - return result(left_replace, right); - } - - template - typename apply::type - operator()(Sequence& seq, Position const& pos, T const& x) const - { - typedef apply replacer; - - typedef typename replacer::left_type left_type; - typedef typename replacer::right_type right_type; - typedef typename replacer::left_replace_type left_replace_type; - typedef typename replacer::insert_type insert_type; - typedef typename replacer::type result; - - left_type left(fusion::begin(seq), pos); - right_type right(fusion::next(pos), fusion::end(seq)); - insert_type ins(x); - left_replace_type left_replace(left, ins); - return result(left_replace, right); - } - }; - } - - function::replace const replace = function::replace(); -}} - -#endif - diff --git a/include/boost/spirit/fusion/algorithm/transform.hpp b/include/boost/spirit/fusion/algorithm/transform.hpp deleted file mode 100644 index b5c5c5fcc..000000000 --- a/include/boost/spirit/fusion/algorithm/transform.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ALGORITHM_TRANSFORM_HPP) -#define FUSION_ALGORITHM_TRANSFORM_HPP - -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct transform - { - typedef transform_view type; - }; - } - - namespace function - { - struct transform - { - template - struct apply : meta::transform {}; - - template - typename apply::type - operator()(Sequence const& seq, F const& f) const - { - return transform_view(seq, f); - } - - template - typename apply::type - operator()(Sequence& seq, F const& f) const - { - return transform_view(seq, f); - } - }; - } - - function::transform const transform = function::transform(); - -}} - -#endif - diff --git a/include/boost/spirit/fusion/detail/access.hpp b/include/boost/spirit/fusion/detail/access.hpp deleted file mode 100644 index 4b3561d5e..000000000 --- a/include/boost/spirit/fusion/detail/access.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_DETAIL_ACCESS_HPP) -#define FUSION_DETAIL_ACCESS_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - struct ref_result - { - typedef typename add_reference::type type; - }; - - template - struct cref_result - { - typedef typename add_reference< - typename add_const::type - >::type type; - }; - - template - struct non_ref_parameter - { - typedef typename boost::remove_cv::type const& type; - }; - - template - struct call_param - { - typedef - typename mpl::eval_if< - is_reference - , mpl::identity - , non_ref_parameter - >::type - type; - }; -}}} - -#endif - diff --git a/include/boost/spirit/fusion/detail/config.hpp b/include/boost/spirit/fusion/detail/config.hpp deleted file mode 100644 index 011372910..000000000 --- a/include/boost/spirit/fusion/detail/config.hpp +++ /dev/null @@ -1,442 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_DETAIL_CONFIG_HPP) -#define FUSION_DETAIL_CONFIG_HPP - -#include -#include -#include -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -#include -#endif - -#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1310)) \ - || (defined(__BORLANDC__) && (__BORLANDC__ <= 0x570)) \ - || (defined(__GNUC__) && (__GNUC__ < 3)) \ - || (defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ < 1)) -#else -# define FUSION_COMFORMING_COMPILER -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// BOOST_NO_TEMPLATED_STREAMS macro. This ought to be in boost.config -// -/////////////////////////////////////////////////////////////////////////////// -#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ <= 97 -#define BOOST_NO_TEMPLATED_STREAMS -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Before including MPL, we define these dummy template functions. Borland -// complains when a template class has the same name as a template function, -// regardless if they are in different namespaces. This is a workaround to -// this Borland quirk. -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -namespace boost { namespace fusion { namespace borland_only { - - template void begin(T) {} - template void end(T) {} - template void next(T) {} - template void prior(T) {} - template void find(T) {} - template void find_if(T) {} - -}}} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// MSVC, even with VC7.1 has problems with returning a default constructed -// value of a given type: return type(); This only happens on debug builds. -// It seems to be a return value optimization bug. -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1301) && !defined(NDEBUG) -# define FUSION_RETURN_DEFAULT_CONSTRUCTED type r=type(); return r -#else -# define FUSION_RETURN_DEFAULT_CONSTRUCTED return type() -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Borland does not like the T::value syntax. Instead, we use a metafunction -// get_value::value. The explicit qualification (::boost::fusion::detail::) -// also makes Borland happy. -// -// VC6/7 on the other hand chokes with ETI (early instantiation bug). So we -// forward the call to get_value::value and fix the ETI bug there (see -// get_value below). -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) \ - || BOOST_WORKAROUND(BOOST_MSVC, < 1300) -namespace boost { namespace fusion { namespace detail -{ - template - struct get_value - { - BOOST_STATIC_CONSTANT(int, value = T::value); - }; - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - - // VC6 ETI (early template instantiation) bug workaround. - template <> - struct get_value - { - BOOST_STATIC_CONSTANT(int, value = 0); - }; -#endif -}}} -#endif - -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) \ - || BOOST_WORKAROUND(BOOST_MSVC, < 1300) -# define FUSION_GET_VALUE(T) ::boost::fusion::detail::get_value::value -#else -# define FUSION_GET_VALUE(T) T::value -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Borland does not like returning a const reference from a tuple member. -// We do the cast explicitly. -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -# define FUSION_RETURN_TUPLE_MEMBER(n) \ - typedef typename tuple_access_result::type type; \ - return type(t.BOOST_PP_CAT(m, n)) -#else -# define FUSION_RETURN_TUPLE_MEMBER(n) \ - return t.BOOST_PP_CAT(m, n) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// See get.hpp. In function get(t), mpl::int_* = 0 is a function -// parameter that defaults to 0. This is a hack to make VC6 happy, otherwise, -// VC6 will return the wrong result from a wrong index! -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# define FUSION_GET_MSVC_WORKAROUND , mpl::int_* = 0 -#else -# define FUSION_GET_MSVC_WORKAROUND -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// FUSION_MSVC_ETI_WRAPPER (VC6 and VC7) -// -// VC6/VC7 chokes with ETI (early instantiation bug) with typename T::name. -// So, we forward the call to get_name::type and fix the ETI bug. -// -/////////////////////////////////////////////////////////////////////////////// - -// VC6 ETI (early template instantiation) bug workaround. -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -#define FUSION_MSVC_ETI_WRAPPER(name) \ -namespace boost { namespace fusion { namespace detail \ -{ \ - template \ - struct BOOST_PP_CAT(get_, name) \ - { \ - typedef typename T::name type; \ - }; \ - \ - template <> \ - struct BOOST_PP_CAT(get_, name) \ - { \ - typedef int type; \ - }; \ -}}} -#endif -/* -// is_msvc_70_ETI_arg: Detect a VC7 ETI arg -#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) -namespace boost { namespace fusion { namespace detail -{ - struct int_convertible_ - { - int_convertible_(int); - }; - - template< typename T > - struct is_msvc_70_ETI_arg - { - typedef char (&no_tag)[1]; - typedef char (&yes_tag)[2]; - - static no_tag test(...); - static yes_tag test(int_convertible_); - static T get(); - - BOOST_STATIC_CONSTANT(bool, value = - sizeof(test(get())) == sizeof(yes_tag) - ); - }; -}}} -#endif - -// VC7 ETI (early template instantiation) bug workaround. -#if BOOST_WORKAROUND(BOOST_MSVC, == 1300) -#define FUSION_MSVC_ETI_WRAPPER(name) \ -namespace boost { namespace fusion { namespace detail \ -{ \ - template \ - struct BOOST_PP_CAT(get_impl_, name) \ - { \ - template \ - struct result \ - { \ - typedef int type; \ - }; \ - }; \ - \ - struct BOOST_PP_CAT(get_impl_, name) \ - { \ - template \ - struct result \ - { \ - typedef typename T::name type; \ - }; \ - }; \ - \ - template \ - struct BOOST_PP_CAT(get_, name) \ - : BOOST_PP_CAT(get_impl_, name)::value> \ - ::template result {}; \ -}}} -#endif -*/ -/////////////////////////////////////////////////////////////////////////////// -// -// T::tag wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -FUSION_MSVC_ETI_WRAPPER(tag) -# define FUSION_GET_TAG(T) ::boost::fusion::detail::get_tag::type -#else -# define FUSION_GET_TAG(T) typename T::tag -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// T::type wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -FUSION_MSVC_ETI_WRAPPER(type) -# define FUSION_GET_TYPE(T) ::boost::fusion::detail::get_type::type -#else -# define FUSION_GET_TYPE(T) typename T::type -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// T::types wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -FUSION_MSVC_ETI_WRAPPER(types) -# define FUSION_GET_TYPES(T) ::boost::fusion::detail::get_types::type -#else -# define FUSION_GET_TYPES(T) typename T::types -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// T::index wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -FUSION_MSVC_ETI_WRAPPER(index) -# define FUSION_GET_INDEX(T) ::boost::fusion::detail::get_index::type -#else -# define FUSION_GET_INDEX(T) typename T::index -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// T::tuple wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -FUSION_MSVC_ETI_WRAPPER(tuple) -# define FUSION_GET_TUPLE(T) ::boost::fusion::detail::get_tuple::type -#else -# define FUSION_GET_TUPLE(T) typename T::tuple -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// T::size wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -FUSION_MSVC_ETI_WRAPPER(size) -# define FUSION_GET_SIZE(T) ::boost::fusion::detail::get_size::type -#else -# define FUSION_GET_SIZE(T) typename T::size -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// T::value_type wrapper -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -FUSION_MSVC_ETI_WRAPPER(value_type) -# define FUSION_GET_VALUE_TYPE(T) ::boost::fusion::detail::get_value_type::type -#else -# define FUSION_GET_VALUE_TYPE(T) typename T::value_type -#endif - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - -namespace boost {namespace fusion { namespace aux { -template< typename T > -struct msvc_never_true -{ - enum { value = false }; -}; -}}} //namespace boost::fusion::aux - -#endif - -namespace boost {namespace fusion { -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - -namespace aux { - // msvc_apply -#define AUX778076_MSVC_DTW_NAME msvc_apply1 -#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply -#define AUX778076_MSVC_DTW_ARITY 1 -#include "boost/mpl/aux_/msvc_dtw.hpp" - -#define AUX778076_MSVC_DTW_NAME msvc_apply2 -#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply -#define AUX778076_MSVC_DTW_ARITY 2 -#include "boost/mpl/aux_/msvc_dtw.hpp" - -} //namespace aux - -template -struct fusion_apply1 -{ - typedef typename aux::msvc_apply1::template result_::type type; -}; - -template -struct fusion_apply2 -{ - typedef typename aux::msvc_apply2::template result_::type type; -}; - -#else -template -struct fusion_apply1 -{ - typedef typename A::template apply::type type; -}; -template -struct fusion_apply2 -{ - typedef typename A::template apply::type type; -}; -#endif -}} //namespace boost::fusion - -namespace boost {namespace fusion {namespace detail { -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template - struct bool_base {}; - template<> - struct bool_base > : boost::mpl::bool_{}; - template<> - struct bool_base > : boost::mpl::bool_{}; -#else - template - struct bool_base : T {}; -#endif -}}} - -//VC 6 has serious problems with mpl::int_ in tuple_iterator_base. -//It ICEs because operator int() const on mpl::int_ is inlined. -//At the same time, another test using integral_c ICEs because operator int() is not inlined. -//Only solution seems to be to define a special msvc_fusion_int for VC 6 to be used in tuple_iterator_base -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -namespace boost {namespace fusion {namespace detail{ - -template -struct msvc_fusion_int -{ - BOOST_STATIC_CONSTANT(int, value = N); - typedef msvc_fusion_int type; - typedef int value_type; - typedef boost::mpl::integral_c_tag tag; - - typedef msvc_fusion_int next; - typedef msvc_fusion_int prior; - - operator int() const; -}; - -template -msvc_fusion_int::operator int() const -{ - return static_cast(this->value); -} - -}}} -#define FUSION_INT(N) boost::fusion::detail::msvc_fusion_int -#else -#define FUSION_INT(N) boost::mpl::int_ -#endif - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Borland is so flaky with const correctness of iterators. It's getting -// confused with tuple_iterator where T is a const tuple. We cast -// what Borland thinks is a const reference to a true reference. -// -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace fusion { namespace detail -{ -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) - - template - T& ref(T const& r) - { - return const_cast(r); - } - -#else - - template - T& ref(T& r) - { - return r; - } - -#endif - -}}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/as_fusion_iterator.hpp b/include/boost/spirit/fusion/iterator/as_fusion_iterator.hpp deleted file mode 100644 index 28c00a2c9..000000000 --- a/include/boost/spirit/fusion/iterator/as_fusion_iterator.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_AS_FUSION_ITERATOR_HPP) -#define FUSION_SEQUENCE_AS_FUSION_ITERATOR_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - // Test T. If it is a fusion iterator, return a reference to it. - // else, assume it is an mpl iterator. - - namespace as_fusion_iterator_detail { - template - static T const& - convert(T const& x, mpl::true_) - { - return x; - } - - template - static type_sequence_iterator - convert(T const& x, mpl::false_) - { - return type_sequence_iterator(); - } - } - - template - struct as_fusion_iterator - { - typedef typename - mpl::if_< - fusion::is_iterator - , T - , type_sequence_iterator - >::type - type; - - static typename - mpl::if_< - fusion::is_iterator - , T const& - , type_sequence_iterator - >::type - convert(T const& x); - }; - - template - typename - mpl::if_< - fusion::is_iterator - , T const& - , type_sequence_iterator - >::type - as_fusion_iterator::convert(T const& x) - { - return as_fusion_iterator_detail::convert(x, fusion::is_iterator()); - } - -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/cons_iterator.hpp b/include/boost/spirit/fusion/iterator/cons_iterator.hpp deleted file mode 100755 index 9df62d5ca..000000000 --- a/include/boost/spirit/fusion/iterator/cons_iterator.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_CONS_ITERATOR_HPP) -#define FUSION_ITERATOR_CONS_ITERATOR_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct nil; - - struct cons_iterator_tag; - - template - struct cons_iterator : iterator_base > - { - typedef cons_iterator_tag tag; - typedef Cons cons_type; - typedef mpl::forward_iterator_tag category; - - #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - typedef typename cons_detail::next_traits_impl::type next; - typedef typename cons_detail::value_traits_impl::type type; - #endif - - explicit cons_iterator(cons_type& cons_) - : cons(cons_) {} - - cons_type& cons; - private: - cons_iterator& operator=(cons_iterator const&); - }; - - template <> - struct cons_iterator : iterator_base > - { - typedef cons_iterator_tag tag; - typedef nil cons_type; - typedef mpl::forward_iterator_tag category; - - #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - typedef cons_iterator next; - typedef mpl::na type; - #endif - - cons_iterator() {} - explicit cons_iterator(nil const&) {} - }; - - template <> - struct cons_iterator : iterator_base > - { - typedef cons_iterator_tag tag; - typedef nil const cons_type; - typedef mpl::forward_iterator_tag category; - - #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - typedef cons_iterator next; - typedef mpl::na type; - #endif - - cons_iterator() {} - explicit cons_iterator(nil const&) {} - }; -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/deref.hpp b/include/boost/spirit/fusion/iterator/deref.hpp deleted file mode 100644 index 2c624f8ac..000000000 --- a/include/boost/spirit/fusion/iterator/deref.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DEREF_HPP) -#define FUSION_ITERATOR_DEREF_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct deref_impl - { - template - struct apply {}; - }; - - template - struct deref - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - typedef typename - deref_impl:: - template apply::type - type; - }; - } - - namespace deref_detail { - template - typename meta::deref::type - deref(Iterator const& i,mpl::true_) - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - typename meta::deref::type result = - meta::deref_impl:: - template apply::call(converter::convert(i)); - return result; - } - - template - inline typename meta::deref::type - deref(Iterator& i,mpl::false_) - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - typename meta::deref::type result = - meta::deref_impl:: - template apply::call(converter::convert(i)); - return result; - } - } - - template - typename meta::deref::type - deref(Iterator& i) { - return deref_detail::deref(i,is_const()); - } - - template - typename meta::deref::type - deref(Iterator const & i) { - return deref_detail::deref(i,is_const()); - } - - template - typename meta::deref::type - operator*(iterator_base const& i) - { - return fusion::deref(i.cast()); - } - - template - inline typename meta::deref::type - operator*(iterator_base& i) - { - return fusion::deref(i.cast()); - } - - // Note: VC7.1 has a problem when we pass the return value directly. - // Try removing the named temporary. This only happens on debug builds. - // It seems to be a return value optimization bug. -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/detail/adapt_deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/adapt_deref_traits.hpp deleted file mode 100644 index d0231411c..000000000 --- a/include/boost/spirit/fusion/iterator/detail/adapt_deref_traits.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ADAPT_DEREF_TRAITS_HPP) -#define FUSION_ADAPT_DEREF_TRAITS_HPP - -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace adapt_deref_detail { - template - struct deref_traits_impl - { - typedef typename - meta::deref::type - type; - - static type - call(Iterator const& i); - }; - - template - typename deref_traits_impl::type - deref_traits_impl::call(Iterator const& i) - { - return *i.first; - } - } - struct adapt_deref_traits { - template - struct apply : adapt_deref_detail::deref_traits_impl - {}; - }; - -}}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/adapt_value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/adapt_value_traits.hpp deleted file mode 100644 index 6a0001b06..000000000 --- a/include/boost/spirit/fusion/iterator/detail/adapt_value_traits.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ADAPT_VALUE_TRAITS_HPP) -#define FUSION_ADAPT_VALUE_TRAITS_HPP - -#include - -namespace boost { namespace fusion { namespace detail -{ - struct adapt_value_traits - { - template - struct apply - { - typedef typename - meta::value_of::type - type; - }; - }; -}}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/cons_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/cons_iterator/deref_traits.hpp deleted file mode 100755 index b182bf510..000000000 --- a/include/boost/spirit/fusion/iterator/detail/cons_iterator/deref_traits.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_CONS_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_CONS_ITERATOR_DEREF_TRAITS_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct cons_iterator_tag; - - namespace cons_detail - { - template - struct deref_traits_impl - { - typedef typename Iterator::cons_type cons_type; - typedef typename cons_type::car_type value_type; - - typedef typename mpl::eval_if< - is_const - , add_reference::type> - , add_reference >::type - type; - - static type - call(Iterator const& i) - { - return detail::ref(i.cons.car); - } - }; - } - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl - { - template - struct apply : cons_detail::deref_traits_impl {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/cons_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/cons_iterator/next_traits.hpp deleted file mode 100755 index 353f4b214..000000000 --- a/include/boost/spirit/fusion/iterator/detail/cons_iterator/next_traits.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_CONS_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_CONS_ITERATOR_NEXT_TRAITS_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct cons_iterator_tag; - - template - struct cons_iterator; - - namespace cons_detail - { - template - struct next_traits_impl - { - typedef typename Iterator::cons_type cons_type; - typedef typename cons_type::cdr_type cdr_type; - - typedef cons_iterator< - typename mpl::eval_if< - is_const - , add_const - , mpl::identity - >::type> - type; - - static type - call(Iterator const& i) - { - return type(detail::ref(i.cons.cdr)); - } - }; - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : cons_detail::next_traits_impl {}; - }; - } -}} - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -namespace boost { namespace mpl -{ - template - struct next; - - template - struct next > - : fusion::cons_detail::next_traits_impl > - { - }; -}} - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/cons_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/cons_iterator/value_traits.hpp deleted file mode 100755 index 33bd27ddb..000000000 --- a/include/boost/spirit/fusion/iterator/detail/cons_iterator/value_traits.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_CONS_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_CONS_ITERATOR_VALUE_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct cons_iterator_tag; - - namespace cons_detail - { - template - struct value_traits_impl - { - typedef typename Iterator::cons_type cons_type; - typedef typename cons_type::car_type type; - }; - } - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - { - template - struct apply : cons_detail::value_traits_impl {}; - }; - } - -}} - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - -namespace boost { namespace mpl -{ - template - struct deref; - - template - struct deref > - : fusion::cons_detail::value_traits_impl > - { - }; -}} - -#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/deref_traits.hpp deleted file mode 100644 index 7205162b0..000000000 --- a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/deref_traits.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_DEREF_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct filter_view_iterator_tag; - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl : detail::adapt_deref_traits - {}; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/equal_to_traits.hpp b/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/equal_to_traits.hpp deleted file mode 100644 index fd1453645..000000000 --- a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/equal_to_traits.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - Copyright (c) 2003-2005 Joel de Guzman - Copyright (c) 2005 Dan Marsden - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_EQUAL_TO_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_EQUAL_TO_TRAITS_HPP - -namespace boost { namespace fusion -{ - struct filter_view_iterator_tag; - - namespace meta - { - template - struct equal_to; - - template - struct equal_to_impl; - - template<> - struct equal_to_impl - { - template - struct apply - : equal_to - {}; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/next_traits.hpp deleted file mode 100644 index 8e26b89aa..000000000 --- a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/next_traits.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_NEXT_TRAITS_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct filter_view_iterator_tag; - - template - struct filter_iterator; - - namespace filter_view_detail { - template - struct next_traits_impl { - typedef typename Iterator::first_type first_type; - typedef typename Iterator::last_type last_type; - typedef typename Iterator::pred_type pred_type; - - typedef typename - mpl::eval_if< - meta::equal_to - , mpl::identity - , meta::next - >::type - next_type; - - typedef typename detail::static_find_if< - next_type, last_type, pred_type> - filter; - - typedef filter_iterator< - typename filter::type, last_type, pred_type> - type; - - static type - call(Iterator const& i); - }; - template - typename next_traits_impl::type - next_traits_impl::call(Iterator const& i) - { - return type(filter::call(i.first)); - } - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : filter_view_detail::next_traits_impl - {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/value_traits.hpp deleted file mode 100644 index 94e1d27f4..000000000 --- a/include/boost/spirit/fusion/iterator/detail/filter_view_iterator/value_traits.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_FILTER_VIEW_ITERATOR_VALUE_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct filter_view_iterator_tag; - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - : detail::adapt_value_traits {}; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/iterator_base.hpp b/include/boost/spirit/fusion/iterator/detail/iterator_base.hpp deleted file mode 100644 index 7ab9301ce..000000000 --- a/include/boost/spirit/fusion/iterator/detail/iterator_base.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_ITERATOR_BASE_HPP) -#define FUSION_ITERATOR_DETAIL_ITERATOR_BASE_HPP - -namespace boost { namespace fusion -{ - struct iterator_root {}; - - template - struct iterator_base : iterator_root - { - Iterator const& - cast() const; - - Iterator& - cast(); - }; - - template - Iterator const& - iterator_base::cast() const - { - return static_cast(*this); - } - - template - Iterator& - iterator_base::cast() - { - return static_cast(*this); - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/deref_traits.hpp deleted file mode 100644 index 8738365a7..000000000 --- a/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/deref_traits.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_JOINT_VIEW_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_JOINT_VIEW_ITERATOR_DEREF_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct joint_view_iterator_tag; - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl - : detail::adapt_deref_traits {}; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/next_traits.hpp deleted file mode 100644 index f49749244..000000000 --- a/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/next_traits.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_JOINT_VIEW_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_JOINT_VIEW_ITERATOR_NEXT_TRAITS_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct joint_view_iterator_tag; - - template - struct joint_view_iterator; - - namespace join_view_detail { - template - struct next_traits_impl { - typedef typename Iterator::first_type first_type; - typedef typename Iterator::last_type last_type; - typedef typename Iterator::concat_type concat_type; - typedef typename meta::next::type next_type; - typedef meta::equal_to equal_to; - - typedef typename - mpl::if_< - equal_to - , concat_type - , joint_view_iterator - >::type - type; - - static type - call(Iterator const& i); - }; - - template - typename next_traits_impl::type - call(Iterator const& i, mpl::true_) - { - return i.concat; - } - - template - typename next_traits_impl::type - call(Iterator const& i, mpl::false_) - { - typedef typename next_traits_impl::type type; - return type(fusion::next(i.first), i.concat); - } - - template - typename next_traits_impl::type - next_traits_impl::call(Iterator const& i) - { - return join_view_detail::call(i, equal_to()); - } - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : join_view_detail::next_traits_impl - {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/value_traits.hpp deleted file mode 100644 index ed6431efd..000000000 --- a/include/boost/spirit/fusion/iterator/detail/joint_view_iterator/value_traits.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_JOINT_VIEW_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_JOINT_VIEW_ITERATOR_VALUE_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct joint_view_iterator_tag; - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - : detail::adapt_value_traits {}; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/single_view_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/single_view_iterator/deref_traits.hpp deleted file mode 100644 index ac5b69b22..000000000 --- a/include/boost/spirit/fusion/iterator/detail/single_view_iterator/deref_traits.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_SINGLE_VIEW_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_SINGLE_VIEW_ITERATOR_DEREF_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace detail - { - template - struct single_view_access_result - { - typedef typename - mpl::eval_if< - is_const - , cref_result > - , ref_result > - >::type - type; - }; - } - - namespace single_view_iterator_detail - { - template - struct deref_traits_impl - { - typedef typename Iterator::single_view_type single_view_type; - typedef typename detail::single_view_access_result< - single_view_type>::type - type; - - static type - call(Iterator const& i); - }; - - template - inline typename deref_traits_impl::type - deref_traits_impl::call(Iterator const& i) - { - return detail::ref(i.view.val); - } - } - - struct single_view_iterator_tag; - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl - { - template - struct apply : single_view_iterator_detail::deref_traits_impl {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/single_view_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/single_view_iterator/next_traits.hpp deleted file mode 100644 index 46521b456..000000000 --- a/include/boost/spirit/fusion/iterator/detail/single_view_iterator/next_traits.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_SINGLE_VIEW_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_SINGLE_VIEW_ITERATOR_NEXT_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct single_view_iterator_tag; - - template - struct single_view_iterator_end; - - template - struct single_view_iterator; - - namespace single_view_detail - { - template - struct next_traits_impl - { - typedef single_view_iterator_end< - typename Iterator::single_view_type> - type; - - static type - call(Iterator); - }; - - template - typename next_traits_impl::type - next_traits_impl::call(Iterator) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : single_view_detail::next_traits_impl - {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/single_view_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/single_view_iterator/value_traits.hpp deleted file mode 100644 index 86520cd9f..000000000 --- a/include/boost/spirit/fusion/iterator/detail/single_view_iterator/value_traits.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_SINGLE_VIEW_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_SINGLE_VIEW_ITERATOR_VALUE_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct single_view_iterator_tag; - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - { - template - struct apply - { - typedef typename Iterator::single_view_type single_view_type; - typedef FUSION_GET_VALUE_TYPE(single_view_type) type; - }; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/deref_traits.hpp deleted file mode 100644 index e481cf13f..000000000 --- a/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/deref_traits.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TRANSFORM_VIEW_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TRANSFORM_VIEW_ITERATOR_DEREF_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct transform_view_iterator_tag; - - namespace transform_view_detail { - template - struct deref_traits_impl { - typedef typename - meta::value_of::type - value_type; - - typedef typename Iterator::transform_type transform_type; - typedef typename fusion_apply1::type type; - - static type - call(Iterator const& i); - }; - - template - BOOST_DEDUCED_TYPENAME deref_traits_impl::type - deref_traits_impl::call(Iterator const& i) - { - return i.f(*i.first); - } - } - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl - { - template - struct apply : transform_view_detail::deref_traits_impl - {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/next_traits.hpp deleted file mode 100644 index cdf1b0a5b..000000000 --- a/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/next_traits.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TRANSFORM_VIEW_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TRANSFORM_VIEW_ITERATOR_NEXT_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct transform_view_iterator_tag; - - template - struct transform_view_iterator; - - namespace transform_view_detail { - template - struct next_traits_impl - { - typedef typename Iterator::first_type first_type; - typedef typename meta::next::type next_type; - typedef typename Iterator::transform_type transform_type; - typedef transform_view_iterator type; - - static type - call(Iterator const& i); - }; - template - typename next_traits_impl::type - next_traits_impl::call(Iterator const& i) - { - return type(fusion::next(i.first), i.f); - } - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : transform_view_detail::next_traits_impl - {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/value_traits.hpp deleted file mode 100644 index 94e959b88..000000000 --- a/include/boost/spirit/fusion/iterator/detail/transform_view_iterator/value_traits.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TRANSFORM_VIEW_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TRANSFORM_VIEW_ITERATOR_VALUE_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct transform_view_iterator_tag; - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - { - template - struct apply - { - typedef typename - meta::value_of::type - value_type; - - typedef typename Iterator::transform_type transform_type; - typedef typename fusion_apply1::type type; - }; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/tuple_iterator/deref_traits.hpp deleted file mode 100644 index 5002c9ee0..000000000 --- a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/deref_traits.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_DEREF_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_iterator_tag; - - namespace detail - { - template - struct tuple_access; - } - - namespace tuple_iterator_detail - { - template - struct deref_traits_impl - { - typedef FUSION_GET_INDEX(Iterator) index; - typedef FUSION_GET_TUPLE(Iterator) tuple_; - - typedef BOOST_DEDUCED_TYPENAME - boost::fusion::detail::tuple_access_result< - tuple_, FUSION_GET_VALUE(index)>::type - type; - - static type - call(Iterator const& i); - }; - - template - inline typename deref_traits_impl::type - deref_traits_impl::call(Iterator const& i) - { - return detail::tuple_access - ::get(detail::ref(i.get_tuple())); - } - } - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl - { - template - struct apply : - tuple_iterator_detail::deref_traits_impl {}; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/equal_to_traits.hpp b/include/boost/spirit/fusion/iterator/detail/tuple_iterator/equal_to_traits.hpp deleted file mode 100644 index 27dfc3434..000000000 --- a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/equal_to_traits.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_EQUAL_TO_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_EQUAL_TO_TRAITS_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_iterator_tag; - - namespace detail - { - template - struct has_same_tags - : is_same {}; - - template - struct has_same_index - : mpl::equal_to::type {}; - - template - struct tuple_identity - { - typedef typename I::tuple tuple_type; - typedef typename tuple_type::identity_type type; - }; - - template - struct has_same_tuple_identity - : is_same< - typename tuple_identity::type - , typename tuple_identity::type - > - {}; - - template - struct tuple_iterator_equal_to - : mpl::and_< - has_same_index - , has_same_tuple_identity - > - { - BOOST_STATIC_ASSERT((has_same_tags::value)); - }; - } - - namespace meta - { - template - struct equal_to_impl; - - template <> - struct equal_to_impl - { - template - struct apply : detail::tuple_iterator_equal_to {}; - }; - } -}} - -#endif - diff --git a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/tuple_iterator/next_traits.hpp deleted file mode 100644 index ead1e6247..000000000 --- a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/next_traits.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_NEXT_TRAITS_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_iterator_tag; - - template - struct tuple_iterator; - - namespace detail - { - template - struct tuple_iterator_next_traits_impl - { - typedef FUSION_GET_INDEX(Iterator) index; - typedef FUSION_GET_TUPLE(Iterator) tuple_; - typedef FUSION_GET_SIZE(tuple_) size; -#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) - BOOST_STATIC_ASSERT((::boost::mpl::less::value)); -#endif - typedef typename mpl::next::type next; - typedef tuple_iterator type; - - static type - call(Iterator const& i); - }; - - template - inline typename tuple_iterator_next_traits_impl::type - tuple_iterator_next_traits_impl::call(Iterator const& i) - { - return type(detail::ref(i.get_tuple())); - } - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : detail::tuple_iterator_next_traits_impl {}; - }; - } -}} - -#endif - diff --git a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/prior_traits.hpp b/include/boost/spirit/fusion/iterator/detail/tuple_iterator/prior_traits.hpp deleted file mode 100644 index ac1ca17db..000000000 --- a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/prior_traits.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_PRIOR_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_PRIOR_TRAITS_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_iterator_tag; - - template - struct tuple_iterator; - - namespace detail - { - template - struct tuple_iterator_prior_traits_impl - { - typedef FUSION_GET_INDEX(Iterator) index; - typedef FUSION_GET_TUPLE(Iterator) tuple_; - typedef FUSION_INT(0) other_index; -#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300) - BOOST_STATIC_ASSERT(( - ::boost::mpl::greater_equal::value)); -#endif - typedef typename mpl::prior::type prior; - typedef tuple_iterator type; - - static type - call(Iterator const& i); - }; - - template - inline typename tuple_iterator_prior_traits_impl::type - tuple_iterator_prior_traits_impl::call(Iterator const& i) - { - return type(detail::ref(i.get_tuple())); - } - } - - namespace meta - { - template - struct prior_impl; - - template <> - struct prior_impl - { - template - struct apply : detail::tuple_iterator_prior_traits_impl {}; - }; - } -}} - -#endif - diff --git a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/tuple_iterator/value_traits.hpp deleted file mode 100644 index 1b5fca4d4..000000000 --- a/include/boost/spirit/fusion/iterator/detail/tuple_iterator/value_traits.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TUPLE_ITERATOR_VALUE_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_iterator_tag; - - namespace detail - { - template - struct tuple_access; - } - - namespace detail - { - template - struct tuple_iterator_value_traits_impl - { - typedef FUSION_GET_INDEX(Iterator) index; - typedef FUSION_GET_TUPLE(Iterator) tuple_; - - typedef BOOST_DEDUCED_TYPENAME - tuple_element< - FUSION_GET_VALUE(index), tuple_>::type - type; - }; - } - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - { - template - struct apply : detail::tuple_iterator_value_traits_impl {}; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/deref_traits.hpp b/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/deref_traits.hpp deleted file mode 100644 index 3f43ecaf4..000000000 --- a/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/deref_traits.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TYPE_SEQUENCE_ITERATOR_DEREF_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TYPE_SEQUENCE_ITERATOR_DEREF_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace type_sequence_iterator_detail - { - template - struct deref_traits_impl - { - typedef typename mpl::deref< - typename Iterator::iterator_type>::type - type; - - static type - call(Iterator); - }; - - template - inline typename deref_traits_impl::type - deref_traits_impl::call(Iterator) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - } - - struct type_sequence_iterator_tag; - - namespace meta - { - template - struct deref_impl; - - template <> - struct deref_impl - { - template - struct apply - : type_sequence_iterator_detail::deref_traits_impl {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/next_traits.hpp b/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/next_traits.hpp deleted file mode 100644 index 66e60ea41..000000000 --- a/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/next_traits.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TYPE_SEQUENCE_ITERATOR_NEXT_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TYPE_SEQUENCE_ITERATOR_NEXT_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct type_sequence_iterator_tag; - - template - struct type_sequence_iterator; - - namespace type_sequence_detail { - template - struct next_traits_impl - { - typedef type_sequence_iterator< - typename mpl::next::type - > type; - - static type - call(Iterator); - }; - - template - typename next_traits_impl::type - next_traits_impl::call(Iterator) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - } - - namespace meta - { - template - struct next_impl; - - template <> - struct next_impl - { - template - struct apply : type_sequence_detail::next_traits_impl - {}; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/value_traits.hpp b/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/value_traits.hpp deleted file mode 100644 index 4268b19cf..000000000 --- a/include/boost/spirit/fusion/iterator/detail/type_sequence_iterator/value_traits.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_DETAIL_TYPE_SEQUENCE_ITERATOR_VALUE_TRAITS_HPP) -#define FUSION_ITERATOR_DETAIL_TYPE_SEQUENCE_ITERATOR_VALUE_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - struct type_sequence_iterator_tag; - - namespace meta - { - template - struct value_impl; - - template <> - struct value_impl - { - template - struct apply - { - typedef typename mpl::deref< - typename Iterator::iterator_type>::type - type; - }; - }; - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/equal_to.hpp b/include/boost/spirit/fusion/iterator/equal_to.hpp deleted file mode 100644 index 5daf835c4..000000000 --- a/include/boost/spirit/fusion/iterator/equal_to.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_EQUAL_TO_HPP) -#define FUSION_ITERATOR_EQUAL_TO_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct equal_to_impl - { - template - struct apply - { - typedef typename - is_same< - typename add_const::type - , typename add_const::type - >::type - type; - BOOST_STATIC_CONSTANT(bool, value = FUSION_GET_VALUE(type)); - }; - }; - - template - struct equal_to - : detail::bool_base< - typename equal_to_impl::type::tag>:: - template apply< - typename as_fusion_iterator::type - , typename as_fusion_iterator::type - >::type - > {}; - } -}} - -#endif - diff --git a/include/boost/spirit/fusion/iterator/filter_view_iterator.hpp b/include/boost/spirit/fusion/iterator/filter_view_iterator.hpp deleted file mode 100644 index 84b785745..000000000 --- a/include/boost/spirit/fusion/iterator/filter_view_iterator.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_FILTER_VIEW_ITERATOR_HPP) -#define FUSION_ITERATOR_FILTER_VIEW_ITERATOR_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct filter_view_iterator_tag; - - template - struct filter_iterator : iterator_base > - { - typedef as_fusion_iterator first_converter; - typedef typename first_converter::type first_iter; - typedef as_fusion_iterator last_converter; - typedef typename last_converter::type last_iter; - - typedef filter_view_iterator_tag tag; - typedef detail::static_find_if filter; - typedef typename filter::type first_type; - typedef last_iter last_type; - typedef Pred pred_type; - - filter_iterator(First const& first); - - first_type first; - }; - - template - filter_iterator::filter_iterator(First const& first) - : first(filter::call(first_converter::convert(first))) - {} -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/is_iterator.hpp b/include/boost/spirit/fusion/iterator/is_iterator.hpp deleted file mode 100644 index b0376efe4..000000000 --- a/include/boost/spirit/fusion/iterator/is_iterator.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_IS_ITERATOR_HPP) -#define FUSION_ITERATOR_IS_ITERATOR_HPP - -#include - -namespace boost { namespace fusion -{ - /////////////////////////////////////////////////////////////////////////// - // - // is_iterator metafunction - // - // Given a type T, returns a value true or false if T is a - // fusion iterator or not. Usage: - // - // is_iterator::value - // - /////////////////////////////////////////////////////////////////////////// - struct iterator_root; - - template - struct is_iterator : is_base_and_derived {}; - -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/joint_view_iterator.hpp b/include/boost/spirit/fusion/iterator/joint_view_iterator.hpp deleted file mode 100644 index 031e2c310..000000000 --- a/include/boost/spirit/fusion/iterator/joint_view_iterator.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_JOINT_VIEW_ITERATOR_HPP) -#define FUSION_ITERATOR_JOINT_VIEW_ITERATOR_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct joint_view_iterator_tag; - - template - struct joint_view_iterator - : iterator_base > - { - typedef as_fusion_iterator first_converter; - typedef as_fusion_iterator last_converter; - typedef as_fusion_iterator concat_converter; - - typedef typename first_converter::type first_type; - typedef typename last_converter::type last_type; - typedef typename concat_converter::type concat_type; - - typedef joint_view_iterator_tag tag; -#if! BOOST_WORKAROUND(BOOST_MSVC,<=1300) - BOOST_STATIC_ASSERT((!meta::equal_to::value)); -#endif - joint_view_iterator(First const& first, Concat const& concat); - - first_type first; - concat_type concat; - }; - template - joint_view_iterator::joint_view_iterator(First const& first, Concat const& concat) - : first(first_converter::convert(first)) - , concat(concat_converter::convert(concat)) - {} - - -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/next.hpp b/include/boost/spirit/fusion/iterator/next.hpp deleted file mode 100644 index 676257816..000000000 --- a/include/boost/spirit/fusion/iterator/next.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_NEXT_HPP) -#define FUSION_ITERATOR_NEXT_HPP - -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct next_impl - { - template - struct apply - { - // VC6 needs this - typedef int type; - }; - }; - - template - struct next - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - typedef typename - next_impl:: - template apply::type - type; - }; - } - - template - inline typename meta::next::type - next(Iterator const& i) - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - return meta::next_impl:: - template apply::call(converter::convert(i)); - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/prior.hpp b/include/boost/spirit/fusion/iterator/prior.hpp deleted file mode 100644 index 9ac539aeb..000000000 --- a/include/boost/spirit/fusion/iterator/prior.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_PRIOR_HPP) -#define FUSION_ITERATOR_PRIOR_HPP - -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct prior_impl - { - template - struct apply {}; - }; - - template - struct prior - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - typedef typename - prior_impl:: - template apply::type - type; - }; - } - - template - inline typename meta::prior::type - prior(Iterator const& i) - { - typedef as_fusion_iterator converter; - typedef typename converter::type iter; - - return meta::prior_impl:: - template apply::call(converter::convert(i)); - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/single_view_iterator.hpp b/include/boost/spirit/fusion/iterator/single_view_iterator.hpp deleted file mode 100644 index 4762ea7ff..000000000 --- a/include/boost/spirit/fusion/iterator/single_view_iterator.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_SINGLE_VIEW_ITERATOR_HPP) -#define FUSION_ITERATOR_SINGLE_VIEW_ITERATOR_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct single_view_iterator_tag; - - template - struct single_view_iterator_end - : iterator_base > - { - typedef single_view_iterator_tag tag; - }; - - template - struct single_view_iterator - : iterator_base > - { - typedef single_view_iterator_tag tag; - typedef SingleView single_view_type; - typedef typename add_reference::type reference_type; - - explicit single_view_iterator(reference_type view) - : view(view) {} - - reference_type view; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/transform_view_iterator.hpp b/include/boost/spirit/fusion/iterator/transform_view_iterator.hpp deleted file mode 100644 index f98f7bc56..000000000 --- a/include/boost/spirit/fusion/iterator/transform_view_iterator.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_TRANSFORM_VIEW_ITERATOR_HPP) -#define FUSION_ITERATOR_TRANSFORM_VIEW_ITERATOR_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct transform_view_iterator_tag; - - template - struct transform_view_iterator - : iterator_base > - { - typedef transform_view_iterator_tag tag; - typedef as_fusion_iterator converter; - typedef typename converter::type first_type; - typedef F transform_type; - - transform_view_iterator(First const& first, F f); - - first_type first; - transform_type f; - }; - - template - transform_view_iterator::transform_view_iterator(First const& first, F f) - : first(converter::convert(first)), f(f) {} - -}} - -#endif - diff --git a/include/boost/spirit/fusion/iterator/tuple_iterator.hpp b/include/boost/spirit/fusion/iterator/tuple_iterator.hpp deleted file mode 100644 index 58cd58368..000000000 --- a/include/boost/spirit/fusion/iterator/tuple_iterator.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_TUPLE_ITERATOR_HPP) -#define FUSION_ITERATOR_TUPLE_ITERATOR_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_iterator_tag; - struct void_t; - - template - struct tuple_iterator; - - template - struct tuple_iterator_base : iterator_base > - { - typedef FUSION_INT(N) index; - typedef Tuple tuple; - typedef tuple_iterator_tag tag; - typedef tuple_iterator self_type; - }; - - template - struct tuple_iterator : tuple_iterator_base - { - typedef typename tuple_iterator_base::tuple tuple; - typedef typename tuple_iterator_base::index index; - typedef typename - mpl::eval_if< - mpl::less - , detail::tuple_iterator_next_traits_impl > - , mpl::identity - >::type - next; - - typedef typename - mpl::eval_if< - mpl::less - , detail::tuple_iterator_value_traits_impl > - , mpl::identity - >::type - type; - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - tuple_iterator(tuple_iterator const& i); -#else - template - tuple_iterator(tuple_iterator const& i) - : t(static_cast(i.get_tuple())) {} -#endif - tuple_iterator(tuple& t); - - tuple& - get_tuple() const; - private: - - tuple& t; - }; - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template - tuple_iterator::tuple_iterator(tuple_iterator const& i) - : t(static_cast(i.get_tuple())) {} -#endif - - template - tuple_iterator::tuple_iterator(tuple& t) - : t(t) {} - - template - typename tuple_iterator::tuple& - tuple_iterator::get_tuple() const - { - return t; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/iterator/type_sequence_iterator.hpp b/include/boost/spirit/fusion/iterator/type_sequence_iterator.hpp deleted file mode 100644 index afd9c2d15..000000000 --- a/include/boost/spirit/fusion/iterator/type_sequence_iterator.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_ITERATOR_TYPE_SEQUENCE_ITERATOR_HPP) -#define FUSION_ITERATOR_TYPE_SEQUENCE_ITERATOR_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct type_sequence_iterator_tag; - - template - struct type_sequence_iterator - : iterator_base > - { - typedef type_sequence_iterator_tag tag; - typedef typename remove_const::type iterator_type; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/iterator/value_of.hpp b/include/boost/spirit/fusion/iterator/value_of.hpp deleted file mode 100644 index 9a5a6e51c..000000000 --- a/include/boost/spirit/fusion/iterator/value_of.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_VALUE_OF_HPP) -#define FUSION_VALUE_OF_HPP - -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct value_impl - { - template - struct apply - { - // VC6 needs this - typedef int type; - }; - }; - - template - struct value_of - { - typedef typename - value_impl:: - template apply::type - type; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/append_view.hpp b/include/boost/spirit/fusion/sequence/append_view.hpp deleted file mode 100644 index be107617e..000000000 --- a/include/boost/spirit/fusion/sequence/append_view.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_APPEND_VIEW_HPP) -#define FUSION_SEQUENCE_APPEND_VIEW_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - template - struct append_view : joint_view > - { - append_view(View& view, typename detail::call_param::type val) - : joint_view >(view, held) - , held(val) {} - single_view held; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/as_fusion_sequence.hpp b/include/boost/spirit/fusion/sequence/as_fusion_sequence.hpp deleted file mode 100644 index 2b6312b99..000000000 --- a/include/boost/spirit/fusion/sequence/as_fusion_sequence.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_AS_FUSION_SEQUENCE_HPP) -#define FUSION_SEQUENCE_AS_FUSION_SEQUENCE_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - // Test T. If it is a fusion sequence, return a reference to it. - // else, assume it is an mpl sequence. Fail if it is not. - - namespace fusion_sequence_detail { - template - static T const& convert_const(T const& x, mpl::true_) { - return x; - } - template - static type_sequence convert_const(T const& x, mpl::false_) { - BOOST_STATIC_ASSERT(mpl::is_sequence::value); - return type_sequence(); - } - template - static T& convert(T& x, mpl::true_) - { - return x; - } - - template - static type_sequence convert(T& x, mpl::false_) - { - BOOST_STATIC_ASSERT(mpl::is_sequence::value); - return type_sequence(); - } - } - - template - struct as_fusion_sequence { - typedef typename - mpl::if_< - fusion::is_sequence - , T - , type_sequence - >::type - type; - - static typename - mpl::if_< - fusion::is_sequence - , T const& - , type_sequence - >::type - convert_const(T const& x); - - static typename - mpl::if_< - fusion::is_sequence - , T & - , type_sequence - >::type - convert(T& x); - }; - - template - typename - mpl::if_< - fusion::is_sequence - , T const& - , type_sequence - >::type - as_fusion_sequence::convert_const(T const& x) { - return fusion_sequence_detail::convert_const(x,fusion::is_sequence()); - } - - template - typename - mpl::if_< - fusion::is_sequence - , T& - , type_sequence - >::type - as_fusion_sequence::convert(T& x) { - return fusion_sequence_detail::convert(x,fusion::is_sequence()); - } -}} - - -#endif diff --git a/include/boost/spirit/fusion/sequence/at.hpp b/include/boost/spirit/fusion/sequence/at.hpp deleted file mode 100644 index c651737d8..000000000 --- a/include/boost/spirit/fusion/sequence/at.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_AT_HPP) -#define FUSION_SEQUENCE_AT_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct at_impl - { - template - struct apply; - }; - - template - struct at_c - { - typedef as_fusion_sequence seq_converter; - typedef typename seq_converter::type seq; - - typedef typename - at_impl:: - template apply::type - type; - }; - - template - struct at : at_c {}; - } -#if! BOOST_WORKAROUND(BOOST_MSVC, < 1300) - template - inline typename meta::at_c::type - at(sequence_base const& seq FUSION_GET_MSVC_WORKAROUND) - { - typedef meta::at_c at_meta; - return meta::at_impl:: - template apply::call( - at_meta::seq_converter::convert_const(seq.cast())); - } - - template - inline typename meta::at_c::type - at(sequence_base& seq FUSION_GET_MSVC_WORKAROUND) - { - typedef meta::at_c at_meta; - return meta::at_impl:: - template apply::call( - at_meta::seq_converter::convert(seq.cast())); - } -#endif -}} - -#endif - diff --git a/include/boost/spirit/fusion/sequence/begin.hpp b/include/boost/spirit/fusion/sequence/begin.hpp deleted file mode 100644 index 6e1ff1fed..000000000 --- a/include/boost/spirit/fusion/sequence/begin.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_BEGIN_HPP) -#define FUSION_SEQUENCE_BEGIN_HPP - -#include -#include -#include -namespace boost { namespace fusion -{ - namespace meta - { - template - struct begin_impl - { - template - struct apply { - typedef int type; - }; - }; - - template - struct begin - { - typedef as_fusion_sequence seq_converter; - typedef typename seq_converter::type seq; - - typedef typename - begin_impl:: - template apply::type - type; - }; - } - -#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) - namespace detail { - template - inline typename meta::begin::type - begin(Sequence const& seq,mpl::bool_) - { - typedef meta::begin begin_meta; - return meta::begin_impl:: - template apply::call( - begin_meta::seq_converter::convert_const(seq)); - } - - template - inline typename meta::begin::type - begin(Sequence& seq,mpl::bool_) - { - typedef meta::begin begin_meta; - return meta::begin_impl:: - template apply::call( - begin_meta::seq_converter::convert(seq)); - } - } - - template - inline typename meta::begin::type - begin(Sequence& seq) - { - return detail::begin(seq,is_const()); - } -#else - template - inline typename meta::begin::type - begin(Sequence const& seq) - { - typedef meta::begin begin_meta; - return meta::begin_impl:: - template apply::call( - begin_meta::seq_converter::convert_const(seq)); - } - - template - inline typename meta::begin::type - begin(Sequence& seq) - { - typedef meta::begin begin_meta; - return meta::begin_impl:: - template apply::call( - begin_meta::seq_converter::convert(seq)); - } -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/cons.hpp b/include/boost/spirit/fusion/sequence/cons.hpp deleted file mode 100755 index ad0e84a65..000000000 --- a/include/boost/spirit/fusion/sequence/cons.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_CONS_HPP) -#define FUSION_SEQUENCE_CONS_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct void_t; - - struct cons_tag; - - struct nil : sequence_base - { - typedef cons_tag tag; - typedef void_t car_type; - typedef void_t cdr_type; - }; - - template - struct cons : sequence_base > - { - typedef cons_tag tag; - typedef typename call_traits::value_type car_type; - typedef Cdr cdr_type; - - cons() - : car(), cdr() {} - - explicit cons( - typename call_traits::param_type car_ - , typename call_traits::param_type cdr_ = Cdr()) - : car(car_), cdr(cdr_) {} - - car_type car; - cdr_type cdr; - }; - - template - inline cons - make_cons(Car const& car) - { - return cons(car); - } - - template - inline cons - make_cons(Car const& car, Cdr const& cdr) - { - return cons(car, cdr); - } -}} - -#endif - diff --git a/include/boost/spirit/fusion/sequence/detail/as_tuple_element.hpp b/include/boost/spirit/fusion/sequence/detail/as_tuple_element.hpp deleted file mode 100644 index 426a68407..000000000 --- a/include/boost/spirit/fusion/sequence/detail/as_tuple_element.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_AS_TUPLE_ELEMENT_HPP) -#define FUSION_SEQUENCE_DETAIL_AS_TUPLE_ELEMENT_HPP - -#include - -#if defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -# include -# include -# include -# include -#endif - -namespace boost { namespace fusion { namespace detail -{ -#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - template - struct as_tuple_element - { - typedef T type; - }; - - template - struct as_tuple_element > - { - typedef T& type; - }; - -#if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - - template - struct as_tuple_element const> - { - typedef T& type; - }; - -#endif - - template - struct as_tuple_element - { - typedef const T(&type)[N]; - }; - - template - struct as_tuple_element - { - typedef const volatile T(&type)[N]; - }; - - template - struct as_tuple_element - { - typedef const volatile T(&type)[N]; - }; - -#else - - // The Non-PTS version cannot accept arrays since there is no way to - // get the element type of an array T[N]. However, we shall provide - // the most common case where the array is a char[N] or wchar_t[N]. - // Doing so will allow literal string argument types. - - template - struct maybe_string - { - typedef typename - mpl::eval_if< - is_array - , mpl::eval_if< - is_convertible - , mpl::identity - , mpl::eval_if< - is_convertible - , mpl::identity - , mpl::identity - > - > - , mpl::identity - >::type - type; - }; - - template - struct as_tuple_element - { - typedef typename - mpl::eval_if< - is_reference_wrapper - , add_reference::type> - , maybe_string - >::type - type; - }; - -#endif - -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/cons_begin_end_traits.hpp b/include/boost/spirit/fusion/sequence/detail/cons_begin_end_traits.hpp deleted file mode 100755 index 53a2055fe..000000000 --- a/include/boost/spirit/fusion/sequence/detail/cons_begin_end_traits.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - Copyright (c) 2005 Eric Niebler - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_CONS_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_CONS_BEGIN_END_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct nil; - - struct cons_tag; - - template - struct cons; - - template - struct cons_iterator; - - namespace cons_detail - { - template - struct begin_traits_impl - { - typedef cons_iterator type; - - static type - call(Cons& t) - { - return type(t); - } - }; - - template - struct end_traits_impl - { - typedef cons_iterator< - typename mpl::if_, nil const, nil>::type> - type; - - static type - call(Cons&) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - }; - } - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply : cons_detail::begin_traits_impl - {}; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply : cons_detail::end_traits_impl - {}; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/filter_view_begin_end_trts.hpp b/include/boost/spirit/fusion/sequence/detail/filter_view_begin_end_trts.hpp deleted file mode 100644 index 630dab5ff..000000000 --- a/include/boost/spirit/fusion/sequence/detail/filter_view_begin_end_trts.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_FILTER_VIEW_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_FILTER_VIEW_BEGIN_END_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct filter_view_tag; - - template - struct filter_view; - - template - struct filter_iterator; - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply - { - typedef typename Sequence::first_type first_type; - typedef typename Sequence::last_type last_type; - typedef typename Sequence::pred_type pred_type; - typedef filter_iterator type; - - static type - call(Sequence& s) - { - return type(s.first); - } - }; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply - { - typedef typename Sequence::last_type last_type; - typedef typename Sequence::pred_type pred_type; - typedef filter_iterator type; - - static type - call(Sequence& s) - { - return type(s.last); - } - }; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/detail/generate.hpp b/include/boost/spirit/fusion/sequence/detail/generate.hpp deleted file mode 100644 index 7e41b00cb..000000000 --- a/include/boost/spirit/fusion/sequence/detail/generate.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_GENERATE_HPP) -#define FUSION_SEQUENCE_DETAIL_GENERATE_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define FUSION_DEREF_ITERATOR(z, n, data) \ - typename checked_deref_iterator< \ - BOOST_PP_CAT(T, n), Last>::type - -#define FUSION_NEXT_ITERATOR(z, n, data) \ - typedef typename checked_next_iterator< \ - BOOST_PP_CAT(T, n), Last>::type \ - BOOST_PP_CAT(T, BOOST_PP_INC(n)); - -namespace boost { namespace fusion { namespace detail -{ - template - struct checked_deref_iterator - { - typedef typename - mpl::eval_if< - meta::equal_to - , mpl::identity - , meta::value_of - >::type - type; - }; - - template - struct checked_next_iterator - { - typedef typename - mpl::eval_if< - meta::equal_to - , mpl::identity - , meta::next - >::type - type; - }; - - template - struct result_of_generate - { - typedef First T0; - BOOST_PP_REPEAT( - BOOST_PP_DEC(FUSION_MAX_TUPLE_SIZE), FUSION_NEXT_ITERATOR, _) - typedef tuple type; - }; - - template - inline typename result_of_generate::type - generate(First const& first, Last const&) - { - typedef typename result_of_generate::type result; - return result(first); - } -}}} - -#undef FUSION_DEREF_ITERATOR -#undef FUSION_NEXT_ITERATOR -#endif - - diff --git a/include/boost/spirit/fusion/sequence/detail/io.hpp b/include/boost/spirit/fusion/sequence/detail/io.hpp deleted file mode 100644 index c12889baf..000000000 --- a/include/boost/spirit/fusion/sequence/detail/io.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 1999-2003 Jeremiah Willcock - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_IO_HPP) -#define FUSION_SEQUENCE_DETAIL_IO_HPP - -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - struct delimiter_io - { - // print a delimiter - template - static void - print(OS& os, char const* delim, mpl::false_ = mpl::false_()) - { - detail::string_ios_manip manip(os); - manip.print(delim); - } - - template - static void - print(OS& os, char const* delim, mpl::true_) - { - } - - // read a delimiter - template - static void - read(IS& is, char const* delim, mpl::false_ = mpl::false_()) - { - detail::string_ios_manip manip(is); - manip.read(delim); - } - - template - static void - read(IS& is, char const* delim, mpl::true_) - { - } - }; - - struct print_sequence_loop - { - template - static void - call(OS& os, First const&, Last const&, mpl::true_) - { - } - - template - static void - call(OS& os, First const& first, Last const& last, mpl::false_) - { - meta::equal_to< - BOOST_DEDUCED_TYPENAME meta::next::type - , Last - > - is_last; - - os << *first; - delimiter_io::print(os, " ", is_last); - call(os, fusion::next(first), last, is_last); - } - - template - static void - call(OS& os, First const& first, Last const& last) - { - meta::equal_to eq; - call(os, first, last, eq); - } - }; - - struct read_sequence_loop - { - template - static void - call(IS& is, First const&, Last const&, mpl::true_) - { - } - - template - static void - call(IS& is, First const& first, Last const& last, mpl::false_) - { - meta::equal_to< - BOOST_DEDUCED_TYPENAME meta::next::type - , Last - > - is_last; - - is >> *first; - delimiter_io::read(is, " ", is_last); - call(is, fusion::next(first), last, is_last); - } - - template - static void - call(IS& is, First const& first, Last const& last) - { - meta::equal_to eq; - call(is, first, last, eq); - } - }; - - template - inline void - print_sequence(OS& os, Sequence const& seq) - { - delimiter_io::print(os, "("); - print_sequence_loop::call(os, fusion::begin(seq), fusion::end(seq)); - delimiter_io::print(os, ")"); - } - - template - inline void - read_sequence(IS& is, Sequence& seq) - { - delimiter_io::read(is, "("); - read_sequence_loop::call(is, fusion::begin(seq), fusion::end(seq)); - delimiter_io::read(is, ")"); - } -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/joint_view_begin_end_traits.hpp b/include/boost/spirit/fusion/sequence/detail/joint_view_begin_end_traits.hpp deleted file mode 100644 index d98fa0cc1..000000000 --- a/include/boost/spirit/fusion/sequence/detail/joint_view_begin_end_traits.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_JOINT_VIEW_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_JOINT_VIEW_BEGIN_END_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct joint_view_tag; - - template - struct joint_view_iterator; - - namespace joint_view_detail { - template - struct begin_traits_impl - { - typedef typename Sequence::first_type first_type; - typedef typename Sequence::last_type last_type; - typedef typename Sequence::concat_type concat_type; - typedef boost::fusion::meta::equal_to equal_to; - - typedef typename - boost::mpl::if_< - equal_to - , concat_type - , boost::fusion::joint_view_iterator - >::type - type; - - static type - call(Sequence& s); - }; - - template - typename begin_traits_impl::type - call(Sequence& s, boost::mpl::true_) { - return s.concat(); - } - - template - typename begin_traits_impl::type - call(Sequence& s, boost::mpl::false_) { - typedef BOOST_DEDUCED_TYPENAME begin_traits_impl::type type; - return type(s.first(), s.concat()); - } - - template - typename begin_traits_impl::type - begin_traits_impl::call(Sequence& s) - { - return joint_view_detail::call(s, equal_to()); - } - - template - struct end_traits_impl - { - typedef typename Sequence::concat_last_type type; - - static type - call(Sequence& s); - }; - - template - typename end_traits_impl::type - end_traits_impl::call(Sequence& s) - { - return s.concat_last(); - } - } - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply : joint_view_detail::begin_traits_impl - {}; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply : joint_view_detail::end_traits_impl - {}; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/detail/manip.hpp b/include/boost/spirit/fusion/sequence/detail/manip.hpp deleted file mode 100644 index a402469af..000000000 --- a/include/boost/spirit/fusion/sequence/detail/manip.hpp +++ /dev/null @@ -1,336 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jeremiah Willcock - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#ifndef FUSION_SEQUENCE_DETAIL_MANIP_HPP -#define FUSION_SEQUENCE_DETAIL_MANIP_HPP - -#include -#include -#include -#include -#include - -// Tuple I/O manipulators - -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -FUSION_MSVC_ETI_WRAPPER(char_type) -FUSION_MSVC_ETI_WRAPPER(traits_type) -# define FUSION_GET_CHAR_TYPE(T) get_char_type::type -# define FUSION_GET_TRAITS_TYPE(T) get_traits_type::type -#else -# define FUSION_GET_CHAR_TYPE(T) typename T::char_type -# define FUSION_GET_TRAITS_TYPE(T) typename T::traits_type -#endif - -#if defined (BOOST_NO_TEMPLATED_STREAMS) -#define FUSION_STRING_OF_STREAM(Stream) std::string -#else -#define FUSION_STRING_OF_STREAM(Stream) \ - std::basic_string< \ - FUSION_GET_CHAR_TYPE(Stream) \ - , FUSION_GET_TRAITS_TYPE(Stream) \ - > -#endif - -namespace boost { namespace fusion -{ - namespace detail - { - template - int get_xalloc_index(Tag* = 0) - { - // each Tag will have a unique index - static int index = std::ios::xalloc(); - return index; - } - - template - struct stream_data - { - struct arena - { - ~arena() - { - for ( - typename std::vector::iterator i = data.begin() - ; i != data.end() - ; ++i) - { - delete *i; - } - } - - std::vector data; - }; - - static void attach(Stream& stream, T const& data); - static T const* get(Stream& stream); - }; - - template - void stream_data::attach(Stream& stream, T const& data) - { - static arena ar; // our arena - ar.data.push_back(new T(data)); - stream.pword(get_xalloc_index()) = ar.data.back(); - } - - template - T const* stream_data::get(Stream& stream) - { - return (T const*)stream.pword(get_xalloc_index()); - } - - template - class string_ios_manip - { - public: - - typedef FUSION_STRING_OF_STREAM(Stream) string_type; - - typedef stream_data stream_data_t; - - string_ios_manip(Stream& str_); - void set(string_type const& s); - void print(char const* default_) const; - void read(char const* default_) const; - private: - - template - void - check_delim(Char c) const - { - if (!isspace(c)) - { - if (stream.get() != c) - { - stream.unget(); - stream.setstate(std::ios::failbit); - } - } - } - - Stream& stream; - }; - - template - string_ios_manip::string_ios_manip(Stream& str_) - : stream(str_) - {} - - template - void - string_ios_manip::set(string_type const& s) - { - stream_data_t::attach(stream, s); - } - - template - void - string_ios_manip::print(char const* default_) const - { - // print a delimiter - string_type const* p = stream_data_t::get(stream); - if (p) - stream << *p; - else - stream << default_; - } - - template - void - string_ios_manip::read(char const* default_) const - { - // read a delimiter - string_type const* p = stream_data_t::get(stream); - using namespace std; - ws(stream); - - if (p) - { - typedef typename string_type::const_iterator iterator; - for (iterator i = p->begin(); i != p->end(); ++i) - check_delim(*i); - } - else - { - while (*default_) - check_delim(*default_++); - } - } - - } // detail - -#if defined (BOOST_NO_TEMPLATED_STREAMS) - -#define STD_TUPLE_DEFINE_MANIPULATOR(name) \ - namespace detail \ - { \ - struct name##_tag; \ - \ - struct name##_type \ - { \ - typedef std::string string_type; \ - string_type data; \ - name##_type(const string_type& d): data(d) {} \ - }; \ - \ - template \ - Stream& operator>>(Stream& s, const name##_type& m) \ - { \ - string_ios_manip(s).set(m.data); \ - return s; \ - } \ - \ - template \ - Stream& operator<<(Stream& s, const name##_type& m) \ - { \ - string_ios_manip(s).set(m.data); \ - return s; \ - } \ - } - -#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ - inline detail::name##_type \ - name(const std::string& s) \ - { \ - return detail::name##_type(s); \ - } \ - \ - inline detail::name##_type \ - name(const char* s) \ - { \ - return detail::name##_type(std::string(s)); \ - } \ - \ - inline detail::name##_type \ - name(char c) \ - { \ - return detail::name##_type(std::string(1, c)); \ - } - -#else // defined(BOOST_NO_TEMPLATED_STREAMS) - -#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - -#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ - template \ - inline detail::name##_type \ - name(const std::basic_string& s) \ - { \ - return detail::name##_type(s); \ - } \ - \ - inline detail::name##_type \ - name(char const* s) \ - { \ - return detail::name##_type(std::basic_string(s)); \ - } \ - \ - inline detail::name##_type \ - name(wchar_t const* s) \ - { \ - return detail::name##_type(std::basic_string(s)); \ - } \ - \ - inline detail::name##_type \ - name(char c) \ - { \ - return detail::name##_type(std::basic_string(1, c)); \ - } \ - \ - inline detail::name##_type \ - name(wchar_t c) \ - { \ - return detail::name##_type(std::basic_string(1, c)); \ - } - -#else // defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) - -#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ - template \ - inline detail::name##_type \ - name(const std::basic_string& s) \ - { \ - return detail::name##_type(s); \ - } \ - \ - template \ - inline detail::name##_type \ - name(Char s[]) \ - { \ - return detail::name##_type(std::basic_string(s)); \ - } \ - \ - template \ - inline detail::name##_type \ - name(Char const s[]) \ - { \ - return detail::name##_type(std::basic_string(s)); \ - } \ - \ - template \ - inline detail::name##_type \ - name(Char c) \ - { \ - return detail::name##_type(std::basic_string(1, c)); \ - } - -#endif - -#define STD_TUPLE_DEFINE_MANIPULATOR(name) \ - namespace detail \ - { \ - struct name##_tag; \ - \ - template > \ - struct name##_type \ - { \ - typedef std::basic_string string_type; \ - string_type data; \ - name##_type(const string_type& d): data(d) {} \ - }; \ - \ - template \ - Stream& operator>>(Stream& s, const name##_type& m) \ - { \ - string_ios_manip(s).set(m.data); \ - return s; \ - } \ - \ - template \ - Stream& operator<<(Stream& s, const name##_type& m) \ - { \ - string_ios_manip(s).set(m.data); \ - return s; \ - } \ - } \ - -#endif // defined(BOOST_NO_TEMPLATED_STREAMS) - - STD_TUPLE_DEFINE_MANIPULATOR(tuple_open) - STD_TUPLE_DEFINE_MANIPULATOR(tuple_close) - STD_TUPLE_DEFINE_MANIPULATOR(tuple_delimiter) - - STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_open) - STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_close) - STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_delimiter) - -#undef STD_TUPLE_DEFINE_MANIPULATOR -#undef STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS -#undef FUSION_STRING_OF_STREAM -#undef FUSION_GET_CHAR_TYPE -#undef FUSION_GET_TRAITS_TYPE - -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/range_begin_end_traits.hpp b/include/boost/spirit/fusion/sequence/detail/range_begin_end_traits.hpp deleted file mode 100644 index 2bdae7bbb..000000000 --- a/include/boost/spirit/fusion/sequence/detail/range_begin_end_traits.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_RANGE_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_RANGE_BEGIN_END_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct range_tag; - - template - struct range; - - template - struct begin_impl; - - namespace range_detail - { - template - struct begin_traits_impl - { - typedef typename Sequence::begin_type type; - - static type - call(Sequence const& s); - }; - - template - inline typename begin_traits_impl::type - begin_traits_impl::call(Sequence const& s) - { - return s.first; - } - - template - struct end_traits_impl - { - typedef typename Sequence::end_type type; - - static type - call(Sequence const& s); - }; - - template - inline typename end_traits_impl::type - end_traits_impl::call(Sequence const& s) - { - return s.last; - } - } - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply : range_detail::begin_traits_impl - {}; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply : range_detail::end_traits_impl - {}; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_base.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_base.hpp deleted file mode 100644 index 782c3fdf3..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_base.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_BASE_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_BASE_HPP - -namespace boost { namespace fusion -{ - struct sequence_root {}; - - template - struct sequence_base : sequence_root - { - Sequence const& - cast() const; - - Sequence& - cast(); - }; - - template - Sequence const& - sequence_base::cast() const - { - return static_cast(*this); - } - - template - Sequence& - sequence_base::cast() - { - return static_cast(*this); - } - -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_equal_to.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_equal_to.hpp deleted file mode 100644 index 6daf3eefc..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_equal_to.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_EQUAL_TO_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_EQUAL_TO_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace sequence_equal_to_detail { - template - bool call(T const& self,I1 const& a, I2 const& b) { - return fusion::deref(a) == fusion::deref(b) - && T::call(fusion::next(a), fusion::next(b)); - } - } - - template - struct sequence_equal_to - { - typedef typename meta::end::type end1_type; - typedef typename meta::end::type end2_type; - - template - static bool - call(I1 const& a, I2 const& b) - { - typename meta::equal_to::type eq; - return call(a, b, eq); - } - - template - static bool - call(I1 const&, I2 const&, mpl::true_) - { - BOOST_STATIC_ASSERT((meta::equal_to::value)); - return true; - } - - template - static bool - call(I1 const& a, I2 const& b, mpl::false_) - { - return sequence_equal_to_detail::call(sequence_equal_to(),a,b); - } - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_greater.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_greater.hpp deleted file mode 100644 index 49cbbe1d3..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_greater.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_GREATER_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_GREATER_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace sequence_greater_detail { - template - bool call(T const& self,I1 const& a, I2 const& b) { - return (*b < *a) || !(*a < *b) && T::call(fusion::next(a), fusion::next(b)); - } - } - - template - struct sequence_greater - { - typedef typename meta::end::type end1_type; - typedef typename meta::end::type end2_type; - - template - static bool - call(I1 const& a, I2 const& b) - { - typename meta::equal_to::type eq; - return call(a, b, eq); - } - - template - static bool - call(I1 const&, I2 const&, mpl::true_) - { - BOOST_STATIC_ASSERT((meta::equal_to::value)); - return false; - } - - template - static bool - call(I1 const& a, I2 const& b, mpl::false_) - { - return sequence_greater_detail::call(sequence_greater(),a,b); - } - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_greater_equal.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_greater_equal.hpp deleted file mode 100644 index 5ccbb9eb9..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_greater_equal.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_GREATER_EQUAL_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_GREATER_EQUAL_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace sequence_greater_equal_detail { - template - bool call(T const& self,I1 const& a, I2 const& b) { - return *b < *a - || !(*a < *b) && T::call(fusion::next(a), fusion::next(b)); - } - } - - template - struct sequence_greater_equal - { - typedef typename meta::end::type end1_type; - typedef typename meta::end::type end2_type; - - template - static bool - call(I1 const& a, I2 const& b) - { - typename meta::equal_to::type eq; - return call(a, b, eq); - } - - template - static bool - call(I1 const&, I2 const&, mpl::true_) - { - BOOST_STATIC_ASSERT((meta::equal_to::value)); - return true; - } - - template - static bool - call(I1 const& a, I2 const& b, mpl::false_) - { - return sequence_greater_equal_detail::call(sequence_greater_equal(),a,b); - } - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_less.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_less.hpp deleted file mode 100644 index caf1a5872..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_less.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_LESS_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_LESS_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace sequence_less_detail { - template - bool call(T const& self,I1 const& a, I2 const& b) { - return *a < *b - || !(*b < *a) - && T::call(fusion::next(a), fusion::next(b)); - } - } - - template - struct sequence_less - { - typedef typename meta::end::type end1_type; - typedef typename meta::end::type end2_type; - - template - static bool - call(I1 const& a, I2 const& b) - { - typename meta::equal_to::type eq; - return call(a, b, eq); - } - - template - static bool - call(I1 const&, I2 const&, mpl::true_) - { - BOOST_STATIC_ASSERT((meta::equal_to::value)); - return false; - } - - template - static bool - call(I1 const& a, I2 const& b, mpl::false_) - { - return sequence_less_detail::call(sequence_less(),a,b); - } - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_less_equal.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_less_equal.hpp deleted file mode 100644 index e36a98007..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_less_equal.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_LESS_EQUAL_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_LESS_EQUAL_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace sequence_less_equal_detail { - template - bool call(T const& self,I1 const& a, I2 const& b) { - return *a < *b || !(*b < *a) && T::call(fusion::next(a), fusion::next(b)); - } - } - - template - struct sequence_less_equal - { - typedef typename meta::end::type end1_type; - typedef typename meta::end::type end2_type; - - template - static bool - call(I1 const& a, I2 const& b) - { - typename meta::equal_to::type eq; - return call(a, b, eq); - } - - template - static bool - call(I1 const&, I2 const&, mpl::true_) - { - BOOST_STATIC_ASSERT((meta::equal_to::value)); - return true; - } - - template - static bool - call(I1 const& a, I2 const& b, mpl::false_) - { - return sequence_less_equal_detail::call(sequence_less_equal(),a,b); - } - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/sequence_not_equal_to.hpp b/include/boost/spirit/fusion/sequence/detail/sequence_not_equal_to.hpp deleted file mode 100644 index e230c2917..000000000 --- a/include/boost/spirit/fusion/sequence/detail/sequence_not_equal_to.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_NOT_EQUAL_TO_HPP) -#define FUSION_SEQUENCE_DETAIL_SEQUENCE_NOT_EQUAL_TO_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - namespace sequence_not_equal_to_detail { - template - bool call(T const& self,I1 const& a, I2 const& b) { - return !(*a == *b) - || T::call(fusion::next(a), fusion::next(b)); - } - } - template - struct sequence_not_equal_to - { - typedef typename meta::end::type end1_type; - typedef typename meta::end::type end2_type; - - template - static bool - call(I1 const& a, I2 const& b) - { - typename meta::equal_to::type eq; - return call(a, b, eq); - } - - template - static bool - call(I1 const&, I2 const&, mpl::true_) - { - BOOST_STATIC_ASSERT((meta::equal_to::value)); - return false; - } - - template - static bool - call(I1 const& a, I2 const& b, mpl::false_) - { - return sequence_not_equal_to_detail::call(sequence_not_equal_to(),a,b); - } - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/single_view_begin_end_trts.hpp b/include/boost/spirit/fusion/sequence/detail/single_view_begin_end_trts.hpp deleted file mode 100644 index 86173e28e..000000000 --- a/include/boost/spirit/fusion/sequence/detail/single_view_begin_end_trts.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_SINGLE_VIEW_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_SINGLE_VIEW_BEGIN_END_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct single_view_tag; - - template - struct single_view_iterator_end; - - template - struct single_view_iterator; - - namespace single_view_detail - { - template - struct begin_traits_impl - { - typedef single_view_iterator type; - - static type - call(Sequence& s); - }; - - template - inline typename begin_traits_impl::type - begin_traits_impl::call(Sequence& s) - { - return type(s); - } - - template - struct end_traits_impl - { - typedef single_view_iterator_end type; - - static type - call(Sequence&); - }; - - template - inline typename end_traits_impl::type - end_traits_impl::call(Sequence&) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - } - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply : single_view_detail::begin_traits_impl {}; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply : single_view_detail::end_traits_impl {}; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/detail/trsfrm_view_begin_end_trts.hpp b/include/boost/spirit/fusion/sequence/detail/trsfrm_view_begin_end_trts.hpp deleted file mode 100644 index 19e513c9c..000000000 --- a/include/boost/spirit/fusion/sequence/detail/trsfrm_view_begin_end_trts.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TRANSFORM_VIEW_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_TRANSFORM_VIEW_BEGIN_END_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct transform_view_tag; - - template - struct transform_view; - - template - struct transform_view_iterator; - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply - { - typedef typename Sequence::first_type first_type; - typedef typename Sequence::transform_type transform_type; - typedef transform_view_iterator type; - - static type - call(Sequence& s) - { - return type(s.first, s.f); - } - }; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply - { - typedef typename Sequence::last_type last_type; - typedef typename Sequence::transform_type transform_type; - typedef transform_view_iterator type; - - static type - call(Sequence& s) - { - return type(s.last, s.f); - } - }; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/detail/tuple10.hpp b/include/boost/spirit/fusion/sequence/detail/tuple10.hpp deleted file mode 100644 index c24f196f1..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple10.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE10_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE10_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include -#endif - -namespace boost { namespace fusion -{ - namespace detail - { - struct disambiguate_as_tuple {}; - struct disambiguate_as_data {}; - struct disambiguate_as_iterator {}; - - template - struct disambiguate - { - typedef typename - mpl::if_< - is_convertible - , disambiguate_as_data - , typename mpl::if_< - is_base_and_derived - , disambiguate_as_tuple - , disambiguate_as_iterator - >::type - >::type - type; - - static type - call() - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - }; - - template - struct tuple_access; - - template <> - struct tuple_access<0> - { - template - static typename tuple_access_result::type - get(Tuple& t) - { - FUSION_RETURN_TUPLE_MEMBER(0); - } - }; - - template <> - struct tuple_access<1> - { - template - static typename tuple_access_result::type - get(Tuple& t) - { - FUSION_RETURN_TUPLE_MEMBER(1); - } - }; - - template <> - struct tuple_access<2> - { - template - static typename tuple_access_result::type - get(Tuple& t) - { - FUSION_RETURN_TUPLE_MEMBER(2); - } - }; - -}}} // namespace boost::fusion::detail - -/////////////////////////////////////////////////////////////////////////////// -// -// Bring in the rest of the fixed-tuples using the pre-processor. Generate -// expansions for the tuple_access and tupleN+1 classes for N = 3..10. -// -/////////////////////////////////////////////////////////////////////////////// -#include - -namespace boost { namespace fusion -{ - namespace detail - { - BOOST_PP_REPEAT_FROM_TO(3, 10, FUSION_TUPLE_N_ACCESS, _) - } - - struct tuple_tag; - -# define BOOST_PP_ITERATION_PARAMS_1 (3, (4, 10, )) -# include BOOST_PP_ITERATE() -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_access_result.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_access_result.hpp deleted file mode 100644 index eb18b8871..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_access_result.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_ACCESS_RESULT_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_ACCESS_RESULT_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace detail -{ - template - struct tuple_access_result - { - typedef mpl::at_c element; - typedef typename - mpl::eval_if< - is_const - , cref_result - , ref_result - >::type - type; - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_at_traits.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_at_traits.hpp deleted file mode 100644 index f1be6119d..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_at_traits.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_AT_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_AT_TRAITS_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_tag; - - namespace detail - { - template - struct tuple_access; - } - - namespace detail - { - template - struct tuple_at_impl - { - typedef BOOST_DEDUCED_TYPENAME - boost::fusion::detail::tuple_access_result::type - type; - - static type - call(Sequence& t); - }; - - template - inline typename tuple_at_impl::type - tuple_at_impl::call(Sequence& t) - { - return detail::tuple_access::get(t); - } - } - - namespace meta - { - template - struct at_impl; - - template <> - struct at_impl - { - template - struct apply : detail::tuple_at_impl {}; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_begin_end_traits.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_begin_end_traits.hpp deleted file mode 100644 index e81551626..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_begin_end_traits.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_BEGIN_END_TRAITS_HPP - -#include - -namespace boost { namespace fusion -{ - struct tuple_tag; - - template - struct tuple_iterator; - - namespace tuple_detail - { - template - struct begin_traits_impl - { - typedef tuple_iterator<0, Tuple> type; - - static type - call(Tuple& t); - }; - - template - inline typename begin_traits_impl::type - begin_traits_impl::call(Tuple& t) - { - return type(t); - } - - template - struct end_traits_impl - { - typedef typename Tuple::size size; - typedef tuple_iterator type; - - static type - call(Tuple& t); - }; - - template - inline typename end_traits_impl::type - end_traits_impl::call(Tuple& t) - { - return type(t); - } - } - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply : tuple_detail::begin_traits_impl {}; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply : tuple_detail::end_traits_impl {}; - }; - } -}} - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace meta -{ - template - struct generate; - - template - struct push_front; -}}} - -namespace boost { namespace mpl -{ - // these mpl traits really ought to be placed somewhere else - - template - struct begin_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template - struct end_impl; - - template <> - struct end_impl - : fusion::meta::end_impl {}; - - template - struct clear_impl; - - template <> - struct clear_impl - { - template - struct apply - { - typedef fusion::tuple<> type; - }; - }; - - template - struct push_front_impl; - - template <> - struct push_front_impl - { - template - struct apply - { - typedef typename fusion::meta::push_front func1_; - typedef typename fusion::meta::generate::type - type; - }; - }; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_body.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_body.hpp deleted file mode 100755 index 81aa65c52..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_body.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright David Abrahams 2003. Use, modification and distribution is -// 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) - -// !!No include guards, intentionally!! - -#define N BOOST_PP_ITERATION() - -template -struct BOOST_PP_CAT(tuple, N); - -template -struct BOOST_PP_CAT(tuple_data, N) - : sequence_base > -{ - typedef mpl::BOOST_PP_CAT(vector, N) types; - typedef tuple_tag tag; - typedef mpl::int_ size; - typedef BOOST_PP_CAT(tuple_data, N) identity_type; - - BOOST_PP_CAT(tuple_data, N)() - : BOOST_PP_ENUM(N, FUSION_TUPLE_MEMBER_DEFAULT_INIT, _) {} - - BOOST_PP_CAT(tuple_data, N)(BOOST_PP_ENUM_BINARY_PARAMS( - N, typename detail::call_param::type _)) - : BOOST_PP_ENUM(N, FUSION_TUPLE_MEMBER_INIT, _) {} - - template - BOOST_PP_CAT(tuple_data, N)(detail::disambiguate_as_iterator, - BOOST_PP_ENUM_BINARY_PARAMS(N, A, & _)) - : BOOST_PP_ENUM(N, FUSION_TUPLE_MEMBER_ITERATOR_INIT, _) {} - - BOOST_PP_REPEAT(N, FUSION_TUPLE_MEMBER, _) -}; - -template -struct BOOST_PP_CAT(tuple, N) - : BOOST_PP_CAT(tuple_data, N) -{ - typedef BOOST_PP_CAT(tuple_data, N)< - BOOST_PP_ENUM_PARAMS(N, T)> base_type; - - BOOST_PP_CAT(tuple, N)() - : base_type() - {} - - BOOST_PP_CAT(tuple, N)(BOOST_PP_ENUM_BINARY_PARAMS( - N, typename detail::call_param::type _)) - : base_type(BOOST_PP_ENUM_PARAMS(N, _)) - {} - - template - explicit BOOST_PP_CAT(tuple, N)(X const& x) - : base_type(construct(x, &x)) - {} - - template - BOOST_PP_CAT(tuple, N)& - operator=(BOOST_PP_CAT(tuple, N) const& t) - { - BOOST_PP_REPEAT(N, FUSION_TUPLE_MEMBER_ASSIGN, _) - return *this; - } - -private: - - template - static base_type - construct(i0_type const& i0, void const*) - { - FUSION_TUPLE_CONSTRUCT_FROM_ITER(N) - return base_type( - detail::disambiguate_as_iterator(), BOOST_PP_ENUM_PARAMS(N, i)); - } - - template - static base_type - construct(Tuple const& t, sequence_root const*) - { - return base_type(BOOST_PP_ENUM_PARAMS(N, t.m)); - } -}; - -#undef N - diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_builder.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_builder.hpp deleted file mode 100644 index 53602455d..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_builder.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_BUILDER_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_BUILDER_HPP - -#include -#include - -// include tuple0..N where N is FUSION_MAX_TUPLE_SIZE -#include -#if (FUSION_MAX_TUPLE_SIZE > 10) -#include -#endif -#if (FUSION_MAX_TUPLE_SIZE > 20) -#include -#endif -#if (FUSION_MAX_TUPLE_SIZE > 30) -#include -#endif -#if (FUSION_MAX_TUPLE_SIZE > 40) -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct void_t; -}} - -namespace boost { namespace fusion { namespace detail -{ - template - struct get_tuple_n; - - template <> - struct get_tuple_n<0> - { - template - struct call - { - typedef tuple0 type; - }; - }; - -#define FUSION_GET_TUPLE_N(z, n, _) \ - template <> \ - struct get_tuple_n \ - { \ - template \ - struct call \ - { \ - typedef BOOST_PP_CAT(tuple, n) type; \ - }; \ - }; - - BOOST_PP_REPEAT_FROM_TO(1, FUSION_MAX_TUPLE_SIZE, FUSION_GET_TUPLE_N, _) -#undef FUSION_GET_TUPLE_N - - template - struct tuple_builder - { - typedef - mpl::BOOST_PP_CAT(vector, FUSION_MAX_TUPLE_SIZE) - - input; - - typedef typename mpl::begin::type begin; - typedef typename mpl::find::type end; - typedef typename mpl::distance::type size; - - typedef typename get_tuple_n::template - call::type - type; - }; -}}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_macro.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_macro.hpp deleted file mode 100644 index 8192b7b76..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_macro.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_MACRO_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_MACRO_HPP - -/////////////////////////////////////////////////////////////////////////////// -// -// Pre-processor gunk. See tuple10.hpp and detail/tuple10.hpp. The -// following code is the preprocessor version of the code found in -// those files, plus/minus a few specific details (specifically, -// the tuple_access and tupleN+1 classes). -// -/////////////////////////////////////////////////////////////////////////////// -#include -#include -#include -#include -#include -#include -#include -#include - -#define FUSION_TUPLE_N_ACCESS(z, n, _) \ - \ - template <> \ - struct tuple_access \ - { \ - template \ - static typename tuple_access_result::type \ - get(Tuple& t) \ - { \ - FUSION_RETURN_TUPLE_MEMBER(n); \ - } \ - }; - -#define FUSION_TUPLE_MEMBER_DEFAULT_INIT(z, n, _) \ - BOOST_PP_CAT(m, n)(BOOST_PP_CAT(T, n)()) - -#define FUSION_TUPLE_MEMBER_INIT(z, n, _) \ - BOOST_PP_CAT(m, n)(BOOST_PP_CAT(_, n)) - -#define FUSION_TUPLE_MEMBER_ITERATOR_INIT(z, n, _) \ - BOOST_PP_CAT(m, n)(*BOOST_PP_CAT(_, n)) - -#define FUSION_TUPLE_MEMBER(z, n, _) \ - BOOST_PP_CAT(T, n) BOOST_PP_CAT(m, n); - -#define FUSION_TUPLE_MEMBER_ASSIGN(z, n, _) \ - this->BOOST_PP_CAT(m, n) = t.BOOST_PP_CAT(m, n); - -#define FUSION_TUPLE_RESULT_OF_NEXT_TYPE(z, n, _) \ - typedef typename meta::next< \ - BOOST_PP_CAT(BOOST_PP_CAT(i, n), _type)>::type \ - BOOST_PP_CAT(BOOST_PP_CAT(i, BOOST_PP_INC(n)), _type); - -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -# define FUSION_TUPLE_RESULT_OF_NEXT(z, n, _) \ - next_iter::BOOST_PP_CAT(BOOST_PP_CAT(i, BOOST_PP_INC(n)), _type) \ - BOOST_PP_CAT(i, BOOST_PP_INC(n))(fusion::next(BOOST_PP_CAT(i, n))); -#else -# define FUSION_TUPLE_RESULT_OF_NEXT(z, n, _) \ - FUSION_TUPLE_RESULT_OF_NEXT_TYPE(z, n, _) \ - BOOST_PP_CAT(BOOST_PP_CAT(i, BOOST_PP_INC(n)), _type) \ - BOOST_PP_CAT(i, BOOST_PP_INC(n))(fusion::next(BOOST_PP_CAT(i, n))); -#endif - -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -# define FUSION_TUPLE_NEXT_ITER_N(z, n, _) \ - namespace detail \ - { \ - template \ - struct BOOST_PP_CAT(next_iter, n) \ - { \ - BOOST_PP_REPEAT( \ - BOOST_PP_DEC(n), FUSION_TUPLE_RESULT_OF_NEXT_TYPE, _) \ - }; \ - } - -#else -# define FUSION_TUPLE_NEXT_ITER_N(z, n, _) -#endif - -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) -# define FUSION_TUPLE_CONSTRUCT_FROM_ITER(n) \ - typedef detail::BOOST_PP_CAT(next_iter, n) next_iter; \ - BOOST_PP_REPEAT(BOOST_PP_DEC(n), FUSION_TUPLE_RESULT_OF_NEXT, _) -#else -# define FUSION_TUPLE_CONSTRUCT_FROM_ITER(n) \ - BOOST_PP_REPEAT(BOOST_PP_DEC(n), FUSION_TUPLE_RESULT_OF_NEXT, _) -#endif - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_size_traits.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_size_traits.hpp deleted file mode 100644 index dc1e86d06..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_size_traits.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_SIZE_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_SIZE_TRAITS_HPP - -namespace boost { namespace fusion -{ - struct tuple_tag; - - namespace meta - { - template - struct size_impl; - - template <> - struct size_impl - { - template - struct apply : Sequence::size {}; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/tuple_value_at_traits.hpp b/include/boost/spirit/fusion/sequence/detail/tuple_value_at_traits.hpp deleted file mode 100644 index 9c5e7d910..000000000 --- a/include/boost/spirit/fusion/sequence/detail/tuple_value_at_traits.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TUPLE_VALUE_AT_TRAITS_IPP) -#define FUSION_SEQUENCE_DETAIL_TUPLE_VALUE_AT_TRAITS_IPP - -#include -#include - -namespace boost { namespace fusion -{ - struct tuple_tag; - - namespace meta - { - template - struct value_at_impl; - - template <> - struct value_at_impl - { - template - struct apply - { - typedef typename - mpl::at_c::type - type; - }; - }; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/detail/type_seq_begin_end_trts.hpp b/include/boost/spirit/fusion/sequence/detail/type_seq_begin_end_trts.hpp deleted file mode 100644 index 86352cd53..000000000 --- a/include/boost/spirit/fusion/sequence/detail/type_seq_begin_end_trts.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_DETAIL_TYPE_SEQUENCE_BEGIN_END_TRAITS_HPP) -#define FUSION_SEQUENCE_DETAIL_TYPE_SEQUENCE_BEGIN_END_TRAITS_HPP - -#include -#include - -namespace boost { namespace fusion -{ - template - struct type_sequence_iterator; - - struct type_sequence_tag; - - template - struct type_sequence; - - namespace meta - { - template - struct begin_impl; - - template <> - struct begin_impl - { - template - struct apply - { - typedef type_sequence_iterator< - typename mpl::begin::type> - type; - - static type - call(Sequence) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - }; - }; - - template - struct end_impl; - - template <> - struct end_impl - { - template - struct apply - { - typedef type_sequence_iterator< - typename mpl::end::type> - type; - - static type - call(Sequence) - { - FUSION_RETURN_DEFAULT_CONSTRUCTED; - } - }; - }; - } -}} - -namespace boost { namespace mpl -{ - template - struct begin_impl; - - template - struct end_impl; - - template <> - struct begin_impl - : fusion::meta::begin_impl {}; - - template <> - struct end_impl - : fusion::meta::end_impl {}; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/end.hpp b/include/boost/spirit/fusion/sequence/end.hpp deleted file mode 100644 index 82fdfc6ce..000000000 --- a/include/boost/spirit/fusion/sequence/end.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_END_HPP) -#define FUSION_SEQUENCE_END_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct end_impl - { - template - struct apply { - typedef int type; - }; - }; - - template - struct end - { - typedef as_fusion_sequence seq_converter; - typedef typename seq_converter::type seq; - - typedef typename - end_impl:: - template apply::type - type; - }; - } - -#if BOOST_WORKAROUND(BOOST_MSVC,<=1300) - namespace detail { - template - inline typename meta::end::type - end(Sequence const& seq,mpl::true_) - { - typedef meta::end end_meta; - return meta::end_impl:: - template apply::call( - end_meta::seq_converter::convert_const(seq)); - } - - template - inline typename meta::end::type - end(Sequence& seq,mpl::false_) - { - typedef meta::end end_meta; - return meta::end_impl:: - template apply::call( - end_meta::seq_converter::convert(seq)); - } - - } - template - inline typename meta::end::type - end(Sequence& seq) - { - return detail::end(seq,is_const()); - } -#else - template - inline typename meta::end::type - end(Sequence const& seq) - { - typedef meta::end end_meta; - return meta::end_impl:: - template apply::call( - end_meta::seq_converter::convert_const(seq)); - } - - template - inline typename meta::end::type - end(Sequence& seq) - { - typedef meta::end end_meta; - return meta::end_impl:: - template apply::call( - end_meta::seq_converter::convert(seq)); - } -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/equal_to.hpp b/include/boost/spirit/fusion/sequence/equal_to.hpp deleted file mode 100644 index da2f4c64d..000000000 --- a/include/boost/spirit/fusion/sequence/equal_to.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_EQUAL_TO_HPP) -#define FUSION_SEQUENCE_EQUAL_TO_HPP - -#include -#include -#include - -#ifdef FUSION_COMFORMING_COMPILER -#include -#include -#include -#endif - -namespace boost { namespace fusion -{ - template - inline bool - operator==(sequence_base const& a, sequence_base const& b) - { - return detail::sequence_equal_to:: - call( - fusion::begin(a.cast()) - , fusion::begin(b.cast()) - ); - } - -#ifdef FUSION_COMFORMING_COMPILER - - template - inline typename disable_if, bool>::type - operator==(sequence_base const& a, Seq2 const& b) - { - return a == as_fusion_sequence::convert_const(b); - } - - template - inline typename disable_if, bool>::type - operator==(Seq1 const& a, sequence_base const& b) - { - return as_fusion_sequence::convert_const(a) == b; - } - -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/filter_view.hpp b/include/boost/spirit/fusion/sequence/filter_view.hpp deleted file mode 100644 index ea5f99070..000000000 --- a/include/boost/spirit/fusion/sequence/filter_view.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_FILTER_VIEW_HPP) -#define FUSION_SEQUENCE_FILTER_VIEW_HPP - -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct filter_view_tag; - - template - struct filter_view : sequence_base > - { - typedef as_fusion_sequence seq_converter; - typedef typename seq_converter::type seq; - - typedef filter_view_tag tag; - typedef typename meta::begin::type first_type; - typedef typename meta::end::type last_type; - typedef Pred pred_type; - - filter_view(Sequence& seq) - : first(fusion::begin(seq)) - , last(fusion::end(seq)) - {} - - first_type first; - last_type last; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/generate.hpp b/include/boost/spirit/fusion/sequence/generate.hpp deleted file mode 100644 index 903909c39..000000000 --- a/include/boost/spirit/fusion/sequence/generate.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_GENERATE_HPP) -#define FUSION_SEQUENCE_GENERATE_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct generate - { - typedef typename as_fusion_sequence::type seq; - typedef typename - detail::result_of_generate< - typename meta::begin::type - , typename meta::end::type - >::type - type; - }; - } - - template - inline typename meta::generate::type - generate(Sequence const& seq) - { - typedef as_fusion_sequence converter; - return detail::generate( - fusion::begin(converter::convert_const(seq)) - , fusion::end(converter::convert_const(seq))); - } -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/get.hpp b/include/boost/spirit/fusion/sequence/get.hpp deleted file mode 100644 index 2eba18584..000000000 --- a/include/boost/spirit/fusion/sequence/get.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_GET_HPP) -#define FUSION_SEQUENCE_GET_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace detail - { - template - struct pair_element; - - template<> - struct pair_element<0> - { - template - static BOOST_DEDUCED_TYPENAME add_reference::type - get(std::pair& pr) - { - return pr.first; - } - - template - static BOOST_DEDUCED_TYPENAME add_reference::type - get(const std::pair& pr) - { - return pr.first; - } - }; - - template<> - struct pair_element<1> - { - template - static BOOST_DEDUCED_TYPENAME add_reference::type - get(std::pair& pr) - { - return pr.second; - } - - template - static BOOST_DEDUCED_TYPENAME add_reference::type - get(const std::pair& pr) - { - return pr.second; - } - }; - } - - /////////////////////////////////////////////////////////////////////////// - // - // get function - // - // Given a constant integer N and a sequence, returns a reference to - // the Nth element of the sequence. (N is a zero based index). Usage: - // - // get(seq) - // - // This function is provided here for compatibility with the tuples TR1 - // specification. This function forwards to at(seq). - // - /////////////////////////////////////////////////////////////////////////// - template - inline typename meta::at_c::type - get(sequence_base const& seq FUSION_GET_MSVC_WORKAROUND) - { - typedef meta::at_c at_meta; - return meta::at_impl:: - template apply::call( - at_meta::seq_converter::convert_const(seq.cast())); - -// return at(seq.cast()); - } - - template - inline typename meta::at_c::type - get(sequence_base& seq FUSION_GET_MSVC_WORKAROUND) - { - typedef meta::at_c at_meta; - return meta::at_impl:: - template apply::call( - at_meta::seq_converter::convert(seq.cast())); -// return at(seq.cast()); - } - - template - inline BOOST_DEDUCED_TYPENAME boost::add_reference< - BOOST_DEDUCED_TYPENAME tuple_element >::type>::type - get(std::pair& pr) - { - return detail::pair_element::get(pr); - } - - template - inline BOOST_DEDUCED_TYPENAME boost::add_reference< - const BOOST_DEDUCED_TYPENAME tuple_element >::type>::type - get(const std::pair& pr) - { - return detail::pair_element::get(pr); - } -}} - -#endif - diff --git a/include/boost/spirit/fusion/sequence/greater.hpp b/include/boost/spirit/fusion/sequence/greater.hpp deleted file mode 100644 index c52515c26..000000000 --- a/include/boost/spirit/fusion/sequence/greater.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_GREATER_HPP) -#define FUSION_SEQUENCE_GREATER_HPP - -#include -#include -#include - -#ifdef FUSION_COMFORMING_COMPILER -#include -#include -#include -#endif - -namespace boost { namespace fusion -{ - template - inline bool - operator>(sequence_base const& a, sequence_base const& b) - { - return detail::sequence_greater:: - call( - fusion::begin(a.cast()) - , fusion::begin(b.cast()) - ); - } - -#ifdef FUSION_COMFORMING_COMPILER - - template - inline typename disable_if, bool>::type - operator>(sequence_base const& a, Seq2 const& b) - { - return a > as_fusion_sequence::convert_const(b); - } - - template - inline typename disable_if, bool>::type - operator>(Seq1 const& a, sequence_base const& b) - { - return as_fusion_sequence::convert_const(a) > b; - } - -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/greater_equal.hpp b/include/boost/spirit/fusion/sequence/greater_equal.hpp deleted file mode 100644 index cd3e5dc56..000000000 --- a/include/boost/spirit/fusion/sequence/greater_equal.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_GREATER_EQUAL_HPP) -#define FUSION_SEQUENCE_GREATER_EQUAL_HPP - -#include -#include -#include - -#ifdef FUSION_COMFORMING_COMPILER -#include -#include -#include -#endif - -namespace boost { namespace fusion -{ - template - inline bool - operator>=(sequence_base const& a, sequence_base const& b) - { - return detail::sequence_greater_equal:: - call( - fusion::begin(a.cast()) - , fusion::begin(b.cast()) - ); - } - -#ifdef FUSION_COMFORMING_COMPILER - - template - inline typename disable_if, bool>::type - operator>=(sequence_base const& a, Seq2 const& b) - { - return a >= as_fusion_sequence::convert_const(b); - } - - template - inline typename disable_if, bool>::type - operator>=(Seq1 const& a, sequence_base const& b) - { - return as_fusion_sequence::convert_const(a) >= b; - } - -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/io.hpp b/include/boost/spirit/fusion/sequence/io.hpp deleted file mode 100644 index cceadc6dc..000000000 --- a/include/boost/spirit/fusion/sequence/io.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 1999-2003 Jeremiah Willcock - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(BOOST_IO_HPP) -#define BOOST_IO_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - /////////////////////////////////////////////////////////////////////////// - // - // Sequence I/O (<< and >> operators) - // - /////////////////////////////////////////////////////////////////////////// - - template - inline OStream& - operator<<(OStream& os, sequence_base const& seq) - { - detail::print_sequence(os, - as_fusion_sequence::convert(seq.cast())); - return os; - } - - template - inline IStream& - operator>>(IStream& is, sequence_base& seq) - { - detail::read_sequence(is, - as_fusion_sequence::convert(seq.cast())); - return is; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/is_sequence.hpp b/include/boost/spirit/fusion/sequence/is_sequence.hpp deleted file mode 100644 index 40615d7fd..000000000 --- a/include/boost/spirit/fusion/sequence/is_sequence.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_IS_SEQUENCE_HPP) -#define FUSION_SEQUENCE_IS_SEQUENCE_HPP - -#include -#include - -namespace boost { namespace fusion -{ - /////////////////////////////////////////////////////////////////////////// - // - // is_sequence metafunction - // - // Given a type T, returns a value true or false if T is a - // fusion sequence or not. Usage: - // - // is_sequence::value - // - /////////////////////////////////////////////////////////////////////////// - template - struct is_sequence : is_base_and_derived {}; - -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/joint_view.hpp b/include/boost/spirit/fusion/sequence/joint_view.hpp deleted file mode 100644 index ca1db7880..000000000 --- a/include/boost/spirit/fusion/sequence/joint_view.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_JOINT_VIEW_HPP) -#define FUSION_SEQUENCE_JOINT_VIEW_HPP - -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace boost { namespace fusion -{ - struct joint_view_tag; - - template - struct joint_view; - - template - struct joint_view : sequence_base > - { - typedef as_fusion_sequence view1_converter; - typedef typename view1_converter::type view1; - typedef as_fusion_sequence view2_converter; - typedef typename view2_converter::type view2; - - typedef joint_view_tag tag; - typedef typename meta::begin::type first_type; - typedef typename meta::end::type last_type; - typedef typename meta::begin::type concat_type; - typedef typename meta::end::type concat_last_type; - - joint_view(View1& view1, View2& view2); - - first_type first() const { return boost::fusion::begin(view1_); } - concat_type concat() const { return boost::fusion::begin(view2_); } - concat_last_type concat_last() const { return boost::fusion::end(view2_); } - - private: - typename boost::mpl::if_c::type view1_; - typename boost::mpl::if_c::type view2_; - }; - - template - joint_view::joint_view(View1& view1, View2& view2) - : view1_(view1), view2_(view2) - {} - -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/less.hpp b/include/boost/spirit/fusion/sequence/less.hpp deleted file mode 100644 index 3b176b3f2..000000000 --- a/include/boost/spirit/fusion/sequence/less.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_LESS_HPP) -#define FUSION_SEQUENCE_LESS_HPP - -#include -#include -#include - -#ifdef FUSION_COMFORMING_COMPILER -#include -#include -#include -#endif - -namespace boost { namespace fusion -{ - template - inline bool - operator<(sequence_base const& a, sequence_base const& b) - { - return detail::sequence_less:: - call( - fusion::begin(a.cast()) - , fusion::begin(b.cast()) - ); - } - -#ifdef FUSION_COMFORMING_COMPILER - - template - inline typename disable_if, bool>::type - operator<(sequence_base const& a, Seq2 const& b) - { - return a < as_fusion_sequence::convert_const(b); - } - - template - inline typename disable_if, bool>::type - operator<(Seq1 const& a, sequence_base const& b) - { - return as_fusion_sequence::convert_const(a) < b; - } - -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/less_equal.hpp b/include/boost/spirit/fusion/sequence/less_equal.hpp deleted file mode 100644 index 445f0e741..000000000 --- a/include/boost/spirit/fusion/sequence/less_equal.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_LESS_EQUAL_HPP) -#define FUSION_SEQUENCE_LESS_EQUAL_HPP - -#include -#include -#include - -#ifdef FUSION_COMFORMING_COMPILER -#include -#include -#include -#endif - -namespace boost { namespace fusion -{ - template - inline bool - operator<=(sequence_base const& a, sequence_base const& b) - { - return detail::sequence_less_equal:: - call( - fusion::begin(a.cast()) - , fusion::begin(b.cast()) - ); - } - -#ifdef FUSION_COMFORMING_COMPILER - - template - inline typename disable_if, bool>::type - operator<=(sequence_base const& a, Seq2 const& b) - { - return a <= as_fusion_sequence::convert_const(b); - } - - template - inline typename disable_if, bool>::type - operator<=(Seq1 const& a, sequence_base const& b) - { - return as_fusion_sequence::convert_const(a) <= b; - } - -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/limits.hpp b/include/boost/spirit/fusion/sequence/limits.hpp deleted file mode 100644 index 5c817973d..000000000 --- a/include/boost/spirit/fusion/sequence/limits.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_LIMITS_HPP) -#define FUSION_SEQUENCE_LIMITS_HPP - -#if !defined(FUSION_MAX_TUPLE_SIZE) -# define FUSION_MAX_TUPLE_SIZE 10 -#else -# if FUSION_MAX_TUPLE_SIZE < 3 -# undef FUSION_MAX_TUPLE_SIZE -# define FUSION_MAX_TUPLE_SIZE 10 -# endif -#endif - -#endif diff --git a/include/boost/spirit/fusion/sequence/make_tuple.hpp b/include/boost/spirit/fusion/sequence/make_tuple.hpp deleted file mode 100644 index 6b73bd018..000000000 --- a/include/boost/spirit/fusion/sequence/make_tuple.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_MAKE_TUPLE_HPP) -#define FUSION_SEQUENCE_MAKE_TUPLE_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - inline tuple<> - make_tuple() - { - return tuple<>(); - } - -#define BOOST_FUSION_AS_TUPLE_ELEMENT(z, n, data) \ - BOOST_DEDUCED_TYPENAME detail::as_tuple_element::type - -#define FUSION_MAKE_TUPLE(z, n, _) \ - \ - template \ - inline tuple \ - make_tuple(BOOST_PP_ENUM_BINARY_PARAMS(n, T, const& _)) \ - { \ - return tuple( \ - BOOST_PP_ENUM_PARAMS(n, _)); \ - } - - BOOST_PP_REPEAT_FROM_TO(1, FUSION_MAX_TUPLE_SIZE, FUSION_MAKE_TUPLE, _) - -#undef BOOST_FUSION_AS_TUPLE_ELEMENT -#undef FUSION_MAKE_TUPLE - -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/not_equal_to.hpp b/include/boost/spirit/fusion/sequence/not_equal_to.hpp deleted file mode 100644 index cdaf5c839..000000000 --- a/include/boost/spirit/fusion/sequence/not_equal_to.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_NOT_EQUAL_TO_HPP) -#define FUSION_SEQUENCE_NOT_EQUAL_TO_HPP - -#include -#include -#include - -#ifdef FUSION_COMFORMING_COMPILER -#include -#include -#include -#endif - -namespace boost { namespace fusion -{ - template - inline bool - operator!=(sequence_base const& a, sequence_base const& b) - { - return detail::sequence_not_equal_to:: - call( - fusion::begin(a.cast()) - , fusion::begin(b.cast()) - ); - } - -#ifdef FUSION_COMFORMING_COMPILER - - template - inline typename disable_if, bool>::type - operator!=(sequence_base const& a, Seq2 const& b) - { - return a != as_fusion_sequence::convert_const(b); - } - - template - inline typename disable_if, bool>::type - operator!=(Seq1 const& a, sequence_base const& b) - { - return as_fusion_sequence::convert_const(a) != b; - } - -#endif -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/prepend_view.hpp b/include/boost/spirit/fusion/sequence/prepend_view.hpp deleted file mode 100644 index c0e51ee70..000000000 --- a/include/boost/spirit/fusion/sequence/prepend_view.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_PREPEND_VIEW_HPP) -#define FUSION_SEQUENCE_PREPEND_VIEW_HPP - -#include -#include -#include - -namespace boost { namespace fusion -{ - template - struct prepend_view : joint_view, View> - { - prepend_view(View& view, typename detail::call_param::type val) - : joint_view, View>(held, view) - , held(val) {} - single_view held; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/range.hpp b/include/boost/spirit/fusion/sequence/range.hpp deleted file mode 100644 index ff7db2ac3..000000000 --- a/include/boost/spirit/fusion/sequence/range.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_RANGE_HPP) -#define FUSION_SEQUENCE_RANGE_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct range_tag; - - template - struct range : sequence_base > - { - typedef typename as_fusion_iterator::type begin_type; - typedef typename as_fusion_iterator::type end_type; - typedef range_tag tag; - - range(First const& first, Last const& last) - : first(as_fusion_iterator::convert(first)) - , last(as_fusion_iterator::convert(last)) {} - - begin_type first; - end_type last; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/single_view.hpp b/include/boost/spirit/fusion/sequence/single_view.hpp deleted file mode 100644 index 55a81a8ac..000000000 --- a/include/boost/spirit/fusion/sequence/single_view.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_SINGLE_VIEW_HPP) -#define FUSION_SEQUENCE_SINGLE_VIEW_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct single_view_tag; - - template - struct single_view : sequence_base > - { - typedef single_view_tag tag; - typedef typename detail::as_tuple_element::type value_type; - - single_view() - : val() {} - - explicit single_view(typename detail::call_param::type val) - : val(val) {} - - value_type val; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/size.hpp b/include/boost/spirit/fusion/sequence/size.hpp deleted file mode 100644 index 1fdc5b9b5..000000000 --- a/include/boost/spirit/fusion/sequence/size.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_SIZE_HPP) -#define FUSION_SEQUENCE_SIZE_HPP - -#include -#include - -namespace boost { namespace fusion -{ - /////////////////////////////////////////////////////////////////////////// - // - // size metafunction - // - // Get the size of a Sequence. Usage: - // - // size::value - // - /////////////////////////////////////////////////////////////////////////// - namespace meta - { - template - struct size_impl - { - template - struct apply {}; - }; - - template - struct size - : size_impl::type::tag>:: - template apply::type> - {}; - } -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tie.hpp b/include/boost/spirit/fusion/sequence/tie.hpp deleted file mode 100644 index 68e180300..000000000 --- a/include/boost/spirit/fusion/sequence/tie.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TIE_HPP) -#define FUSION_SEQUENCE_TIE_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - // Swallows any assignment (by Doug Gregor) - namespace detail - { - struct swallow_assign - { - template - swallow_assign const& - operator=(const T&) const - { - return *this; - } - }; - } - - // "ignore" allows tuple positions to be ignored when using "tie". - detail::swallow_assign const ignore = detail::swallow_assign(); - -#define FUSION_REFERENCE_TYPE(z, n, data) \ - BOOST_PP_CAT(T, n)& - -#define FUSION_TIE(z, n, _) \ - \ - template \ - inline tuple \ - tie(BOOST_PP_ENUM_BINARY_PARAMS(n, T, & _)) \ - { \ - return tuple( \ - BOOST_PP_ENUM_PARAMS(n, _)); \ - } - - BOOST_PP_REPEAT_FROM_TO(1, FUSION_MAX_TUPLE_SIZE, FUSION_TIE, _) - -#undef FUSION_REFERENCE_TYPE -#undef FUSION_TIE - -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/transform_view.hpp b/include/boost/spirit/fusion/sequence/transform_view.hpp deleted file mode 100644 index d1815b80a..000000000 --- a/include/boost/spirit/fusion/sequence/transform_view.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TRANSFORM_VIEW_HPP) -#define FUSION_SEQUENCE_TRANSFORM_VIEW_HPP - -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct transform_view_tag; - - template - struct transform_view : sequence_base > - { - typedef as_fusion_sequence seq_converter; - typedef typename seq_converter::type seq; - - typedef transform_view_tag tag; - typedef typename meta::begin::type first_type; - typedef typename meta::end::type last_type; - typedef F transform_type; - - transform_view(Sequence& seq, F f); - - first_type first; - last_type last; - transform_type f; - }; - - template - transform_view::transform_view(Sequence& seq, F f) - : first(fusion::begin(seq)) - , last(fusion::end(seq)) - , f(f) - {} -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/tuple.hpp b/include/boost/spirit/fusion/sequence/tuple.hpp deleted file mode 100644 index 5d27572ed..000000000 --- a/include/boost/spirit/fusion/sequence/tuple.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE_HPP) -#define FUSION_SEQUENCE_TUPLE_HPP - -#include // for std::pair -#include -#include -#include -#include -#include -#include - -#define FUSION_TUPLE_CONSTRUCTOR(z, n, _) \ - tuple(BOOST_PP_ENUM_BINARY_PARAMS( \ - n, typename detail::call_param::type _)) \ - : base_type(BOOST_PP_ENUM_PARAMS(n, _)) \ - {} - -namespace boost { namespace fusion -{ - struct void_t; - - template - struct tuple : - detail::tuple_builder< - BOOST_PP_ENUM_PARAMS(FUSION_MAX_TUPLE_SIZE, T) - >::type - { - typedef - typename detail::tuple_builder< - BOOST_PP_ENUM_PARAMS(FUSION_MAX_TUPLE_SIZE, T) - >::type - base_type; - - tuple() - : base_type() {} - - template - /*explicit*/ tuple(X const& x) - : base_type(x) {} - - explicit tuple(typename detail::call_param::type _0) - : base_type(_0) {} - - BOOST_PP_REPEAT_FROM_TO( - 2, FUSION_MAX_TUPLE_SIZE, FUSION_TUPLE_CONSTRUCTOR, _) - - template - tuple& operator=(X const& other) - { - base() = other; - return *this; - } - - typedef detail::tuple_builder builder; - - typedef typename builder::begin begin; - typedef typename builder::end end; - typedef typename builder::size size; - - base_type& base() { return *this; } - base_type const& base() const { return *this; } - }; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple10.hpp b/include/boost/spirit/fusion/sequence/tuple10.hpp deleted file mode 100644 index 16414183a..000000000 --- a/include/boost/spirit/fusion/sequence/tuple10.hpp +++ /dev/null @@ -1,307 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE10_HPP) -#define FUSION_SEQUENCE_TUPLE10_HPP - -#include -#include -#include -#include -#include // for std::pair -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct next; - } - - struct tuple_tag; - - struct tuple0 : sequence_base - { - typedef mpl::void_ types; - typedef tuple_tag tag; - typedef mpl::int_<0> size; - typedef tuple0 identity_type; - - tuple0() {} - - template - tuple0(Iterator const& i) {} - }; - - template - struct tuple1 : sequence_base > - { - typedef mpl::vector1 types; - typedef tuple_tag tag; - typedef mpl::int_<1> size; - typedef tuple1 identity_type; - - tuple1() - : m0(T0()) - {} - - template - explicit tuple1(X const& x) - : m0(construct(x, detail::disambiguate::call())) - {} - - tuple1(typename detail::call_param::type _0) - : m0(_0) - {} - - template - tuple1& operator=(tuple1 const& t) - { - m0 = t.m0; - return *this; - } - - tuple1& operator=(tuple1 const& t) - { - m0 = t.m0; - return *this; - } - - T0 m0; - - private: - - template - static T0 - construct(Iterator const& i, detail::disambiguate_as_iterator) - { - return *i; - } - - template - static T0 - construct(Tuple const& t, detail::disambiguate_as_tuple) - { - return t.m0; - } - - template - static T0 - construct(X const& v, detail::disambiguate_as_data) - { - return v; - } - }; - - template - struct tuple2; - - template - struct tuple_data2 : sequence_base > - { - typedef mpl::vector2 types; - typedef tuple_tag tag; - typedef mpl::int_<2> size; - typedef tuple_data2 identity_type; - - tuple_data2() - : m0(T0()) - , m1(T1()) - {} - - tuple_data2( - typename detail::call_param::type _0 - , typename detail::call_param::type _1 - ) - : m0(_0) - , m1(_1) - {} - - template - tuple_data2(detail::disambiguate_as_iterator, A0& _0, A1& _1) - : m0(*_0) - , m1(*_1) - {} - - T0 m0; - T1 m1; - }; - - template - struct tuple3; - - template - struct tuple_data3 : sequence_base > - { - typedef mpl::vector3 types; - typedef tuple_tag tag; - typedef mpl::int_<3> size; - typedef tuple_data3 identity_type; - - tuple_data3() - : m0(T0()) - , m1(T1()) - , m2(T2()) - {} - - tuple_data3( - typename detail::call_param::type _0 - , typename detail::call_param::type _1 - , typename detail::call_param::type _2 - ) - : m0(_0) - , m1(_1) - , m2(_2) - {} - - template - tuple_data3(detail::disambiguate_as_iterator, A0& _0, A1& _1, A2& _2) - : m0(*_0) - , m1(*_1) - , m2(*_2) - {} - - T0 m0; - T1 m1; - T2 m2; - }; - - template - struct tuple2 : tuple_data2 - { - tuple2() - : tuple_data2() - {} - - tuple2( - typename detail::call_param::type _0 - , typename detail::call_param::type _1 - ) - : tuple_data2(_0, _1) - {} - - template - explicit tuple2(X const& x) - : tuple_data2(construct(x, addressof(x))) - {} - - template - tuple2& operator=(tuple2 const& t) - { - this->m0 = t.m0; - this->m1 = t.m1; - return *this; - } - - template - tuple2& operator=(std::pair const& p) - { - this->m0 = p.first; - this->m1 = p.second; - return *this; - } - - private: - - template - static tuple_data2 - construct(Iterator const& i, void const*) - { - typedef typename meta::next::type i1_type; - i1_type i1(fusion::next(i)); - return tuple_data2(detail::disambiguate_as_iterator(), i, i1); - } - - template - static tuple_data2 - construct(Tuple const& t, sequence_root const*) - { - return tuple_data2(t.m0, t.m1); - } - - template - static tuple_data2 - construct(std::pair const& p, std::pair const*) - { - return tuple_data2(p.first, p.second); - } - }; - -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) - namespace detail - { - template - struct next_iter3 - { - typedef typename meta::next::type i1_type; - typedef typename meta::next::type i2_type; - }; - } -#endif - - template - struct tuple3 : tuple_data3 - { - tuple3() - : tuple_data3() - {} - - tuple3( - typename detail::call_param::type _0 - , typename detail::call_param::type _1 - , typename detail::call_param::type _2 - ) - : tuple_data3(_0, _1, _2) - {} - - template - explicit tuple3(X const& x) - : tuple_data3(construct(x, &x)) - {} - - template - tuple3& operator=(tuple3 const& t) - { - this->m0 = t.m0; - this->m1 = t.m1; - this->m2 = t.m2; - return *this; - } - - private: - - template - static tuple_data3 - construct(Iterator const& i, void const*) - { -#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551) - typedef detail::next_iter3 next_iter; - next_iter::i1_type i1(fusion::next(i)); - next_iter::i2_type i2(fusion::next(i1)); -#else - typedef typename meta::next::type i1_type; - typedef typename meta::next::type i2_type; - i1_type i1(fusion::next(i)); - i2_type i2(fusion::next(i1)); -#endif - return tuple_data3(detail::disambiguate_as_iterator(), i, i1, i2); - } - - template - static tuple_data3 - construct(Tuple const& t, sequence_root const*) - { - return tuple_data3(t.m0, t.m1, t.m2); - } - }; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple20.hpp b/include/boost/spirit/fusion/sequence/tuple20.hpp deleted file mode 100644 index 5dac6e93f..000000000 --- a/include/boost/spirit/fusion/sequence/tuple20.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE20_HPP) -#define FUSION_SEQUENCE_TUPLE20_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// See tuple10.hpp and detail/tuple10.ipp. The following code are -// expansions of the tuple_access and tupleN+1 classes for N = 10..20. -// -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace fusion -{ - namespace detail - { - BOOST_PP_REPEAT_FROM_TO(10, 20, FUSION_TUPLE_N_ACCESS, _) - } - - struct tuple_tag; - -# define BOOST_PP_ITERATION_PARAMS_1 (3, (11, 20, )) -# include BOOST_PP_ITERATE() -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple30.hpp b/include/boost/spirit/fusion/sequence/tuple30.hpp deleted file mode 100644 index bf7abebce..000000000 --- a/include/boost/spirit/fusion/sequence/tuple30.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE30_HPP) -#define FUSION_SEQUENCE_TUPLE30_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// See tuple10.hpp and detail/tuple10.ipp. The following code are -// expansions of the tuple_access and tupleN+1 classes for N = 20..30. -// -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace fusion -{ - namespace detail - { - BOOST_PP_REPEAT_FROM_TO(20, 30, FUSION_TUPLE_N_ACCESS, _) - } - - struct tuple_tag; - -# define BOOST_PP_ITERATION_PARAMS_1 (3, (21, 30, )) -# include BOOST_PP_ITERATE() -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple40.hpp b/include/boost/spirit/fusion/sequence/tuple40.hpp deleted file mode 100644 index fb0d13563..000000000 --- a/include/boost/spirit/fusion/sequence/tuple40.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE40_HPP) -#define FUSION_SEQUENCE_TUPLE40_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// See tuple10.hpp and detail/tuple10.ipp. The following code are -// expansions of the tuple_access and tupleN+1 classes for N = 30..40. -// -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace fusion -{ - namespace detail - { - BOOST_PP_REPEAT_FROM_TO(30, 40, FUSION_TUPLE_N_ACCESS, _) - } - - struct tuple_tag; - -# define BOOST_PP_ITERATION_PARAMS_1 (3, (31, 40, )) -# include BOOST_PP_ITERATE() -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple50.hpp b/include/boost/spirit/fusion/sequence/tuple50.hpp deleted file mode 100644 index 301b53d80..000000000 --- a/include/boost/spirit/fusion/sequence/tuple50.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE50_HPP) -#define FUSION_SEQUENCE_TUPLE50_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) -# include -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// See tuple10.hpp and detail/tuple10.hpp. The following code are -// expansions of the tuple_access and tupleN+1 classes for N = 40..50. -// -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace fusion -{ - namespace detail - { - BOOST_PP_REPEAT_FROM_TO(40, 50, FUSION_TUPLE_N_ACCESS, _) - } - - struct tuple_tag; - -# define BOOST_PP_ITERATION_PARAMS_1 (3, (41, 50, )) -# include BOOST_PP_ITERATE() -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple_element.hpp b/include/boost/spirit/fusion/sequence/tuple_element.hpp deleted file mode 100644 index 59a8e9a42..000000000 --- a/include/boost/spirit/fusion/sequence/tuple_element.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE_ELEMENT_HPP) -#define FUSION_SEQUENCE_TUPLE_ELEMENT_HPP - -#include -#include - -namespace boost { namespace fusion -{ - /////////////////////////////////////////////////////////////////////////// - // - // tuple_element metafunction - // - // Given a constant integer N and a Sequence, returns the - // tuple element type at slot N. (N is a zero based index). Usage: - // - // tuple_element::type - // - // This metafunction is provided here for compatibility with the - // tuples TR1 specification. This metafunction forwards to - // meta::value_at_c. - // - /////////////////////////////////////////////////////////////////////////// - template - struct tuple_element : meta::value_at_c {}; - - template - struct tuple_element<0, std::pair > - { - typedef T1 type; - }; - - template - struct tuple_element<1, std::pair > - { - typedef T2 type; - }; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple_forward.hpp b/include/boost/spirit/fusion/sequence/tuple_forward.hpp deleted file mode 100644 index 4b44a437f..000000000 --- a/include/boost/spirit/fusion/sequence/tuple_forward.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - Copyright (c) 1999-2003 Jaakko Järvi - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE_FORWARD_HPP) -#define FUSION_SEQUENCE_TUPLE_FORWARD_HPP - -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct void_t; - - template < - BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( - FUSION_MAX_TUPLE_SIZE, typename T, void_t) - > - struct tuple; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/tuple_size.hpp b/include/boost/spirit/fusion/sequence/tuple_size.hpp deleted file mode 100644 index df740246f..000000000 --- a/include/boost/spirit/fusion/sequence/tuple_size.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TUPLE_SIZE_HPP) -#define FUSION_SEQUENCE_TUPLE_SIZE_HPP - -#include -#include - -#include - -namespace boost { namespace fusion -{ - /////////////////////////////////////////////////////////////////////////// - // - // tuple_size metafunction - // - // Get the size of Sequence. Usage: - // - // tuple_size::value - // - // This metafunction is provided here for compatibility with the - // tuples TR1 specification. This metafunction forwards to - // meta::size. - // - /////////////////////////////////////////////////////////////////////////// - template - struct tuple_size : meta::size {}; - - template - struct tuple_size > : boost::mpl::int_<2> { }; -}} - -#endif diff --git a/include/boost/spirit/fusion/sequence/type_sequence.hpp b/include/boost/spirit/fusion/sequence/type_sequence.hpp deleted file mode 100644 index 6df8891cc..000000000 --- a/include/boost/spirit/fusion/sequence/type_sequence.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TYPE_SEQUENCE_HPP) -#define FUSION_SEQUENCE_TYPE_SEQUENCE_HPP - -#include -#include -#include -#include -#include - -namespace boost { namespace fusion -{ - struct type_sequence_tag; - - template - struct type_sequence : sequence_base > - { - typedef type_sequence_tag tag; - typedef typename remove_const::type sequence_type; - }; -}} - -#endif - - diff --git a/include/boost/spirit/fusion/sequence/value_at.hpp b/include/boost/spirit/fusion/sequence/value_at.hpp deleted file mode 100644 index 5cebad33e..000000000 --- a/include/boost/spirit/fusion/sequence/value_at.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2004 Peder Holt - - Use, modification and distribution is 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) -==============================================================================*/ -#if !defined(FUSION_SEQUENCE_VALUE_AT_HPP) -#define FUSION_SEQUENCE_VALUE_AT_HPP - -#include -#include - -namespace boost { namespace fusion -{ - namespace meta - { - template - struct value_at_impl - { - template - struct apply { - typedef int type; - }; - }; - - template - struct value_at_c - { - typedef as_fusion_sequence seq_converter; - typedef typename seq_converter::type seq; - - typedef typename - value_at_impl:: - template apply::type - type; - }; - - template - struct value_at : value_at_c {}; - } -}} - -#endif