Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63923 - in branches/release/libs/spirit/example/scheme: . detail example/generate_qiexpr test test/generate_qiexpr test/parse_qiexpr test/qi test/scheme test/sexpr
From: hartmut.kaiser_at_[hidden]
Date: 2010-07-12 09:08:06


Author: hkaiser
Date: 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
New Revision: 63923
URL: http://svn.boost.org/trac/boost/changeset/63923

Log:
Spirit: Updating scheme example on release branch
Added:
   branches/release/libs/spirit/example/scheme/test/qi/calc.scm (contents, props changed)
Removed:
   branches/release/libs/spirit/example/scheme/detail/
   branches/release/libs/spirit/example/scheme/out.txt
   branches/release/libs/spirit/example/scheme/sexpr.hpp
   branches/release/libs/spirit/example/scheme/sexpr_test.cpp
   branches/release/libs/spirit/example/scheme/sexpr_test.txt
   branches/release/libs/spirit/example/scheme/simple_print.hpp
   branches/release/libs/spirit/example/scheme/test/generate_qiexpr/
   branches/release/libs/spirit/example/scheme/test/parse_qiexpr/
   branches/release/libs/spirit/example/scheme/test/sexpr/
   branches/release/libs/spirit/example/scheme/utree_test.cpp
Text files modified:
   branches/release/libs/spirit/example/scheme/example/generate_qiexpr/generate_qiexpr.cpp | 2 +-
   branches/release/libs/spirit/example/scheme/test/Jamfile | 20 ++------------------
   branches/release/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp | 14 +++++++++-----
   branches/release/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp | 22 ++++++++--------------
   branches/release/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp | 1 +
   5 files changed, 21 insertions(+), 38 deletions(-)

Modified: branches/release/libs/spirit/example/scheme/example/generate_qiexpr/generate_qiexpr.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/example/generate_qiexpr/generate_qiexpr.cpp (original)
+++ branches/release/libs/spirit/example/scheme/example/generate_qiexpr/generate_qiexpr.cpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
@@ -3,7 +3,7 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
-#define BOOST_SPIRIT_KARMA_DEBUG
+// #define BOOST_SPIRIT_KARMA_DEBUG
 
 #include <utree/operators.hpp>
 

Deleted: branches/release/libs/spirit/example/scheme/out.txt
==============================================================================
--- branches/release/libs/spirit/example/scheme/out.txt 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
+++ (empty file)
@@ -1,2 +0,0 @@
-success: (123.45 true false 255 63 "this is a € string" "Τη γλώσσα μου έδωσαν ελληνική" (92 ("another string" apple Sîne)))
-

Deleted: branches/release/libs/spirit/example/scheme/sexpr.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/sexpr.hpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
+++ (empty file)
@@ -1,179 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2010 Joel de Guzman
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#if !defined(BOOST_SPIRIT_SEXPR)
-#define BOOST_SPIRIT_SEXPR
-
-#include <string>
-
-#define BOOST_SPIRIT_UNICODE // We'll use unicode (UTF8) all throughout
-
-#include <boost/config/warning_disable.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/spirit/include/qi.hpp>
-#include <boost/spirit/include/phoenix_core.hpp>
-#include <boost/spirit/include/phoenix_container.hpp>
-#include <boost/spirit/include/phoenix_statement.hpp>
-#include <boost/spirit/include/phoenix_operator.hpp>
-#include <boost/regex/pending/unicode_iterator.hpp>
-
-#include "utree.hpp"
-
-namespace scheme
-{
- using boost::spirit::unicode::char_;
- using boost::spirit::unicode::space;
- using boost::spirit::unicode::print;
- using boost::spirit::qi::grammar;
- using boost::spirit::qi::rule;
- using boost::spirit::qi::eol;
- using boost::spirit::qi::_val;
- using boost::spirit::qi::_r1;
- using boost::spirit::qi::_1;
- using boost::spirit::qi::uint_parser;
- using boost::spirit::qi::real_parser;
- using boost::spirit::qi::strict_real_policies;
- using boost::spirit::qi::char_set;
- using boost::spirit::qi::int_;
- using boost::spirit::qi::hex;
- using boost::spirit::qi::oct;
- using boost::spirit::qi::bool_;
- using boost::spirit::qi::no_case;
- using boost::spirit::qi::lexeme;
- using boost::spirit::qi::lit;
- using boost::phoenix::function;
-
- typedef boost::spirit::char_encoding::unicode unicode;
- typedef boost::uint32_t uchar; // a unicode code point
-
- template <typename Iterator>
- struct white_space : grammar<Iterator, unicode>
- {
- white_space() : white_space::base_type(start)
- {
- start =
- space // tab/space/cr/lf
- | ';' >> *(char_ - eol) >> eol // comments
- ;
- }
-
- rule<Iterator, unicode> start;
- };
-
- namespace detail
- {
- struct push_utf8
- {
- template <typename S, typename C>
- struct result { typedef void type; };
-
- void operator()(std::string& utf8, uchar code_point) const
- {
- typedef std::back_insert_iterator<std::string> insert_iter;
- insert_iter out_iter(utf8);
- boost::utf8_output_iterator<insert_iter> utf8_iter(out_iter);
- *utf8_iter++ = code_point;
- }
- };
-
- struct push_symbol_utf8
- {
- template <typename S, typename C>
- struct result { typedef void type; };
-
- void operator()(std::string& utf8, uchar code_point) const
- {
- if (utf8.size() == 0)
- utf8 += '\0'; // mark a symbol with prefix 0
- // (a 0 byte at the beginning signifies a symbol)
- push_utf8()(utf8, code_point);
- }
- };
-
- struct push_esc
- {
- template <typename S, typename C>
- struct result { typedef void type; };
-
- void operator()(std::string& utf8, uchar c) const
- {
- switch (c)
- {
- case 'b': utf8 += '\b'; break;
- case 't': utf8 += '\t'; break;
- case 'n': utf8 += '\n'; break;
- case 'f': utf8 += '\f'; break;
- case 'r': utf8 += '\r'; break;
- case '"': utf8 += '"'; break;
- case '\\': utf8 += '\\'; break;
- }
- }
- };
- }
-
- template <typename Iterator>
- struct string : grammar<Iterator, unicode, std::string()>
- {
- string() : string::base_type(start)
- {
- uint_parser<uchar, 16> hex;
- function<detail::push_utf8> push_utf8;
- function<detail::push_esc> push_esc;
-
- str_esc
- = '\\'
- >> ( ('u' >> hex) [push_utf8(_r1, _1)]
- | char_("btnfr\\\"'") [push_esc(_r1, _1)]
- )
- ;
-
- start
- = '"'
- >> *(str_esc(_val) | (char_ - '"') [push_utf8(_val, _1)])
- >> '"'
- ;
- }
-
- rule<Iterator, unicode, void(std::string&)> str_esc;
- rule<Iterator, unicode, std::string()> start;
- };
-
- template <typename Iterator>
- struct sexpr : grammar<Iterator, unicode, white_space<Iterator>, utree()>
- {
- sexpr() : sexpr::base_type(start)
- {
- real_parser<double, strict_real_policies<double> > strict_double;
- function<detail::push_symbol_utf8> push_symbol_utf8;
-
- start = atom | list;
-
- list = '(' >> *start >> ')';
-
- atom = number [_val = _1]
- | bool_ [_val = _1]
- | string [_val = _1]
- | symbol [_val = _1]
- ;
-
- char const* exclude = " ();\"\n\r\t";
- symbol = +lexeme[print - char_(exclude)] [push_symbol_utf8(_val, _1)];
-
- number = strict_double [_val = _1]
- | lexeme[no_case["0x"] >> hex] [_val = _1]
- | lexeme['0' >> oct] [_val = _1]
- | int_ [_val = _1]
- ;
- }
-
- rule<Iterator, unicode, white_space<Iterator>, utree()> start, list;
- rule<Iterator, unicode, utree()> atom, number;
- rule<Iterator, unicode, std::string()> symbol;
- scheme::string<Iterator> string;
- };
-}
-
-#endif

Deleted: branches/release/libs/spirit/example/scheme/sexpr_test.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/sexpr_test.cpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
+++ (empty file)
@@ -1,93 +0,0 @@
-/*=============================================================================
- Copyright (c) 2001-2010 Joel de Guzman
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-=============================================================================*/
-#include "sexpr.hpp"
-#include "simple_print.hpp"
-#include <iostream>
-#include <fstream>
-
-namespace scheme
-{
- inline std::ostream& operator<<(std::ostream& out, utree const& x)
- {
- using ::detail::println;
- println(x);
- return out;
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Main program
-///////////////////////////////////////////////////////////////////////////////
-int main(int argc, char **argv)
-{
- using ::detail::println;
-
- char const* filename;
- if (argc > 1)
- {
- filename = argv[1];
- }
- else
- {
- std::cerr << "Error: No input file provided." << std::endl;
- return 1;
- }
-
- std::ifstream in(filename, std::ios_base::in);
-
- if (!in)
- {
- std::cerr << "Error: Could not open input file: "
- << filename << std::endl;
- return 1;
- }
-
- // Ignore the BOM marking the beginning of a UTF-8 file in Windows
- char c = in.peek();
- if (c == '\xef')
- {
- char s[3];
- in >> s[0] >> s[1] >> s[2];
- s[3] = '\0';
- if (s != std::string("\xef\xbb\xbf"))
- {
- std::cerr << "Error: Unexpected characters from input file: "
- << filename << std::endl;
- return 1;
- }
- }
-
- std::string source_code; // We will read the contents here.
- in.unsetf(std::ios::skipws); // No white space skipping!
- std::copy(
- std::istream_iterator<char>(in),
- std::istream_iterator<char>(),
- std::back_inserter(source_code));
-
- typedef boost::u8_to_u32_iterator<std::string::const_iterator> iterator_type;
- iterator_type first(source_code.begin());
- iterator_type last(source_code.end());
-
- scheme::sexpr<iterator_type> p;
- scheme::white_space<iterator_type> ws;
-
- scheme::utree result;
- if (phrase_parse(first, last, p, ws, result))
- {
- std::cout << "success: ";
- println(result);
- std::cout << std::endl;
- }
- else
- {
- std::cout << "parse error" << std::endl;
- }
-
- return 0;
-}
-
-

Deleted: branches/release/libs/spirit/example/scheme/sexpr_test.txt
==============================================================================
--- branches/release/libs/spirit/example/scheme/sexpr_test.txt 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
+++ (empty file)
@@ -1,12 +0,0 @@
-(
- 123.45
- true
- false
- 0xFF
- 077
- "this is a \u20AC string" ; A UTF-8 string
- "Τη γλώσσα μου έδωσαν ελληνική" ; Another UTF-8 string
- (
- 92 ("another string" apple Sîne)
- )
-)
\ No newline at end of file

Deleted: branches/release/libs/spirit/example/scheme/simple_print.hpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/simple_print.hpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
+++ (empty file)
@@ -1,92 +0,0 @@
-#if !defined(UTREE_SIMPLE_PRINT)
-#define UTREE_SIMPLE_PRINT
-
-#include "utree.hpp"
-#include <iostream>
-
-namespace detail
-{
- ///////////////////////////////////////////////////////////////////////////
- // simple utree printing facility prints the utree in a single line
- ///////////////////////////////////////////////////////////////////////////
- void print(char ch);
- void print(scheme::utree const& val);
- void println(scheme::utree const& val);
-
- // simple_print visitor
- struct simple_print
- {
- typedef void result_type;
-
- void operator()(scheme::utree::nil) const
- {
- std::cout << "nil";
- }
-
- template <typename T>
- void operator()(T val) const
- {
- std::cout << val;
- }
-
- void operator()(bool b) const
- {
- std::cout << (b ? "true" : "false");
- }
-
- template <typename Range> // for lists
- void print_string_or_list(Range range, boost::mpl::false_) const
- {
- typedef typename Range::const_iterator iterator;
- print('(');
- for (iterator i = range.begin(); i != range.end(); ++i)
- {
- if (i != range.begin())
- detail::print(' ');
- detail::print(*i);
- }
- detail::print(')');
- }
-
- template <typename Range> // for strings
- void print_string_or_list(Range range, boost::mpl::true_) const
- {
- typedef typename Range::const_iterator iterator;
- iterator i = range.begin();
- bool const is_symbol = *i == '\0'; // a 0 byte at the beginning signifies a symbol
- if (!is_symbol)
- detail::print('"');
- else
- ++i;
- for (; i != range.end(); ++i)
- detail::print(*i);
- if (!is_symbol)
- detail::print('"');
- }
-
- template <typename Iterator>
- void operator()(boost::iterator_range<Iterator> const& range) const
- {
- // This code works for both strings and lists
- print_string_or_list(range, boost::is_pointer<Iterator>());
- }
- };
-
- inline void print(char ch)
- {
- std::cout << ch;
- }
-
- inline void print(scheme::utree const& val)
- {
- scheme::utree::visit(val, simple_print());
- }
-
- inline void println(scheme::utree const& val)
- {
- detail::print(val);
- std::cout << std::endl;
- }
-}
-
-#endif
\ No newline at end of file

Modified: branches/release/libs/spirit/example/scheme/test/Jamfile
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/Jamfile (original)
+++ branches/release/libs/spirit/example/scheme/test/Jamfile 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
@@ -13,6 +13,8 @@
     ;
 
 # bring in rules for testing
+# [ run sources : cmdlineargs : input files : requirements : name ]
+
 import testing ;
 
 {
@@ -27,24 +29,6 @@
     ;
 }
 
-exe sexpr_input_test : sexpr/sexpr_input_test.cpp ;
-exe sexpr_output_test : sexpr/sexpr_output_test.cpp ;
-
-exe parse_qi_test
- : parse_qiexpr/generate_sexpr_to_ostream.cpp
- parse_qiexpr/parse_qi_test.cpp
- parse_qiexpr/parse_qiexpr.cpp
- ;
-
-exe generate_qi_test
- : parse_qiexpr/parse_qiexpr.cpp
- generate_qiexpr/generate_qi_test.cpp
- generate_qiexpr/generate_qiexpr.cpp
- ;
-
-exe scheme_test1 : scheme/scheme_test1.cpp ;
-exe scheme_test2 : scheme/scheme_test2.cpp ;
-exe scheme_test3 : scheme/scheme_test3.cpp ;
 
 
 

Added: branches/release/libs/spirit/example/scheme/test/qi/calc.scm
==============================================================================
--- (empty file)
+++ branches/release/libs/spirit/example/scheme/test/qi/calc.scm 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
@@ -0,0 +1,24 @@
+; The calculator in spirit.scheme
+
+(define expression) ; forward declaration
+
+(define factor
+ (qi:|
+ (qi:int_)
+ (qi:>> (qi:char_ "(") (expression) (qi:char_ ")"))
+ (qi:>> (qi:char_ "-") (factor))
+ (qi:>> (qi:char_ "+") (factor))))
+
+(define term
+ (qi:>> (factor)
+ (qi:*
+ (qi:|
+ (qi:>> (qi:char_ "*") (factor))
+ (qi:>> (qi:char_ "/") (factor))))))
+
+(define expression
+ (qi:>> (term)
+ (qi:*
+ (qi:|
+ (qi:>> (qi:char_ "+") (term))
+ (qi:>> (qi:char_ "-") (term))))))
\ No newline at end of file

Modified: branches/release/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/scheme/scheme_test1.cpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
@@ -4,6 +4,7 @@
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
 #include <boost/config/warning_disable.hpp>
 
 #include <input/parse_sexpr_impl.hpp>
@@ -17,6 +18,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 int main()
 {
+ using scheme::utree;
+
     { // testing the c++ side
 
         using scheme::if_;
@@ -28,18 +31,19 @@
         using scheme::_2;
         using scheme::lambda;
 
- std::cout << "result: " << plus(11, 22, 33) () << std::endl;
- std::cout << "result: " << plus(11, 22, _1) (33) << std::endl;
- std::cout << "result: " << plus(11, _1, _2) (22, 33) << std::endl;
- std::cout << "result: " << plus(11, plus(_1, _2)) (22, 33) << std::endl;
+ BOOST_TEST(plus(11, 22, 33) () == utree(66));
+ BOOST_TEST(plus(11, 22, _1) (33) == utree(66));
+ BOOST_TEST(plus(11, _1, _2) (22, 33) == utree(66));
+ BOOST_TEST(plus(11, plus(_1, _2)) (22, 33) == utree(66));
 
         lambda factorial;
         factorial = if_(lte(_1, 0), 1, times(_1, factorial(minus(_1, 1))));
 
- std::cout << "result: " << factorial(_1) (10) << std::endl;
+ BOOST_TEST(factorial(_1) (10) == utree(3628800));
     }
 
     return boost::report_errors();
 }
 
 
+

Modified: branches/release/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/scheme/scheme_test2.cpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
@@ -4,6 +4,7 @@
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
 #include <boost/config/warning_disable.hpp>
 
 #include <input/parse_sexpr_impl.hpp>
@@ -15,17 +16,15 @@
 ///////////////////////////////////////////////////////////////////////////////
 // Main program
 ///////////////////////////////////////////////////////////////////////////////
-int main()
+int main(int argc, char **argv)
 {
- char const* filename = "factorial.scm";
+ using scheme::utree;
+
+ BOOST_TEST(argc > 1);
+ char const* filename = filename = argv[1];
     std::ifstream in(filename, std::ios_base::in);
 
- if (!in)
- {
- std::cerr << "Error: Could not open input file: "
- << filename << std::endl;
- return 1;
- }
+ BOOST_TEST(in);
 
     // Ignore the BOM marking the beginning of a UTF-8 file in Windows
     char c = in.peek();
@@ -34,12 +33,7 @@
         char s[3];
         in >> s[0] >> s[1] >> s[2];
         s[3] = '\0';
- if (s != std::string("\xef\xbb\xbf"))
- {
- std::cerr << "Error: Unexpected characters from input file: "
- << filename << std::endl;
- return 1;
- }
+ BOOST_TEST(s != std::string("\xef\xbb\xbf"));
     }
 
     using scheme::interpreter;

Modified: branches/release/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp (original)
+++ branches/release/libs/spirit/example/scheme/test/scheme/scheme_test3.cpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
@@ -4,6 +4,7 @@
     Distributed under the Boost Software License, Version 1.0. (See accompanying
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
 #include <boost/config/warning_disable.hpp>
 
 #include <input/sexpr.hpp>

Deleted: branches/release/libs/spirit/example/scheme/utree_test.cpp
==============================================================================
--- branches/release/libs/spirit/example/scheme/utree_test.cpp 2010-07-12 09:08:03 EDT (Mon, 12 Jul 2010)
+++ (empty file)
@@ -1,155 +0,0 @@
-#include "utree.hpp"
-#include "simple_print.hpp"
-#include <iostream>
-
-int main()
-{
- using scheme::utree;
- using scheme::ulist;
- using ::detail::println;
-
- {
- // test the size
- std::cout << "size of utree is: "
- << sizeof(scheme::utree) << " bytes" << std::endl;
- }
-
- {
- utree val;
- println(val);
- }
-
- {
- utree val(true);
- println(val);
- }
-
- {
- utree val(123);
- println(val);
- }
-
- {
- utree val(123.456);
- println(val);
- }
-
- {
- utree val("Hello, World");
- println(val);
- utree val2;
- val2 = val;
- println(val2);
- utree val3("Hello, World. Chuckie is back!!!");
- val = val3;
- println(val);
-
- utree val4("Apple");
- utree val5("Apple");
- BOOST_ASSERT(val4 == val5);
-
- utree val6("ApplePie");
- BOOST_ASSERT(val4 < val6);
- }
-
- {
- utree val;
- val.push_back(123);
- val.push_back("Chuckie");
- utree val2;
- val2.push_back(123.456);
- val2.push_back("Mah Doggie");
- val.push_back(val2);
- println(val);
- println(val.front());
-
- utree val3;
- val3.swap(val);
- println(val);
- val3.swap(val);
- println(val);
- val.push_back("Ba Ba Black Sheep");
- println(val);
- val.pop_front();
- println(val);
- utree::iterator i = val.begin();
- ++++i;
- val.insert(i, "Right in the middle");
- BOOST_ASSERT(val.size() == 4);
- println(val);
- val.pop_back();
- println(val);
- BOOST_ASSERT(val.size() == 3);
- val.erase(val.end());
- println(val);
- BOOST_ASSERT(val.size() == 2);
-
- val.insert(val.begin(), val2.begin(), val2.end());
- println(val);
- }
-
- {
- utree val;
- val.insert(val.end(), 123);
- val.insert(val.end(), "Mia");
- val.insert(val.end(), "Chuckie");
- val.insert(val.end(), "Poly");
- val.insert(val.end(), "Mochi");
- println(val);
- }
-
- {
- utree a, b;
- BOOST_ASSERT(a == b);
- a = 123;
- BOOST_ASSERT(a != b);
- b = 123;
- BOOST_ASSERT(a == b);
- a = 100.00;
- BOOST_ASSERT(a < b);
-
- b = a = ulist();
- BOOST_ASSERT(a == b);
- a.push_back(1);
- a.push_back("two");
- a.push_back(3.0);
- b.push_back(1);
- b.push_back("two");
- b.push_back(3.0);
- BOOST_ASSERT(a == b);
- b.push_back(4);
- BOOST_ASSERT(a != b);
- BOOST_ASSERT(a < b);
- }
-
- {
- ulist a;
- a.push_back(1);
- a.push_back(2);
- a.push_back(3);
- a.push_back(4);
- a.push_back(5);
- a.push_back(6);
- a.push_back(7);
- a.push_back(8);
- a.push_back(9);
- a.push_back(10);
- a.push_back(11);
- a.push_back(12);
-
- BOOST_ASSERT(a[0] == utree(1));
- BOOST_ASSERT(a[1] == utree(2));
- BOOST_ASSERT(a[2] == utree(3));
- BOOST_ASSERT(a[3] == utree(4));
- BOOST_ASSERT(a[4] == utree(5));
- BOOST_ASSERT(a[5] == utree(6));
- BOOST_ASSERT(a[6] == utree(7));
- BOOST_ASSERT(a[7] == utree(8));
- BOOST_ASSERT(a[8] == utree(9));
- BOOST_ASSERT(a[9] == utree(10));
- BOOST_ASSERT(a[10] == utree(11));
- BOOST_ASSERT(a[11] == utree(12));
- }
-
- return 0;
-}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk