+2004-02-05 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * update boost to version 1.31.0
+
2004-01-26 Lars Gullik Bjonnes <larsbj@gullik.net>
* libs/regex/src/Makefile.am: remove trailing backslash
#include <typeinfo>
#include "boost/config.hpp"
-#include "boost/throw_exception.hpp"
+#include <boost/throw_exception.hpp>
namespace boost
{
{
const ValueType * result = any_cast<ValueType>(&operand);
if(!result)
- throw_exception(bad_any_cast());
+ boost::throw_exception(bad_any_cast());
return *result;
}
#ifndef BOOST_BIND_HPP_INCLUDED
#define BOOST_BIND_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A &)
+ {
+ return unwrap(f, 0)();
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A &) const
{
return unwrap(f, 0)();
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+ template<class R, class F, class A> R operator()(type<R>, F f, A & a)
+ {
+ return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
+ }
+
template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
{
return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
template <class R> struct evaluator0
{
template<class L, class F, class A>
- static R eval(L const&, F f, A &)
+ static R eval(L &, F f, A &)
{
return unwrap(f, 0)();
}
template <> struct evaluator0<void>
{
template<class L, class F, class A>
- static void eval(L const&, F f, A &)
+ static void eval(L &, F f, A &)
{
unwrap(f, 0)();
}
template <class R> struct evaluator1
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_]);
}
template <> struct evaluator1<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_]);
}
template <class R> struct evaluator2
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_]);
}
template <> struct evaluator2<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_]);
}
template <class R> struct evaluator3
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
}
template <> struct evaluator3<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]);
}
template <class R> struct evaluator4
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
}
template <> struct evaluator4<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
}
template <class R> struct evaluator5
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
}
template <> struct evaluator5<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
}
template <class R> struct evaluator6
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
}
template <> struct evaluator6<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
}
template <class R> struct evaluator7
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
}
template <> struct evaluator7<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
}
template <class R> struct evaluator8
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
}
template <> struct evaluator8<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
}
template <class R> struct evaluator9
{
template<class L, class F, class A>
- static R eval(L const& l, F f, A & a)
+ static R eval(L & l, F f, A & a)
{
return unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
}
template <> struct evaluator9<void>
{
template<class L, class F, class A>
- static void eval(L const& l, F f, A & a)
+ static void eval(L & l, F f, A & a)
{
unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
}
//
// apply.hpp
//
-// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
{
typedef R result_type;
- template<class F> result_type operator()(F f) const
+ template<class F> result_type operator()(F & f) const
{
return f();
}
- template<class F, class A1> result_type operator()(F f, A1 & a1) const
+ template<class F, class A1> result_type operator()(F & f, A1 & a1) const
{
return f(a1);
}
- template<class F, class A1, class A2> result_type operator()(F f, A1 & a1, A2 & a2) const
+ template<class F, class A1, class A2> result_type operator()(F & f, A1 & a1, A2 & a2) const
{
return f(a1, a2);
}
- template<class F, class A1, class A2, class A3> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3) const
+ template<class F, class A1, class A2, class A3> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3) const
{
return f(a1, a2, a3);
}
- template<class F, class A1, class A2, class A3, class A4> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+ template<class F, class A1, class A2, class A3, class A4> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
{
return f(a1, a2, a3, a4);
}
- template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+ template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
{
return f(a1, a2, a3, a4, a5);
}
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
{
return f(a1, a2, a3, a4, a5, a6);
}
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
{
return f(a1, a2, a3, a4, a5, a6, a7);
}
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
{
return f(a1, a2, a3, a4, a5, a6, a7, a8);
}
- template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
{
return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
#ifndef BOOST_BIND_ARG_HPP_INCLUDED
#define BOOST_BIND_ARG_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
-// (C) Copyright Boost.org 2000. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/utility for most recent version including documentation.
-// See http://www.boost.org/libs/utility/call_traits.htm for Documentation.
// See boost/detail/call_traits.hpp and boost/detail/ob_call_traits.hpp
// for full copyright notices.
# ifdef LONGLONG_MIN
return LONGLONG_MIN;
# else
- return -9223372036854775808LL; // hope this is portable
+ return -( 9223372036854775807LL )-1; // hope this is portable
# endif
}
};
#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
#define BOOST_CHECKED_DELETE_HPP_INCLUDED
+// MS compatible compilers support #pragma once
+
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
+++ /dev/null
-/* supplementing compose function objects
- * Fri Jul 16 21:01:58 MEST 1999
- */
-/* The following code example is taken from the book
- * "The C++ Standard Library - A Tutorial and Reference"
- * by Nicolai M. Josuttis, Addison-Wesley, 1999
- *
- * (C) Copyright Nicolai M. Josuttis 1999.
- * Permission to copy, use, modify, sell and distribute this software
- * is granted provided this copyright notice appears in all copies.
- * This software is provided "as is" without express or implied
- * warranty, and with no claim as to its suitability for any purpose.
- */
-
-// See http://www.boost.org/libs/compose for Documentation.
-
-#ifndef BOOST_COMPOSE_HPP
-#define BOOST_COMPOSE_HPP
-
-#include <functional>
-
-namespace boost {
-
-/**********************************************************
- * type nullary_function
- * - as supplement to unary_function and binary_function
- **********************************************************/
-template <class Result>
-struct nullary_function {
- typedef Result result_type;
-};
-
-/**********************************************************
- * ptr_fun for functions with no argument
- **********************************************************/
-template <class Result>
-class pointer_to_nullary_function : public nullary_function<Result>
-{
- protected:
- Result (*ptr)();
- public:
- pointer_to_nullary_function() {
- }
- explicit pointer_to_nullary_function(Result (*x)()) : ptr(x) {
- }
- Result operator()() const {
- return ptr();
- }
-};
-
-template <class Result>
-inline pointer_to_nullary_function<Result> ptr_fun(Result (*x)())
-{
- return pointer_to_nullary_function<Result>(x);
-}
-
-/*********** compose_f_gx_t and compose_f_gx **********************/
-
-/* class for the compose_f_gx adapter
- */
-template <class OP1, class OP2>
-class compose_f_gx_t
- : public std::unary_function<typename OP2::argument_type,
- typename OP1::result_type>
-{
- private:
- OP1 op1; // process: op1(op2(x))
- OP2 op2;
- public:
- // constructor
- compose_f_gx_t(const OP1& o1, const OP2& o2)
- : op1(o1), op2(o2) {
- }
-
- // function call
- typename OP1::result_type
- operator()(const typename OP2::argument_type& x) const {
- return op1(op2(x));
- }
-};
-
-/* convenience functions for the compose_f_gx adapter
- */
-template <class OP1, class OP2>
-inline compose_f_gx_t<OP1,OP2>
-compose_f_gx (const OP1& o1, const OP2& o2) {
- return compose_f_gx_t<OP1,OP2>(o1,o2);
-}
-
-/*********** compose_f_gx_hx_t and compose_f_gx_hx **********************/
-
-/* class for the compose_f_gx_hx adapter
- */
-template <class OP1, class OP2, class OP3>
-class compose_f_gx_hx_t
- : public std::unary_function<typename OP2::argument_type,
- typename OP1::result_type>
-{
- private:
- OP1 op1; // process: op1(op2(x),op3(x))
- OP2 op2;
- OP3 op3;
- public:
- // constructor
- compose_f_gx_hx_t (const OP1& o1, const OP2& o2, const OP3& o3)
- : op1(o1), op2(o2), op3(o3) {
- }
-
- // function call
- typename OP1::result_type
- operator()(const typename OP2::argument_type& x) const {
- return op1(op2(x),op3(x));
- }
-};
-
-/* convenience functions for the compose_f_gx_hx adapter
- */
-template <class OP1, class OP2, class OP3>
-inline compose_f_gx_hx_t<OP1,OP2,OP3>
-compose_f_gx_hx (const OP1& o1, const OP2& o2, const OP3& o3) {
- return compose_f_gx_hx_t<OP1,OP2,OP3>(o1,o2,o3);
-}
-
-/*********** compose_f_gxy_t and compose_f_gxy **********************/
-
-/* class for the compose_f_gxy adapter
- */
-template <class OP1, class OP2>
-class compose_f_gxy_t
- : public std::binary_function<typename OP2::first_argument_type,
- typename OP2::second_argument_type,
- typename OP1::result_type>
-{
- private:
- OP1 op1; // process: op1(op2(x,y))
- OP2 op2;
- public:
- // constructor
- compose_f_gxy_t (const OP1& o1, const OP2& o2)
- : op1(o1), op2(o2) {
- }
-
- // function call
- typename OP1::result_type
- operator()(const typename OP2::first_argument_type& x,
- const typename OP2::second_argument_type& y) const {
- return op1(op2(x,y));
- }
-};
-
-/* convenience function for the compose_f_gxy adapter
- */
-template <class OP1, class OP2>
-inline compose_f_gxy_t<OP1,OP2>
-compose_f_gxy (const OP1& o1, const OP2& o2) {
- return compose_f_gxy_t<OP1,OP2>(o1,o2);
-}
-
-/*********** compose_f_gx_hy_t and compose_f_gx_hy **********************/
-
-/* class for the compose_f_gx_hy adapter
- */
-template <class OP1, class OP2, class OP3>
-class compose_f_gx_hy_t
- : public std::binary_function<typename OP2::argument_type,
- typename OP3::argument_type,
- typename OP1::result_type>
-{
- private:
- OP1 op1; // process: op1(op2(x),op3(y))
- OP2 op2;
- OP3 op3;
- public:
- // constructor
- compose_f_gx_hy_t (const OP1& o1, const OP2& o2, const OP3& o3)
- : op1(o1), op2(o2), op3(o3) {
- }
-
- // function call
- typename OP1::result_type
- operator()(const typename OP2::argument_type& x,
- const typename OP3::argument_type& y) const {
- return op1(op2(x),op3(y));
- }
-};
-
-/* convenience function for the compose_f_gx_hy adapter
- */
-template <class OP1, class OP2, class OP3>
-inline compose_f_gx_hy_t<OP1,OP2,OP3>
-compose_f_gx_hy (const OP1& o1, const OP2& o2, const OP3& o3) {
- return compose_f_gx_hy_t<OP1,OP2,OP3>(o1,o2,o3);
-}
-
-/*********** compose_f_g_t and compose_f_g **********************/
-
-/* class for the compose_f_g adapter
- */
-template <class OP1, class OP2>
-class compose_f_g_t
- : public boost::nullary_function<typename OP1::result_type>
-{
- private:
- OP1 op1; // process: op1(op2())
- OP2 op2;
- public:
- // constructor
- compose_f_g_t(const OP1& o1, const OP2& o2)
- : op1(o1), op2(o2) {
- }
-
- // function call
- typename OP1::result_type
- operator()() const {
- return op1(op2());
- }
-};
-
-/* convenience functions for the compose_f_g adapter
- */
-template <class OP1, class OP2>
-inline compose_f_g_t<OP1,OP2>
-compose_f_g (const OP1& o1, const OP2& o2) {
- return compose_f_g_t<OP1,OP2>(o1,o2);
-}
-
-} /* namespace boost */
-
-#endif /*BOOST_COMPOSE_HPP*/
-// (C) Copyright Boost.org 2000. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/utility for most recent version including documentation.
-// See http://www.boost.org for most recent version including documentation.
// See boost/detail/compressed_pair.hpp and boost/detail/ob_compressed_pair.hpp
// for full copyright notices.
#include <boost/config.hpp>
#include <boost/iterator.hpp>
+#include <boost/mpl/identity.hpp>
#include <functional>
namespace boost {
// is really quite innocent. The name of this class needs to be
// changed.
template <class T>
- class static_object {
+ class static_object
+ {
public:
- static T& get() {
- static char d[sizeof(T)];
- return *reinterpret_cast<T*>(d);
- }
+ static T& get()
+ {
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ return *reinterpret_cast<T*>(0);
+#else
+ static char d[sizeof(T)];
+ return *reinterpret_cast<T*>(d);
+#endif
+ }
};
template <class Base = null_archetype<> >
struct optag2 { };
struct optag3 { };
-#define BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(OP, NAME) \
- template <class Base = null_archetype<>, class Tag = optag1 > \
- class NAME##_first_archetype : public Base { \
- public: \
- NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
- }; \
- \
- template <class Base = null_archetype<>, class Tag = optag1 > \
- class NAME##_second_archetype : public Base { \
- public: \
- NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
- }; \
- \
- template <class BaseFirst, class BaseSecond, class Tag> \
- boolean_archetype \
- operator OP (const NAME##_first_archetype<BaseFirst, Tag>&, \
- const NAME##_second_archetype<BaseSecond, Tag>&) \
- { \
- return boolean_archetype(static_object<detail::dummy_constructor>::get()); \
+#define BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(OP, NAME) \
+ template <class Base = null_archetype<>, class Tag = optag1 > \
+ class NAME##_first_archetype : public Base { \
+ public: \
+ NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
+ }; \
+ \
+ template <class Base = null_archetype<>, class Tag = optag1 > \
+ class NAME##_second_archetype : public Base { \
+ public: \
+ NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
+ }; \
+ \
+ template <class BaseFirst, class BaseSecond, class Tag> \
+ boolean_archetype \
+ operator OP (const NAME##_first_archetype<BaseFirst, Tag>&, \
+ const NAME##_second_archetype<BaseSecond, Tag>&) \
+ { \
+ return boolean_archetype(static_object<detail::dummy_constructor>::get()); \
}
BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(==, equal_op)
// Iterator Archetype Classes
template <class T>
- struct input_proxy {
- operator const T&() { return static_object<T>::get(); }
- };
- template <class T>
- class trivial_iterator_archetype
- {
- typedef trivial_iterator_archetype self;
- public:
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- typedef T value_type;
- typedef void reference;
- typedef void pointer;
- typedef void difference_type;
- typedef void iterator_category;
-#endif
- trivial_iterator_archetype() { }
- self& operator=(const self&) { return *this; }
- bool operator==(const self&) const { return true; }
- bool operator!=(const self&) const { return true; }
- input_proxy<T> operator*() const { return input_proxy<T>(); }
- };
-} // namespace boost
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
-namespace std {
- template <class T>
- struct iterator_traits< boost::trivial_iterator_archetype<T> >
- {
- typedef T value_type;
- };
-}
-#endif
-
-namespace boost {
- template <class T>
- struct input_output_proxy {
- input_output_proxy<T>& operator=(const T&) { return *this; }
- operator const T&() { return static_object<T>::get(); }
- };
- template <class T>
- class mutable_trivial_iterator_archetype
+ class input_iterator_archetype
{
- typedef mutable_trivial_iterator_archetype self;
+ private:
+ typedef input_iterator_archetype self;
public:
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ typedef std::input_iterator_tag iterator_category;
typedef T value_type;
- typedef void reference;
- typedef void pointer;
- typedef void difference_type;
- typedef void iterator_category;
-#endif
- mutable_trivial_iterator_archetype() { }
+ struct reference {
+ operator value_type() const { return static_object<T>::get(); }
+ };
+ typedef const T* pointer;
+ typedef std::ptrdiff_t difference_type;
self& operator=(const self&) { return *this; }
bool operator==(const self&) const { return true; }
bool operator!=(const self&) const { return true; }
- input_output_proxy<T> operator*() const { return input_output_proxy<T>(); }
- };
-} // namespace boost
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
-namespace std {
- template <class T>
- struct iterator_traits< boost::mutable_trivial_iterator_archetype<T> >
- {
- typedef T value_type;
+ reference operator*() const { return reference(); }
+ self& operator++() { return *this; }
+ self operator++(int) { return *this; }
};
-}
-#endif
-
-namespace boost {
template <class T>
- class input_iterator_archetype
+ class input_iterator_archetype_no_proxy
{
- public:
- typedef input_iterator_archetype self;
+ private:
+ typedef input_iterator_archetype_no_proxy self;
public:
typedef std::input_iterator_tag iterator_category;
typedef T value_type;
typedef const T& reference;
typedef const T* pointer;
typedef std::ptrdiff_t difference_type;
- input_iterator_archetype() { }
self& operator=(const self&) { return *this; }
bool operator==(const self&) const { return true; }
bool operator!=(const self&) const { return true; }
self operator++(int) { return *this; }
};
- template <class T>
+ template <class T>
struct output_proxy {
output_proxy& operator=(const T&) { return *this; }
};
output_iterator_archetype() { }
};
+ template <class T>
+ class input_output_iterator_archetype
+ {
+ private:
+ typedef input_output_iterator_archetype self;
+ struct in_out_tag : public std::input_iterator_tag, public std::output_iterator_tag { };
+ public:
+ typedef in_out_tag iterator_category;
+ typedef T value_type;
+ struct reference {
+ reference& operator=(const T&) { return *this; }
+ operator value_type() { return static_object<T>::get(); }
+ };
+ typedef const T* pointer;
+ typedef std::ptrdiff_t difference_type;
+ input_output_iterator_archetype() { }
+ self& operator=(const self&) { return *this; }
+ bool operator==(const self&) const { return true; }
+ bool operator!=(const self&) const { return true; }
+ reference operator*() const { return reference(); }
+ self& operator++() { return *this; }
+ self operator++(int) { return *this; }
+ };
+
template <class T>
class forward_iterator_archetype
{
typedef std::forward_iterator_tag iterator_category;
typedef T value_type;
typedef const T& reference;
- typedef T* pointer;
+ typedef T const* pointer;
typedef std::ptrdiff_t difference_type;
forward_iterator_archetype() { }
self& operator=(const self&) { return *this; }
#include <utility>
#include <boost/type_traits/conversion_traits.hpp>
#include <boost/static_assert.hpp>
-#include <boost/type.hpp>
+#include <boost/mpl/identity.hpp>
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__BORLANDC__)
// the unused, defaulted parameter is a workaround for MSVC and Compaq C++
template <class Concept>
-inline void function_requires(type<Concept>* = 0)
+inline void function_requires(mpl::identity<Concept>* = 0)
{
#if !defined(NDEBUG)
void (Concept::*x)() = BOOST_FPTR Concept::constraints;
#define BOOST_CLASS_REQUIRE(type_var, ns, concept) \
typedef void (ns::concept <type_var>::* func##type_var##concept)(); \
- template <func##type_var##concept _Tp1> \
+ template <func##type_var##concept Tp1_> \
struct concept_checking_##type_var##concept { }; \
typedef concept_checking_##type_var##concept< \
BOOST_FPTR ns::concept<type_var>::constraints> \
#define BOOST_CLASS_REQUIRE2(type_var1, type_var2, ns, concept) \
typedef void (ns::concept <type_var1,type_var2>::* \
func##type_var1##type_var2##concept)(); \
- template <func##type_var1##type_var2##concept _Tp1> \
+ template <func##type_var1##type_var2##concept Tp1_> \
struct concept_checking_##type_var1##type_var2##concept { }; \
typedef concept_checking_##type_var1##type_var2##concept< \
BOOST_FPTR ns::concept<type_var1,type_var2>::constraints> \
#define BOOST_CLASS_REQUIRE3(tv1, tv2, tv3, ns, concept) \
typedef void (ns::concept <tv1,tv2,tv3>::* \
func##tv1##tv2##tv3##concept)(); \
- template <func##tv1##tv2##tv3##concept _Tp1> \
+ template <func##tv1##tv2##tv3##concept Tp1_> \
struct concept_checking_##tv1##tv2##tv3##concept { }; \
typedef concept_checking_##tv1##tv2##tv3##concept< \
BOOST_FPTR ns::concept<tv1,tv2,tv3>::constraints> \
#define BOOST_CLASS_REQUIRE4(tv1, tv2, tv3, tv4, ns, concept) \
typedef void (ns::concept <tv1,tv2,tv3,tv4>::* \
func##tv1##tv2##tv3##tv4##concept)(); \
- template <func##tv1##tv2##tv3##tv4##concept _Tp1> \
+ template <func##tv1##tv2##tv3##tv4##concept Tp1_> \
struct concept_checking_##tv1##tv2##tv3##tv4##concept { }; \
typedef concept_checking_##tv1##tv2##tv3##tv4##concept< \
BOOST_FPTR ns::concept<tv1,tv2,tv3,tv4>::constraints> \
#define BOOST_CLASS_REQUIRES(type_var, concept) \
typedef void (concept <type_var>::* func##type_var##concept)(); \
- template <func##type_var##concept _Tp1> \
+ template <func##type_var##concept Tp1_> \
struct concept_checking_##type_var##concept { }; \
typedef concept_checking_##type_var##concept< \
BOOST_FPTR concept <type_var>::constraints> \
#define BOOST_CLASS_REQUIRES2(type_var1, type_var2, concept) \
typedef void (concept <type_var1,type_var2>::* func##type_var1##type_var2##concept)(); \
- template <func##type_var1##type_var2##concept _Tp1> \
+ template <func##type_var1##type_var2##concept Tp1_> \
struct concept_checking_##type_var1##type_var2##concept { }; \
typedef concept_checking_##type_var1##type_var2##concept< \
BOOST_FPTR concept <type_var1,type_var2>::constraints> \
#define BOOST_CLASS_REQUIRES3(type_var1, type_var2, type_var3, concept) \
typedef void (concept <type_var1,type_var2,type_var3>::* func##type_var1##type_var2##type_var3##concept)(); \
- template <func##type_var1##type_var2##type_var3##concept _Tp1> \
+ template <func##type_var1##type_var2##type_var3##concept Tp1_> \
struct concept_checking_##type_var1##type_var2##type_var3##concept { }; \
typedef concept_checking_##type_var1##type_var2##type_var3##concept< \
BOOST_FPTR concept <type_var1,type_var2,type_var3>::constraints> \
#define BOOST_CLASS_REQUIRES4(type_var1, type_var2, type_var3, type_var4, concept) \
typedef void (concept <type_var1,type_var2,type_var3,type_var4>::* func##type_var1##type_var2##type_var3##type_var4##concept)(); \
- template <func##type_var1##type_var2##type_var3##type_var4##concept _Tp1> \
+ template <func##type_var1##type_var2##type_var3##type_var4##concept Tp1_> \
struct concept_checking_##type_var1##type_var2##type_var3##type_var4##concept { }; \
typedef concept_checking_##type_var1##type_var2##type_var3##type_var4##concept< \
BOOST_FPTR concept <type_var1,type_var2,type_var3,type_var4>::constraints> \
// Iterator Concepts
template <class TT>
- struct TrivialIteratorConcept
+ struct InputIteratorConcept
{
void constraints() {
function_requires< AssignableConcept<TT> >();
- function_requires< DefaultConstructibleConcept<TT> >();
function_requires< EqualityComparableConcept<TT> >();
+ TT j(i);
(void)*i; // require dereference operator
- }
- TT i;
- };
-
- template <class TT>
- struct Mutable_TrivialIteratorConcept
- {
- void constraints() {
- function_requires< TrivialIteratorConcept<TT> >();
- *i = *j; // require dereference and assignment
- }
- TT i, j;
- };
-
- template <class TT>
- struct InputIteratorConcept
- {
- void constraints() {
- function_requires< TrivialIteratorConcept<TT> >();
- // require iterator_traits typedef's
#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+ // require iterator_traits typedef's
typedef typename std::iterator_traits<TT>::difference_type D;
// Hmm, the following is a bit fragile
//function_requires< SignedIntegerConcept<D> >();
typedef typename std::iterator_traits<TT>::iterator_category C;
function_requires< ConvertibleConcept<C, std::input_iterator_tag> >();
#endif
- ++i; // require preincrement operator
+ ++j; // require preincrement operator
i++; // require postincrement operator
}
TT i;
// Boost config.hpp configuration header file ------------------------------//
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for most recent version.
+
--- /dev/null
+// abi_prefix header -------------------------------------------------------//
+
+// © Copyright John Maddock 2003
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+
+#ifndef BOOST_CONFIG_ABI_PREFIX_HPP
+# define BOOST_CONFIG_ABI_PREFIX_HPP
+#else
+# error double inclusion of header boost/config/abi_prefix.hpp is an error
+#endif
+
+#include <boost/config.hpp>
+
+// this must occur after all other includes and before any code appears:
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
--- /dev/null
+// abi_sufffix header -------------------------------------------------------//
+
+// © Copyright John Maddock 2003
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+
+// This header should be #included AFTER code that was preceded by a #include
+// <boost/config/abi_prefix.hpp>.
+
+#ifndef BOOST_CONFIG_ABI_PREFIX_HPP
+# error Header boost/config/abi_prefix.hpp must only be used after boost/config/abi_prefix.hpp
+#else
+# undef BOOST_CONFIG_ABI_PREFIX_HPP
+#endif
+
+// the suffix header occurs after all of our code:
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+
--- /dev/null
+// (C) Copyright John Maddock 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE auto_link.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
+ */
+
+/*************************************************************************
+
+USAGE:
+~~~~~~
+
+Before including this header you must define one or more of define the following macros:
+
+BOOST_LIB_NAME: Required: A string containing the basename of the library,
+ for example boost_regex.
+BOOST_DYN_LINK: Optional: when set link to dll rather than static library.
+BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
+ of the library selected (useful for debugging).
+
+These macros will be undef'ed at the end of the header, further this header
+has no include guards - so be sure to include it only once from your library!
+
+Algorithm:
+~~~~~~~~~~
+
+Libraries for Borland and Microsoft compilers are automatically
+selected here, the name of the lib is selected according to the following
+formula:
+
+BOOST_LIB_PREFIX
+ + BOOST_LIB_NAME
+ + "_"
+ + BOOST_LIB_TOOLSET
+ + BOOST_LIB_THREAD_OPT
+ + BOOST_LIB_RT_OPT
+ "-"
+ + BOOST_LIB_VERSION
+
+These are defined as:
+
+BOOST_LIB_PREFIX: "lib" for static libraries otherwise "".
+
+BOOST_LIB_NAME: The base name of the lib ( for example boost_regex).
+
+BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
+
+BOOST_LIB_THREAD_OPT: "-mt" for multithread builds, otherwise nothing.
+
+BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
+ contains one or more of the following letters after
+ a hiphen:
+
+ s static runtime (dynamic if not present).
+ d debug build (release if not present).
+ g debug/diagnostic runtime (release if not present).
+ p STLPort Build.
+
+BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
+
+
+***************************************************************************/
+
+#ifdef __cplusplus
+# ifndef BOOST_CONFIG_HPP
+# include <boost/config.hpp>
+# endif
+#elif defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__EDG_VERSION__)
+//
+// C language compatability (no, honestly)
+//
+# define BOOST_MSVC _MSC_VER
+# define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
+# define BOOST_DO_STRINGIZE(X) #X
+#endif
+//
+// Only include what follows for known and supported compilers:
+//
+#if (defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)) \
+ || defined(__BORLANDC__) \
+ || (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
+ || (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))
+
+#ifndef BOOST_VERSION_HPP
+# include <boost/version.hpp>
+#endif
+
+#ifndef BOOST_LIB_NAME
+# error "Macro BOOST_LIB_NAME not set (internal error)"
+#endif
+
+//
+// error check:
+//
+#if defined(__MSVC_RUNTIME_CHECKS) && !defined(_DEBUG)
+# pragma message("Using the /RTC option without specifying a debug runtime will lead to linker errors")
+# pragma message("Hint: go to the code generation options and switch to one of the debugging runtimes")
+# error "Incompatible build options"
+#endif
+//
+// select toolset:
+//
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
+
+ // vc6:
+# define BOOST_LIB_TOOLSET "vc6"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
+
+ // vc7:
+# define BOOST_LIB_TOOLSET "vc7"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310)
+
+ // vc71:
+# define BOOST_LIB_TOOLSET "vc71"
+
+#elif defined(__BORLANDC__)
+
+ // CBuilder 6:
+# define BOOST_LIB_TOOLSET "bcb"
+
+#elif defined(__ICL)
+
+ // Intel C++, no version number:
+# define BOOST_LIB_TOOLSET "iw"
+
+#elif defined(__MWERKS__) && (__MWERKS__ <= 0x31FF )
+
+ // Metrowerks CodeWarrior 8.x
+# define BOOST_LIB_TOOLSET "cw8"
+
+#elif defined(__MWERKS__) && (__MWERKS__ <= 0x32FF )
+
+ // Metrowerks CodeWarrior 9.x
+# define BOOST_LIB_TOOLSET "cw9"
+
+#endif
+
+//
+// select thread opt:
+//
+#if defined(_MT) || defined(__MT__)
+# define BOOST_LIB_THREAD_OPT "-mt"
+#else
+# define BOOST_LIB_THREAD_OPT
+#endif
+
+#if defined(_MSC_VER) || defined(__MWERKS__)
+
+# ifdef _DLL
+
+# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-gdp"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-gdp"
+# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-p"
+# endif
+
+# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-gdpn"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-gdpn"
+# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-pn"
+# endif
+
+# else
+
+# if defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-gd"
+# else
+# define BOOST_LIB_RT_OPT
+# endif
+
+# endif
+
+# else
+
+# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-sgdp"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-sgdp"
+# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-sp"
+# endif
+
+# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+
+# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
+# define BOOST_LIB_RT_OPT "-sgdpn"
+# elif defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-sgdpn"
+# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
+# error "Build options aren't compatible with pre-built libraries"
+# else
+# define BOOST_LIB_RT_OPT "-spn"
+# endif
+
+# else
+
+# if defined(_DEBUG)
+# define BOOST_LIB_RT_OPT "-sgd"
+# else
+# define BOOST_LIB_RT_OPT "-s"
+# endif
+
+# endif
+
+# endif
+
+#elif defined(__BORLANDC__)
+
+//
+// figure out whether we want the debug builds or not:
+//
+#pragma defineonoption BOOST_BORLAND_DEBUG -v
+//
+// sanity check:
+//
+#if defined(__STL_DEBUG) || defined(_STLP_DEBUG)
+#error "Pre-built versions of the Boost libraries are not provided in STLPort-debug form"
+#endif
+
+# ifdef _RTLDLL
+
+# ifdef BOOST_BORLAND_DEBUG
+# define BOOST_LIB_RT_OPT "-d"
+# else
+# define BOOST_LIB_RT_OPT
+# endif
+
+# else
+
+# ifdef BOOST_BORLAND_DEBUG
+# define BOOST_LIB_RT_OPT "-sd"
+# else
+# define BOOST_LIB_RT_OPT "-s"
+# endif
+
+# endif
+
+#endif
+
+//
+// select linkage opt:
+//
+#if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK)
+# define BOOST_LIB_PREFIX
+#elif defined(BOOST_DYN_LINK)
+# error "Mixing a dll boost library with a static runtime is a really bad idea..."
+#else
+# define BOOST_LIB_PREFIX "lib"
+#endif
+
+//
+// now include the lib:
+//
+#if defined(BOOST_LIB_NAME) \
+ && defined(BOOST_LIB_PREFIX) \
+ && defined(BOOST_LIB_TOOLSET) \
+ && defined(BOOST_LIB_THREAD_OPT) \
+ && defined(BOOST_LIB_RT_OPT) \
+ && defined(BOOST_LIB_VERSION)
+
+# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
+#ifdef BOOST_LIB_DIAGNOSTIC
+# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
+#endif
+
+#else
+# error "some required macros where not defined (internal logic error)."
+#endif
+
+
+#endif // _MSC_VER || __BORLANDC__
+
+//
+// finally undef any macros we may have set:
+//
+#ifdef BOOST_LIB_PREFIX
+# undef BOOST_LIB_PREFIX
+#endif
+#if defined(BOOST_LIB_NAME)
+# undef BOOST_LIB_NAME
+#endif
+#if defined(BOOST_LIB_TOOLSET)
+# undef BOOST_LIB_TOOLSET
+#endif
+#if defined(BOOST_LIB_THREAD_OPT)
+# undef BOOST_LIB_THREAD_OPT
+#endif
+#if defined(BOOST_LIB_RT_OPT)
+# undef BOOST_LIB_RT_OPT
+#endif
+#if defined(BOOST_LIB_LINK_OPT)
+# undef BOOST_LIB_LINK_OPT
+#endif
+#if defined(BOOST_LIB_DEBUG_OPT)
+# undef BOOST_LIB_DEBUG_OPT
+#endif
+#if defined(BOOST_DYN_LINK)
+# undef BOOST_DYN_LINK
+#endif
+
+
+
+
+
+
+
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_NO_CV_SPECIALIZATIONS
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+# define BOOST_NO_DEDUCED_TYPENAME
+#endif
+
+#if (__BORLANDC__ <= 0x564)
+# define BOOST_NO_SFINAE
#endif
// Version 7.0 (Kylix) and below:
-#if (__BORLANDC__ <= 0x570) || !defined(BOOST_STRICT_CONFIG)
+#if (__BORLANDC__ <= 0x570)
# define BOOST_NO_INTEGRAL_INT64_T
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
# define BOOST_NO_PRIVATE_IN_AGGREGATE
# define BOOST_NO_USING_TEMPLATE
# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
# define BOOST_NO_TEMPLATE_TEMPLATES
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
// we shouldn't really need this - but too many things choke
// without it, this needs more investigation:
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+# ifdef NDEBUG
+ // fix broken <cstring> so that Boost.test works:
+# include <cstring>
+# undef strcmp
+# endif
//
// new bug in 5.61:
-#if __BORLANDC__ >= 0x561
+#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x570)
// this seems to be needed by the command line compiler, but not the IDE:
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
#endif
//
// Post 0x561 we have long long and stdint.h:
#if __BORLANDC__ >= 0x561
-# define BOOST_HAS_LONG_LONG
+# ifndef __NO_LONG_LONG
+# define BOOST_HAS_LONG_LONG
+# endif
// On non-Win32 platforms let the platform config figure this out:
# ifdef _WIN32
# define BOOST_HAS_STDINT_H
//
// __int64:
//
-#if __BORLANDC__ >= 0x530
+#if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)
# define BOOST_HAS_MS_INT64
#endif
//
// check for exception handling support:
//
-#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND)
+#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
//
// all versions have a <dirent.h>:
//
-#define BOOST_HAS_DIRENT_H
+#ifndef __STRICT_ANSI__
+# define BOOST_HAS_DIRENT_H
+#endif
+//
+// all versions support __declspec:
+//
+#ifndef __STRICT_ANSI__
+# define BOOST_HAS_DECLSPEC
+#endif
+//
+// ABI fixing headers:
+//
+#if __BORLANDC__ < 0x600 // not implemented for version 6 compiler yet
+#ifndef BOOST_ABI_PREFIX
+# define BOOST_ABI_PREFIX "boost/config/abi/borland_prefix.hpp"
+#endif
+#ifndef BOOST_ABI_SUFFIX
+# define BOOST_ABI_SUFFIX "boost/config/abi/borland_suffix.hpp"
+#endif
+#endif
//
// Disable Win32 support in ANSI mode:
//
-#pragma defineonoption BOOST_DISABLE_WIN32 -A
+#if __BORLANDC__ < 0x600
+# pragma defineonoption BOOST_DISABLE_WIN32 -A
+#elif defined(__STRICT_ANSI__)
+# define BOOST_DISABLE_WIN32
+#endif
+//
+// MSVC compatibility mode does some nasty things:
+//
+#if defined(_MSC_VER) && (_MSC_VER <= 1200)
+# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+# define BOOST_NO_VOID_RETURNS
+#endif
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
# error "Compiler not supported or configured - please reconfigure"
#endif
//
-// last known and checked version is 5.7 (Kylix 3):
-#if (__BORLANDC__ > 0x570)
+// last known and checked version is 1536 (Builder X preview):
+#if (__BORLANDC__ > 1536)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Douglas Gregor 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Aleksey Gurtovoy 2003.
+// (C) Copyright Beman Dawes 2003.
+// (C) Copyright Jens Maurer 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#include "boost/config/compiler/common_edg.hpp"
#if (__COMO_VERSION__ <= 4245) || !defined(BOOST_STRICT_CONFIG)
+
+# ifdef _WIN32
+# define BOOST_NO_SWPRINTF
+# endif
+
# if defined(_MSC_VER) && _MSC_VER <= 1300
# define BOOST_NO_STDC_NAMESPACE
-# define BOOST_NO_SWPRINTF
# if _MSC_VER > 100
// only set this in non-strict mode:
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#if (__EDG_VERSION__ <= 238)
# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_NO_SFINAE
#endif
#if (__EDG_VERSION__ <= 240)
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// Nothing to do here?
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001 - 2002.
+// (C) Copyright Jens Maurer 2001 - 2002.
+// (C) Copyright Beman Dawes 2001 - 2003.
+// (C) Copyright Douglas Gregor 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Synge Todo 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
# endif
+# if __GNUC__ == 2 && __GNUC_MINOR__ < 96
+# define BOOST_NO_SFINAE
+# endif
+
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 97
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# define BOOST_NO_OPERATORS_IN_NAMESPACE
# if __GNUC__ < 3
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# endif
#ifndef __EXCEPTIONS
// those platforms where we can know for sure). It will get turned off again
// later if no threading API is detected.
//
-#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
+#if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__)
# define BOOST_HAS_THREADS
-#endif
+#endif
//
// gcc has "long long"
# error "Compiler not configured - please reconfigure"
#endif
//
-// last known and checked version is 3.3:
+// last known and checked version is 3.4:
#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 4))
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# warning "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Toon Knapen 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// member templates are sufficiently broken that we disable them for now
# define BOOST_NO_MEMBER_TEMPLATES
# define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
#endif
#if (__HP_aCC <= 33900) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
#endif
+#if (__HP_aCC <= 53800 )
+# define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+#endif
+
#define BOOST_COMPILER "HP aCC version " BOOST_STRINGIZE(__HP_aCC)
//
#endif
//
// last known and checked version is 0:
-#if (__HP_aCC > 33900)
+#if (__HP_aCC > 53800)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
+// (C) Copyright Guillaume Melquiond 2002 - 2003.
+// (C) Copyright Beman Dawes 2003.
+// (C) Copyright Martin Wille 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
#endif
+#if (BOOST_INTEL_CXX_VERSION <= 800) || !defined(BOOST_STRICT_CONFIG)
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#endif
+
#if _MSC_VER+0 >= 1000
# if _MSC_VER >= 1200
# define BOOST_HAS_MS_INT64
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright David Abrahams 2001 - 2002.
+// (C) Copyright Beman Dawes 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
# if(__MWERKS__ <= 0x3003) // 8.x
+# define BOOST_NO_SFINAE
+# endif
+
+# if(__MWERKS__ <= 0x3202) // 9.2
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# endif
# define BOOST_NO_EXCEPTIONS
#endif
+#if (__INTEL__ && _WIN32) || (__POWERPC__ && macintosh)
# if __MWERKS__ == 0x3000
# define BOOST_COMPILER_VERSION 8.0
# elif __MWERKS__ == 0x3001
# define BOOST_COMPILER_VERSION 8.2
# elif __MWERKS__ == 0x3003
# define BOOST_COMPILER_VERSION 8.3
+# elif __MWERKS__ == 0x3200
+# define BOOST_COMPILER_VERSION 9.0
+# elif __MWERKS__ == 0x3201
+# define BOOST_COMPILER_VERSION 9.1
+# elif __MWERKS__ == 0x3202
+# define BOOST_COMPILER_VERSION 9.2
# else
# define BOOST_COMPILER_VERSION __MWERKS__
-# endif
+# endif
+#else
+# define BOOST_COMPILER_VERSION __MWERKS__
+#endif
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
#endif
//
// last known and checked version:
-#if (__MWERKS__ > 0x3003)
+#if (__MWERKS__ > 0x3202)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// version check:
// probably nothing to do here?
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// (C) Copyright Peter Dimov 2002.
+// (C) Copyright Aleksey Gurtovoy 2002 - 2003.
+// (C) Copyright David Abrahams 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
# if (__SUNPRO_CC <= 0x530) || !defined(BOOST_STRICT_CONFIG)
+ // Requesting debug info (-g) with Boost.Python results
+ // in an internal compiler error for "static const"
+ // initialized in-class.
+ // >> Assertion: (../links/dbg_cstabs.cc, line 611)
+ // while processing ../test.cpp at line 0.
+ // (Jens Maurer according to Gottfried Ganßauge 04 Mar 2002)
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+
// SunPro 5.3 has better support for partial specialization,
// but breaks when compiling std::less<shared_ptr<T> >
// (Jens Maurer 4 Nov 2001).
# if (__SUNPRO_CC <= 0x540) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_NO_TEMPLATE_TEMPLATES
+ // see http://lists.boost.org/MailArchives/boost/msg47184.php
+ // and http://lists.boost.org/MailArchives/boost/msg47220.php
+# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+# define BOOST_NO_SFINAE
+# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
# endif
#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Toon Knapen 2001 - 2003.
+// (C) Copyright Lie-Quan Lee 2001.
+// (C) Copyright Markus Schöpflin 2002 - 2003.
+// (C) Copyright Beman Dawes 2002 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001 - 2002.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Aleksey Gurtovoy 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Beman Dawes 2002 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#if _MSC_VER <= 1200 // 1200 == VC++ 6.0
#pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
-# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_VOID_RETURNS
# define BOOST_NO_EXCEPTION_STD_NAMESPACE
-# define BOOST_NO_DEDUCED_TYPENAME
// disable min/max macro defines on vc6:
//
#endif
-#if (_MSC_VER <= 1300) // 1200 == VC++ 7.0
+#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0
#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
#endif
+# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
# define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
# define BOOST_NO_PRIVATE_IN_AGGREGATE
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# define BOOST_NO_INTEGRAL_INT64_T
+# define BOOST_NO_DEDUCED_TYPENAME
+# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
// VC++ 6/7 has member templates but they have numerous problems including
// cases of silent failure, so for safety we define:
# define BOOST_NO_USING_TEMPLATE
# define BOOST_NO_SWPRINTF
# define BOOST_NO_TEMPLATE_TEMPLATES
+# define BOOST_NO_SFINAE
# if (_MSC_VER > 1200)
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
# endif
//
// __int64 support:
//
-#if (_MSC_VER >= 1200) && defined(_MSC_EXTENSIONS)
+#if (_MSC_VER >= 1200)
# define BOOST_HAS_MS_INT64
#endif
#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS)
# define BOOST_DISABLE_WIN32
#endif
+//
+// all versions support __declspec:
+//
+#define BOOST_HAS_DECLSPEC
+//
+// prefix and suffix headers:
+//
+#ifndef BOOST_ABI_PREFIX
+# define BOOST_ABI_PREFIX "boost/config/abi/msvc_prefix.hpp"
+#endif
+#ifndef BOOST_ABI_SUFFIX
+# define BOOST_ABI_SUFFIX "boost/config/abi/msvc_suffix.hpp"
+#endif
+
# if _MSC_VER == 1200
# define BOOST_COMPILER_VERSION 6.0
# elif _MSC_VER == 1300
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
+
-
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#define BOOST_NO_STD_WSTRING
#define BOOST_NO_INTRINSIC_WCHAR_T
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#include <boost/config/posix_features.hpp>
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Douglas Gregor 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_HAS_FTIME
#endif
+//
+// find out if we have a stdint.h, there should be a better way to do this:
+//
+#include <sys/types.h>
+#ifdef _STDINT_H
+#define BOOST_HAS_STDINT_H
+#endif
+
// boilerplate code:
#include <boost/config/posix_features.hpp>
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Toon Knapen 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_HAS_SIGACTION
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
// See http://www.boost.org for most recent version.
#include <boost/config/posix_features.hpp>
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# endif
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001 - 2002.
+// (C) Copyright Bill Kempf 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_HAS_GETTIMEOFDAY
# define BOOST_HAS_SIGACTION
-# ifndef __APPLE_CC__
+# if (__GNUC__ < 3) && !defined( __APPLE_CC__)
// GCC strange "ignore std" mode works better if you pretend everything
// is in the std namespace, for the most part.
#endif
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Bill Kempf 2001.
+// (C) Copyright Aleksey Gurtovoy 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_NO_SWPRINTF
#endif
+#if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC)
+# define BOOST_HAS_DECLSPEC
+#endif
+
+#if defined(__MINGW32__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
+# define BOOST_HAS_STDINT_H
+# define __STDC_LIMIT_MACROS
+#endif
+
//
// Win32 will normally be using native Win32 threads,
// but there is a pthread library avaliable as an option,
#endif
#ifdef BOOST_MSVC
+#include <algorithm> // for existing std::min and std::max
namespace std{
// Apparently, something in the Microsoft libraries requires the "long"
// overload, because it calls the min/max functions with arguments of
using std::min;
using std::max;
# endif
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
// See http://www.boost.org for most recent version.
# endif
+
// Boost compiler configuration selection header file
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Martin Wille 2003.
+// (C) Copyright Guillaume Melquiond 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// Comeau C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
+#elif defined __DMC__
+// Digital Mars C++
+# define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"
+
#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
// Intel
# define BOOST_COMPILER_CONFIG "boost/config/compiler/intel.hpp"
#elif defined (BOOST_ASSERT_CONFIG)
// this must come last - generate an error if we don't
// recognise the compiler:
-# error "Unknown compiler - please configure and report the results to boost.org"
+# error "Unknown compiler - please configure (http://www.boost.org/libs/config/config.htm#configuring) and report the results to the main boost mailing list (http://www.boost.org/more/mailing_lists.htm#main)"
#endif
-
// Boost compiler configuration selection header file
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Jens Maurer 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#endif
+
// Boost compiler configuration selection header file
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
// See http://www.boost.org for most recent version.
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Guillaume Melquiond 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
// full dinkumware 3.06 and above
// fully conforming provided the compiler supports it:
-# if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(_STD) && !(defined(__ICC) && (__ICC >= 700)) // can be defined in yvals.h
+# if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(__BORLANDC__) && !defined(_STD) && !(defined(__ICC) && (__ICC >= 700)) // can be defined in yvals.h
# define BOOST_NO_STDC_NAMESPACE
# endif
# if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0)) && !(defined(_MSC_VER) && (_MSC_VER > 1300)) && defined(BOOST_MSVC)
# define BOOST_NO_STD_ALLOCATOR
# endif
# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
-# if defined(_MSC_VER) && (_MSC_VER < 1300)
+# if (defined(_MSC_VER) && (_MSC_VER < 1300)) && !defined(__BORLANDC__)
// if this lib version is set up for vc6 then there is no std::use_facet:
# define BOOST_NO_STD_USE_FACET
# define BOOST_HAS_TWO_ARG_USE_FACET
# if !defined(_LONGLONG) && (_CPPLIB_VER <= 310)
# define BOOST_NO_MS_INT64_NUMERIC_LIMITS
# endif
-// 3.06 appears to have (non-sgi versions of) <hash_set> & <hash_map>,
+// 3.06 appears to have (non-sgi versions of) <hash_set> & <hash_map>,
// and no <slist> at all
#else
# define BOOST_MSVC_STD_ITERATOR 1
#endif
-#if (defined(_MSC_VER) && (_MSC_VER <= 1300)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306)
+#if (defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__BORLANDC__)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306)
// if we're using a dinkum lib that's
// been configured for VC6/7 then there is
// no iterator traits (true even for icl)
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2002 - 2003.
+// (C) Copyright Jens Maurer 2002 - 2003.
+// (C) Copyright Beman Dawes 2002 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#define BOOST_STDLIB "Comeau standard library " BOOST_STRINGIZE(__LIBCOMO_VERSION__)
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Jens Maurer 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# undef BOOST_HAS_LONG_LONG
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright Jens Maurer 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// (C) Copyright Darin Adler 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# include <boost/config/posix_features.hpp>
#endif
-#if _MWMT
+#if defined(_MWMT) || _MSL_THREADSAFE
# define BOOST_HAS_THREADS
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Jens Maurer 2001.
+// (C) Copyright David Abrahams 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#endif
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Jens Maurer 2001 - 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
//
// SGI's new iostreams have missing "const" in messages<>::open
//
-#if defined(__sgi) && (_COMPILER_VERSION <= 730) && defined(__STL_USE_NEW_IOSTREAMS)
+#if defined(__sgi) && (_COMPILER_VERSION <= 740) && defined(__STL_USE_NEW_IOSTREAMS)
# define BOOST_NO_STD_MESSAGES
#endif
#define BOOST_STDLIB "SGI standard library"
+
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Jens Maurer 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_NO_STD_ALLOCATOR
#endif
+#if defined(_STLP_NO_MEMBER_TEMPLATE_KEYWORD) && defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
+# define BOOST_NO_STD_ALLOCATOR
+#endif
+
//
// We always have SGI style hash_set, hash_map, and slist:
//
// BCB6 does cause problems. If we detect C++ Builder, then don't define
// BOOST_NO_STDC_NAMESPACE
//
-#if !defined(__BORLANDC__)
+#if !defined(__BORLANDC__) && !defined(__DMC__)
//
// If STLport is using it's own namespace, and the real names are in
// the global namespace, then we duplicate STLport's using declarations
# define BOOST_NO_STDC_NAMESPACE
# define BOOST_NO_EXCEPTION_STD_NAMESPACE
# endif
-#elif __BORLANDC__ < 0x560
+#elif defined(__BORLANDC__) && __BORLANDC__ < 0x560
// STLport doesn't import std::abs correctly:
#include <stdlib.h>
namespace std { using ::abs; }
+
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2002.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
#define BOOST_STDLIB "Visual Age default standard library"
+
// Boost config.hpp configuration header file ------------------------------//
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001 - 2003.
+// (C) Copyright Darin Adler 2001.
+// (C) Copyright Peter Dimov 2001.
+// (C) Copyright Bill Kempf 2002.
+// (C) Copyright Jens Maurer 2002.
+// (C) Copyright David Abrahams 2002 - 2003.
+// (C) Copyright Gennaro Prota 2003.
+// (C) Copyright Eric Friedman 2003.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
# endif
+//
+// Without partial specialization, we can't have array-type partial specialisations:
+//
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
+# define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
+# endif
+
//
// Without partial specialization, std::iterator_traits can't work:
//
# define BOOST_NO_STD_ALLOCATOR
# endif
+//
+// without ADL support then using declarations will break ADL as well:
+//
+#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
+#endif
+
//
// If we have a standard allocator, then we have a partial one as well:
//
# undef BOOST_HAS_THREADS
#endif
+//
+// Turn threading detail macros off if we don't (want to) use threading
+//
+#ifndef BOOST_HAS_THREADS
+# undef BOOST_HAS_PTHREADS
+# undef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+# undef BOOST_HAS_WINTHREADS
+# undef BOOST_HAS_BETHREADS
+# undef BOOST_HAS_MPTASKS
+#endif
+
//
// If the compiler claims to be C99 conformant, then it had better
// have a <stdint.h>:
# define BOOST_NO_HASH
# endif
+// BOOST_HAS_ABI_HEADERS
+// This macro gets set if we have headers that fix the ABI,
+// and prevent ODR violations when linking to external libraries:
+#if defined(BOOST_ABI_PREFIX) && defined(BOOST_ABI_SUFFIX) && !defined(BOOST_HAS_ABI_HEADERS)
+# define BOOST_HAS_ABI_HEADERS
+#endif
+
+#if defined(BOOST_HAS_ABI_HEADERS) && defined(BOOST_DISABLE_ABI_HEADERS)
+# undef BOOST_HAS_ABI_HEADERS
+#endif
+
// BOOST_NO_STDC_NAMESPACE workaround --------------------------------------//
// Because std::size_t usage is so common, even in boost headers which do not
// otherwise use the C library, the <cstddef> workaround is included here so
# define BOOST_DEDUCED_TYPENAME
#endif
+// BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
+//
+// Some compilers have problems with function templates whose
+// template parameters don't appear in the function parameter
+// list (basically they just link one instantiation of the
+// template in the final executable). These macros provide a
+// uniform way to cope with the problem with no effects on the
+// calling syntax.
+
+// Example:
+//
+// #include <iostream>
+// #include <ostream>
+// #include <typeinfo>
+//
+// template <int n>
+// void f() { std::cout << n << ' '; }
+//
+// template <typename T>
+// void g() { std::cout << typeid(T).name() << ' '; }
+//
+// int main() {
+// f<1>();
+// f<2>();
+//
+// g<int>();
+// g<double>();
+// }
+//
+// With VC++ 6.0 the output is:
+//
+// 2 2 double double
+//
+// To fix it, write
+//
+// template <int n>
+// void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
+//
+// template <typename T>
+// void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }
+//
+
+
+#if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+
+# include "boost/type.hpp"
+# include "boost/non_type.hpp"
+
+# define BOOST_EXPLICIT_TEMPLATE_TYPE(t) boost::type<t>* = 0
+# define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type<t>*
+# define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type<t, v>* = 0
+# define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type<t, v>*
+
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
+ , BOOST_EXPLICIT_TEMPLATE_TYPE(t)
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
+ , BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
+ , BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
+ , BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
+
+#else
+
+// no workaround needed: expand to nothing
+
+# define BOOST_EXPLICIT_TEMPLATE_TYPE(t)
+# define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
+# define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
+# define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
+
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
+# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
+
+
+#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+
+
// ---------------------------------------------------------------------------//
//
#endif
+
// boost/config/user.hpp ---------------------------------------------------//
-// (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2001.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Do not check in modified versions of this file,
// This file may be customized by the end user, but not by boost.
// define if you want to disable threading support, even
// when available:
-#define BOOST_DISABLE_THREADS 1
+// #define BOOST_DISABLE_THREADS
// define when you want to disable Win32 specific features
// even when available:
// #define BOOST_DISABLE_WIN32
+// BOOST_DISABLE_ABI_HEADERS: Stops boost headers from including any
+// prefix/suffix headers that normally control things like struct
+// packing and alignment.
+// #define BOOST_DISABLE_ABI_HEADERS
+
+// BOOST_ABI_PREFIX: A prefix header to include in place of whatever
+// boost.config would normally select, any replacement should set up
+// struct packing and alignment options as required.
+// #define BOOST_ABI_PREFIX my-header-name
+
+// BOOST_ABI_SUFFIX: A suffix header to include in place of whatever
+// boost.config would normally select, any replacement should undo
+// the effects of the prefix header.
+// #define BOOST_ABI_SUFFIX my-header-name
+
+// BOOST_ALL_DYN_LINK: Forces all libraries that have separate source,
+// to be linked as dll's rather than static libraries on Microsoft Windows
+// (this macro is used to turn on __declspec(dllimport) modifiers, so that
+// the compiler knows which symbols to look for in a dll rather than in a
+// static library). Note that there may be some libraries that can only
+// be statically linked (Boost.Test for example) and others which may only
+// be dynamically linked (Boost.Threads for example), in these cases this
+// macro has no effect.
+// #define BOOST_ALL_DYN_LINK
+
+// BOOST_WHATEVER_DYN_LINK: Forces library "whatever" to be linked as a dll
+// rather than a static library on Microsoft Windows: replace the WHATEVER
+// part of the macro name with the name of the library that you want to
+// dynamically link to, for example use BOOST_DATE_TIME_DYN_LINK or
+// BOOST_REGEX_DYN_LINK etc (this macro is used to turn on __declspec(dllimport)
+// modifiers, so that the compiler knows which symbols to look for in a dll
+// rather than in a static library).
+// Note that there may be some libraries that can only be statically linked
+// (Boost.Test for example) and others which may only be dynamically linked
+// (Boost.Threads for example), in these cases this macro is unsupported.
+// #define BOOST_WHATEVER_DYN_LINK
+
+// BOOST_ALL_NO_LIB: Tells the config system not to automatically select
+// which libraries to link against.
+// Normally if a compiler supports #pragma lib, then the correct library
+// build variant will be automatically selected and linked against,
+// simply by the act of including one of that library's headers.
+// This macro turns that feature off.
+// #define BOOST_ALL_NO_LIB
+
+// BOOST_WHATEVER_NO_LIB: Tells the config system not to automatically
+// select which library to link against for library "whatever",
+// replace WHATEVER in the macro name with the name of the library;
+// for example BOOST_DATE_TIME_NO_LIB or BOOST_REGEX_NO_LIB.
+// Normally if a compiler supports #pragma lib, then the correct library
+// build variant will be automatically selected and linked against, simply
+// by the act of including one of that library's headers. This macro turns
+// that feature off.
+// #define BOOST_WHATEVER_NO_LIB
+
+
-#define BOOST_NO_WREGEX 1
-#define BOOST_NO_WSTRING 1
// Boost CRC library crc.hpp header file -----------------------------------//
-// (C) Copyright Daryle Walker 2001. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or
-// implied warranty, and with no claim as to its suitability for any purpose.
+// Copyright 2001 Daryle Walker. Use, modification, and distribution are
+// subject to the Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
-// See http://www.boost.org/libs/crc for documentation.
+// See <http://www.boost.org/libs/crc/> for the library's home page.
#ifndef BOOST_CRC_HPP
#define BOOST_CRC_HPP
typedef typename base_type::least least;
typedef typename base_type::fast fast;
+#if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243
+ static const least high_bit = 1ul << ( Bits - 1u );
+ static const fast high_bit_fast = 1ul << ( Bits - 1u );
+#else
BOOST_STATIC_CONSTANT( least, high_bit = (least( 1u ) << ( Bits
- 1u )) );
BOOST_STATIC_CONSTANT( fast, high_bit_fast = (fast( 1u ) << ( Bits
- 1u )) );
+#endif
}; // boost::detail::high_uint_t
BOOST_STATIC_CONSTANT( fast, high_bit_fast = base_type::high_bit_fast );
#endif
+#if defined(__EDG_VERSION__) && __EDG_VERSION__ <= 243
+ static const least sig_bits = (~( ~( 0ul ) << Bits )) ;
+#else
BOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits )) );
+#endif
BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) );
}; // boost::detail::mask_uint_t
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BOOST_RE_CREGEX_HPP
#define BOOST_RE_CREGEX_HPP
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/cregex.hpp>
+#else
+#include <boost/regex/v4/cregex.hpp>
+#endif
#endif // include guard
+
+
#else // BOOST_HAS_STDINT_H
-# include <limits.h> // implementation artifact; not part of interface
+# include <boost/limits.hpp> // implementation artifact; not part of interface
namespace boost
# else
# error defaults not correct; you must hand modify boost/cstdint.hpp
# endif
+# elif defined(__GNUC__) && defined(BOOST_HAS_LONG_LONG)
+ __extension__ typedef long long intmax_t;
+ __extension__ typedef unsigned long long uintmax_t;
+ __extension__ typedef long long int64_t;
+ __extension__ typedef long long int_least64_t;
+ __extension__ typedef long long int_fast64_t;
+ __extension__ typedef unsigned long long uint64_t;
+ __extension__ typedef unsigned long long uint_least64_t;
+ __extension__ typedef unsigned long long uint_fast64_t;
# elif defined(BOOST_HAS_MS_INT64)
//
// we have Borland/Intel/Microsoft __int64:
// boost/cstdlib.hpp header ------------------------------------------------//
-// (C) Copyright Beman Dawes 2001. Permission to copy, use, modify, sell
-// and distribute this software is granted provided this copyright notice
-// appears in all copies. This software is provided "as is" without express or
-// implied warranty, and with no claim as to its suitability for any purpose.
+// Copyright Beman Dawes 2001.
+// See accompanying license for terms and conditions of use.
// See http://www.boost.org/libs/utility/cstdlib.html for documentation.
#ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
#define BOOST_CURRENT_FUNCTION_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
inline void current_function_helper()
{
-#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000))
+#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600))
# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
# define BOOST_CURRENT_FUNCTION __FUNCSIG__
+#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
+
+# define BOOST_CURRENT_FUNCTION __FUNCTION__
+
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
# define BOOST_CURRENT_FUNCTION __FUNC__
* Copyright (c) 2001
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/config.hpp>
#include <cstdlib>
+#include <new>
+#include <assert.h>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
using ::ptrdiff_t;
} // namespace detail
} // namespace boost
-#elif !defined(BOOST_NO_MEMBER_TEMPLATES)
+#elif !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__SUNPRO_CC)
// no std::allocator, but the compiler supports the necessary syntax,
// write our own allocator instead:
#ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
#define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
#ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
#define BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/utility for most recent version including documentation.
// call_traits: defines typedefs for function usage
// (see libs/utility/call_traits.htm)
#ifndef BOOST_CONFIG_HPP
#include <boost/config.hpp>
#endif
+#include <cstddef>
-#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
-#include <boost/type_traits/arithmetic_traits.hpp>
-#endif
-#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP
-#include <boost/type_traits/composite_traits.hpp>
-#endif
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/type_traits/is_pointer.hpp>
namespace boost{
typedef T& param_type; // hh removed const
};
#endif
-#ifndef __SUNPRO_CC
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
template <typename T, std::size_t N>
struct call_traits<T [N]>
{
// boost/catch_exceptions.hpp -----------------------------------------------//
-// (C) Copyright Beman Dawes 1995-2001. Permission to copy, use, modify, sell
-// and distribute this software is granted provided this copyright notice
-// appears in all copies. This software is provided "as is" without express or
-// implied warranty, and with no claim as to its suitability for any purpose.
+// Copyright Beman Dawes 1995-2001.
+// See accompanying license for terms and conditions of use.
-// See http://www.boost.org for updates, documentation, and revision history.
+// See http://www.boost.org/libs/test for documentation.
// Revision History
// 13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones)
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/utility for most recent version including documentation.
// compressed_pair: pair that "compresses" empty members
// (see libs/utility/compressed_pair.htm)
//
+// JM changes 25 Jan 2004:
+// For the case where T1 == T2 and both are empty, then first() and second()
+// should return different objects.
// JM changes 25 Jan 2000:
// Removed default arguments from compressed_pair_switch to get
// C++ Builder 4 to accept them
#define BOOST_DETAIL_COMPRESSED_PAIR_HPP
#include <algorithm>
-#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP
-#include <boost/type_traits/object_traits.hpp>
-#endif
-#ifndef BOOST_SAME_TRAITS_HPP
-#include <boost/type_traits/same_traits.hpp>
-#endif
-#ifndef BOOST_CALL_TRAITS_HPP
+
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_empty.hpp>
+#include <boost/type_traits/is_same.hpp>
#include <boost/call_traits.hpp>
-#endif
namespace boost
{
compressed_pair_imp() {}
- compressed_pair_imp(first_param_type x, second_param_type)
- : first_type(x) {}
+ compressed_pair_imp(first_param_type x, second_param_type y)
+ : first_type(x), m_second(y) {}
compressed_pair_imp(first_param_type x)
- : first_type(x) {}
+ : first_type(x), m_second(x) {}
first_reference first() {return *this;}
first_const_reference first() const {return *this;}
- second_reference second() {return *this;}
- second_const_reference second() const {return *this;}
+ second_reference second() {return m_second;}
+ second_const_reference second() const {return m_second;}
void swap(::boost::compressed_pair<T1,T2>&) {}
private:
+ T2 m_second;
};
// 5 T1 == T2 and are not empty: //JM
--- /dev/null
+// Copyright David Abrahams 2004. 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 IS_INCREMENTABLE_DWA200415_HPP
+# define IS_INCREMENTABLE_DWA200415_HPP
+
+# include <boost/type_traits/remove_cv.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/detail/workaround.hpp>
+
+namespace boost { namespace detail {
+
+// is_incrementable<T> metafunction
+//
+// Requires: Given x of type T&, if the expression ++x is well-formed
+// it must have complete type; otherwise, it must neither be ambiguous
+// nor violate access.
+
+// This namespace ensures that ADL doesn't mess things up.
+namespace is_incrementable_
+{
+ struct tag {};
+
+ // any soaks up implicit conversions and makes the following
+ // operator++ less-preferred than any other such operator which
+ // might be found via ADL.
+ struct any { template <class T> any(T const&); };
+ tag operator++(any const&);
+
+ // two check overloads help us identify which operator++ was picked
+ char (& check(tag) )[2];
+
+ template <class T>
+ char check(T const&);
+
+
+ template <class T>
+ struct
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ impl
+# else
+ is_incrementable
+# endif
+ {
+ static typename remove_cv<T>::type& x;
+
+ BOOST_STATIC_CONSTANT(
+ bool
+ , value = sizeof(is_incrementable_::check(++x)) == 1
+ );
+
+ typedef mpl::bool_<(
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ ::boost::detail::is_incrementable_::is_incrementable<T>::
+# endif
+ value)> type;
+ };
+}
+
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+template <class T>
+struct is_incrementable : is_incrementable_::impl<T>
+{
+};
+# else
+using is_incrementable_::is_incrementable;
+# endif
+
+}} // namespace boost::detail
+
+#endif // IS_INCREMENTABLE_DWA200415_HPP
# define ITERATOR_DWA122600_HPP_
# include <boost/config.hpp>
-# include <boost/type_traits/remove_const.hpp>
-# include <boost/type_traits/detail/yes_no_type.hpp>
-# include <boost/type_traits/is_pointer.hpp>
-# include <boost/type_traits/is_base_and_derived.hpp>
-# include <boost/mpl/if.hpp>
-# include <boost/mpl/aux_/has_xxx.hpp>
# include <iterator>
-# include <cstddef>
-
-// should be the last #include
-#include "boost/type_traits/detail/bool_trait_def.hpp"
// STLPort 4.0 and betas have a bug when debugging is enabled and there is no
// partial specialization: instead of an iterator_category typedef, the standard
# endif // STLPort <= 4.1b4 && no partial specialization
-namespace boost { namespace detail {
-
-BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
-BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
-BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer)
-BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type)
-BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
-
# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) \
&& !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& !defined(BOOST_MSVC_STD_ITERATOR)
+
+namespace boost { namespace detail {
+
// Define a new template so it can be specialized
template <class Iterator>
struct iterator_traits
: std::iterator_traits<Iterator>
{};
using std::distance;
-# elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
- && !defined(BOOST_MSVC_STD_ITERATOR)
+
+}} // namespace boost::detail
+
+# else
+
+# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MSVC_STD_ITERATOR)
+
+// This is the case where everything conforms except BOOST_NO_STD_ITERATOR_TRAITS
+
+namespace boost { namespace detail {
// Rogue Wave Standard Library fools itself into thinking partial
// specialization is missing on some platforms (e.g. Sun), so fails to
typedef std::random_access_iterator_tag iterator_category;
};
-# else
+}} // namespace boost::detail
+
+# else
+
+# include <boost/type_traits/remove_const.hpp>
+# include <boost/type_traits/detail/yes_no_type.hpp>
+# include <boost/type_traits/is_pointer.hpp>
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/remove_pointer.hpp>
+# endif
+# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
+# include <boost/type_traits/is_base_and_derived.hpp>
+# endif
+
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/aux_/has_xxx.hpp>
+# include <cstddef>
+
+// should be the last #include
+# include "boost/type_traits/detail/bool_trait_def.hpp"
+
+namespace boost { namespace detail {
+
+BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type)
+BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
+BOOST_MPL_HAS_XXX_TRAIT_DEF(pointer)
+BOOST_MPL_HAS_XXX_TRAIT_DEF(difference_type)
+BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
// is_mutable_iterator --
//
template <class T>
type_traits::yes_type is_mutable_iterator_helper(T const*, BOOST_DEDUCED_TYPENAME T::value_type*);
+// Since you can't take the address of an rvalue, the guts of
+// is_mutable_iterator_impl will fail if we use &*t directly. This
+// makes sure we can still work with non-lvalue iterators.
+template <class T> T* mutable_iterator_lvalue_helper(T& x);
+int mutable_iterator_lvalue_helper(...);
+
+
// This one detects output iterators such as ostream_iterator which
// return references to themselves.
template <class T>
{
static T t;
- BOOST_STATIC_CONSTANT(bool, value = sizeof(
- detail::is_mutable_iterator_helper((T*)0, &*t))
- == sizeof(type_traits::yes_type)
- );
+ BOOST_STATIC_CONSTANT(
+ bool, value = sizeof(
+ detail::is_mutable_iterator_helper(
+ (T*)0
+ , mutable_iterator_lvalue_helper(*t) // like &*t
+ ))
+ == sizeof(type_traits::yes_type)
+ );
};
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_full_iterator_traits,T,::boost::detail::is_full_iterator_traits_impl<T>::value)
-# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
BOOST_MPL_HAS_XXX_TRAIT_DEF(_Iterator_category)
// is_stlport_40_debug_iterator --
typedef typename T::difference_type difference_type;
typedef typename T::_Iterator_category iterator_category;
};
-# endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+# endif // BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
template <class T> struct pointer_iterator_traits;
-# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T>
struct pointer_iterator_traits<T*>
{
typedef std::random_access_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
};
-# else
-template <class Ptr>
-struct must_manually_specialize_boost_detail_iterator_traits;
+# else
+
+// In case of no template partial specialization, and if T is a
+// pointer, iterator_traits<T>::value_type can still be computed. For
+// some basic types, remove_pointer is manually defined in
+// type_traits/broken_compiler_spec.hpp. For others, do it yourself.
+
+template<class P> class please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee;
+
+template<class P>
+struct pointer_value_type
+ : mpl::if_<
+ is_same<P, typename remove_pointer<P>::type>
+ , please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
+ , typename remove_const<
+ typename remove_pointer<P>::type
+ >::type
+ >
+{
+};
+
+
+template<class P>
+struct pointer_reference
+ : mpl::if_<
+ is_same<P, typename remove_pointer<P>::type>
+ , please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<P>
+ , typename remove_pointer<P>::type&
+ >
+{
+};
template <class T>
struct pointer_iterator_traits
typedef std::random_access_iterator_tag iterator_category;
typedef std::ptrdiff_t difference_type;
- // Makes MSVC6 happy under some circumstances
- typedef must_manually_specialize_boost_detail_iterator_traits<T> value_type;
- typedef must_manually_specialize_boost_detail_iterator_traits<T> reference;
+ typedef typename pointer_value_type<T>::type value_type;
+ typedef typename pointer_reference<T>::type reference;
};
-// Use this as a base class in manual iterator_traits specializations
-// for pointer types. T should be the value_type. CV should be the
-// cv-qualified value_type to which */& is added in order to produce
-// pointer/reference.
-template <class T, class CV = T>
-struct ptr_iter_traits
-{
- typedef T value_type;
- typedef CV* pointer;
- typedef CV& reference;
- typedef std::random_access_iterator_tag iterator_category;
- typedef std::ptrdiff_t difference_type;
-};
-# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
// We'll sort iterator types into one of these classifications, from which we
// can determine the difference_type, pointer, reference, and value_type
typedef const value_type& reference;
};
-# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
+# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
template <class Iterator>
struct is_bad_output_iterator
: is_base_and_derived<
typedef void pointer;
typedef void reference;
};
-# endif
+# endif
// If we're looking at an MSVC6 (old Dinkumware) ``standard''
// iterator, this will generate an appropriate traits class.
is_full_iterator_traits<Iterator>
// Use a standard iterator_traits implementation
, standard_iterator_traits<Iterator>
-# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
// Check for STLPort 4.0 broken _Iterator_category type
, mpl::if_<
is_stlport_40_debug_iterator<Iterator>
, stlport_40_debug_iterator_traits<Iterator>
-# endif
+# endif
// Otherwise, assume it's a Dinkum iterator
, msvc_stdlib_iterator_traits<Iterator>
-# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
>::type
-# endif
+# endif
>::type
{
};
// Explicit forwarding from base class needed to keep MSVC6 happy
// under some circumstances.
private:
-# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
+# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
typedef
typename mpl::if_<
is_bad_output_iterator<Iterator>
, bad_output_iterator_traits
, iterator_traits_aux<Iterator>
>::type base;
-# else
+# else
typedef iterator_traits_aux<Iterator> base;
-# endif
+# endif
public:
typedef typename base::value_type value_type;
typedef typename base::pointer pointer;
};
// This specialization cuts off ETI (Early Template Instantiation) for MSVC.
-template <> struct iterator_traits<int>{};
+template <> struct iterator_traits<int>
+{
+ typedef int value_type;
+ typedef int pointer;
+ typedef int reference;
+ typedef int difference_type;
+ typedef int iterator_category;
+};
+
+}} // namespace boost::detail
+
+# endif // workarounds
+
+namespace boost { namespace detail {
namespace iterator_traits_
{
{
static Difference execute(Iterator i1, const Iterator i2, ...)
{
- typename Difference result = 0;
+ Difference result = 0;
while (i1 != i2)
{
++i1;
return iterator_traits_::distance_select<Iterator,diff_t>::execute(
first, last, (iterator_category*)0);
}
-# endif // workarounds
-}} // namespace boost::detail
+}}
+
+# endif
+
# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
#ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
#define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
// boost/detail/lightweight_mutex.hpp - lightweight mutex
//
-// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// shared_ptr_timing_test.cpp will compile succesfully with a stub do-nothing
// pthreads library, since it doesn't create any threads.
-#ifndef BOOST_HAS_THREADS
-# include <boost/detail/lwm_nop.hpp>
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(BOOST_LWM_USE_CRITICAL_SECTION) && !defined(BOOST_LWM_USE_PTHREADS)
+# define BOOST_LWM_WIN32
+#endif
+
+#if !defined(BOOST_HAS_THREADS)
+# if defined(BOOST_LWM_WIN32)
+# include <boost/detail/lwm_win32_nt.hpp>
+# else
+# include <boost/detail/lwm_nop.hpp>
+# endif
#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(BOOST_USE_ASM_ATOMIC_H)
# include <boost/detail/lwm_linux.hpp>
#elif defined(BOOST_LWM_USE_CRITICAL_SECTION)
# include <boost/detail/lwm_win32_cs.hpp>
#elif defined(BOOST_LWM_USE_PTHREADS)
# include <boost/detail/lwm_pthreads.hpp>
-#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+#elif defined(BOOST_LWM_WIN32)
# include <boost/detail/lwm_win32.hpp>
#elif defined(BOOST_LWM_USE_SPINLOCK) && defined(__sgi)
# include <boost/detail/lwm_irix.hpp>
#ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
#define BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
-#endif
-
//
// boost/detail/lwm_irix.hpp
//
#ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
#define BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
-#endif
-
//
// boost/detail/lwm_linux.hpp
//
#ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED
#define BOOST_DETAIL_LWM_NOP_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
#ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
#define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
#ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
#define BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
#ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
#define BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
--- /dev/null
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/lib/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_DETAIL_NONE_T_17SEP2003_HPP
+#define BOOST_DETAIL_NONE_T_17SEP2003_HPP
+
+namespace boost {
+
+namespace detail {
+
+struct none_helper{};
+
+typedef int none_helper::*none_t ;
+
+} // namespace detail
+
+} // namespace boost
+
+#endif
+
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/utility for most recent version including documentation.
//
// Crippled version for crippled compilers:
// see libs/utility/call_traits.htm
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/utility for most recent version including documentation.
// see libs/utility/compressed_pair.hpp
//
/* Release notes:
typedef typename call_traits<second_type>::const_reference second_const_reference;
compressed_pair_4() : T1() {}
- compressed_pair_4(first_param_type x, second_param_type) : T1(x) {}
+ compressed_pair_4(first_param_type x, second_param_type y) : T1(x), m_second(y) {}
// only one single argument constructor since T1 == T2
- explicit compressed_pair_4(first_param_type x) : T1(x) {}
+ explicit compressed_pair_4(first_param_type x) : T1(x), m_second(x) {}
compressed_pair_4(const ::boost::compressed_pair<T1,T2>& x)
- : T1(x.first()){}
+ : T1(x.first()), m_second(x.second()) {}
first_reference first() { return *this; }
first_const_reference first() const { return *this; }
- second_reference second() { return *this; }
- second_const_reference second() const { return *this; }
+ second_reference second() { return m_second; }
+ second_const_reference second() const { return m_second; }
void swap(compressed_pair_4& y)
{
// no need to swap empty base classes:
}
+private:
+ T2 m_second;
};
// T1 == T2, not empty
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost detail/reference_content.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
+#define BOOST_DETAIL_REFERENCE_CONTENT_HPP
+
+#include "boost/config.hpp"
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# include "boost/mpl/bool.hpp"
+# include "boost/type_traits/has_nothrow_copy.hpp"
+#else
+# include "boost/mpl/if.hpp"
+# include "boost/type_traits/is_reference.hpp"
+#endif
+
+#include "boost/mpl/void.hpp"
+
+namespace boost {
+
+namespace detail {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class template reference_content
+//
+// Non-Assignable wrapper for references.
+//
+template <typename RefT>
+class reference_content
+{
+private: // representation
+
+ RefT content_;
+
+public: // structors
+
+ ~reference_content()
+ {
+ }
+
+ reference_content(RefT r)
+ : content_( r )
+ {
+ }
+
+ reference_content(const reference_content& operand)
+ : content_( operand.content_ )
+ {
+ }
+
+private: // non-Assignable
+
+ reference_content& operator=(const reference_content&);
+
+public: // queries
+
+ RefT get() const
+ {
+ return content_;
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction make_reference_content
+//
+// Wraps with reference_content if specified type is reference.
+//
+
+template <typename T = mpl::void_> struct make_reference_content;
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <typename T>
+struct make_reference_content
+{
+ typedef T type;
+};
+
+template <typename T>
+struct make_reference_content< T& >
+{
+ typedef reference_content<T&> type;
+};
+
+#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <typename T>
+struct make_reference_content
+ : mpl::if_<
+ is_reference<T>
+ , reference_content<T>
+ , T
+ >
+{
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
+
+template <>
+struct make_reference_content< mpl::void_ >
+{
+ template <typename T>
+ struct apply
+ : make_reference_content<T>
+ {
+ };
+
+ typedef mpl::void_ type;
+};
+
+} // namespace detail
+
+///////////////////////////////////////////////////////////////////////////////
+// reference_content<T&> type traits specializations
+//
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <typename T>
+struct has_nothrow_copy<
+ ::boost::detail::reference_content< T& >
+ >
+ : mpl::true_
+{
+};
+
+#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+} // namespace boost
+
+#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP
#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
#define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
+// MS compatible compilers support #pragma once
+
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
virtual void * get_deleter(std::type_info const & ti) = 0;
- void add_ref()
+ void add_ref_copy()
{
#if defined(BOOST_HAS_THREADS)
mutex_type::scoped_lock lock(mtx_);
#endif
- if(use_count_ == 0 && weak_count_ != 0) boost::throw_exception(boost::bad_weak_ptr());
++use_count_;
- ++weak_count_;
+ }
+
+ void add_ref_lock()
+ {
+#if defined(BOOST_HAS_THREADS)
+ mutex_type::scoped_lock lock(mtx_);
+#endif
+ if(use_count_ == 0) boost::throw_exception(boost::bad_weak_ptr());
+ ++use_count_;
}
void release() // nothrow
#endif
long new_use_count = --use_count_;
- if(new_use_count != 0)
- {
- --weak_count_;
- return;
- }
+ if(new_use_count != 0) return;
}
dispose();
sp_counted_base(sp_counted_base const &);
sp_counted_base & operator= (sp_counted_base const &);
- // inv: use_count_ <= weak_count_
+ long use_count_; // #shared
+ long weak_count_; // #weak + (#shared != 0)
- long use_count_;
- long weak_count_;
-
-#if defined(BOOST_HAS_THREADS)
+#if defined(BOOST_HAS_THREADS) || defined(BOOST_LWM_WIN32)
mutable mutex_type mtx_;
#endif
};
r.release();
}
-#endif
+#endif
~shared_count() // nothrow
{
, id_(shared_count_id)
#endif
{
- if(pi_ != 0) pi_->add_ref();
+ if(pi_ != 0) pi_->add_ref_copy();
}
explicit shared_count(weak_count const & r); // throws bad_weak_ptr when r.use_count() == 0
shared_count & operator= (shared_count const & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
- if(tmp != 0) tmp->add_ref();
+ if(tmp != 0) tmp->add_ref_copy();
if(pi_ != 0) pi_->release();
pi_ = tmp;
{
if(pi_ != 0)
{
- pi_->add_ref();
+ pi_->add_ref_lock();
}
else
{
# define BOOST_OPEN_PAREN (
# define BOOST_TESTED_AT(value) > value) ?(-1): BOOST_OPEN_PAREN 1
# else
-# define BOOST_TESTED_AT(value) != 0
+# define BOOST_TESTED_AT(value) != ((value)-(value))
# endif
# else
--- /dev/null
+#ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
+#define BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
+
+//
+// enable_shared_from_this.hpp
+//
+// Copyright (c) 2002 Peter Dimov
+//
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+//
+// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
+//
+
+#include <boost/weak_ptr.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+
+namespace boost
+{
+
+template<class T> class enable_shared_from_this
+{
+protected:
+
+ enable_shared_from_this()
+ {
+ }
+
+ enable_shared_from_this(enable_shared_from_this const &)
+ {
+ }
+
+ enable_shared_from_this & operator=(enable_shared_from_this const &)
+ {
+ return *this;
+ }
+
+ ~enable_shared_from_this()
+ {
+ }
+
+public:
+
+ shared_ptr<T> shared_from_this()
+ {
+ shared_ptr<T> p(_internal_weak_this);
+ BOOST_ASSERT(p.get() == this);
+ return p;
+ }
+
+ shared_ptr<T const> shared_from_this() const
+ {
+ shared_ptr<T const> p(_internal_weak_this);
+ BOOST_ASSERT(p.get() == this);
+ return p;
+ }
+
+ typedef T _internal_element_type; // for bcc 5.5.1
+ weak_ptr<_internal_element_type> _internal_weak_this;
+};
+
+} // namespace boost
+
+#endif // #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED
--- /dev/null
+// boost/filesystem/config.hpp ---------------------------------------------//
+
+// © Copyright Beman Dawes 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)
+
+// See library home page at http://www.boost.org/libs/filesystem
+
+//----------------------------------------------------------------------------//
+
+#ifndef BOOST_FILESYSTEM_CONFIG_HPP
+#define BOOST_FILESYSTEM_CONFIG_HPP
+
+// This header implements separate compilation features as described in
+// http://www.boost.org/more/separate_compilation.html
+
+#include <boost/config.hpp>
+
+// enable dynamic linking on Windows ---------------------------------------//
+
+#ifdef BOOST_HAS_DECLSPEC // defined in config system
+// we need to import/export our code only if the user has specifically
+// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
+// libraries to be dynamically linked, or BOOST_FILESYSTEM_DYN_LINK
+// if they want just this one to be dynamically liked:
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
+// export if this is our own source, otherwise import:
+#ifdef BOOST_FILESYSTEM_SOURCE
+# define BOOST_FILESYSTEM_DECL __declspec(dllexport)
+#else
+# define BOOST_FILESYSTEM_DECL __declspec(dllimport)
+#endif // BOOST_FILESYSTEM_SOURCE
+#endif // DYN_LINK
+#endif // BOOST_HAS_DECLSPEC
+//
+// if BOOST_FILESYSTEM_DECL isn't defined yet define it now:
+#ifndef BOOST_FILESYSTEM_DECL
+#define BOOST_FILESYSTEM_DECL
+#endif
+
+// enable automatic library variant selection ------------------------------//
+
+#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
+//
+// Set the name of our library, this will get undef'ed by auto_link.hpp
+// once it's done with it:
+//
+#define BOOST_LIB_NAME boost_filesystem
+//
+// If we're importing code from a dll, then tell auto_link.hpp about it:
+//
+#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
+# define BOOST_DYN_LINK
+#endif
+//
+// And include the header that does the work:
+//
+#include <boost/config/auto_link.hpp>
+#endif // auto-linking disabled
+
+#endif // BOOST_FILESYSTEM_CONFIG_HPP
// boost/filesystem/convenience.hpp ----------------------------------------//
-// (C) Copyright Beman Dawes, 2002
-// (C) Copyright Vladimir Prus, 2002
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// © Copyright Beman Dawes, 2002
+// © Copyright Vladimir Prus, 2002
+// 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)
-
-// See http://www.boost.org/libs/filesystem for documentation.
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP
#define BOOST_FILESYSTEM_CONVENIENCE_HPP
-#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/path.hpp> // includes <boost/filesystem/config.hpp>
#include <boost/filesystem/operations.hpp>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
namespace boost
{
namespace filesystem
// create_directories (contributed by Vladimir Prus) -----------------------//
- /** Creates directory 'ph' and all necessary parent directories.
- @post exists(directory_ph) && is_directory(directory_ph) && is_empty(directory_ph)
- */
- void create_directories(const path& ph);
+ BOOST_FILESYSTEM_DECL void create_directories(const path& ph);
+
+ BOOST_FILESYSTEM_DECL std::string extension(const path& ph);
+
+ BOOST_FILESYSTEM_DECL std::string basename(const path& ph);
+
+ BOOST_FILESYSTEM_DECL path change_extension(const path& ph,
+ const std::string& new_extension);
} // namespace filesystem
} // namespace boost
-#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP
-
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
+#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP
// boost/filesystem/exception.hpp ------------------------------------------//
-// < ----------------------------------------------------------------------- >
-// < Copyright © 2002 Beman Dawes >
-// < Copyright © 2001 Dietmar Kühl, All Rights Reserved >
-// < >
-// < Permission to use, copy, modify, distribute and sell this >
-// < software for any purpose is hereby granted without fee, provided >
-// < that the above copyright notice appears in all copies and that >
-// < both that copyright notice and this permission notice appear in >
-// < supporting documentation. The authors make no representations about >
-// < the suitability of this software for any purpose. It is provided >
-// < "as is" without express or implied warranty. >
-// < ----------------------------------------------------------------------- >
-
-// See http://www.boost.org/libs/filesystem for documentation.
+// Copyright © 2002 Beman Dawes
+// Copyright © 2001 Dietmar Kühl
+//
+// 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)
+
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_EXCEPTION_HPP
#define BOOST_FILESYSTEM_EXCEPTION_HPP
+#include <boost/filesystem/config.hpp>
#include <boost/filesystem/path.hpp>
#include <string>
-#include <stdexcept>
+#include <exception>
+#include <boost/shared_ptr.hpp>
+
+#include <boost/config/abi_prefix.hpp> // must be the last header
//----------------------------------------------------------------------------//
{
namespace detail
{
- int system_error_code(); // artifact of POSIX and WINDOWS error reporting
+ BOOST_FILESYSTEM_DECL int system_error_code(); // artifact of POSIX and WINDOWS error reporting
}
enum error_code
};
- class filesystem_error : public std::runtime_error
+ class BOOST_FILESYSTEM_DECL filesystem_error : public std::exception
{
public:
~filesystem_error() throw();
+ virtual const char * what() const throw();
+
int native_error() const { return m_sys_err; }
// Note: a value of 0 implies a library (rather than system) error
error_code error() const { return m_err; }
const path & path2() const; // argument 2 to who; may be empty()
private:
- int m_sys_err;
- error_code m_err;
- std::string m_who;
- path m_path1;
- path m_path2;
+ class m_imp;
+ shared_ptr<m_imp> m_imp_ptr;
+ int m_sys_err;
+ error_code m_err;
};
} // namespace filesystem
} // namespace boost
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_FILESYSTEM_EXCEPTION_HPP
// boost/filesystem/fstream.hpp --------------------------------------------//
-// (C) Copyright Beman Dawes 2002. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Copyright Beman Dawes 2002.
+// 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)
-// See http://www.boost.org/libs/filesystem for documentation.
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_FSTREAM_HPP
#define BOOST_FILESYSTEM_FSTREAM_HPP
-#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/path.hpp> // includes <boost/filesystem/config.hpp>
+#include <boost/detail/workaround.hpp>
#include <iosfwd>
#include <fstream>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
namespace boost
{
namespace filesystem
{
public:
virtual ~basic_filebuf() {}
-
-#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this
+#if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
std::basic_filebuf<charT,traits> * open( const path & file_ph,
std::ios_base::openmode mode )
{
{
public:
basic_ifstream() {}
+#if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
explicit basic_ifstream( const path & file_ph,
std::ios_base::openmode mode = std::ios_base::in )
: std::basic_ifstream<charT,traits>(
file_ph.native_file_string().c_str(), mode ) {}
- virtual ~basic_ifstream() {}
-#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
void open( const path & file_ph,
std::ios_base::openmode mode = std::ios_base::in )
{
std::basic_ifstream<charT,traits>::open(
file_ph.native_file_string().c_str(), mode );
}
+# endif
+#else // workaround for VC++ 7.1 bug id VSWhidbey 38416
+ explicit basic_ifstream( const path & file_ph )
+ : std::basic_ifstream<charT,traits>(
+ file_ph.native_file_string().c_str(), std::ios_base::in ) {}
+ basic_ifstream( const path & file_ph,
+ std::ios_base::openmode mode )
+ : std::basic_ifstream<charT,traits>(
+ file_ph.native_file_string().c_str(), mode ) {}
+ void open( const path & file_ph )
+ {
+ std::basic_ifstream<charT,traits>::open(
+ file_ph.native_file_string().c_str(), std::ios_base::in );
+ }
+ void open( const path & file_ph,
+ std::ios_base::openmode mode )
+ {
+ std::basic_ifstream<charT,traits>::open(
+ file_ph.native_file_string().c_str(), mode );
+ }
#endif
+ virtual ~basic_ifstream() {}
};
typedef basic_ifstream<char> ifstream;
{
public:
basic_ofstream() {}
+#if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
explicit basic_ofstream( const path & file_ph,
std::ios_base::openmode mode = std::ios_base::out )
: std::basic_ofstream<charT,traits>(
file_ph.native_file_string().c_str(), mode ) {}
- virtual ~basic_ofstream() {}
-#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
void open( const path & file_ph,
std::ios_base::openmode mode = std::ios_base::out )
{
std::basic_ofstream<charT,traits>::open(
file_ph.native_file_string().c_str(), mode );
}
+# endif
+#else // workaround for VC++ 7.1 bug id VSWhidbey 38416
+ explicit basic_ofstream( const path & file_ph )
+ : std::basic_ofstream<charT,traits>(
+ file_ph.native_file_string().c_str(), std::ios_base::out ) {}
+ basic_ofstream( const path & file_ph,
+ std::ios_base::openmode mode )
+ : std::basic_ofstream<charT,traits>(
+ file_ph.native_file_string().c_str(), mode ) {}
+ void open( const path & file_ph )
+ {
+ std::basic_ofstream<charT,traits>::open(
+ file_ph.native_file_string().c_str(), std::ios_base::out );
+ }
+ void open( const path & file_ph,
+ std::ios_base::openmode mode )
+ {
+ std::basic_ofstream<charT,traits>::open(
+ file_ph.native_file_string().c_str(), mode );
+ }
#endif
+ virtual ~basic_ofstream() {}
};
typedef basic_ofstream<char> ofstream;
{
public:
basic_fstream() {}
+#if !BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
explicit basic_fstream( const path & file_ph,
std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out )
: std::basic_fstream<charT,traits>(
file_ph.native_file_string().c_str(), mode ) {}
- virtual ~basic_fstream() {}
-#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this
+# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
void open( const path & file_ph,
std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out )
{
std::basic_fstream<charT,traits>::open(
file_ph.native_file_string().c_str(), mode );
}
+# endif
+#else // workaround for VC++ 7.1 bug id VSWhidbey 38416
+ explicit basic_fstream( const path & file_ph )
+ : std::basic_fstream<charT,traits>(
+ file_ph.native_file_string().c_str(),
+ std::ios_base::in|std::ios_base::out ) {}
+ basic_fstream( const path & file_ph,
+ std::ios_base::openmode mode )
+ : std::basic_fstream<charT,traits>(
+ file_ph.native_file_string().c_str(), mode ) {}
+ void open( const path & file_ph )
+ {
+ std::basic_fstream<charT,traits>::open(
+ file_ph.native_file_string().c_str(),
+ std::ios_base::in|std::ios_base::out );
+ }
+ void open( const path & file_ph,
+ std::ios_base::openmode mode )
+ {
+ std::basic_fstream<charT,traits>::open(
+ file_ph.native_file_string().c_str(), mode );
+ }
#endif
+ virtual ~basic_fstream() {}
};
typedef basic_fstream<char> fstream;
} // namespace boost
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_FILESYSTEM_FSTREAM_HPP
-
// boost/filesystem/directory.hpp ------------------------------------------//
-// < ----------------------------------------------------------------------- >
-// < Copyright © 2002 Beman Dawes. >
-// < Copyright © 2002 Jan Langer. >
-// < Copyright © 2001 Dietmar Kühl, All Rights Reserved >
-// < >
-// < Permission to use, copy, modify, distribute and sell this >
-// < software for any purpose is hereby granted without fee, provided >
-// < that the above copyright notice appears in all copies and that >
-// < both that copyright notice and this permission notice appear in >
-// < supporting documentation. The authors make no representations about >
-// < the suitability of this software for any purpose. It is provided >
-// < "as is" without express or implied warranty. >
-// < ----------------------------------------------------------------------- >
-
-// See http://www.boost.org/libs/filesystem for documentation.
+// Copyright © 2002, 2003 Beman Dawes
+// Copyright © 2002 Jan Langer
+// Copyright © 2001 Dietmar Kühl
+//
+// 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)
+
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_DIRECTORY_HPP
#define BOOST_FILESYSTEM_DIRECTORY_HPP
-#include <boost/config.hpp>
-#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/path.hpp> // includes <boost/filesystem/config.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/iterator.hpp>
#include <string>
+#include <ctime>
+
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+ namespace std { using ::time_t; }
+# endif
//----------------------------------------------------------------------------//
// query functions ---------------------------------------------------------//
- bool exists( const path & ph );
-
- bool is_directory( const path & ph );
+ BOOST_FILESYSTEM_DECL bool exists( const path & ph );
+ BOOST_FILESYSTEM_DECL bool symbolic_link_exists( const path & ph );
+ BOOST_FILESYSTEM_DECL bool is_directory( const path & ph );
// VC++ 7.0 and earlier has a serious namespace bug that causes a clash
// between boost::filesystem::is_empty and the unrelated type trait
// boost::is_empty. The workaround for those who must use broken versions
// of VC++ is to use the function _is_empty. All others should use the
// correct is_empty name.
- bool _is_empty( const path & ph ); // deprecated
+ BOOST_FILESYSTEM_DECL bool _is_empty( const path & ph ); // deprecated
# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300
inline bool is_empty( const path & ph ) { return _is_empty( ph ); }
# endif
+ BOOST_FILESYSTEM_DECL std::time_t last_write_time( const path & ph );
+ BOOST_FILESYSTEM_DECL void last_write_time( const path & ph, const std::time_t new_time );
+
// operations --------------------------------------------------------------//
- void create_directory( const path & directory_ph );
+ BOOST_FILESYSTEM_DECL void create_directory( const path & directory_ph );
- bool remove( const path & ph );
- unsigned long remove_all( const path & ph );
+ BOOST_FILESYSTEM_DECL bool remove( const path & ph );
+ BOOST_FILESYSTEM_DECL unsigned long remove_all( const path & ph );
- void rename( const path & from_path,
+ BOOST_FILESYSTEM_DECL void rename( const path & from_path,
const path & to_path );
- void copy_file( const path & from_file_ph,
+ BOOST_FILESYSTEM_DECL void copy_file( const path & from_file_ph,
const path & to_file_ph );
- path current_path();
- const path & initial_path();
+ BOOST_FILESYSTEM_DECL path current_path();
+ BOOST_FILESYSTEM_DECL const path & initial_path();
- path system_complete( const path & ph );
- path complete( const path & ph, const path & base = initial_path() );
+ BOOST_FILESYSTEM_DECL path system_complete( const path & ph );
+ BOOST_FILESYSTEM_DECL path complete( const path & ph, const path & base = initial_path() );
+
+// directory_iterator helpers ----------------------------------------------//
+// forwarding functions avoid need for BOOST_FILESYSTEM_DECL for class
+// directory_iterator, and so avoid iterator_facade DLL template problems
+ namespace detail
+ {
+ class dir_itr_imp;
+ // shared_ptr provides shallow-copy semantics required for InputIterators
+ typedef boost::shared_ptr< dir_itr_imp > dir_itr_imp_ptr;
+ BOOST_FILESYSTEM_DECL void dir_itr_init( dir_itr_imp_ptr & m_imp,
+ const path & dir_path );
+ BOOST_FILESYSTEM_DECL path & dir_itr_dereference(
+ const dir_itr_imp_ptr & m_imp );
+ BOOST_FILESYSTEM_DECL void dir_itr_increment( dir_itr_imp_ptr & m_imp );
+ } // namespace detail
// directory_iterator ------------------------------------------------------//
class directory_iterator
- : public boost::iterator< std::input_iterator_tag,
- path, std::ptrdiff_t, const path *, const path & >
+ : public boost::iterator_facade<
+ directory_iterator,
+ path,
+ boost::single_pass_traversal_tag >
{
- private:
- typedef directory_iterator self;
public:
- directory_iterator(); // creates the "end" iterator
- explicit directory_iterator( const path & p );
-
- reference operator*() const { return m_deref(); }
- pointer operator->() const { return &m_deref(); }
- self & operator++() { m_inc(); return *this; }
-
- friend bool operator==( const self & x, const self & y )
- { return x.m_imp == y.m_imp; }
- friend bool operator!=( const self & x, const self & y )
- { return !(x.m_imp == y.m_imp); }
-
- struct path_proxy // allows *i++ to work, as required by std
+ directory_iterator(){} // creates the "end" iterator
+ explicit directory_iterator( const path & p )
+ { detail::dir_itr_init( m_imp, p ); }
+
+/*
+The *r++ requirement doesn't appear to apply to the new single_pass_traversal category
+Thus I'm leaving the proxy out pending confirmation from the N1477 authors
+struct path_proxy // allows *r++ to work, as required by 24.1.1
{
path pv;
explicit path_proxy( const path & p ) : pv(p) {}
++*this;
return pp;
}
+*/
private:
- class dir_itr_imp;
- // shared_ptr provides shallow-copy semantics required for InputIterators
- typedef boost::shared_ptr< dir_itr_imp > m_imp_ptr;
- m_imp_ptr m_imp;
- reference m_deref() const;
- void m_inc();
+ detail::dir_itr_imp_ptr m_imp;
+ friend class boost::iterator_core_access;
+ reference dereference() const
+ { return detail::dir_itr_dereference( m_imp ); }
+ void increment()
+ { detail::dir_itr_increment( m_imp ); }
+ bool equal( const directory_iterator & rhs ) const
+ { return m_imp == rhs.m_imp; }
};
-
} // namespace filesystem
} // namespace boost
+
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_FILESYSTEM_DIRECTORY_HPP
// boost/filesystem/path.hpp -----------------------------------------------//
-// (C) Copyright Beman Dawes 2002. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// © Copyright Beman Dawes 2002-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)
-
-// See http://www.boost.org/libs/filesystem for documentation.
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
#ifndef BOOST_FILESYSTEM_PATH_HPP
#define BOOST_FILESYSTEM_PATH_HPP
-#include <boost/iterator_adaptors.hpp>
+#include <boost/filesystem/config.hpp>
+#include <boost/iterator/iterator_facade.hpp>
#include <string>
#include <cassert>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
//----------------------------------------------------------------------------//
namespace boost
{
namespace filesystem
{
- class path;
+ class directory_iterator;
- namespace detail
- {
- struct path_itr_imp
- {
- std::string name; // cache current element.
- const path * path_ptr; // path being iterated over.
- std::string::size_type pos; // position of name in
- // path_ptr->string(). The
- // end() iterator is indicated by
- // pos == path_ptr->string().size()
-
- const std::string & operator*() const { return name; }
- void operator++();
- void operator--();
- bool operator==( const path_itr_imp & rhs ) const
- { return path_ptr == rhs.path_ptr && pos == rhs.pos; }
- };
- } // detail
-
- enum path_format { native }; // ugly enough to discourage use
- // except when actually needed
// path -------------------------------------------------------------------//
- class path
+ class BOOST_FILESYSTEM_DECL path
{
public:
+ typedef bool (*name_check)( const std::string & name );
+
// compiler generates copy constructor, copy assignment, and destructor
path(){}
path( const std::string & src );
path( const char * src );
- path( const std::string & src, path_format );
- path( const char * src, path_format );
+ path( const std::string & src, name_check checker );
+ path( const char * src, name_check checker );
// append operations:
path & operator /=( const path & rhs );
path operator /( const path & rhs ) const
{ return path( *this ) /= rhs; }
+ // modification functions:
+ path & normalize();
+
// conversion functions:
const std::string & string() const { return m_path; }
std::string native_file_string() const;
bool has_branch_path() const;
// iteration over the names in the path:
- typedef boost::iterator_adaptor<
- detail::path_itr_imp,
- boost::default_iterator_policies,
- std::string,
- const std::string &,
- const std::string *,
- std::bidirectional_iterator_tag,
- std::ptrdiff_t
- > iterator;
+ class iterator : public boost::iterator_facade<
+ iterator,
+ std::string const,
+ boost::single_pass_traversal_tag >
+ {
+ private:
+ friend class boost::iterator_core_access;
+ friend class boost::filesystem::path;
+
+ reference dereference() const { return m_name; }
+ bool equal( const iterator & rhs ) const
+ { return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos; }
+ void increment();
+ void decrement();
+
+ std::string m_name; // cache current element.
+ const path * m_path_ptr; // path being iterated over.
+ std::string::size_type m_pos; // position of name in
+ // path_ptr->string(). The
+ // end() iterator is indicated by
+ // pos == path_ptr->string().size()
+ };
iterator begin() const;
iterator end() const
{
iterator itr;
- itr.base().path_ptr = this;
- itr.base().pos = m_path.size();
+ itr.m_path_ptr = this;
+ itr.m_pos = m_path.size();
return itr;
}
+ // default name_check mechanism:
+ static bool default_name_check_writable();
+ static void default_name_check( name_check new_check );
+ static name_check default_name_check();
+
private:
// Note: This is an implementation for POSIX and Windows, where there
// are only minor differences between generic and system-specific
std::string m_path;
friend class directory_iterator;
- friend struct boost::filesystem::detail::path_itr_imp;
-
- enum source_context { generic, platform, nocheck };
-
- void m_path_append( const std::string & src,
- source_context context = generic );
+ // Was qualified; como433beta8 reports:
+ // warning #427-D: qualified name is not allowed in member declaration
+ friend class iterator;
public: // should be private, but friend functions don't work for me
+ void m_path_append( const std::string & src, name_check checker );
void m_replace_leaf( const char * new_leaf );
};
inline path operator / ( const std::string & lhs, const path & rhs )
{ return path( lhs ) /= rhs; }
- // error checking --------------------------------------------------------//
-
-// TODO: write a program that probes valid file and directory names. Ask
-// Boost people to report results from many operating systems. Use results
-// to adjust generic_name().
-
- // generic_name() is extremely permissive; its intent is not to ensure
- // general portablity, but rather to detect names so trouble-prone that
- // they likely represent coding errors or gross misconceptions.
- //
- // Any characters are allowed except:
- //
- // Those characters < ' ', including '\0'. These are the so-called
- // control characters, in both ASCII (and its decendents) and EBCDIC.
- // Hard to imagine how these could be useful in a generic path name.
- //
- // < > : " / \ | * ? These have special meaning to enough operating
- // systems that use in a generic name would be a serious problem.
- //
- // The names "." and ".." are not allowed.
- // An empty name (null string) is not allowed.
- // Names beginning or ending with spaces are not allowed.
- //
- bool generic_name( const std::string & name );
-
- // posix_name() is based on POSIX (IEEE Std 1003.1-2001)
- // "Portable Filename Character Set" rules.
- // http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap03.html
- //
- // That character set only allows 0-9, a-z, A-Z, '.', '_', and '-'.
- // Note that such names are also portable to other popular operating
- // systems, such as Windows.
- //
- bool posix_name( const std::string & name );
-
- const path & check_posix_leaf( const path & ph );
- // Throws: if !posix_name( ph.leaf() )
- // Returns: ph
- // Note: Although useful in its own right, check_posix_leaf() also serves
- // as an example. A user might provide similar functions; behavior might
- // be to assert or warn rather than throw. A user provided function
- // could also check the entire path instead of just the leaf; a leaf
- // check is often, but not always, the required behavior.
- // Rationale: For the "const path &" rather than "void" return is to
- // allow (and encourage portability checking) uses like:
- // create_directory( check_posix_leaf( "foo" ) );
- // While there is some chance of misuse (by passing through a reference
- // to a temporary), the benefits outweigh the costs.
-
- // For Boost, we often tighten name restrictions for maximum portability:
- //
- // * The portable POSIX character restrictions, plus
- // * Maximum name length 31 characters (for Classic Mac OS).
- // * Lowercase only (so code written on case-insensitive platforms like
- // Windows works properly when used on case-sensitive systems like
- // POSIX.
- // * Directory names do not contain '.', as this is not a valid character
- // for directory names on some systems.
- //
- // TODO: provide some check_boost_xxx functions once error handling
- // approach ratified.
-
- bool boost_file_name( const std::string & name );
- bool boost_directory_name( const std::string & name );
+ // path::name_checks ---------------------------------------------------//
+
+ BOOST_FILESYSTEM_DECL bool portable_posix_name( const std::string & name );
+ BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name );
+ BOOST_FILESYSTEM_DECL bool portable_name( const std::string & name );
+ BOOST_FILESYSTEM_DECL bool portable_directory_name( const std::string & name );
+ BOOST_FILESYSTEM_DECL bool portable_file_name( const std::string & name );
+ BOOST_FILESYSTEM_DECL bool no_check( const std::string & name ); // always returns true
+ BOOST_FILESYSTEM_DECL bool native( const std::string & name );
+ // native(name) must return true for any name which MIGHT be valid
+ // on the native platform.
} // namespace filesystem
} // namespace boost
+#include <boost/config/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
#endif // BOOST_FILESYSTEM_PATH_HPP
// See http://www.boost.org for updates, documentation, and revision history.
// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
// Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream
// ----------------------------------------------------------------------------
// format.hpp : primary header
#include <vector>
#include <string>
-#include <sstream>
-#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
+#include <boost/format/detail/config_macros.hpp>
#ifndef BOOST_NO_STD_LOCALE
#include <locale>
#endif
-
-// make sure our local macros wont override something :
-#if defined(BOOST_NO_LOCALE_ISDIGIT) || defined(BOOST_OVERLOAD_FOR_NON_CONST) \
- || defined(BOOST_IO_STD) || defined( BOOST_IO_NEEDS_USING_DECLARATION )
-#error "a local macro would overwrite a previously defined macro"
-#endif
-
-
-#include <boost/format/macros_stlport.hpp> // stlport workarounds
-#include <boost/format/macros_default.hpp>
-
-#if defined(BOOST_NO_STD_LOCALE) || \
- ( BOOST_WORKAROUND(__BORLANDC__, <= 0x564) \
- || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) )
-// some future __BORLANDC__ >0x564 versions might not need this
-// 0x570 is Borland's kylix branch
-#define BOOST_NO_LOCALE_ISIDIGIT
-#endif
-
#ifdef BOOST_NO_LOCALE_ISIDIGIT
#include <cctype> // we'll use the non-locale <cctype>'s std::isdigit(int)
#endif
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) ) || BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1300))
-#define BOOST_NO_OVERLOAD_FOR_NON_CONST
-#endif
-
-
// **** Forward declarations ----------------------------------
-#include <boost/format/format_fwd.hpp> // basic_format<Ch,Tr>, and other frontends
-#include <boost/format/internals_fwd.hpp> // misc forward declarations for internal use
-
+#include <boost/format/format_fwd.hpp> // basic_format<Ch,Tr>, and other frontends
+#include <boost/format/internals_fwd.hpp> // misc forward declarations for internal use
// **** Auxiliary structs (stream_format_state<Ch,Tr> , and format_item<Ch,Tr> )
#include <boost/format/internals.hpp>
// **** Implementation -------------------------------------------
#include <boost/format/format_implementation.hpp> // member functions
-
#include <boost/format/group.hpp> // class for grouping arguments
-
#include <boost/format/feed_args.hpp> // argument-feeding functions
#include <boost/format/parsing.hpp> // format-string parsing (member-)functions
// *** Undefine 'local' macros :
-#ifdef BOOST_NO_OVERLOAD_FOR_NON_CONST
-#undef BOOST_NO_OVERLOAD_FOR_NON_CONST
-#endif
-#ifdef BOOST_NO_LOCALE_ISIDIGIT
-#undef BOOST_NO_LOCALE_ISIDIGIT
-#endif
-#ifdef BOOST_IO_STD
-#undef BOOST_IO_STD
-#endif
-#ifdef BOOST_IO_NEEDS_USING_DECLARATION
-#undef BOOST_IO_NEEDS_USING_DECLARATION
-#endif
+#include <boost/format/detail/unset_macros.hpp>
#endif // BOOST_FORMAT_HPP
--- /dev/null
+// -*- C++ -*-
+// Boost general library 'format' ---------------------------
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Samuel Krempp 2001
+// Permission to copy, use, modify, sell and
+// distribute this software is granted provided this copyright notice appears
+// in all copies. This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+
+// ------------------------------------------------------------------------------
+// config_macros.hpp : configuration macros for the format library
+// only BOOST_IO_STD is absolutely needed. other are just used to trigger workaround
+// codes here and there.
+// ------------------------------------------------------------------------------
+
+#ifndef BOOST_FORMAT_CONFIG_MACROS_HPP
+#define BOOST_FORMAT_CONFIG_MACROS_HPP
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+// make sure our local macros wont override something :
+#if defined(BOOST_NO_LOCALE_ISDIGIT) || defined(BOOST_OVERLOAD_FOR_NON_CONST) \
+ || defined(BOOST_IO_STD) || defined( BOOST_IO_NEEDS_USING_DECLARATION )
+#error "boost::format defines a local macro that would overwrite a previously defined macro."
+#endif
+
+// specific workarounds. each header can define BOOS_IO_STD if it
+// needs. (e.g. because of IO_NEEDS_USING_DECLARATION)
+#include <boost/format/detail/workarounds_gcc-2.95.hpp>
+#include <boost/format/detail/workarounds_stlport.hpp> // stlport workarounds
+
+#ifndef BOOST_IO_STD
+# define BOOST_IO_STD std::
+#endif
+
+#if defined(BOOST_NO_STD_LOCALE) || \
+ ( BOOST_WORKAROUND(__BORLANDC__, <= 0x564) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) )
+// some future __BORLANDC__ >0x564 versions might not need this
+// 0x570 is Borland's kylix branch
+#define BOOST_NO_LOCALE_ISIDIGIT
+#endif
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) ) || BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1300))
+#define BOOST_NO_OVERLOAD_FOR_NON_CONST
+#endif
+
+// gcc-2.95's stringstream is not usable, unless it's the one from STLPORT :
+#if BOOST_WORKAROUND(__GNUC__, < 3) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+#define BOOST_FORMAT_IGNORE_STRINGSTREAM
+#endif
+
+
+// **** Workaround for io streams, stlport and msvc.
+#ifdef BOOST_IO_NEEDS_USING_DECLARATION
+namespace boost {
+ using std::char_traits;
+ using std::basic_ostream;
+ using std::basic_ostringstream;
+ namespace io {
+ using std::basic_ostream;
+ namespace detail {
+ using std::basic_ios;
+ using std::basic_ostream;
+ using std::basic_ostringstream;
+ }
+ }
+}
+#endif
+
+// ------------------------------------------------------------------------------
+
+#endif // BOOST_FORMAT_MACROS_DEFAULT_HPP
--- /dev/null
+// -*- C++ -*-
+// Boost general library 'format' ---------------------------
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Samuel Krempp 2001
+// krempp@crans.ens-cachan.fr
+// Permission to copy, use, modify, sell and
+// distribute this software is granted provided this copyright notice appears
+// in all copies. This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+
+// ideas taken from Rüdiger Loos's format class
+// and Karl Nelson's ofstream
+
+// ----------------------------------------------------------------------------
+// msvc_disambiguater.hpp : msvc workarounds. (for put_{head|last} overloads)
+// the trick was described in boost's list by Aleksey Gurtovoy
+// ----------------------------------------------------------------------------
+
+
+#ifndef BOOST_MSVC_DISAMBIGUATER_HPP
+#define BOOST_MSVC_DISAMBIGUATER_HPP
+
+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) // this whole header is specifically for msvc
+
+#include <boost/format/group.hpp>
+#include <ostream>
+
+namespace boost {
+namespace io {
+namespace detail {
+
+template< class Ch, class Tr, class T >
+struct disambiguater
+{
+ template< typename U >
+ static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
+ {
+ os << group_head(x.a1_);
+ }
+ static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
+ {
+ }
+ template< typename U >
+ static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
+ {
+ os << group_last(x.a1_);
+ }
+ static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
+ {
+ os << x;
+ }
+};
+
+} // namespace detail
+} // namespace io
+} // namespace boost
+
+#endif // -BOOST_MSVC
+
+#endif // -BOOST_MSVC_DISAMBIGUATER_HPP
--- /dev/null
+// *** Undefine 'local' macros :
+#ifdef BOOST_NO_OVERLOAD_FOR_NON_CONST
+#undef BOOST_NO_OVERLOAD_FOR_NON_CONST
+#endif
+#ifdef BOOST_NO_LOCALE_ISIDIGIT
+#undef BOOST_NO_LOCALE_ISIDIGIT
+#endif
+#ifdef BOOST_IO_STD
+#undef BOOST_IO_STD
+#endif
+#ifdef BOOST_IO_NEEDS_USING_DECLARATION
+#undef BOOST_IO_NEEDS_USING_DECLARATION
+#endif
--- /dev/null
+// -*- C++ -*-
+// Boost general library 'format' ---------------------------
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Samuel Krempp 2003
+// Permission to copy, use, modify, sell and
+// distribute this software is granted provided this copyright notice appears
+// in all copies. This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+
+
+// workarounds for gcc < 3.0 :
+// . defines a few macros
+// . supplies template classes basic_foo<char, Tr> where gcc only supplies foo :
+// - basic_ios<char, Tr> from ios
+// - basic_ostream<char, Tr> from ostream
+// - basic_srteambuf<char, Tr> from streambuf
+// of course, the traits type 'Tr' is not used at all,
+// and you instantiating those template with a char type different than char fails.
+
+#if BOOST_WORKAROUND(__GNUC__, < 3) & defined(__STL_CONFIG_H) // nothing to do else
+
+#ifndef BOOST_FORMAT_WORKAROUNDS_GCC295_H
+#define BOOST_FORMAT_WORKAROUNDS_GCC295_H
+
+#include <iostream> // SGI STL doesnt have <ostream> and others, we need iostream.
+
+
+#ifndef BOOST_IO_STD
+# define BOOST_IO_STD std::
+#endif
+
+
+
+// ***
+// gcc's simple classes turned into standard-like template classes :
+
+namespace std {
+
+
+template <class Ch>
+class char_traits : public string_char_traits<Ch> {
+};
+// only problem : gcc's 'string' is a typedef for basic_string<char, string_char_traits<char> >,
+// so strings built using char_traits wont match the type 'string'.
+// so it's better to use string_char_traits directly.
+
+template <class Ch, class Tr>
+class basic_ios;
+
+template <class Tr>
+class basic_ios<char, Tr> : virtual public ostream {
+public:
+ char fill() const { return ios::fill(); } // gcc returns wchar..
+ char fill(char c) { return ios::fill(c); } // gcc takes wchar..
+};
+
+typedef ios ios_base;
+
+
+template <class Ch, class Tr>
+class basic_ostream;
+
+template <class Tr>
+class basic_ostream<char, Tr> : public basic_ios<char, Tr> {
+public:
+ basic_ostream(streambuf* sb) : ostream(sb) {}
+ basic_ostream() : ostream() {}
+ char widen(char c) { return c; }
+ char narrow(char c, char def) { return c; }
+};
+
+
+template <class Ch, class Tr>
+class basic_streambuf;
+
+template <class Tr>
+class basic_streambuf<char, Tr> : public streambuf {
+};
+
+
+} // namespace std
+
+
+#endif // include guard
+
+#endif // if workaround
--- /dev/null
+// -*- C++ -*-
+// Boost general library 'format' ---------------------------
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Samuel Krempp 2001
+// Permission to copy, use, modify, sell and
+// distribute this software is granted provided this copyright notice appears
+// in all copies. This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+
+// ideas taken from Rüdiger Loos's format class
+// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+
+// ------------------------------------------------------------------------------
+// workarounds_stlport.hpp : configuration for the format library
+// The contents of this file should be integrated into the boost config system.
+// ------------------------------------------------------------------------------
+
+#ifndef BOOST_MACROS_STLPORT_HPP
+#define BOOST_MACROS_STLPORT_HPP
+
+// *** This should go to "boost/config/stdlib/stlport.hpp".
+
+// If the streams are not native and there are problems with using templates
+// accross namespaces, we define some macros to enable a workaround for this.
+
+// STLport 4.5
+#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE)
+# define BOOST_IO_STD
+# define BOOST_IO_NEEDS_USING_DECLARATION
+#endif
+
+// STLport 4.0
+#if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_OWN_NAMESPACE) && defined(BOOST_NO_USING_TEMPLATE)
+# define BOOST_IO_STD
+# define BOOST_IO_NEEDS_USING_DECLARATION
+#endif
+
+
+// ------------------------------------------------------------------------------
+
+#endif // BOOST_MACROS_STLPORT_HPP
#ifndef BOOST_FORMAT_FEED_ARGS_HPP
#define BOOST_FORMAT_FEED_ARGS_HPP
-#include "boost/format/format_class.hpp"
-#include "boost/format/group.hpp"
+#include <boost/format/format_class.hpp>
+#include <boost/format/group.hpp>
-#include "boost/format/msvc_disambiguater.hpp"
-#include "boost/throw_exception.hpp"
+#include <boost/format/detail/msvc_disambiguater.hpp>
+#include <boost/throw_exception.hpp>
namespace boost {
namespace io {
namespace detail {
namespace {
- template<class Tr, class Ch> inline
- void empty_buf(BOOST_IO_STD basic_ostringstream<Ch,Tr> & os) {
- static const std::basic_string<Ch, Tr> emptyStr;
- os.str(emptyStr);
- }
-
- template<class Ch, class Tr>
- void do_pad( std::basic_string<Ch,Tr> & s,
- std::streamsize w,
- const Ch c,
- std::ios_base::fmtflags f,
- bool center)
- // applies centered / left / right padding to the string s.
- // Effects : string s is padded.
- {
- std::streamsize n=w-s.size();
- if(n<=0) {
- return;
+ template<class Ch, class Tr>
+ void clear_buffer(io::basic_outsstream<Ch,Tr> & os) {
+ os.clear_buffer();
}
- if(center)
- {
- s.reserve(w); // allocate once for the 2 inserts
- const std::streamsize n1 = n /2, n0 = n - n1;
- s.insert(s.begin(), n0, c);
- s.append(n1, c);
- }
- else
- {
- if(f & std::ios_base::left) {
- s.append(n, c);
+
+ template<class Ch, class Tr>
+ void mk_str( std::basic_string<Ch,Tr> & res,
+ const Ch * beg,
+ std::streamsize size,
+ std::streamsize w,
+ const Ch fill_char,
+ std::ios_base::fmtflags f,
+ const Ch prefix_space, // 0 if no space-padding
+ bool center)
+ // applies centered / left / right padding to the string [beg, beg+size[
+ // Effects : the result is placed in res.
+ {
+ res.resize(0);
+ std::streamsize n=w-size-!!prefix_space;
+ std::streamsize n_after = 0, n_before = 0;
+
+ if(n<=0) { // no need to pad.
+ res.reserve(size + !!prefix_space);
}
- else {
- s.insert(s.begin(), n, c);
+ else {
+ res.reserve(w); // allocate once for the 2 inserts
+ if(center)
+ n_after = n/2, n_before = n - n_after;
+ else
+ if(f & std::ios_base::left)
+ n_after = n;
+ else
+ n_before = n;
}
- }
- } // -do_pad(..)
+ // now make the res string :
+ if(n_before) res.append(n_before, fill_char);
+ if(prefix_space)
+ res.append(1, prefix_space);
+ res.append(beg, size);
+ if(n_after) res.append(n_after, fill_char);
+ } // -mk_str(..)
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300)
// MSVC needs to be tricked to disambiguate this simple overload..
// the trick is in "boost/format/msvc_disambiguater.hpp"
- template< class Ch, class Tr, class T> inline
- void put_head( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const T& x ) {
- disambiguater<Ch, Tr, T>::put_head(os, x, 1L);
- }
- template< class Ch, class Tr, class T> inline
- void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const T& x ) {
- disambiguater<Ch, Tr, T>::put_last(os, x, 1L);
- }
+ template< class Ch, class Tr, class T> inline
+ void put_head( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const T& x ) {
+ disambiguater<Ch, Tr, T>::put_head(os, x, 1L);
+ }
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const T& x ) {
+ disambiguater<Ch, Tr, T>::put_last(os, x, 1L);
+ }
#else
- template< class Ch, class Tr, class T> inline
- void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& , const T& ) {
- }
+ template< class Ch, class Tr, class T> inline
+ void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& , const T& ) {
+ }
- template< class Ch, class Tr, class T> inline
- void put_head( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const group1<T>& x ) {
- os << group_head(x.a1_); // send the first N-1 items, not the last
- }
+ template< class Ch, class Tr, class T> inline
+ void put_head( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const group1<T>& x ) {
+ os << group_head(x.a1_); // send the first N-1 items, not the last
+ }
- template< class Ch, class Tr, class T> inline
- void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const T& x ) {
- os << x ;
- }
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const T& x ) {
+ os << x ;
+ }
- template< class Ch, class Tr, class T> inline
- void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const group1<T>& x ) {
- os << group_last(x.a1_); // this selects the last element
- }
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, const group1<T>& x ) {
+ os << group_last(x.a1_); // this selects the last element
+ }
#ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
- template< class Ch, class Tr, class T> inline
- void put_head( BOOST_IO_STD basic_ostream<Ch, Tr>& , T& ) {
- }
-
- template< class Ch, class Tr, class T> inline
- void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, T& x ) {
- os << x ;
- }
+ template< class Ch, class Tr, class T> inline
+ void put_head( BOOST_IO_STD basic_ostream<Ch, Tr>& , T& ) {
+ }
+
+ template< class Ch, class Tr, class T> inline
+ void put_last( BOOST_IO_STD basic_ostream<Ch, Tr>& os, T& x ) {
+ os << x ;
+ }
#endif
#endif // -msvc workaround
+ template< class Ch, class Tr, class T>
+ void put( T x,
+ const format_item<Ch, Tr>& specs,
+ std::basic_string<Ch, Tr> & res,
+ io::basic_outsstream<Ch, Tr>& oss_ )
+ {
+ // does the actual conversion of x, with given params, into a string
+ // using the *supplied* strinstream. (the stream state is important)
-
-template< class Ch, class Tr, class T>
-void put( T x,
- const format_item<Ch, Tr>& specs,
- std::basic_string<Ch, Tr> & res,
- BOOST_IO_STD basic_ostringstream<Ch, Tr>& oss_ )
-{
- // does the actual conversion of x, with given params, into a string
- // using the *supplied* strinstream. (the stream state is important)
-
- typedef std::basic_string<Ch, Tr> string_t;
- typedef format_item<Ch, Tr> format_item_t;
-
- stream_format_state<Ch, Tr> prev_state(oss_);
+ typedef std::basic_string<Ch, Tr> string_t;
+ typedef format_item<Ch, Tr> format_item_t;
- specs.state_.apply_on(oss_);
-
- // in case x is a group, apply the manip part of it,
- // in order to find width
- put_head( oss_, x );
- empty_buf( oss_);
-
- const std::streamsize w=oss_.width();
- const std::ios_base::fmtflags fl=oss_.flags();
- const bool internal = (fl & std::ios_base::internal) != 0;
- const bool two_stepped_padding = internal
- && ! ( specs.pad_scheme_ & format_item_t::spacepad )
- && specs.truncate_ < 0 ;
+ specs.fmtstate_.apply_on(oss_);
+
+ // the stream format state can be modified by manipulators in the argument :
+ put_head( oss_, x );
+ // in case x is a group, apply the manip part of it,
+ // in order to find width
+ // clear_buffer( oss_); // fixme. is it necessary ?
+
+ const std::ios_base::fmtflags fl=oss_.flags();
+ const bool internal = (fl & std::ios_base::internal) != 0;
+ const std::streamsize w = oss_.width();
+ const bool two_stepped_padding= internal && (w!=0);
-
- if(! two_stepped_padding)
- {
- if(w>0) // handle simple padding via do_pad, not natively in stream
- oss_.width(0);
- put_last( oss_, x);
- res = oss_.str();
-
- if (specs.truncate_ >= 0 && static_cast<unsigned int>(specs.truncate_) < res.size() )
- res.erase(specs.truncate_);
-
- // complex pads :
- if(specs.pad_scheme_ & format_item_t::spacepad)
- {
- if( res.size()==0 || ( res[0]!='+' && res[0]!='-' ))
- {
- res.insert(res.begin(), 1, ' '); // insert 1 space at pos 0
+ res.resize(0);
+ if(! two_stepped_padding) {
+ if(w>0) // handle padding via mk_str, not natively in stream
+ oss_.width(0);
+ put_last( oss_, x);
+ const Ch * res_beg = oss_.begin();
+ Ch prefix_space = 0;
+ if(specs.pad_scheme_ & format_item_t::spacepad)
+ if(oss_.pcount()== 0 ||
+ (res_beg[0] !=oss_.widen('+') && res_beg[0] !=oss_.widen('-') ))
+ prefix_space = oss_.widen(' ');
+ std::streamsize res_size = std::min(
+ static_cast<std::streamsize>(specs.truncate_ - !!prefix_space),
+ oss_.pcount());
+
+ mk_str(res, res_beg, res_size, w, oss_.fill(), fl,
+ prefix_space, (specs.pad_scheme_ & format_item_t::centered) !=0 );
+ }
+ else { // 2-stepped padding
+ // internal can be implied by zeropad, or user-set.
+ // left, right, and centered alignment overrule internal,
+ // but spacepad or truncate might be mixed with internal (using manipulator)
+ put_last( oss_, x); // may pad
+ const Ch * res_beg = oss_.begin();
+ std::streamsize res_size = oss_.pcount();
+ bool prefix_space=false;
+ if(specs.pad_scheme_ & format_item_t::spacepad)
+ if(oss_.pcount()== 0 ||
+ (res_beg[0] !=oss_.widen('+') && res_beg[0] !=oss_.widen('-') ))
+ prefix_space = true;
+ if(res_size == w && w<=specs.truncate_ && !prefix_space) {
+ // okay, only one thing was printed and padded, so res is fine
+ res.assign(res_beg, res_size);
}
- }
- if(w > 0) // need do_pad
- {
- do_pad(res,w,oss_.fill(), fl, (specs.pad_scheme_ & format_item_t::centered) !=0 );
- }
- }
- else // 2-stepped padding
- {
- put_last( oss_, x); // oss_.width() may result in padding.
- res = oss_.str();
-
- if (specs.truncate_ >= 0)
- res.erase(specs.truncate_);
-
- if( res.size() - w > 0)
- { // length w exceeded
- // either it was multi-output with first output padding up all width..
- // either it was one big arg and we are fine.
- empty_buf( oss_);
- oss_.width(0);
- put_last(oss_, x );
- string_t tmp = oss_.str(); // minimal-length output
- std::streamsize d;
- if( (d=w - tmp.size()) <=0 )
- {
- // minimal length is already >= w, so no padding (cool!)
- res.swap(tmp);
- }
- else
- { // hum.. we need to pad (it was necessarily multi-output)
- typedef typename string_t::size_type size_type;
- size_type i = 0;
- while( i<tmp.size() && tmp[i] == res[i] ) // find where we should pad.
- ++i;
- tmp.insert(i, static_cast<size_type>( d ), oss_.fill());
- res.swap( tmp );
+ else { // length w exceeded
+ // either it was multi-output with first output padding up all width..
+ // either it was one big arg and we are fine.
+ //BOOST_ASSERT(res_size > w); //res_size<w means buggy user-defined formatting
+ res.assign(res_beg, res_size);
+ res_beg=NULL; // invalidate pointers.
+ clear_buffer( oss_);
+ oss_.width(0);
+ if(prefix_space)
+ oss_ << ' ';
+ put_last(oss_, x );
+ if(oss_.pcount()==0 && specs.pad_scheme_ & format_item_t::spacepad) {
+ prefix_space =true;
+ oss_ << ' ';
+ }
+ // minimal-length output
+ const Ch * tmp_beg = oss_.begin();
+ std::streamsize tmp_size = std::min(oss_.pcount(),
+ static_cast<std::streamsize>(specs.truncate_));
+ std::streamsize d;
+ if( (d=w - tmp_size) <=0 ) {
+ // minimal length is already >= w, so no padding (cool!)
+ res.assign(tmp_beg, tmp_size);
+ }
+ else { // hum.. we need to pad (multi_output, or spacepad present)
+ typedef typename string_t::size_type size_type;
+ std::streamsize i = prefix_space;
+ //find where we should pad
+ //BOOST_ASSERT( static_cast<size_t>(tmp_size-prefix_space <= res.size() ));
+ std::streamsize sz = std::min(res_size+prefix_space, tmp_size);
+ for(; i<sz && tmp_beg[i] == res[i-prefix_space]; ++i){}
+ if(i>=tmp_size) i=prefix_space;
+ res.assign(tmp_beg, i);
+ if(d>0) res.append(static_cast<size_type>( d ), oss_.fill());
+ res.append(tmp_beg+i, tmp_size-i);
+ assert(i+(tmp_size-i)+std::max(d,(std::streamsize)0) == w);
+ assert(res.size() == (std::size_t)w);
+ }
}
}
- else
- { // okay, only one thing was printed and padded, so res is fine.
- }
- }
-
- prev_state.apply_on(oss_);
- empty_buf( oss_);
- oss_.clear();
-} // end- put(..)
+ clear_buffer( oss_);
+ } // end- put(..)
} // local namespace
-
-
-
-template< class Ch, class Tr, class T>
-void distribute(basic_format<Ch,Tr>& self, T x)
- // call put(x, ..) on every occurence of the current argument :
-{
- if(self.cur_arg_ >= self.num_args_)
- {
- if( self.exceptions() & too_many_args_bit )
- boost::throw_exception(too_many_args()); // too many variables have been supplied !
- else return;
- }
- for(unsigned long i=0; i < self.items_.size(); ++i)
- {
- if(self.items_[i].argN_ == self.cur_arg_)
- {
- put<Ch, Tr, T> (x, self.items_[i], self.items_[i].res_, self.oss_ );
+ template< class Ch, class Tr, class T>
+ void distribute(basic_format<Ch,Tr>& self, T x) {
+ // call put(x, ..) on every occurence of the current argument :
+ if(self.cur_arg_ >= self.num_args_) {
+ if( self.exceptions() & too_many_args_bit )
+ boost::throw_exception(too_many_args()); // too many variables supplied
+ else return;
+ }
+ for(unsigned long i=0; i < self.items_.size(); ++i) {
+ if(self.items_[i].argN_ == self.cur_arg_) {
+ put<Ch, Tr, T> (x, self.items_[i], self.items_[i].res_, self.oss_ );
+ }
}
}
-}
-
-template<class Ch, class Tr, class T>
-basic_format<Ch, Tr>& feed(basic_format<Ch,Tr>& self, T x)
-{
- if(self.dumped_) self.clear();
- distribute<Ch, Tr, T> (self, x);
- ++self.cur_arg_;
- if(self.bound_.size() != 0)
- {
- while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] )
+
+ template<class Ch, class Tr, class T>
+ basic_format<Ch, Tr>& feed(basic_format<Ch,Tr>& self, T x) {
+ if(self.dumped_) self.clear();
+ distribute<Ch, Tr, T> (self, x);
++self.cur_arg_;
+ if(self.bound_.size() != 0) {
+ while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] )
+ ++self.cur_arg_;
+ }
+ return self;
}
-
- // this arg is finished, reset the stream's format state
- self.state0_.apply_on(self.oss_);
- return self;
-}
-
} // namespace detail
} // namespace io
} // namespace boost
// format_class.hpp : class interface
// ------------------------------------------------------------------------------
-
#ifndef BOOST_FORMAT_CLASS_HPP
#define BOOST_FORMAT_CLASS_HPP
+
#include <vector>
#include <string>
#include <boost/format/format_fwd.hpp>
#include <boost/format/internals_fwd.hpp>
-
#include <boost/format/internals.hpp>
+#include <boost/format/outsstream.hpp>
namespace boost {
-template<class Ch, class Tr>
-class basic_format
-{
-public:
- typedef Ch CharT; // those 2 are necessary for borland compatibilty,
- typedef Tr Traits; // in the body of the operator% template.
-
+ template<class Ch, class Tr>
+ class basic_format
+ {
+ public:
+ typedef Ch CharT; // borland fails if we use Ch and Tr directly
+ typedef Tr Traits; // in the body of the operator% template.
+ typedef std::basic_string<Ch, Tr> string_t;
+ typedef typename std::basic_string<Ch, Tr>::size_type size_type;
- typedef std::basic_string<Ch, Tr> string_t;
- typedef BOOST_IO_STD basic_ostringstream<Ch, Tr> internal_stream_t;
-private:
- typedef BOOST_IO_STD basic_ostream<Ch, Tr> stream_t;
- typedef io::detail::stream_format_state<Ch, Tr> stream_format_state;
- typedef io::detail::format_item<Ch, Tr> format_item_t;
+ typedef io::basic_outsstream<Ch, Tr> internal_stream_t;
-public:
- basic_format(const Ch* str);
- basic_format(const string_t& s);
+ explicit basic_format(const Ch* str=NULL);
+ explicit basic_format(const string_t& s);
#ifndef BOOST_NO_STD_LOCALE
- basic_format(const Ch* str, const std::locale & loc);
- basic_format(const string_t& s, const std::locale & loc);
-#endif // no locale
- basic_format(const basic_format& x);
- basic_format& operator= (const basic_format& x);
+ explicit basic_format(const Ch* str, const std::locale & loc);
+ explicit basic_format(const string_t& s, const std::locale & loc);
+#endif
+ basic_format(const basic_format& x);
+ basic_format& operator= (const basic_format& x);
+ void swap(basic_format& x);
- basic_format& clear(); // empty the string buffers (except bound arguments, see clear_binds() )
+ basic_format& clear(); // empty all converted string buffers (except bound items)
+ basic_format& clear_binds(); // unbind all bound items, and call clear()
+ basic_format& parse(const string_t&); // resets buffers and parse a new format string
- // pass arguments through those operators :
- template<class T> basic_format& operator%(const T& x)
- {
- return io::detail::feed<CharT, Traits, const T&>(*this,x);
- }
+ // pass arguments through those operators :
+ template<class T>
+ basic_format& operator%(const T& x)
+ { return io::detail::feed<CharT, Traits, const T&>(*this,x); }
#ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
- template<class T> basic_format& operator%(T& x)
- {
- return io::detail::feed<CharT, Traits, T&>(*this,x);
- }
+ template<class T> basic_format& operator%(T& x)
+ { return io::detail::feed<CharT, Traits, T&>(*this,x); }
#endif
-
-
- // system for binding arguments :
- template<class T>
- basic_format& bind_arg(int argN, const T& val)
- {
- return io::detail::bind_arg_body(*this, argN, val);
- }
- basic_format& clear_bind(int argN);
- basic_format& clear_binds();
-
- // modify the params of a directive, by applying a manipulator :
- template<class T>
- basic_format& modify_item(int itemN, const T& manipulator)
- {
- return io::detail::modify_item_body(*this, itemN, manipulator) ;
- }
-
- // Choosing which errors will throw exceptions :
- unsigned char exceptions() const;
- unsigned char exceptions(unsigned char newexcept);
-
- // final output
- string_t str() const;
- friend BOOST_IO_STD basic_ostream<Ch, Tr>&
+ // modifying a format object
+ template<class T>
+ basic_format& bind_arg(int argN, const T& val)
+ { return io::detail::bind_arg_body(*this, argN, val); }
+ basic_format& clear_bind(int argN);
+ template<class T>
+ basic_format& modify_item(int itemN, T manipulator)
+ { return io::detail::modify_item_body<Ch,Tr,T> (*this, itemN, manipulator);}
+
+ // Choosing which errors will throw exceptions :
+ unsigned char exceptions() const;
+ unsigned char exceptions(unsigned char newexcept);
+
+ // final output
+ size_type size() const; // sum of the current string pieces sizes
+ string_t str() const;
+ friend BOOST_IO_STD basic_ostream<Ch, Tr>&
#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300)
- operator<< ( BOOST_IO_STD basic_ostream<Ch, Tr>& , const basic_format& );
+ operator<< (BOOST_IO_STD basic_ostream<Ch, Tr>& , const basic_format& );
#else
- operator<< <Ch, Tr> ( BOOST_IO_STD basic_ostream<Ch, Tr>& , const basic_format& );
+ operator<< <Ch, Tr> (BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format&);
#endif
-
-#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS ) && ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570) ) && !BOOST_WORKAROUND( _CRAYC, != 0)
-
- template<class Ch2, class Tr2, class T> friend basic_format<Ch2, Tr2>&
- io::detail::feed(basic_format<Ch2,Tr2>&, T);
-
- template<class Ch2, class Tr2, class T> friend
- void io::detail::distribute(basic_format<Ch2,Tr2>&, T);
-
- template<class Ch2, class Tr2, class T> friend
- basic_format<Ch2, Tr2>& io::detail::modify_item_body(basic_format<Ch2, Tr2>&, int, const T&);
-
- template<class Ch2, class Tr2, class T> friend
- basic_format<Ch2, Tr2>& io::detail::bind_arg_body(basic_format<Ch2, Tr2>&, int, const T&);
-
-// make the members private only if the friend templates are supported
-private:
+#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS ) \
+ && !BOOST_WORKAROUND(__BORLANDC__, <= 0x570) \
+ && !BOOST_WORKAROUND( _CRAYC, != 0)
+ // use friend templates and private members only if supported
+ template<class Ch2, class Tr2, class T> friend basic_format<Ch2, Tr2>&
+ io::detail::feed(basic_format<Ch2,Tr2>&, T);
+ template<class Ch2, class Tr2, class T> friend
+ void io::detail::distribute(basic_format<Ch2,Tr2>&, T);
+ template<class Ch2, class Tr2, class T> friend
+ basic_format<Ch2, Tr2>& io::detail::modify_item_body(basic_format<Ch2, Tr2>&, int, T);
+ template<class Ch2, class Tr2, class T> friend
+ basic_format<Ch2, Tr2>& io::detail::bind_arg_body(basic_format<Ch2, Tr2>&, int, const T&);
+
+ private:
#endif
-
- // flag bits, used for style_
- enum style_values { ordered = 1, // set only if all directives are positional directives
- special_needs = 4 };
-
- // parse the format string :
- void parse(const string_t&);
-
- int style_; // style of format-string : positional or not, etc
- int cur_arg_; // keep track of wich argument will come
- int num_args_; // number of expected arguments
- mutable bool dumped_; // true only after call to str() or <<
- std::vector<format_item_t> items_; // vector of directives (aka items)
- string_t prefix_; // piece of string to insert before first item
-
- std::vector<bool> bound_; // stores which arguments were bound
- // size = num_args OR zero
- internal_stream_t oss_; // the internal stream.
- stream_format_state state0_; // reference state for oss_
- unsigned char exceptions_;
-}; // class basic_format
-
+ typedef BOOST_IO_STD basic_ostream<Ch, Tr> stream_t;
+ typedef io::detail::stream_format_state<Ch, Tr> stream_format_state;
+ typedef io::detail::format_item<Ch, Tr> format_item_t;
+ // flag bits, used for style_
+ enum style_values { ordered = 1, // set only if all directives are positional
+ special_needs = 4 };
+
+ void make_or_reuse_data(std::size_t nbitems);// used for (re-)initialisation
+
+ std::vector<format_item_t> items_; // each '%..' directive leads to a format_item
+ std::vector<bool> bound_; // stores which arguments were bound. size() == 0 || num_args
+ int style_; // style of format-string : positional or not, etc
+ int cur_arg_; // keep track of wich argument is current
+ int num_args_; // number of expected arguments
+ mutable bool dumped_; // true only after call to str() or <<
+ string_t prefix_; // piece of string to insert before first item
+ internal_stream_t oss_; // the internal stream.
+ unsigned char exceptions_;
+ }; // class basic_format
} // namespace boost
// See http://www.boost.org for updates, documentation, and revision history.
// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
// Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
#include <string>
#include <iosfwd>
-#include <boost/config.hpp>
+#include <boost/format/detail/config_macros.hpp>
namespace boost {
-template<class charT, class Traits = BOOST_IO_STD char_traits<charT> > class basic_format;
+ template <class Ch,
+#if !( BOOST_WORKAROUND(__GNUC__, <3) && defined(__STL_CONFIG_H) )
+ class Tr = BOOST_IO_STD char_traits<Ch> >
+#else
+ class Tr = std::string_char_traits<Ch> >
+#endif
+ class basic_format;
+
+ typedef basic_format<char > format;
-typedef basic_format<char > format;
-#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF)
-typedef basic_format<wchar_t > wformat;
+#if !defined(BOOST_NO_STD_WSTRING) && !defined(BOOST_NO_STD_WSTREAMBUF) \
+ && !defined(BOOST_NO_STRINGSTREAM) && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM)
+ //we use either sstream or strstream, and strstream doesnt support wchar
+ typedef basic_format<wchar_t > wformat;
#endif
+ template<class Ch, class Tr>
+ std::basic_string<Ch, Tr> str(const basic_format<Ch, Tr>& ) ;
+
namespace io {
-enum format_error_bits { bad_format_string_bit = 1,
- too_few_args_bit = 2, too_many_args_bit = 4,
- out_of_range_bit = 8,
- all_error_bits = 255, no_error_bits=0 };
-
-// Convertion: format to string
-template<class Ch, class Tr>
-std::basic_string<Ch, Tr> str(const basic_format<Ch, Tr>& ) ;
+ using ::boost::str; // it used to bed define in boost::io, keep compatibility
+ enum format_error_bits { bad_format_string_bit = 1,
+ too_few_args_bit = 2, too_many_args_bit = 4,
+ out_of_range_bit = 8,
+ all_error_bits = 255, no_error_bits=0 };
+
} // namespace io
-template< class Ch, class Tr>
-BOOST_IO_STD basic_ostream<Ch, Tr>&
-operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format<Ch, Tr>&);
+ template< class Ch, class Tr>
+ BOOST_IO_STD basic_ostream<Ch, Tr>&
+ operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format<Ch, Tr>&);
} // namespace boost
#include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
#include <boost/format/format_class.hpp>
+#include <algorithm> // std::swap
namespace boost {
// -------- format:: -------------------------------------------
-template< class Ch, class Tr>
-basic_format<Ch, Tr> ::basic_format(const Ch* str)
- : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
- items_(), oss_(), exceptions_(io::all_error_bits)
-{
- state0_.set_by_stream(oss_);
- string_t emptyStr;
- if( !str) str = emptyStr.c_str();
- parse( str );
-}
+ template< class Ch, class Tr>
+ basic_format<Ch, Tr>:: basic_format(const Ch* str)
+ : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
+ exceptions_(io::all_error_bits)
+ {
+ if( str)
+ parse( str );
+ }
#ifndef BOOST_NO_STD_LOCALE
-template< class Ch, class Tr>
-basic_format<Ch, Tr> ::basic_format(const Ch* str, const std::locale & loc)
- : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
- items_(), oss_(), exceptions_(io::all_error_bits)
-{
- oss_.imbue( loc );
- state0_.set_by_stream(oss_);
- string_t emptyStr;
- if( !str) str = emptyStr.c_str();
- parse( str );
-}
-
-template< class Ch, class Tr>
-basic_format<Ch, Tr> ::basic_format(const string_t& s, const std::locale & loc)
- : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
- items_(), oss_(), exceptions_(io::all_error_bits)
-{
- oss_.imbue( loc );
- state0_.set_by_stream(oss_);
- parse(s);
-}
+ template< class Ch, class Tr>
+ basic_format<Ch, Tr>:: basic_format(const Ch* str, const std::locale & loc)
+ : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
+ exceptions_(io::all_error_bits)
+ {
+ oss_.imbue( loc );
+ if(str) parse( str );
+ }
+
+ template< class Ch, class Tr>
+ basic_format<Ch, Tr>:: basic_format(const string_t& s, const std::locale & loc)
+ : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
+ exceptions_(io::all_error_bits)
+ {
+ oss_.imbue( loc );
+ parse(s);
+ }
#endif //BOOST_NO_STD_LOCALE
-template< class Ch, class Tr>
-basic_format<Ch, Tr> ::basic_format(const string_t& s)
- : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
- items_(), oss_(), exceptions_(io::all_error_bits)
-{
- state0_.set_by_stream(oss_);
- parse(s);
-}
-
-template< class Ch, class Tr>
-basic_format<Ch, Tr> :: basic_format(const basic_format& x)
- : style_(x.style_), cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(false),
- items_(x.items_), prefix_(x.prefix_), bound_(x.bound_),
- oss_(), // <- we obviously can't copy x.oss_
- state0_(x.state0_), exceptions_(x.exceptions_)
-{
- state0_.apply_on(oss_);
-}
-
-template< class Ch, class Tr>
-basic_format<Ch, Tr>& basic_format<Ch, Tr> ::operator= (const basic_format& x)
-{
- if(this == &x)
- return *this;
- state0_ = x.state0_;
- state0_.apply_on(oss_);
-
- // plus all the other (trivial) assignments :
- exceptions_ = x.exceptions_;
- items_ = x.items_;
- prefix_ = x.prefix_;
- bound_=x.bound_;
- style_=x.style_;
- cur_arg_=x.cur_arg_;
- num_args_=x.num_args_;
- dumped_=x.dumped_;
- return *this;
-}
-
-
-template< class Ch, class Tr>
-unsigned char basic_format<Ch,Tr> ::exceptions() const
-{
- return exceptions_;
-}
-
-template< class Ch, class Tr>
-unsigned char basic_format<Ch,Tr> ::exceptions(unsigned char newexcept)
-{
- unsigned char swp = exceptions_;
- exceptions_ = newexcept;
- return swp;
-}
-
-
-template< class Ch, class Tr>
-basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear()
- // empty the string buffers (except bound arguments, see clear_binds() )
- // and make the format object ready for formatting a new set of arguments
-{
- BOOST_ASSERT( bound_.size()==0 || num_args_ == static_cast<int>(bound_.size()) );
-
- for(unsigned long i=0; i<items_.size(); ++i){
- items_[i].state_ = items_[i].ref_state_;
- // clear converted strings only if the corresponding argument is not bound :
- if( bound_.size()==0 || !bound_[ items_[i].argN_ ] ) items_[i].res_.resize(0);
+ template< class Ch, class Tr>
+ basic_format<Ch, Tr>:: basic_format(const string_t& s)
+ : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
+ exceptions_(io::all_error_bits)
+ {
+ parse(s);
}
- cur_arg_=0; dumped_=false;
- // maybe first arg is bound:
- if(bound_.size() != 0)
- {
- while(cur_arg_ < num_args_ && bound_[cur_arg_] ) ++cur_arg_;
- }
- return *this;
-}
-
-template< class Ch, class Tr>
-basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_binds()
- // cancel all bindings, and clear()
-{
- bound_.resize(0);
- clear();
- return *this;
-}
-
-template< class Ch, class Tr>
-basic_format<Ch,Tr>& basic_format<Ch,Tr> ::clear_bind(int argN)
- // cancel the binding of ONE argument, and clear()
-{
- if(argN<1 || argN > num_args_ || bound_.size()==0 || !bound_[argN-1] )
- {
- if( exceptions() & io::out_of_range_bit )
- boost::throw_exception(io::out_of_range()); // arg not in range.
- else return *this;
- }
- bound_[argN-1]=false;
- clear();
- return *this;
-}
-
-
-
-template< class Ch, class Tr>
-std::basic_string<Ch,Tr> basic_format<Ch,Tr> ::str() const
-{
- dumped_=true;
- if(items_.size()==0)
- return prefix_;
- if( cur_arg_ < num_args_)
- if( exceptions() & io::too_few_args_bit )
- boost::throw_exception(io::too_few_args()); // not enough variables have been supplied !
-
- unsigned long sz = prefix_.size();
- unsigned long i;
- for(i=0; i < items_.size(); ++i)
- sz += items_[i].res_.size() + items_[i].appendix_.size();
- string_t res;
- res.reserve(sz);
-
- res += prefix_;
- for(i=0; i < items_.size(); ++i)
- {
- const format_item_t& item = items_[i];
- res += item.res_;
- if( item.argN_ == format_item_t::argN_tabulation)
+
+ template< class Ch, class Tr>
+ basic_format<Ch, Tr>:: basic_format(const basic_format& x)
+ : items_(x.items_), bound_(x.bound_), style_(x.style_),
+ cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(false),
+ prefix_(x.prefix_), exceptions_(x.exceptions_)
{
- BOOST_ASSERT( item.pad_scheme_ & format_item_t::tabulation);
- std::streamsize n = item.state_.width_ - res.size();
- if( n > 0 )
- res.append( n, item.state_.fill_ );
+ }
+
+ template< class Ch, class Tr>
+ void basic_format<Ch, Tr>:: swap (basic_format & x) {
+ std::swap(exceptions_, x.exceptions_);
+ std::swap(style_, x.style_);
+ std::swap(cur_arg_, x.cur_arg_);
+ std::swap(num_args_, x.num_args_);
+ std::swap(dumped_, x.dumped_);
+
+ items_.swap(x.items_);
+ prefix_.swap(x.prefix_);
+ bound_.swap(x.bound_);
+ }
+
+ template< class Ch, class Tr>
+ basic_format<Ch, Tr>& basic_format<Ch, Tr>:: operator= (const basic_format& x) {
+ if(this == &x)
+ return *this;
+ (basic_format<Ch, Tr>(x)).swap(*this);
+ return *this;
+ }
+
+ template< class Ch, class Tr>
+ unsigned char basic_format<Ch,Tr>:: exceptions() const {
+ return exceptions_;
+ }
+
+ template< class Ch, class Tr>
+ unsigned char basic_format<Ch,Tr>:: exceptions(unsigned char newexcept) {
+ unsigned char swp = exceptions_;
+ exceptions_ = newexcept;
+ return swp;
+ }
+
+ template<class Ch, class Tr>
+ void basic_format<Ch, Tr>:: make_or_reuse_data(std::size_t nbitems) {
+ Ch fill = oss_.widen(' ');
+ if(items_.size() == 0)
+ items_.assign( nbitems, format_item_t(fill) );
+ else {
+ bound_.resize(0);
+ items_.resize(nbitems, format_item_t(fill));
+ for(std::size_t i=0; i < nbitems; ++i)
+ items_[i].reset(fill); // strings are resized to "", instead of reallocated
+ }
+ }
+
+ template< class Ch, class Tr>
+ basic_format<Ch,Tr>& basic_format<Ch,Tr>:: clear() {
+ // empty the string buffers (except bound arguments)
+ // and make the format object ready for formatting a new set of arguments
+
+ BOOST_ASSERT( bound_.size()==0 || num_args_ == static_cast<int>(bound_.size()) );
+
+ for(unsigned long i=0; i<items_.size(); ++i) {
+ // clear converted strings only if the corresponding argument is not bound :
+ if( bound_.size()==0 || !bound_[ items_[i].argN_ ] ) items_[i].res_.resize(0);
+ }
+ cur_arg_=0; dumped_=false;
+ // maybe first arg is bound:
+ if(bound_.size() != 0) {
+ while(cur_arg_ < num_args_ && bound_[cur_arg_] )
+ ++cur_arg_;
+ }
+ return *this;
+ }
+
+ template< class Ch, class Tr>
+ basic_format<Ch,Tr>& basic_format<Ch,Tr>:: clear_binds() {
+ // remove all binds, then clear()
+ bound_.resize(0);
+ clear();
+ return *this;
+ }
+
+ template< class Ch, class Tr>
+ basic_format<Ch,Tr>& basic_format<Ch,Tr>:: clear_bind(int argN) {
+ // remove the bind of ONE argument then clear()
+
+ if(argN<1 || argN > num_args_ || bound_.size()==0 || !bound_[argN-1] ) {
+ if( exceptions() & io::out_of_range_bit )
+ boost::throw_exception(io::out_of_range()); // arg not in range.
+ else return *this;
+ }
+ bound_[argN-1]=false;
+ clear();
+ return *this;
+ }
+
+
+
+ template< class Ch, class Tr>
+ std::basic_string<Ch,Tr> basic_format<Ch,Tr>:: str() const {
+ dumped_=true;
+ if(items_.size()==0)
+ return prefix_;
+ if( cur_arg_ < num_args_)
+ if( exceptions() & io::too_few_args_bit )
+ boost::throw_exception(io::too_few_args()); // not enough variables supplied
+ unsigned long i;
+ string_t res;
+ res.reserve(size());
+ res += prefix_;
+ for(i=0; i < items_.size(); ++i) {
+ const format_item_t& item = items_[i];
+ res += item.res_;
+ if( item.argN_ == format_item_t::argN_tabulation) {
+ BOOST_ASSERT( item.pad_scheme_ & format_item_t::tabulation);
+ std::streamsize n = item.fmtstate_.width_ - res.size();
+ if( n > 0 )
+ res.append( n, item.fmtstate_.fill_ );
+ }
+ res += item.appendix_;
+ }
+ return res;
+ }
+ template< class Ch, class Tr>
+ typename basic_format<Ch, Tr>::size_type basic_format<Ch,Tr>::
+ size () const {
+ std::streamsize sz = prefix_.size();
+ unsigned long i;
+ for(i=0; i < items_.size(); ++i) {
+ const format_item_t& item = items_[i];
+ sz += item.res_.size();
+ if( item.argN_ == format_item_t::argN_tabulation)
+ sz = std::max(sz, item.fmtstate_.width_);
+ sz += + item.appendix_.size();
+ }
+ return static_cast<size_type> (sz);
}
- res += item.appendix_;
- }
- return res;
-}
namespace io {
namespace detail {
-template<class Ch, class Tr, class T>
-basic_format<Ch, Tr>& bind_arg_body( basic_format<Ch, Tr>& self,
- int argN,
- const T& val)
- // bind one argument to a fixed value
- // this is persistent over clear() calls, thus also over str() and <<
-{
- if(self.dumped_) self.clear(); // needed, because we will modify cur_arg_..
- if(argN<1 || argN > self.num_args_)
- {
- if( self.exceptions() & io::out_of_range_bit )
- boost::throw_exception(io::out_of_range()); // arg not in range.
- else return self;
- }
- if(self.bound_.size()==0)
- self.bound_.assign(self.num_args_,false);
- else
- BOOST_ASSERT( self.num_args_ == static_cast<signed int>(self.bound_.size()) );
- int o_cur_arg = self.cur_arg_;
- self.cur_arg_ = argN-1; // arrays begin at 0
-
- self.bound_[self.cur_arg_]=false; // if already set, we unset and re-sets..
- self.operator%(val); // put val at the right place, because cur_arg is set
+ template<class Ch, class Tr, class T>
+ basic_format<Ch, Tr>& bind_arg_body( basic_format<Ch, Tr>& self,
+ int argN, const T& val) {
+ // bind one argument to a fixed value
+ // this is persistent over clear() calls, thus also over str() and <<
+ if(self.dumped_)
+ self.clear(); // needed because we will modify cur_arg_
+ if(argN<1 || argN > self.num_args_) {
+ if( self.exceptions() & io::out_of_range_bit )
+ boost::throw_exception(io::out_of_range()); // arg not in range.
+ else return self;
+ }
+ if(self.bound_.size()==0)
+ self.bound_.assign(self.num_args_,false);
+ else
+ BOOST_ASSERT( self.num_args_ == static_cast<signed int>(self.bound_.size()) );
+ int o_cur_arg = self.cur_arg_;
+ self.cur_arg_ = argN-1; // arrays begin at 0
+
+ self.bound_[self.cur_arg_]=false; // if already set, we unset and re-sets..
+ self.operator%(val); // put val at the right place, because cur_arg is set
- // Now re-position cur_arg before leaving :
- self.cur_arg_ = o_cur_arg;
- self.bound_[argN-1]=true;
- if(self.cur_arg_ == argN-1 )
- // hum, now this arg is bound, so move to next free arg
- {
- while(self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_]) ++self.cur_arg_;
- }
- // In any case, we either have all args, or are on a non-binded arg :
- BOOST_ASSERT( self.cur_arg_ >= self.num_args_ || ! self.bound_[self.cur_arg_]);
- return self;
-}
-
-template<class Ch, class Tr, class T>
-basic_format<Ch, Tr>& modify_item_body( basic_format<Ch, Tr>& self,
- int itemN,
- const T& manipulator)
- // applies a manipulator to the format_item describing a given directive.
- // this is a permanent change, clear or clear_binds won't cancel that.
-{
- if(itemN<1 || itemN >= static_cast<signed int>(self.items_.size() ))
- {
- if( self.exceptions() & io::out_of_range_bit )
- boost::throw_exception(io::out_of_range()); // item not in range.
- else return self;
+ // Now re-position cur_arg before leaving :
+ self.cur_arg_ = o_cur_arg;
+ self.bound_[argN-1]=true;
+ if(self.cur_arg_ == argN-1 ) {
+ // hum, now this arg is bound, so move to next free arg
+ while(self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_])
+ ++self.cur_arg_;
+ }
+ // In any case, we either have all args, or are on a non-binded arg :
+ BOOST_ASSERT( self.cur_arg_ >= self.num_args_ || ! self.bound_[self.cur_arg_]);
+ return self;
}
- self.items_[itemN-1].ref_state_.apply_manip( manipulator );
- self.items_[itemN-1].state_ = self.items_[itemN-1].ref_state_;
- return self;
-}
-} // namespace detail
+ template<class Ch, class Tr, class T>
+ basic_format<Ch, Tr>& modify_item_body( basic_format<Ch, Tr>& self,
+ int itemN, T manipulator) {
+ // applies a manipulator to the format_item describing a given directive.
+ // this is a permanent change, clear or reset won't cancel that.
+ if(itemN<1 || itemN > static_cast<signed int>(self.items_.size() )) {
+ if( self.exceptions() & io::out_of_range_bit )
+ boost::throw_exception(io::out_of_range()); // item not in range.
+ else return self;
+ }
+ self.items_[itemN-1].fmtstate_. template apply_manip<T> ( manipulator );
+ return self;
+ }
+} // namespace detail
} // namespace io
-
} // namespace boost
// See http://www.boost.org for updates, documentation, and revision history.
// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
// Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
#ifndef BOOST_FORMAT_FUNCS_HPP
#define BOOST_FORMAT_FUNCS_HPP
-#include "boost/format/format_class.hpp"
-#include "boost/throw_exception.hpp"
+#include <boost/format/format_class.hpp>
+#include <boost/throw_exception.hpp>
namespace boost {
-namespace io {
- template<class Ch, class Tr> inline
- std::basic_string<Ch, Tr> str(const basic_format<Ch, Tr>& f)
- // adds up all pieces of strings and converted items, and return the formatted string
- {
- return f.str();
- }
-} // - namespace io
+ template<class Ch, class Tr> inline
+ std::basic_string<Ch, Tr> str(const basic_format<Ch, Tr>& f) {
+ // adds up all pieces of strings and converted items, and return the formatted string
+ return f.str();
+ }
-template< class Ch, class Tr>
-BOOST_IO_STD basic_ostream<Ch, Tr>&
-operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>& os,
- const boost::basic_format<Ch, Tr>& f)
- // effect: "return os << str(f);" but we can try to do it faster
-{
- typedef boost::basic_format<Ch, Tr> format_t;
- if(f.items_.size()==0)
- os << f.prefix_;
- else {
- if(f.cur_arg_ < f.num_args_)
- if( f.exceptions() & io::too_few_args_bit )
- boost::throw_exception(io::too_few_args()); // not enough variables have been supplied !
- if(f.style_ & format_t::special_needs)
- os << f.str();
- else {
- // else we dont have to count chars output, so we dump directly to os :
- os << f.prefix_;
- for(unsigned long i=0; i<f.items_.size(); ++i)
- {
- const typename format_t::format_item_t& item = f.items_[i];
- os << item.res_;
- os << item.appendix_;
+ template< class Ch, class Tr>
+ BOOST_IO_STD basic_ostream<Ch, Tr>&
+ operator<<( BOOST_IO_STD basic_ostream<Ch, Tr>& os,
+ const boost::basic_format<Ch, Tr>& f)
+ // effect: "return os << str(f);" but we can try to do it faster
+ {
+ typedef boost::basic_format<Ch, Tr> format_t;
+ if(f.items_.size()==0)
+ os << f.prefix_;
+ else {
+ if(f.cur_arg_ < f.num_args_)
+ if( f.exceptions() & io::too_few_args_bit )
+ boost::throw_exception(io::too_few_args()); // not enough variables supplied
+ if(f.style_ & format_t::special_needs)
+ os << f.str();
+ else {
+ // else we dont have to count chars output, so we dump directly to os :
+ os << f.prefix_;
+ for(unsigned long i=0; i<f.items_.size(); ++i) {
+ const typename format_t::format_item_t& item = f.items_[i];
+ os << item.res_;
+ os << item.appendix_;
+ }
+ }
}
+ f.dumped_=true;
+ return os;
}
- }
- f.dumped_=true;
- return os;
-}
-
-
} // namespace boost
#ifndef BOOST_FORMAT_GROUP_HPP
#define BOOST_FORMAT_GROUP_HPP
-#include "boost/config.hpp"
+#include <boost/config.hpp>
namespace boost {
#include <string>
-#include <sstream>
+
+#include <boost/assert.hpp>
+#include <boost/format/outsstream.hpp>
+#include <boost/limits.hpp>
namespace boost {
namespace io {
namespace detail {
-// --------------
-// set of params that define the format state of a stream
-
-template<class Ch, class Tr>
-struct stream_format_state
-{
- typedef BOOST_IO_STD basic_ios<Ch, Tr> basic_ios;
-
- std::streamsize width_;
- std::streamsize precision_;
- Ch fill_;
- std::ios_base::fmtflags flags_;
-
- stream_format_state() : width_(-1), precision_(-1), fill_(0), flags_(std::ios_base::dec) {}
- stream_format_state(basic_ios& os) {set_by_stream(os); }
-
- void apply_on(basic_ios & os) const; //- applies format_state to the stream
- template<class T> void apply_manip(T manipulator) //- modifies state by applying manipulator.
- { apply_manip_body<Ch, Tr, T>( *this, manipulator) ; }
- void reset(); //- sets to default state.
- void set_by_stream(const basic_ios& os); //- sets to os's state.
-};
-
-
-
-// --------------
-// format_item : stores all parameters that can be defined by directives in the format-string
-
-template<class Ch, class Tr>
-struct format_item
-{
- enum pad_values { zeropad = 1, spacepad =2, centered=4, tabulation = 8 };
-
- enum arg_values { argN_no_posit = -1, // non-positional directive. argN will be set later.
- argN_tabulation = -2, // tabulation directive. (no argument read)
- argN_ignored = -3 // ignored directive. (no argument read)
- };
- typedef BOOST_IO_STD basic_ios<Ch, Tr> basic_ios;
- typedef detail::stream_format_state<Ch, Tr> stream_format_state;
- typedef std::basic_string<Ch, Tr> string_t;
- typedef BOOST_IO_STD basic_ostringstream<Ch, Tr> internal_stream_t;
-
-
- int argN_; //- argument number (starts at 0, eg : %1 => argN=0)
- // negative values are used for items that don't process
- // an argument
- string_t res_; //- result of the formatting of this item
- string_t appendix_; //- piece of string between this item and the next
-
- stream_format_state ref_state_;// set by parsing the format_string, is only affected by modify_item
- stream_format_state state_; // always same as ref_state, _unless_ modified by manipulators 'group(..)'
-
- // non-stream format-state parameters
- signed int truncate_; //- is >=0 for directives like %.5s (take 5 chars from the string)
- unsigned int pad_scheme_; //- several possible padding schemes can mix. see pad_values
-
- format_item() : argN_(argN_no_posit), truncate_(-1), pad_scheme_(0) {}
-
- void compute_states(); // sets states according to truncate and pad_scheme.
-};
-
-
-
-// -----------------------------------------------------------
-// Definitions
-// -----------------------------------------------------------
-
-// --- stream_format_state:: -------------------------------------------
-template<class Ch, class Tr> inline
-void stream_format_state<Ch,Tr> ::apply_on(basic_ios & os) const
- // set the state of this stream according to our params
-{
- if(width_ != -1)
- os.width(width_);
- if(precision_ != -1)
- os.precision(precision_);
- if(fill_ != 0)
- os.fill(fill_);
- os.flags(flags_);
-}
-
-template<class Ch, class Tr> inline
-void stream_format_state<Ch,Tr> ::set_by_stream(const basic_ios& os)
- // set our params according to the state of this stream
-{
- flags_ = os.flags();
- width_ = os.width();
- precision_ = os.precision();
- fill_ = os.fill();
-}
-
-template<class Ch, class Tr, class T> inline
-void apply_manip_body( stream_format_state<Ch, Tr>& self,
- T manipulator)
- // modify our params according to the manipulator
-{
- BOOST_IO_STD basic_stringstream<Ch, Tr> ss;
- self.apply_on( ss );
- ss << manipulator;
- self.set_by_stream( ss );
-}
-
-template<class Ch, class Tr> inline
-void stream_format_state<Ch,Tr> ::reset()
- // set our params to standard's default state
-{
- width_=-1; precision_=-1; fill_=0;
- flags_ = std::ios_base::dec;
-}
-
-
-// --- format_items:: -------------------------------------------
-template<class Ch, class Tr> inline
-void format_item<Ch, Tr> ::compute_states()
- // reflect pad_scheme_ on state_ and ref_state_
- // because some pad_schemes has complex consequences on several state params.
-{
- if(pad_scheme_ & zeropad)
- {
- if(ref_state_.flags_ & std::ios_base::left)
+//----- stream_format_state --------------------------------------------------//
+
+// set of params that define the format state of a stream
+ template<class Ch, class Tr>
+ struct stream_format_state
{
- pad_scheme_ = pad_scheme_ & (~zeropad); // ignore zeropad in left alignment
+ typedef BOOST_IO_STD basic_ios<Ch, Tr> basic_ios;
+
+ stream_format_state(Ch fill) { reset(fill); }
+ stream_format_state(const basic_ios& os) { set_by_stream(os); }
+
+ void reset(Ch fill); //- sets to default state.
+ void set_by_stream(const basic_ios& os); //- sets to os's state.
+ void apply_on(basic_ios & os) const; //- applies format_state to the stream
+ template<class T>
+ void apply_manip(T manipulator) //- modifies state by applying manipulator
+ { apply_manip_body<Ch, Tr, T>( *this, manipulator) ; }
+
+ // --- data ---
+ std::streamsize width_;
+ std::streamsize precision_;
+ Ch fill_;
+ std::ios_base::fmtflags flags_;
+ std::ios_base::iostate rdstate_;
+ std::ios_base::iostate exceptions_;
+ };
+
+
+//----- format_item ---------------------------------------------------------//
+
+// stores all parameters that can be specified in format strings
+ template<class Ch, class Tr>
+ struct format_item
+ {
+ enum pad_values { zeropad = 1, spacepad =2, centered=4, tabulation = 8 };
+ // 1. if zeropad is set, all other bits are not,
+ // 2. if tabulation is set, all others are not.
+ // centered and spacepad can be mixed freely.
+ enum arg_values { argN_no_posit = -1, // non-positional directive. will set argN later
+ argN_tabulation = -2, // tabulation directive. (no argument read)
+ argN_ignored = -3 // ignored directive. (no argument read)
+ };
+ typedef BOOST_IO_STD basic_ios<Ch, Tr> basic_ios;
+ typedef detail::stream_format_state<Ch, Tr> stream_format_state;
+ typedef std::basic_string<Ch, Tr> string_t;
+
+ format_item(Ch fill) :argN_(argN_no_posit), fmtstate_(fill),
+ truncate_(max_streamsize()), pad_scheme_(0) {}
+ void reset(Ch fill);
+ void compute_states(); // sets states according to truncate and pad_scheme.
+
+ static std::streamsize max_streamsize() {
+ return std::numeric_limits<std::streamsize>::max();
+ }
+
+ // --- data ---
+ int argN_; //- argument number (starts at 0, eg : %1 => argN=0)
+ // negative values for items that don't process an argument
+ string_t res_; //- result of the formatting of this item
+ string_t appendix_; //- piece of string between this item and the next
+
+ stream_format_state fmtstate_;// set by parsing, is only affected by modify_item
+
+ signed int truncate_; //- is set for directives like %.5s that ask truncation
+ unsigned int pad_scheme_;//- several possible padding schemes can mix. see pad_values
+ };
+
+
+
+//---- Definitions ------------------------------------------------------------
+
+// --- stream_format_state:: -------------------------------------------------
+ template<class Ch, class Tr>
+ void stream_format_state<Ch,Tr>:: apply_on(basic_ios & os) const {
+ // set the state of this stream according to our params
+ if(width_ != -1)
+ os.width(width_);
+ if(precision_ != -1)
+ os.precision(precision_);
+ if(fill_ != 0)
+ os.fill(fill_);
+ os.flags(flags_);
+ os.clear(rdstate_);
+ os.exceptions(exceptions_);
+ }
+
+ template<class Ch, class Tr>
+ void stream_format_state<Ch,Tr>:: set_by_stream(const basic_ios& os) {
+ // set our params according to the state of this stream
+ flags_ = os.flags();
+ width_ = os.width();
+ precision_ = os.precision();
+ fill_ = os.fill();
+ rdstate_ = os.rdstate();
+ exceptions_ = os.exceptions();
+ }
+
+
+ template<class Ch, class Tr, class T>
+ void apply_manip_body( stream_format_state<Ch, Tr>& self,
+ T manipulator) {
+ // modify our params according to the manipulator
+ basic_outsstream<Ch, Tr> ss;
+ self.apply_on( ss );
+ ss << manipulator;
+ self.set_by_stream( ss );
}
- else
- {
- ref_state_.fill_='0';
- ref_state_.flags_ |= std::ios_base::internal;
+
+ template<class Ch, class Tr> inline
+ void stream_format_state<Ch,Tr>:: reset(Ch fill) {
+ // set our params to standard's default state. cf § 27.4.4.1 of the C++ norm
+ width_=0; precision_=6;
+ fill_=fill; // default is widen(' '), but we cant compute it without the locale
+ flags_ = std::ios_base::dec | std::ios_base::skipws;
+ // the adjust_field part is left equal to 0, which means right.
+ exceptions_ = std::ios_base::goodbit;
+ rdstate_ = std::ios_base::goodbit;
+ }
+
+
+// --- format_item:: --------------------------------------------------------
+
+ template<class Ch, class Tr>
+ void format_item<Ch, Tr>::
+ reset(Ch fill) {
+ argN_=argN_no_posit; truncate_ = max_streamsize(); pad_scheme_ =0;
+ res_.resize(0); appendix_.resize(0);
+ fmtstate_.reset(fill);
+ }
+
+ template<class Ch, class Tr>
+ void format_item<Ch, Tr>:: compute_states() {
+ // reflect pad_scheme_ on fmt_state_
+ // because some pad_schemes has complex consequences on several state params.
+ if(pad_scheme_ & zeropad) {
+ // ignore zeropad in left alignment :
+ if(fmtstate_.flags_ & std::ios_base::left) {
+ BOOST_ASSERT(!(fmtstate_.flags_ &(std::ios_base::adjustfield ^std::ios_base::left)));
+ // only left bit might be set. (not right, nor internal)
+ pad_scheme_ = pad_scheme_ & (~zeropad);
+ }
+ else {
+ pad_scheme_ &= ~spacepad; // printf ignores spacepad when zeropadding
+ fmtstate_.fill_='0';
+ fmtstate_.flags_ = (fmtstate_.flags_ & ~std::ios_base::adjustfield)
+ | std::ios_base::internal;
+ // removes all adjustfield bits, and adds internal.
+ }
+ }
+ if(pad_scheme_ & spacepad) {
+ if(fmtstate_.flags_ & std::ios_base::showpos)
+ pad_scheme_ &= ~spacepad;
+ }
}
- }
- state_ = ref_state_;
-}
} } } // namespaces boost :: io :: detail
#ifndef BOOST_FORMAT_INTERNAL_FWD_HPP
#define BOOST_FORMAT_INTERNAL_FWD_HPP
-#include "boost/format/format_fwd.hpp"
-#include "boost/config.hpp"
+#include <boost/format/format_fwd.hpp>
+#include <boost/config.hpp>
namespace boost {
// defined in format_implementation.hpp :
template<class Ch, class Tr, class T>
basic_format<Ch, Tr>& modify_item_body( basic_format<Ch, Tr>& self,
- int itemN, const T& manipulator);
+ int itemN, T manipulator);
template<class Ch, class Tr, class T>
basic_format<Ch, Tr>& bind_arg_body( basic_format<Ch, Tr>& self,
+++ /dev/null
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
-
-// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
-
-// ------------------------------------------------------------------------------
-// macros_default.hpp : configuration for the format library
-// provides default values for the stl workaround macros
-// ------------------------------------------------------------------------------
-
-#ifndef BOOST_FORMAT_MACROS_DEFAULT_HPP
-#define BOOST_FORMAT_MACROS_DEFAULT_HPP
-
-#include <boost/config.hpp>
-
-// *** This should go to "boost/config/suffix.hpp".
-
-#ifndef BOOST_IO_STD
-# define BOOST_IO_STD std::
-#endif
-
-// **** Workaround for io streams, stlport and msvc.
-#ifdef BOOST_IO_NEEDS_USING_DECLARATION
-namespace boost {
- using std::char_traits;
- using std::basic_ostream;
- using std::basic_ostringstream;
- namespace io {
- using std::basic_ostream;
- namespace detail {
- using std::basic_ios;
- using std::basic_ostream;
- using std::basic_ostringstream;
- }
- }
-}
-#endif
-
-// ------------------------------------------------------------------------------
-
-#endif // BOOST_FORMAT_MACROS_DEFAULT_HPP
+++ /dev/null
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
-
-// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
-
-// ------------------------------------------------------------------------------
-// macros_stlport.hpp : configuration for the format library
-// The contents of this file should be integrated into the boost config system.
-// ------------------------------------------------------------------------------
-
-#ifndef BOOST_MACROS_STLPORT_HPP
-#define BOOST_MACROS_STLPORT_HPP
-
-#include <boost/config.hpp>
-
-// *** This should go to "boost/config/stdlib/stlport.hpp".
-
-// If the streams are not native and there are problems with using templates
-// accross namespaces, we define some macros to enable a workaround for this.
-
-// STLport 4.5
-#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE)
-# define BOOST_IO_STD
-# define BOOST_IO_NEEDS_USING_DECLARATION
-#endif
-
-// STLport 4.0
-#if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_OWN_NAMESPACE) && defined(BOOST_NO_USING_TEMPLATE)
-# define BOOST_IO_STD
-# define BOOST_IO_NEEDS_USING_DECLARATION
-#endif
-
-
-// ------------------------------------------------------------------------------
-
-#endif // BOOST_MACROS_STLPORT_HPP
+++ /dev/null
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
-
-// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream
-
-// ----------------------------------------------------------------------------
-// msvc_disambiguater.hpp : msvc workarounds. (for put_{head|last} overloads)
-// the trick was described in boost's list by Aleksey Gurtovoy
-// ----------------------------------------------------------------------------
-
-
-#ifndef BOOST_MSVC_DISAMBIGUATER_HPP
-#define BOOST_MSVC_DISAMBIGUATER_HPP
-
-#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) // this whole header is specifically for msvc
-
-#include "boost/format/group.hpp"
-#include <ostream>
-
-namespace boost {
-namespace io {
-namespace detail {
-
-template< class Ch, class Tr, class T >
-struct disambiguater
-{
- template< typename U >
- static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
- {
- os << group_head(x.a1_);
- }
- static void put_head(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
- {
- }
- template< typename U >
- static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, group1<U> const& x, long)
- {
- os << group_last(x.a1_);
- }
- static void put_last(BOOST_IO_STD basic_ostream<Ch, Tr>& os, T const& x, int)
- {
- os << x;
- }
-};
-
-} // namespace detail
-} // namespace io
-} // namespace boost
-
-#endif // -BOOST_MSVC
-
-#endif // -BOOST_MSVC_DISAMBIGUATER_HPP
--- /dev/null
+// -*- C++ -*-
+// Boost format ----------------------------------------------------
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Samuel Krempp 2003
+// Permission to copy, use, modify, sell and
+// distribute this software is granted provided this copyright notice appears
+// in all copies. This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+
+// ------------------------------------------------------------------------------
+// outsstream<Ch, Tr> is a class extending stringstream by adding :
+// clear_buffer() method, and
+// access to the [pbase(), pptr()[ part of the 'output sequence'
+// (see §27.5.1 of the C++ standard)
+// if sstream is not available, it uses strstream and is slightly different.
+// ------------------------------------------------------------------------------
+
+#ifndef BOOST_FORMAT_OUTSSTREAM_H
+#define BOOST_FORMAT_OUTSSTREAM_H
+
+#include <boost/assert.hpp>
+#include <boost/utility/base_from_member.hpp>
+#include <boost/format/detail/config_macros.hpp>
+
+#if !defined(BOOST_NO_STRINGSTREAM) && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM)
+#include <sstream>
+#else
+#include <strstream>
+#include <string>
+#endif // BOOST_NO_STRING_STREAM
+
+
+namespace boost {
+namespace io {
+
+#if !defined(BOOST_NO_STRINGSTREAM) && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM)
+
+
+//---- The stringstream way ---------------------------------------------------
+
+
+// --- class steal_basic_stringbuf : steals pbase(), pptr() & co -----------
+ template<class Ch, class Tr = BOOST_IO_STD char_traits<Ch> >
+ class steal_basic_stringbuf : public std::basic_stringbuf<Ch, Tr>
+ {
+ typedef std::basic_stringbuf<Ch, Tr> buff_t;
+ public:
+ typedef std::basic_string<Ch,Tr> string_type;
+
+ // get [pbase, pptr[ from stringbuf::str(), which returns [pbase, epptr[ :
+ string_type cur_str() const { return string_type(this->str(), 0, pcount()); }
+
+ // publicize those functions (protected in stringbuf) :
+ std::streamsize pcount() const { return pptr() - pbase(); }
+ const Ch * pbase() const { return buff_t::pbase(); }
+ const Ch * pptr() const { return buff_t::pptr(); }
+ const Ch * epptr() const { return buff_t::epptr(); }
+ // added convenience function :
+ void clear_buffer();
+ };
+
+
+// --- class basic_outsstream -----------------------------------------------
+ template<class Ch, class Tr = BOOST_IO_STD char_traits<Ch> >
+ class basic_outsstream : boost::base_from_member<steal_basic_stringbuf<Ch, Tr> >,
+ public BOOST_IO_STD basic_ostream<Ch, Tr>
+ // use stringbuf with its stolen protected members,
+ // publicly derived from basic_ostream to make this class a stream.
+ {
+ public:
+ typedef std::basic_string<Ch,Tr> string_type;
+ basic_outsstream() : pbase_type(),
+ std::basic_ostream<Ch,Tr>( & sb() ) {}
+ // buffer access via strings
+ string_type str() const { return sb().str(); } // [begin, end[
+ string_type cur_str() const { return sb().cur_str(); } // [begin, cur[
+
+ // copy-less access (note the pointers can be invalidated when modifying the stream)
+ std::streamsize pcount() const { return sb().pcount(); }
+ const Ch * begin() const { return sb().pbase(); }
+ const Ch * cur() const { return sb().pptr(); }
+ const Ch * end() const { return sb().epptr(); }
+
+ void clear_buffer() { sb().clear_buffer(); }
+ private:
+ typedef boost::base_from_member<steal_basic_stringbuf<Ch, Tr> > pbase_type;
+ steal_basic_stringbuf<Ch, Tr> & sb() { return pbase_type::member; }
+ steal_basic_stringbuf<Ch, Tr> const& sb() const { return pbase_type::member; }
+ };
+#else // BOOST_NO_STRINGSTREAM
+
+
+
+//---- The strstream way ------------------------------------------------------
+
+ template <class Ch,
+#if !( BOOST_WORKAROUND(__GNUC__, <3) && defined(__STL_CONFIG_H) )
+ class Tr = BOOST_IO_STD char_traits<Ch> >
+#else
+ class Tr = std::string_char_traits<Ch> >
+#endif
+ class basic_outsstream; // we define only the <char> specialisaton
+
+
+// --- class basic_outsstream -----------------------------------------------
+ template<class Tr>
+ class basic_outsstream<char, Tr> : private BOOST_IO_STD strstreambuf,
+ public std::basic_ostream<char, Tr>
+ {
+ public:
+ typedef char Ch;
+ typedef std::basic_string<Ch,Tr> string_type;
+ typedef BOOST_IO_STD strstreambuf buff_t;
+ typedef std::basic_ostream<char, Tr> stream_t;
+ public:
+ basic_outsstream();
+
+ // ! physically copy chars :
+ string_type str();
+ string_type cur_str() const { return string_type(begin(), cur()); }
+
+ int freeze() const { return buff_t::freeze(); }
+ void freeze(int x) { buff_t::freeze(x); }
+
+ // copy-less access (be careful, the pointer are invalidated when modifying the stream) :
+ std::streamsize pcount() const { return cur()-begin(); }
+ const Ch * begin() const { return buff_t::pbase(); }
+ const Ch * cur() const { return buff_t::pptr(); }
+ const Ch * end() const { return buff_t::epptr(); }
+
+ void clear_buffer();
+ };
+
+#endif // BOOST_NO_STRINGSTREAM
+
+
+ typedef basic_outsstream<char> outsstream;
+
+} // namespace boost::io
+} // namespace boost
+
+
+#include <boost/format/outsstream_impl.hpp> // implementation
+
+#endif // BOOST_FORMAT_OUTSSTREAM_H include guard
--- /dev/null
+// -*- C++ -*-
+// Boost format ----------------------------------------------------
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// (C) Samuel Krempp 2003
+// Permission to copy, use, modify, sell and
+// distribute this software is granted provided this copyright notice appears
+// in all copies. This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+
+// ------------------------------------------------------------------------------
+// implementation included by outsstream.hpp.
+// ------------------------------------------------------------------------------
+
+namespace boost {
+namespace io {
+
+#if !defined(BOOST_NO_STRINGSTREAM) && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM)
+
+template<class Ch, class Tr> inline
+void steal_basic_stringbuf<Ch, Tr> :: clear_buffer() {
+ const Ch * p = pptr();
+ const Ch * b = pbase();
+ if(p != NULL && p != b) {
+ typedef typename Tr::pos_type pos_type;
+ pos_type pos = buff_t::seekpos(0, std::ios_base::out);
+ BOOST_ASSERT( pos != pos_type(std::streamoff(-1)) );
+ }
+}
+
+
+
+#else // BOOST_NO_STRINGSTREAM
+
+
+template <class Tr> inline
+basic_outsstream<char,Tr> ::basic_outsstream() :
+ buff_t(),
+ stream_t(this)
+{
+ stream_t::init(this); // the strem construction isnt enough with gcc-2.95
+}
+
+
+template <class Tr>
+std::basic_string<char, Tr>
+basic_outsstream<char, Tr> ::str() { // ! physically copy chars :
+ string_type s(buff_t::str(), pcount());
+ freeze(false);
+ return s;
+}
+
+template<class Tr > inline
+void
+basic_outsstream<char, Tr>:: clear_buffer() {
+ freeze(false);
+ const Ch * p = cur();
+ const Ch * b = begin();
+ if(p != NULL && p != b) {
+ buff_t::seekpos(0, std::ios_base::out);
+ }
+ freeze(false);
+}
+
+#endif
+
+} //namespace io
+} //namespace boost
// See http://www.boost.org for updates, documentation, and revision history.
// (C) Samuel Krempp 2001
-// krempp@crans.ens-cachan.fr
// Permission to copy, use, modify, sell and
// distribute this software is granted provided this copyright notice appears
// in all copies. This software is provided "as is" without express or implied
namespace io {
namespace detail {
- template<class Ch, class Stream> inline
- bool wrap_isdigit(Ch c, Stream &os)
- {
-#ifndef BOOST_NO_LOCALE_ISIDIGIT
- return std::isdigit(c, os.rdbuf()->getloc() );
+ template<class Ch, class Stream> inline
+ bool wrap_isdigit(Ch c, Stream &os) {
+#if ! defined( BOOST_NO_LOCALE_ISIDIGIT )
+ return std::isdigit(c, os.rdbuf()->getloc() );
# else
- using namespace std;
- return isdigit(c);
+ using namespace std;
+ return isdigit(c);
#endif
- } //end- wrap_isdigit(..)
-
- template<class Res, class Ch, class Tr> inline
- Res str2int(const std::basic_string<Ch, Tr>& s,
- typename std::basic_string<Ch, Tr>::size_type start,
- BOOST_IO_STD basic_ios<Ch,Tr> &os,
- const Res = Res(0) )
- // Input : char string, with starting index
- // a basic_ios& merely to call its widen/narrow member function in the desired locale.
- // Effects : reads s[start:] and converts digits into an integral n, of type Res
- // Returns : n
- {
- Res n = 0;
- while(start<s.size() && wrap_isdigit(s[start], os) ) {
- char cur_ch = os.narrow( s[start], 0);
- BOOST_ASSERT(cur_ch != 0 ); // since we called isdigit, this should not happen.
- n *= 10;
- n += cur_ch - '0'; // 22.2.1.1.2 of the C++ standard
- ++start;
+ } //end- wrap_isdigit(..)
+
+ template<class Iter, class Stream>
+ Iter wrap_scan_notdigit(Iter beg, Iter end, const Stream & os) {
+ using namespace std;
+ for( ; beg!=end && wrap_isdigit(*beg,os); ++beg) ;
+ return beg;
}
- return n;
- }
-
- template<class Ch, class Tr>
- void skip_asterisk(const std::basic_string<Ch,Tr> & buf,
- typename std::basic_string<Ch,Tr>::size_type * pos_p,
- BOOST_IO_STD basic_ios<Ch, Tr> &os)
- // skip printf's "asterisk-fields" directives in the format-string buf
- // Input : char string, with starting index *pos_p
- // a basic_ios& merely to call its widen/narrow member function in the desired locale.
- // Effects : advance *pos_p by skipping printf's asterisk fields.
- // Returns : nothing
- {
- using namespace std;
- BOOST_ASSERT( pos_p != 0);
- if(*pos_p >= buf.size() ) return;
- if(buf[ *pos_p]==os.widen('*')) {
- ++ (*pos_p);
- while (*pos_p < buf.size() && wrap_isdigit(buf[*pos_p],os)) ++(*pos_p);
- if(buf[*pos_p]==os.widen('$')) ++(*pos_p);
+
+
+ template<class Res, class Iter, class Stream>
+ Iter str2int(const Iter & start, const Iter & last, Res & res, Stream &os)
+ // Input : [start, last) iterators range and a
+ // a basic_ios& merely to use its widen/narrow member function
+ // Effects : reads sequence and converts digits into an integral n, of type Res
+ // Returns : n
+ {
+ using namespace std;
+ Iter it;
+ res=0;
+ for(it=start; it != last && wrap_isdigit(*it, os); ++it ) {
+ char cur_ch = os.narrow( *it, 0); // cant fail.
+ res *= 10;
+ res += cur_ch - '0'; // 22.2.1.1.2.13 of the C++ standard
+ }
+ return it;
+ }
+
+ template<class Iter, class Stream>
+ Iter skip_asterisk(Iter start, Iter last, Stream &os)
+ // skip printf's "asterisk-fields" directives in the format-string buf
+ // Input : char string, with starting index *pos_p
+ // a basic_ios& merely to use its widen/narrow member function
+ // Effects : advance *pos_p by skipping printf's asterisk fields.
+ // Returns : nothing
+ {
+ using namespace std;
+ ++ start;
+ start = wrap_scan_notdigit(start, last, os);
+ if(start!=last && *start== os.widen('$') )
+ ++start;
+ return start;
}
- }
- inline void maybe_throw_exception( unsigned char exceptions)
- // auxiliary func called by parse_printf_directive
- // for centralising error handling
- // it either throws if user sets the corresponding flag, or does nothing.
- {
- if(exceptions & io::bad_format_string_bit)
- boost::throw_exception(io::bad_format_string());
- }
+ inline void maybe_throw_exception( unsigned char exceptions)
+ // auxiliary func called by parse_printf_directive
+ // for centralising error handling
+ // it either throws if user sets the corresponding flag, or does nothing.
+ {
+ if(exceptions & io::bad_format_string_bit)
+ boost::throw_exception(io::bad_format_string());
+ }
- template<class Ch, class Tr>
- bool parse_printf_directive(const std::basic_string<Ch, Tr> & buf,
- typename std::basic_string<Ch, Tr>::size_type * pos_p,
- detail::format_item<Ch, Tr> * fpar,
- BOOST_IO_STD basic_ios<Ch,Tr> &os,
- unsigned char exceptions)
- // Input : a 'printf-directive' in the format-string, starting at buf[ *pos_p ]
- // a basic_ios& merely to call its widen/narrow member function in the desired locale.
- // a bitset'excpetions' telling whether to throw exceptions on errors.
- // Returns : true if parse somehow succeeded (possibly ignoring errors if exceptions disabled)
- // false if it failed so bad that the directive should be printed verbatim
- // Effects : - *pos_p is incremented so that buf[*pos_p] is the first char after the directive
- // - *fpar is set with the parameters read in the directive
- {
- typedef format_item<Ch, Tr> format_item_t;
- BOOST_ASSERT( pos_p != 0);
- typename std::basic_string<Ch, Tr>::size_type &i1 = *pos_p,
- i0;
- fpar->argN_ = format_item_t::argN_no_posit; // if no positional-directive
-
- bool in_brackets=false;
- if(buf[i1]==os.widen('|'))
- {
- in_brackets=true;
- if( ++i1 >= buf.size() ) {
- maybe_throw_exception(exceptions);
- return false;
+ template<class Ch, class Tr, class Iter, class Stream>
+ bool parse_printf_directive(Iter & start, const Iter& last,
+ detail::format_item<Ch, Tr> * fpar,
+ Stream &os,
+ unsigned char exceptions)
+ // Input: a 'printf-directive' in the format-string, starting at buf[ *pos_p ]
+ // a basic_ios& merely to use its widen/narrow member function
+ // a bitset'excpetions' telling whether to throw exceptions on errors.
+ // Returns: true if parse somehow succeeded (ignore some errors if exceptions disabled)
+ // false if it failed so bad that the directive should be printed verbatim
+ // Effects: *pos_p is incremented so that buf[*pos_p] is the first char after the directive
+ // *fpar is set with the parameters read in the directive
+ {
+ typedef format_item<Ch, Tr> format_item_t;
+ //BOOST_ASSERT( pos_p != 0);
+
+ fpar->argN_ = format_item_t::argN_no_posit; // if no positional-directive
+ bool precision_set = false;
+ bool in_brackets=false;
+ if(*start== os.widen('|')) {
+ in_brackets=true;
+ if( ++start >= last ) {
+ maybe_throw_exception(exceptions);
+ return false;
+ }
}
- }
-
- // the flag '0' would be picked as a digit for argument order, but here it's a flag :
- if(buf[i1]==os.widen('0'))
- goto parse_flags;
-
- // handle argument order (%2$d) or possibly width specification: %2d
- i0 = i1; // save position before digits
- while (i1 < buf.size() && wrap_isdigit(buf[i1], os))
- ++i1;
- if (i1!=i0)
- {
- if( i1 >= buf.size() ) {
- maybe_throw_exception(exceptions);
- return false;
+
+ // the flag '0' would be picked as a digit for argument order, but here it's a flag :
+ if(*start== os.widen('0'))
+ goto parse_flags;
+
+ // handle argument order (%2$d) or possibly width specification: %2d
+ if(wrap_isdigit(*start, os)) {
+ int n;
+ start = str2int(start, last, n, os);
+ if( start >= last ) {
+ maybe_throw_exception(exceptions);
+ return false;
+ }
+
+ // %N% case : this is already the end of the directive
+ if( *start == os.widen('%') ) {
+ fpar->argN_ = n-1;
+ ++start;
+ if( in_brackets)
+ maybe_throw_exception(exceptions);
+ // but don't return. maybe "%" was used in lieu of '$', so we go on.
+ else
+ return true;
+ }
+
+ if ( *start== os.widen('$') ) {
+ fpar->argN_ = n-1;
+ ++start;
+ }
+ else {
+ // non-positionnal directive
+ fpar->fmtstate_.width_ = n;
+ fpar->argN_ = format_item_t::argN_no_posit;
+ goto parse_precision;
+ }
}
- int n=str2int(buf,i0, os, int(0) );
-
- // %N% case : this is already the end of the directive
- if( buf[i1] == os.widen('%') )
- {
- fpar->argN_ = n-1;
- ++i1;
- if( in_brackets)
- maybe_throw_exception(exceptions);
- // but don't return. maybe "%" was used in lieu of '$', so we go on.
- else return true;
- }
-
- if ( buf[i1]==os.widen('$') )
- {
- fpar->argN_ = n-1;
- ++i1;
- }
- else
- {
- // non-positionnal directive
- fpar->ref_state_.width_ = n;
- fpar->argN_ = format_item_t::argN_no_posit;
- goto parse_precision;
- }
- }
- parse_flags:
- // handle flags
- while ( i1 <buf.size()) // as long as char is one of + - = # 0 l h or ' '
- {
- // misc switches
- switch (os.narrow(buf[i1], 0))
- {
- case '\'' : break; // no effect yet. (painful to implement)
- case 'l':
- case 'h': // short/long modifier : for printf-comaptibility (no action needed)
- break;
- case '-':
- fpar->ref_state_.flags_ |= std::ios_base::left;
+ parse_flags:
+ // handle flags
+ while ( start != last) { // as long as char is one of + - = _ # 0 l h or ' '
+ // misc switches
+ switch ( os.narrow(*start, 0)) {
+ case '\'' : break; // no effect yet. (painful to implement)
+ case 'l':
+ case 'h': // short/long modifier : for printf-comaptibility (no action needed)
+ break;
+ case '-':
+ fpar->fmtstate_.flags_ |= std::ios_base::left;
+ break;
+ case '=':
+ fpar->pad_scheme_ |= format_item_t::centered;
+ break;
+ case '_':
+ fpar->fmtstate_.flags_ |= std::ios_base::internal;
+ break;
+ case ' ':
+ fpar->pad_scheme_ |= format_item_t::spacepad;
+ break;
+ case '+':
+ fpar->fmtstate_.flags_ |= std::ios_base::showpos;
+ break;
+ case '0':
+ fpar->pad_scheme_ |= format_item_t::zeropad;
+ // need to know alignment before really setting flags,
+ // so just add 'zeropad' flag for now, it will be processed later.
+ break;
+ case '#':
+ fpar->fmtstate_.flags_ |= std::ios_base::showpoint | std::ios_base::showbase;
+ break;
+ default:
+ goto parse_width;
+ }
+ ++start;
+ } // loop on flag.
+
+ if( start>=last) {
+ maybe_throw_exception(exceptions);
+ return true;
+ }
+ parse_width:
+ // handle width spec
+ // first skip 'asterisk fields' : *, or *N$
+ if(*start == os.widen('*') )
+ start = skip_asterisk(start, last, os);
+ if(start!=last && wrap_isdigit(*start, os))
+ start = str2int(start, last, fpar->fmtstate_.width_, os);
+
+ parse_precision:
+ if( start>= last) {
+ maybe_throw_exception(exceptions);
+ return true;
+ }
+ // handle precision spec
+ if (*start== os.widen('.')) {
+ ++start;
+ if(start != last && *start == os.widen('*') )
+ start = skip_asterisk(start, last, os);
+ if(start != last && wrap_isdigit(*start, os)) {
+ start = str2int(start, last, fpar->fmtstate_.precision_, os);
+ precision_set = true;
+ }
+ else
+ fpar->fmtstate_.precision_ =0;
+ }
+
+ // handle formatting-type flags :
+ while( start != last &&
+ ( *start== os.widen('l') || *start== os.widen('L') || *start== os.widen('h')) )
+ ++start;
+ if( start>=last) {
+ maybe_throw_exception(exceptions);
+ return true;
+ }
+
+ if( in_brackets && *start== os.widen('|') ) {
+ ++start;
+ return true;
+ }
+ switch ( os.narrow(*start, 0) ) {
+ case 'X':
+ fpar->fmtstate_.flags_ |= std::ios_base::uppercase;
+ case 'p': // pointer => set hex.
+ case 'x':
+ fpar->fmtstate_.flags_ &= ~std::ios_base::basefield;
+ fpar->fmtstate_.flags_ |= std::ios_base::hex;
break;
- case '=':
- fpar->pad_scheme_ |= format_item_t::centered;
+
+ case 'o':
+ fpar->fmtstate_.flags_ &= ~std::ios_base::basefield;
+ fpar->fmtstate_.flags_ |= std::ios_base::oct;
break;
- case ' ':
- fpar->pad_scheme_ |= format_item_t::spacepad;
+
+ case 'E':
+ fpar->fmtstate_.flags_ |= std::ios_base::uppercase;
+ case 'e':
+ fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield;
+ fpar->fmtstate_.flags_ |= std::ios_base::scientific;
+
+ fpar->fmtstate_.flags_ &= ~std::ios_base::basefield;
+ fpar->fmtstate_.flags_ |= std::ios_base::dec;
break;
- case '+':
- fpar->ref_state_.flags_ |= std::ios_base::showpos;
+
+ case 'f':
+ fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield;
+ fpar->fmtstate_.flags_ |= std::ios_base::fixed;
+ case 'u':
+ case 'd':
+ case 'i':
+ fpar->fmtstate_.flags_ &= ~std::ios_base::basefield;
+ fpar->fmtstate_.flags_ |= std::ios_base::dec;
break;
- case '0':
- fpar->pad_scheme_ |= format_item_t::zeropad;
- // need to know alignment before really setting flags,
- // so just add 'zeropad' flag for now, it will be processed later.
+
+ case 'T':
+ ++start;
+ if( start >= last)
+ maybe_throw_exception(exceptions);
+ else
+ fpar->fmtstate_.fill_ = *start;
+ fpar->pad_scheme_ |= format_item_t::tabulation;
+ fpar->argN_ = format_item_t::argN_tabulation;
break;
- case '#':
- fpar->ref_state_.flags_ |= std::ios_base::showpoint | std::ios_base::showbase;
+ case 't':
+ fpar->fmtstate_.fill_ = os.widen(' ');
+ fpar->pad_scheme_ |= format_item_t::tabulation;
+ fpar->argN_ = format_item_t::argN_tabulation;
break;
- default:
- goto parse_width;
- }
- ++i1;
- } // loop on flag.
- if( i1>=buf.size()) {
- maybe_throw_exception(exceptions);
- return true;
- }
- parse_width:
- // handle width spec
- skip_asterisk(buf, &i1, os); // skips 'asterisk fields' : *, or *N$
- i0 = i1; // save position before digits
- while (i1<buf.size() && wrap_isdigit(buf[i1], os))
- i1++;
-
- if (i1!=i0)
- { fpar->ref_state_.width_ = str2int( buf,i0, os, std::streamsize(0) ); }
+ case 'G':
+ fpar->fmtstate_.flags_ |= std::ios_base::uppercase;
+ break;
+ case 'g': // 'g' conversion is default for floats.
+ fpar->fmtstate_.flags_ &= ~std::ios_base::basefield;
+ fpar->fmtstate_.flags_ |= std::ios_base::dec;
- parse_precision:
- if( i1>=buf.size()) {
- maybe_throw_exception(exceptions);
- return true;
- }
- // handle precision spec
- if (buf[i1]==os.widen('.'))
- {
- ++i1;
- skip_asterisk(buf, &i1, os);
- i0 = i1; // save position before digits
- while (i1<buf.size() && wrap_isdigit(buf[i1], os))
- ++i1;
-
- if(i1==i0)
- fpar->ref_state_.precision_ = 0;
- else
- fpar->ref_state_.precision_ = str2int(buf,i0, os, std::streamsize(0) );
- }
-
- // handle formatting-type flags :
- while( i1<buf.size() &&
- ( buf[i1]==os.widen('l') || buf[i1]==os.widen('L') || buf[i1]==os.widen('h')) )
- ++i1;
- if( i1>=buf.size()) {
- maybe_throw_exception(exceptions);
- return true;
- }
-
- if( in_brackets && buf[i1]==os.widen('|') )
- {
- ++i1;
+ // CLEAR all floatield flags, so stream will CHOOSE
+ fpar->fmtstate_.flags_ &= ~std::ios_base::floatfield;
+ break;
+
+ case 'C':
+ case 'c':
+ fpar->truncate_ = 1;
+ break;
+ case 'S':
+ case 's':
+ if(precision_set) // handle truncation manually, with own parameter.
+ fpar->truncate_ = fpar->fmtstate_.precision_;
+ fpar->fmtstate_.precision_ = 6; // default stream precision.
+ break;
+ case 'n' :
+ fpar->argN_ = format_item_t::argN_ignored;
+ break;
+ default:
+ maybe_throw_exception(exceptions);
+ }
+ ++start;
+
+ if( in_brackets ) {
+ if( start != last && *start== os.widen('|') ) {
+ ++start;
+ return true;
+ }
+ else maybe_throw_exception(exceptions);
+ }
return true;
- }
- switch (os.narrow(buf[i1], 0) )
- {
- case 'X':
- fpar->ref_state_.flags_ |= std::ios_base::uppercase;
- case 'p': // pointer => set hex.
- case 'x':
- fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
- fpar->ref_state_.flags_ |= std::ios_base::hex;
- break;
-
- case 'o':
- fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
- fpar->ref_state_.flags_ |= std::ios_base::oct;
- break;
-
- case 'E':
- fpar->ref_state_.flags_ |= std::ios_base::uppercase;
- case 'e':
- fpar->ref_state_.flags_ &= ~std::ios_base::floatfield;
- fpar->ref_state_.flags_ |= std::ios_base::scientific;
-
- fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
- fpar->ref_state_.flags_ |= std::ios_base::dec;
- break;
-
- case 'f':
- fpar->ref_state_.flags_ &= ~std::ios_base::floatfield;
- fpar->ref_state_.flags_ |= std::ios_base::fixed;
- case 'u':
- case 'd':
- case 'i':
- fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
- fpar->ref_state_.flags_ |= std::ios_base::dec;
- break;
-
- case 'T':
- ++i1;
- if( i1 >= buf.size())
- maybe_throw_exception(exceptions);
- else
- fpar->ref_state_.fill_ = buf[i1];
- fpar->pad_scheme_ |= format_item_t::tabulation;
- fpar->argN_ = format_item_t::argN_tabulation;
- break;
- case 't':
- fpar->ref_state_.fill_ = os.widen(' ');
- fpar->pad_scheme_ |= format_item_t::tabulation;
- fpar->argN_ = format_item_t::argN_tabulation;
- break;
-
- case 'G':
- fpar->ref_state_.flags_ |= std::ios_base::uppercase;
- break;
- case 'g': // 'g' conversion is default for floats.
- fpar->ref_state_.flags_ &= ~std::ios_base::basefield;
- fpar->ref_state_.flags_ |= std::ios_base::dec;
-
- // CLEAR all floatield flags, so stream will CHOOSE
- fpar->ref_state_.flags_ &= ~std::ios_base::floatfield;
- break;
-
- case 'C':
- case 'c':
- fpar->truncate_ = 1;
- break;
- case 'S':
- case 's':
- fpar->truncate_ = fpar->ref_state_.precision_;
- fpar->ref_state_.precision_ = -1;
- break;
- case 'n' :
- fpar->argN_ = format_item_t::argN_ignored;
- break;
- default:
- maybe_throw_exception(exceptions);
- }
- ++i1;
-
- if( in_brackets )
- {
- if( i1<buf.size() && buf[i1]==os.widen('|') )
- {
- ++i1;
- return true;
- }
- else maybe_throw_exception(exceptions);
- }
- return true;
- }
+ }
+
+ template<class string_t, class Stream>
+ int upper_bound_from_fstring(const string_t& buf,
+ const typename string_t::value_type arg_mark,
+ Stream& os, // just to carry the locale
+ unsigned char exceptions) {
+ // quick-parsing of the format-string to count arguments mark (arg_mark, '%')
+ // returns : upper bound on the number of format items in the format strings
+ typename string_t::size_type i1=0;
+ int num_items=0;
+ while( (i1=buf.find(arg_mark,i1)) != string_t::npos ) {
+ if( i1+1 >= buf.size() ) {
+ if(exceptions & io::bad_format_string_bit)
+ boost::throw_exception(io::bad_format_string()); // must not end in ".. %"
+ else break; // stop there, ignore last '%'
+ }
+ if(buf[i1+1] == buf[i1] ) {// escaped "%%"
+ i1+=2; continue;
+ }
+
+ ++i1;
+ // in case of %N% directives, dont count it double (wastes allocations..) :
+ i1 = wrap_scan_notdigit(buf.begin()+i1, buf.end(), os) - buf.begin();
+ if( i1 < buf.size() && buf[i1] == arg_mark )
+ ++i1;
+ ++num_items;
+ }
+ return num_items;
+ }
} // detail namespace
} // io namespace
+
// -----------------------------------------------
// format :: parse(..)
-template<class Ch, class Traits>
-void basic_format<Ch, Traits> ::parse(const string_t & buf)
- // parse the format-string
-{
- using namespace std;
- const Ch arg_mark = oss_.widen('%');
- bool ordered_args=true;
- int max_argN=-1;
- typename string_t::size_type i1=0;
- int num_items=0;
-
- // A: find upper_bound on num_items and allocates arrays
- i1=0;
- while( (i1=buf.find(arg_mark,i1)) != string_t::npos )
- {
- if( i1+1 >= buf.size() ) {
- if(exceptions() & io::bad_format_string_bit)
- boost::throw_exception(io::bad_format_string()); // must not end in "bla bla %"
- else break; // stop there, ignore last '%'
- }
- if(buf[i1+1] == buf[i1] ) { i1+=2; continue; } // escaped "%%" / "##"
- ++i1;
-
- // in case of %N% directives, dont count it double (wastes allocations..) :
- while(i1 < buf.size() && io::detail::wrap_isdigit(buf[i1],oss_)) ++i1;
- if( i1 < buf.size() && buf[i1] == arg_mark ) ++ i1;
-
- ++num_items;
- }
- items_.assign( num_items, format_item_t() );
-
- // B: Now the real parsing of the format string :
- num_items=0;
- i1 = 0;
- typename string_t::size_type i0 = i1;
- bool special_things=false;
- int cur_it=0;
- while( (i1=buf.find(arg_mark,i1)) != string_t::npos )
- {
- string_t & piece = (cur_it==0) ? prefix_ : items_[cur_it-1].appendix_;
-
- if( buf[i1+1] == buf[i1] ) // escaped mark, '%%'
- {
- piece += buf.substr(i0, i1-i0) + buf[i1];
- i1+=2; i0=i1;
- continue;
- }
- BOOST_ASSERT( static_cast<unsigned int>(cur_it) < items_.size() || cur_it==0);
-
- if(i1!=i0) piece += buf.substr(i0, i1-i0);
- ++i1;
-
- bool parse_ok;
- parse_ok = io::detail::parse_printf_directive(buf, &i1, &items_[cur_it], oss_, exceptions());
- if( ! parse_ok ) continue; // the directive will be printed verbatim
-
- i0=i1;
- items_[cur_it].compute_states(); // process complex options, like zeropad, into stream params.
-
- int argN=items_[cur_it].argN_;
- if(argN == format_item_t::argN_ignored)
- continue;
- if(argN ==format_item_t::argN_no_posit)
- ordered_args=false;
- else if(argN == format_item_t::argN_tabulation) special_things=true;
- else if(argN > max_argN) max_argN = argN;
- ++num_items;
- ++cur_it;
- } // loop on %'s
- BOOST_ASSERT(cur_it == num_items);
-
- // store the final piece of string
- string_t & piece = (cur_it==0) ? prefix_ : items_[cur_it-1].appendix_;
- piece += buf.substr(i0);
+ template<class Ch, class Tr>
+ basic_format<Ch, Tr>& basic_format<Ch, Tr>:: parse(const string_t& buf) {
+ // parse the format-string
+ using namespace std;
+
+
+ const Ch arg_mark = oss_.widen('%');
+ bool ordered_args=true;
+ int max_argN=-1;
+
+ // A: find upper_bound on num_items and allocates arrays
+ int num_items = io::detail::upper_bound_from_fstring(buf, arg_mark, oss_, exceptions());
+ make_or_reuse_data(num_items);
+
+ // B: Now the real parsing of the format string :
+ num_items=0;
+ typename string_t::size_type i0=0, i1=0;
+ typename string_t::const_iterator it;
+ bool special_things=false;
+ int cur_item=0;
+ while( (i1=buf.find(arg_mark,i1)) != string_t::npos ) {
+ string_t & piece = (cur_item==0) ? prefix_ : items_[cur_item-1].appendix_;
+ if( buf[i1+1] == buf[i1] ) { // escaped mark, '%%'
+ piece += buf.substr(i0, i1+1-i0);
+ i1+=2; i0=i1;
+ continue;
+ }
+ BOOST_ASSERT( static_cast<unsigned int>(cur_item) < items_.size() || cur_item==0);
+
+ if(i1!=i0)
+ piece += buf.substr(i0, i1-i0);
+ ++i1;
+ it = buf.begin()+i1;
+ bool parse_ok = io::detail::parse_printf_directive(
+ it, buf.end(), &items_[cur_item], oss_, exceptions());
+ i1 = it - buf.begin();
+ if( ! parse_ok ) // the directive will be printed verbatim
+ continue;
+ i0=i1;
+ items_[cur_item].compute_states(); // process complex options, like zeropad, into params
+
+ int argN=items_[cur_item].argN_;
+ if(argN == format_item_t::argN_ignored)
+ continue;
+ if(argN ==format_item_t::argN_no_posit)
+ ordered_args=false;
+ else if(argN == format_item_t::argN_tabulation) special_things=true;
+ else if(argN > max_argN) max_argN = argN;
+ ++num_items;
+ ++cur_item;
+ } // loop on %'s
+ BOOST_ASSERT(cur_item == num_items);
- if( !ordered_args)
- {
- if(max_argN >= 0 ) // dont mix positional with non-positionnal directives
+ // store the final piece of string
{
- if(exceptions() & io::bad_format_string_bit)
- boost::throw_exception(io::bad_format_string());
- // else do nothing. => positionnal arguments are processed as non-positionnal
+ string_t & piece = (cur_item==0) ? prefix_ : items_[cur_item-1].appendix_;
+ piece += buf.substr(i0);
+ }
+
+ if( !ordered_args) {
+ if(max_argN >= 0 ) { // dont mix positional with non-positionnal directives
+ if(exceptions() & io::bad_format_string_bit)
+ boost::throw_exception(io::bad_format_string());
+ // else do nothing. => positionnal arguments are processed as non-positionnal
+ }
+ // set things like it would have been with positional directives :
+ int non_ordered_items = 0;
+ for(int i=0; i< num_items; ++i)
+ if(items_[i].argN_ == format_item_t::argN_no_posit) {
+ items_[i].argN_ = non_ordered_items;
+ ++non_ordered_items;
+ }
+ max_argN = non_ordered_items-1;
}
- // set things like it would have been with positional directives :
- int non_ordered_items = 0;
- for(int i=0; i< num_items; ++i)
- if(items_[i].argN_ == format_item_t::argN_no_posit)
- {
- items_[i].argN_ = non_ordered_items;
- ++non_ordered_items;
- }
- max_argN = non_ordered_items-1;
- }
- // C: set some member data :
- items_.resize(num_items);
-
- if(special_things) style_ |= special_needs;
- num_args_ = max_argN + 1;
- if(ordered_args) style_ |= ordered;
- else style_ &= ~ordered;
-}
+ // C: set some member data :
+ items_.resize(num_items, format_item_t(oss_.fill()) );
+
+ if(special_things) style_ |= special_needs;
+ num_args_ = max_argN + 1;
+ if(ordered_args) style_ |= ordered;
+ else style_ &= ~ordered;
+ return *this;
+ }
} // namespace boost
// Boost.Function library
-// Copyright (C) 2001, 2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2001-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)
// For more information, see http://www.boost.org/libs/function
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 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)
// For more information, see http://www.boost.org
#if !defined(BOOST_PP_IS_ITERATING)
// Boost.Function library
-// Copyright (C) 2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
# include <boost/config.hpp>
# include <boost/function/function_base.hpp>
# include <boost/mem_fn.hpp>
-# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/is_integral.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/preprocessor/enum_params.hpp>
# include <boost/preprocessor/cat.hpp>
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2002-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2002-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)
// For more information, see http://www.boost.org
// Boost.Function library
-// Copyright (C) 2001-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2001-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)
// For more information, see http://www.boost.org
#include <boost/pending/ct_if.hpp>
#include <boost/detail/workaround.hpp>
+#ifndef BOOST_NO_SFINAE
+# include "boost/utility/enable_if.hpp"
+#endif
+
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
# define BOOST_FUNCTION_TARGET_FIX(x) x
#else
}}}
#endif
-// GCC 2.95.3 (or earlier) doesn't support enable_if
-#if BOOST_WORKAROUND(__GNUC__, < 3)
-# define BOOST_FUNCTION_NO_ENABLE_IF
-#endif
-
-// MIPSpro 7.3.1.3m doesn't support enable_if
-#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 && !defined(BOOST_STRICT_CONFIG)
-# define BOOST_FUNCTION_NO_ENABLE_IF
-#endif
-
-// MSVC 7.0 doesn't support enable_if
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 && !defined(BOOST_STRICT_CONFIG)
-# define BOOST_FUNCTION_NO_ENABLE_IF
-#endif
-
-// Borland C++ 5.6.0 doesn't support enable_if
-#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
-# define BOOST_FUNCTION_NO_ENABLE_IF
-#endif
-
-// Metrowerks 7.2 doesn't support enable_if
-#if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
-# define BOOST_FUNCTION_NO_ENABLE_IF
-#endif
-
-#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x540)
-# define BOOST_FUNCTION_NO_ENABLE_IF
+#if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ || defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
+ || !(BOOST_STRICT_CONFIG || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
+# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
#endif
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
namespace boost {
#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 && !defined(BOOST_STRICT_CONFIG)
}
};
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- template<bool cond, typename T> struct enable_if;
- template<typename T> struct enable_if<true, T> { typedef T type; };
- template<typename T> struct enable_if<false, T> {};
-
- template<bool x>
- struct enabled
- {
- template<typename T>
- struct base
- {
- typedef T type;
- };
- };
-
- template<>
- struct enabled<false>
- {
- template<typename T>
- struct base
- {
- };
- };
-
- template<bool Enabled, typename T>
- struct enable_if : public enabled<Enabled>::template base<T>
- {
- };
-#endif
-
// A type that is only used for comparisons against zero
struct useless_clear_type {};
} // end namespace function
// Boost.Function library
-// Copyright (C) 2001-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Doug Gregor 2001-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)
// For more information, see http://www.boost.org
>
class BOOST_FUNCTION_FUNCTION : public function_base
{
+ public:
typedef typename detail::function::function_return_type<R>::type
internal_result_type;
+ private:
struct clear_type {};
public:
// one with a default parameter.
template<typename Functor>
BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
- ,typename detail::function::enable_if<
+#ifndef BOOST_NO_SFINAE
+ ,typename enable_if_c<
(::boost::type_traits::ice_not<
- (is_same<Functor, int>::value)>::value),
+ (is_integral<Functor>::value)>::value),
int>::type = 0
-#endif // BOOST_FUNCTION_NO_ENABLE_IF
+#endif // BOOST_NO_SFINAE
) :
function_base(),
invoker(0)
this->assign_to(f);
}
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
+#ifndef BOOST_NO_SFINAE
BOOST_FUNCTION_FUNCTION(clear_type*) : function_base(), invoker(0) {}
#else
BOOST_FUNCTION_FUNCTION(int zero) : function_base(), invoker(0)
if (this->empty())
boost::throw_exception(bad_function_call());
- internal_result_type result = invoker(function_base::functor
+ internal_result_type result = invoker(this->functor
BOOST_FUNCTION_COMMA
BOOST_FUNCTION_ARGS);
// handle BOOST_FUNCTION_FUNCTION as the type of the temporary to
// construct.
template<typename Functor>
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
- typename detail::function::enable_if<
+#ifndef BOOST_NO_SFINAE
+ typename enable_if_c<
(::boost::type_traits::ice_not<
- (is_same<Functor, int>::value)>::value),
+ (is_integral<Functor>::value)>::value),
BOOST_FUNCTION_FUNCTION&>::type
#else
BOOST_FUNCTION_FUNCTION&
return *this;
}
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
+#ifndef BOOST_NO_SFINAE
BOOST_FUNCTION_FUNCTION& operator=(clear_type*)
{
this->clear();
if (&other == this)
return;
- std::swap(function_base::manager, other.manager);
- std::swap(function_base::functor, other.functor);
+ std::swap(this->manager, other.manager);
+ std::swap(this->functor, other.functor);
std::swap(invoker, other.invoker);
}
// Clear out a target, if there is one
void clear()
{
- if (function_base::manager) {
+ if (this->manager) {
function_base::functor =
- function_base::manager(function_base::functor,
- detail::function::destroy_functor_tag);
+ this->manager(this->functor, detail::function::destroy_functor_tag);
}
- function_base::manager = 0;
+ this->manager = 0;
invoker = 0;
}
{
if (!f.empty()) {
invoker = f.invoker;
- function_base::manager = f.manager;
- function_base::functor =
+ this->manager = f.manager;
+ this->functor =
f.manager(f.functor, detail::function::clone_functor_tag);
}
}
invoker_type;
invoker = &invoker_type::invoke;
- function_base::manager =
+ this->manager =
&detail::function::functor_manager<FunctionPtr, Allocator>::manage;
- function_base::functor =
- function_base::manager(detail::function::make_any_pointer(
+ this->functor =
+ this->manager(detail::function::make_any_pointer(
// should be a reinterpret cast, but some compilers
// insist on giving cv-qualifiers to free functions
(void (*)())(f)
invoker_type;
invoker = &invoker_type::invoke;
- function_base::manager = &detail::function::functor_manager<
+ this->manager = &detail::function::functor_manager<
FunctionObj, Allocator>::manage;
#ifndef BOOST_NO_STD_ALLOCATOR
typedef typename Allocator::template rebind<FunctionObj>::other
#else
FunctionObj* new_f = new FunctionObj(f);
#endif // BOOST_NO_STD_ALLOCATOR
- function_base::functor =
+ this->functor =
detail::function::make_any_pointer(static_cast<void*>(new_f));
}
}
invoker_type;
invoker = &invoker_type::invoke;
- function_base::manager = &detail::function::trivial_manager;
- function_base::functor =
- function_base::manager(
+ this->manager = &detail::function::trivial_manager;
+ this->functor =
+ this->manager(
detail::function::make_any_pointer(
const_cast<FunctionObj*>(f.get_pointer())),
detail::function::clone_functor_tag);
>::type
invoker_type;
invoker = &invoker_type::invoke;
- function_base::manager = &detail::function::trivial_manager;
- function_base::functor = detail::function::make_any_pointer(this);
+ this->manager = &detail::function::trivial_manager;
+ this->functor = detail::function::make_any_pointer(this);
}
typedef internal_result_type (*invoker_type)(detail::function::any_pointer
f1.swap(f2);
}
-#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
- && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
- && (BOOST_STRICT_CONFIG || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
+#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
#if BOOST_FUNCTION_NUM_ARGS == 0
#define BOOST_FUNCTION_PARTIAL_SPEC R (void)
template<typename Functor>
function(Functor f
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
- ,typename detail::function::enable_if<
+#ifndef BOOST_NO_SFINAE
+ ,typename enable_if_c<
(::boost::type_traits::ice_not<
- (is_same<Functor, int>::value)>::value),
+ (is_integral<Functor>::value)>::value),
int>::type = 0
#endif
) :
{
}
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
+#ifndef BOOST_NO_SFINAE
function(clear_type*) : base_type() {}
#endif
}
template<typename Functor>
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
- typename detail::function::enable_if<
+#ifndef BOOST_NO_SFINAE
+ typename enable_if_c<
(::boost::type_traits::ice_not<
- (is_same<Functor, int>::value)>::value),
+ (is_integral<Functor>::value)>::value),
self_type&>::type
#else
self_type&
return *this;
}
-#ifndef BOOST_FUNCTION_NO_ENABLE_IF
+#ifndef BOOST_NO_SFINAE
self_type& operator=(clear_type*)
{
this->clear();
#
# Boost.Function library
#
-# Copyright (C) 2001-2003 Doug Gregor (gregod@cs.rpi.edu)
-#
-# Permission to copy, use, sell and distribute this software is granted
-# provided this copyright notice appears in all copies.
-# Permission to modify the code and to distribute modified code is granted
-# provided this copyright notice appears in all copies, and a notice
-# that the code was modified is included with the copyright notice.
-#
-# This software is provided "as is" without express or implied warranty,
-# and with no claim as to its suitability for any purpose.
+# Copyright Doug Gregor 2001-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)
#
# For more information, see http://www.boost.org
use English;
#ifndef BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
#define BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
-#include <boost/iterator_adaptors.hpp>
+#include <boost/iterator/iterator_facade.hpp>
#include <boost/ref.hpp>
namespace boost {
template<class Generator>
-class generator_iterator_policies
+class generator_iterator
+ : public iterator_facade<
+ generator_iterator<Generator>
+ , typename Generator::result_type
+ , single_pass_traversal_tag
+ , typename Generator::result_type const&
+ >
{
-public:
- generator_iterator_policies() { }
-
- template<class Base>
- void initialize(Base& base) {
- m_value = (*base)();
- }
-
- // The Iter template argument is necessary for compatibility with a MWCW
- // bug workaround
- template <class IteratorAdaptor>
- void increment(IteratorAdaptor& iter) {
- m_value = (*iter.base())();
+ typedef iterator_facade<
+ generator_iterator<Generator>
+ , typename Generator::result_type
+ , single_pass_traversal_tag
+ , typename Generator::result_type const&
+ > super_t;
+
+ public:
+ generator_iterator() {}
+ generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}
+
+ void increment()
+ {
+ m_value = (*m_g)();
}
- template <class IteratorAdaptor>
const typename Generator::result_type&
- dereference(const IteratorAdaptor&) const
- { return m_value; }
+ dereference() const
+ {
+ return m_value;
+ }
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return x.base() == y.base() &&
- x.policies().m_value == y.policies().m_value; }
+ bool equal(generator_iterator const& y) const
+ {
+ return this->m_g == y.m_g && this->m_value == y.m_value;
+ }
-private:
- typename Generator::result_type m_value;
+ private:
+ Generator* m_g;
+ typename Generator::result_type m_value;
};
template<class Generator>
struct generator_iterator_generator
{
- typedef iterator_adaptor<Generator*, generator_iterator_policies<Generator>,
- typename Generator::result_type, const typename Generator::result_type&,
- const typename Generator::result_type*, std::input_iterator_tag,
- long> type;
+ typedef generator_iterator<Generator> type;
};
template <class Generator>
-inline typename generator_iterator_generator<Generator>::type
+inline generator_iterator<Generator>
make_generator_iterator(Generator & gen)
{
- typedef typename generator_iterator_generator<Generator>::type result_t;
+ typedef generator_iterator<Generator> result_t;
return result_t(&gen);
}
--- /dev/null
+// Copyright David Abrahams 2004. 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 INDIRECT_REFERENCE_DWA200415_HPP
+# define INDIRECT_REFERENCE_DWA200415_HPP
+
+// dereferenceable_traits provides access to the value_type and
+// reference of a Dereferenceable type.
+
+# include <boost/detail/is_incrementable.hpp>
+# include <boost/iterator/iterator_traits.hpp>
+# include <boost/type_traits/remove_cv.hpp>
+# include <boost/mpl/apply_if.hpp>
+# include <boost/pointee.hpp>
+
+namespace boost {
+
+namespace detail
+{
+ template <class P>
+ struct smart_ptr_reference
+ {
+ typedef typename boost::pointee<P>::type& type;
+ };
+}
+
+template <class P>
+struct indirect_reference
+ : mpl::apply_if<
+ detail::is_incrementable<P>
+ , iterator_reference<P>
+ , detail::smart_ptr_reference<P>
+ >
+{
+};
+
+} // namespace boost
+
+#endif // INDIRECT_REFERENCE_DWA200415_HPP
// boost integer.hpp header file -------------------------------------------//
-// (C) Copyright Beman Dawes 1999. Permission to copy, use, modify, sell
-// and distribute this software is granted provided this copyright
-// notice appears in all copies. This software is provided "as is" without
-// express or implied warranty, and with no claim as to its suitability for
-// any purpose.
+// Copyright Beman Dawes 1999.
+// See accompanying license for terms and conditions of use.
// See http://www.boost.org/libs/integer for documentation.
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
- * $Id: integer_traits.hpp,v 1.22 2002/12/27 16:51:52 beman_dawes Exp $
+ * $Id: integer_traits.hpp,v 1.23 2003/08/27 10:30:53 johnmaddock Exp $
*
* Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
*/
} // namespace boost
#endif /* BOOST_INTEGER_TRAITS_HPP */
+
+
+
return p_ != 0;
}
-#else
+#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ typedef T * (this_type::*unspecified_bool_type)() const;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return p_ == 0? 0: &this_type::get;
+ }
+
+#else
- typedef T * (intrusive_ptr::*unspecified_bool_type) () const;
+ typedef T * this_type::*unspecified_bool_type;
operator unspecified_bool_type () const
{
- return p_ == 0? 0: &intrusive_ptr::get;
+ return p_ == 0? 0: &this_type::p_;
}
#endif
return static_cast<T *>(p.get());
}
+template<class T, class U> intrusive_ptr<T> const_pointer_cast(intrusive_ptr<U> const & p)
+{
+ return const_cast<T *>(p.get());
+}
+
template<class T, class U> intrusive_ptr<T> dynamic_pointer_cast(intrusive_ptr<U> const & p)
{
return dynamic_cast<T *>(p.get());
--- /dev/null
+#error obsolete
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+
+// no include guard multiple inclusion intended
+
+//
+// This is a temporary workaround until the bulk of this is
+// available in boost config.
+// 23/02/03 thw
+//
+
+#include <boost/config.hpp> // for prior
+#include <boost/detail/workaround.hpp>
+
+#ifdef BOOST_ITERATOR_CONFIG_DEF
+# error you have nested config_def #inclusion.
+#else
+# define BOOST_ITERATOR_CONFIG_DEF
+#endif
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531))
+
+// Recall that in general, compilers without partial specialization
+// can't strip constness. Consider counting_iterator, which normally
+// passes a const Value to iterator_facade. As a result, any code
+// which makes a std::vector of the iterator's value_type will fail
+// when its allocator declares functions overloaded on reference and
+// const_reference (the same type).
+//
+// Furthermore, Borland 5.5.1 drops constness in enough ways that we
+// end up using a proxy for operator[] when we otherwise shouldn't.
+// Using reference constness gives it an extra hint that it can
+// return the value_type from operator[] directly, but is not
+// strictly neccessary. Not sure how best to resolve this one.
+
+# define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1
+
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x531)) \
+ || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER))
+# define BOOST_NO_LVALUE_RETURN_DETECTION
+
+# if 0 // test code
+ struct v {};
+
+ typedef char (&no)[3];
+
+ template <class T>
+ no foo(T const&, ...);
+
+ template <class T>
+ char foo(T&, int);
+
+
+ struct value_iterator
+ {
+ v operator*() const;
+ };
+
+ template <class T>
+ struct lvalue_deref_helper
+ {
+ static T& x;
+ enum { value = (sizeof(foo(*x,0)) == 1) };
+ };
+
+ int z2[(lvalue_deref_helper<v*>::value == 1) ? 1 : -1];
+ int z[(lvalue_deref_helper<value_iterator>::value) == 1 ? -1 : 1 ];
+# endif
+
+#endif
+
+#if BOOST_WORKAROUND(__MWERKS__, <=0x2407)
+# define BOOST_NO_IS_CONVERTIBLE // "is_convertible doesn't work for simple types"
+#endif
+
+#if BOOST_WORKAROUND(__GNUC__, == 2) \
+ || BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4) && !defined(__EDG_VERSION__) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+# define BOOST_NO_IS_CONVERTIBLE_TEMPLATE // The following program fails to compile:
+
+# if 0 // test code
+ #include <boost/type_traits/is_convertible.hpp>
+ template <class T>
+ struct foo
+ {
+ foo(T);
+
+ template <class U>
+ foo(foo<U> const& other) : p(other.p) { }
+
+ T p;
+ };
+
+ bool x = boost::is_convertible<foo<int const*>, foo<int*> >::value;
+# endif
+
+#endif
+
+#if BOOST_WORKAROUND(__GNUC__, == 2 && __GNUC_MINOR__ == 95) \
+ || BOOST_WORKAROUND(__MWERKS__, <= 0x2407) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+# define BOOST_ITERATOR_NO_MPL_AUX_HAS_XXX // "MPL's has_xxx facility doesn't work"
+#endif
+
+#if defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE)
+# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
+#endif
+
+# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+# define BOOST_ARG_DEPENDENT_TYPENAME typename
+# else
+# define BOOST_ARG_DEPENDENT_TYPENAME
+# endif
+
+# if BOOST_WORKAROUND(__GNUC__, == 2) && BOOST_WORKAROUND(__GNUC_MINOR__, BOOST_TESTED_AT(95)) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+
+// GCC-2.95 eagerly instantiates templated constructors and conversion
+// operators in convertibility checks, causing premature errors.
+//
+// Borland's problems are harder to diagnose due to lack of an
+// instantiation stack backtrace. They may be due in part to the fact
+// that it drops cv-qualification willy-nilly in templates.
+# define BOOST_NO_ONE_WAY_ITERATOR_INTEROP
+# endif
+
+// no include guard; multiple inclusion intended
--- /dev/null
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+
+// no include guard multiple inclusion intended
+
+//
+// This is a temporary workaround until the bulk of this is
+// available in boost config.
+// 23/02/03 thw
+//
+
+#undef BOOST_NO_IS_CONVERTIBLE
+#undef BOOST_NO_IS_CONVERTIBLE_TEMPLATE
+#undef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
+#undef BOOST_ARG_DEPENDENT_TYPENAME
+#undef BOOST_NO_LVALUE_RETURN_DETECTION
+#undef BOOST_NO_ONE_WAY_ITERATOR_INTEROP
+
+#ifdef BOOST_ITERATOR_CONFIG_DEF
+# undef BOOST_ITERATOR_CONFIG_DEF
+#else
+# error missing or nested #include config_def
+#endif
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_ENABLE_IF_23022003THW_HPP
+#define BOOST_ENABLE_IF_23022003THW_HPP
+
+#include <boost/detail/workaround.hpp>
+#include <boost/mpl/identity.hpp>
+
+#include <boost/iterator/detail/config_def.hpp>
+
+//
+// Boost iterators uses its own enable_if cause we need
+// special semantics for deficient compilers.
+// 23/02/03 thw
+//
+
+namespace boost
+{
+
+ namespace iterators
+ {
+ //
+ // Base machinery for all kinds of enable if
+ //
+ template<bool>
+ struct enabled
+ {
+ template<typename T>
+ struct base
+ {
+ typedef T type;
+ };
+ };
+
+ //
+ // For compilers that don't support "Substitution Failure Is Not An Error"
+ // enable_if falls back to always enabled. See comments
+ // on operator implementation for consequences.
+ //
+ template<>
+ struct enabled<false>
+ {
+ template<typename T>
+ struct base
+ {
+#ifdef BOOST_NO_SFINAE
+
+ typedef T type;
+
+ // This way to do it would give a nice error message containing
+ // invalid overload, but has the big disadvantage that
+ // there is no reference to user code in the error message.
+ //
+ // struct invalid_overload;
+ // typedef invalid_overload type;
+ //
+#endif
+ };
+ };
+
+
+ template <class Cond,
+ class Return>
+ struct enable_if
+# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE)
+ : enabled<(Cond::value)>::template base<Return>
+# else
+ : mpl::identity<Return>
+# endif
+ {
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+ typedef Return type;
+# endif
+ };
+
+ } // namespace iterators
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ENABLE_IF_23022003THW_HPP
--- /dev/null
+// 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)
+#ifndef FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
+# define FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
+
+# include <boost/iterator/iterator_categories.hpp>
+
+# include <boost/static_assert.hpp>
+
+# include <boost/mpl/or.hpp> // used in iterator_tag inheritance logic
+# include <boost/mpl/and.hpp>
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/apply_if.hpp>
+# include <boost/mpl/identity.hpp>
+
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/is_const.hpp>
+# include <boost/type_traits/is_reference.hpp>
+# include <boost/type_traits/is_convertible.hpp>
+
+# include <boost/type_traits/is_same.hpp>
+
+# include <boost/iterator/detail/config_def.hpp> // try to keep this last
+
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+# include <boost/python/detail/indirect_traits.hpp>
+# endif
+
+//
+// iterator_category deduction for iterator_facade
+//
+
+// forward declaration
+namespace boost { struct use_default; }
+
+namespace boost { namespace detail {
+
+struct input_output_iterator_tag
+ : std::input_iterator_tag
+{
+ // Using inheritance for only input_iterator_tag helps to avoid
+ // ambiguities when a stdlib implementation dispatches on a
+ // function which is overloaded on both input_iterator_tag and
+ // output_iterator_tag, as STLPort does, in its __valid_range
+ // function. I claim it's better to avoid the ambiguity in these
+ // cases.
+ operator std::output_iterator_tag() const
+ {
+ return std::output_iterator_tag();
+ }
+};
+
+//
+// True iff the user has explicitly disabled writability of this
+// iterator. Pass the iterator_facade's Value parameter and its
+// nested ::reference type.
+//
+template <class ValueParam, class Reference>
+struct iterator_writability_disabled
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY // Adding Thomas' logic?
+ : mpl::or_<
+ is_const<Reference>
+ , python::detail::is_reference_to_const<Reference>
+ , is_const<ValueParam>
+ >
+# else
+ : is_const<ValueParam>
+# endif
+{};
+
+
+//
+// Convert an iterator_facade's traversal category, Value parameter,
+// and ::reference type to an appropriate old-style category.
+//
+// If writability has been disabled per the above metafunction, the
+// result will not be convertible to output_iterator_tag.
+//
+// Otherwise, if Traversal == single_pass_traversal_tag, the following
+// conditions will result in a tag that is convertible both to
+// input_iterator_tag and output_iterator_tag:
+//
+// 1. Reference is a reference to non-const
+// 2. Reference is not a reference and is convertible to Value
+//
+template <class Traversal, class ValueParam, class Reference>
+struct iterator_facade_default_category
+ : mpl::apply_if<
+ mpl::and_<
+ is_reference<Reference>
+ , is_convertible<Traversal,forward_traversal_tag>
+ >
+ , mpl::apply_if<
+ is_convertible<Traversal,random_access_traversal_tag>
+ , mpl::identity<std::random_access_iterator_tag>
+ , mpl::if_<
+ is_convertible<Traversal,bidirectional_traversal_tag>
+ , std::bidirectional_iterator_tag
+ , std::forward_iterator_tag
+ >
+ >
+ , typename mpl::apply_if<
+ mpl::and_<
+ is_convertible<Traversal, single_pass_traversal_tag>
+
+ // check for readability
+ , is_convertible<Reference, ValueParam>
+ >
+ , mpl::if_<
+ iterator_writability_disabled<ValueParam,Reference>
+ , std::input_iterator_tag
+ , input_output_iterator_tag
+ >
+
+ , mpl::identity<std::output_iterator_tag>
+ >
+ >
+{
+};
+
+// True iff T is convertible to an old-style iterator category.
+template <class T>
+struct is_iterator_category
+ : mpl::or_<
+ is_convertible<T,std::input_iterator_tag>
+ , is_convertible<T,std::output_iterator_tag>
+ >
+{
+};
+
+template <class T>
+struct is_iterator_traversal
+ : is_convertible<T,incrementable_traversal_tag>
+{};
+
+//
+// A composite iterator_category tag convertible to Category (a pure
+// old-style category) and Traversal (a pure traversal tag).
+// Traversal must be a strict increase of the traversal power given by
+// Category.
+//
+template <class Category, class Traversal>
+struct iterator_category_with_traversal
+ : Category, Traversal
+{
+# if 0
+ // Because of limitations on multiple user-defined conversions,
+ // this should be a good test of whether convertibility is enough
+ // in the spec, or whether we need to specify inheritance.
+ operator Category() const { return Category(); }
+ operator Traversal() const { return Traversal(); }
+# endif
+
+# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ // Make sure this isn't used to build any categories where
+ // convertibility to Traversal is redundant. Should just use the
+ // Category element in that case.
+ BOOST_STATIC_ASSERT(
+ !(is_convertible<
+ typename iterator_category_to_traversal<Category>::type
+ , Traversal
+ >::value));
+
+ BOOST_STATIC_ASSERT(is_iterator_category<Category>::value);
+ BOOST_STATIC_ASSERT(!is_iterator_category<Traversal>::value);
+ BOOST_STATIC_ASSERT(!is_iterator_traversal<Category>::value);
+# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
+ BOOST_STATIC_ASSERT(is_iterator_traversal<Traversal>::value);
+# endif
+# endif
+};
+
+// Computes an iterator_category tag whose traversal is Traversal and
+// which is appropriate for an iterator
+template <class Traversal, class ValueParam, class Reference>
+struct facade_iterator_category_impl
+{
+# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ BOOST_STATIC_ASSERT(!is_iterator_category<Traversal>::value);
+# endif
+
+ typedef typename iterator_facade_default_category<
+ Traversal,ValueParam,Reference
+ >::type category;
+
+ typedef typename mpl::if_<
+ is_same<
+ Traversal
+ , typename iterator_category_to_traversal<category>::type
+ >
+ , category
+ , iterator_category_with_traversal<category,Traversal>
+ >::type type;
+};
+
+//
+// Compute an iterator_category for iterator_facade
+//
+template <class CategoryOrTraversal, class ValueParam, class Reference>
+struct facade_iterator_category
+ : mpl::apply_if<
+ is_iterator_category<CategoryOrTraversal>
+ , mpl::identity<CategoryOrTraversal> // old-style categories are fine as-is
+ , facade_iterator_category_impl<CategoryOrTraversal,ValueParam,Reference>
+ >
+{
+};
+
+}} // namespace boost::detail
+
+# include <boost/iterator/detail/config_undef.hpp>
+
+#endif // FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
--- /dev/null
+// 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)
+#ifndef MINIMUM_CATEGORY_DWA20031119_HPP
+# define MINIMUM_CATEGORY_DWA20031119_HPP
+
+# include <boost/type_traits/is_convertible.hpp>
+# include <boost/type_traits/is_same.hpp>
+
+# include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace detail {
+//
+// Returns the minimum category type or error_type
+// if T1 and T2 are unrelated.
+//
+// For compilers not supporting is_convertible this only
+// works with the new boost return and traversal category
+// types. The exact boost _types_ are required. No derived types
+// will work.
+//
+//
+template <bool GreaterEqual, bool LessEqual>
+struct minimum_category_impl
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+{
+ typedef void type;
+}
+# endif
+;
+
+template <class T1, class T2>
+struct error_not_related_by_convertibility;
+
+template <>
+struct minimum_category_impl<true,false>
+{
+ template <class T1, class T2> struct apply
+ {
+ typedef T2 type;
+ };
+};
+
+template <>
+struct minimum_category_impl<false,true>
+{
+ template <class T1, class T2> struct apply
+ {
+ typedef T1 type;
+ };
+};
+
+template <>
+struct minimum_category_impl<true,true>
+{
+ template <class T1, class T2> struct apply
+ {
+ BOOST_STATIC_ASSERT((is_same<T1,T2>::value));
+ typedef T1 type;
+ };
+};
+
+template <>
+struct minimum_category_impl<false,false>
+{
+ template <class T1, class T2> struct apply
+ : error_not_related_by_convertibility<T1,T2>
+ {
+ };
+};
+
+template <class T1 = mpl::_1, class T2 = mpl::_2>
+struct minimum_category
+{
+ typedef minimum_category_impl<
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround
+ is_same<T2,int>::value ||
+# endif
+ ::boost::is_convertible<T1,T2>::value
+ , ::boost::is_convertible<T2,T1>::value
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround
+ || is_same<T1,int>::value
+# endif
+ > outer;
+
+ typedef typename outer::template apply<T1,T2> inner;
+ typedef typename inner::type type;
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(2,minimum_category,(T1,T2))
+};
+
+template <>
+struct minimum_category<mpl::_1,mpl::_2>
+{
+ template <class T1, class T2>
+ struct apply : minimum_category<T1,T2>
+ {};
+};
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // ETI workaround
+template <>
+struct minimum_category<int,int>
+{
+ typedef int type;
+};
+# endif
+
+}} // namespace boost::detail
+
+#endif // MINIMUM_CATEGORY_DWA20031119_HPP
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_FILTER_ITERATOR_23022003THW_HPP
+#define BOOST_FILTER_ITERATOR_23022003THW_HPP
+
+#include <boost/iterator.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/iterator/iterator_categories.hpp>
+
+#include <boost/type_traits/is_class.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost
+{
+ template <class Predicate, class Iterator>
+ class filter_iterator;
+
+ namespace detail
+ {
+ template <class Predicate, class Iterator>
+ struct filter_iterator_base
+ {
+ typedef iterator_adaptor<
+ filter_iterator<Predicate, Iterator>
+ , Iterator
+ , use_default
+ , typename mpl::if_<
+ is_convertible<
+ typename iterator_traversal<Iterator>::type
+ , bidirectional_traversal_tag
+ >
+ , forward_traversal_tag
+ , use_default
+ >::type
+ > type;
+ };
+ }
+
+ template <class Predicate, class Iterator>
+ class filter_iterator
+ : public detail::filter_iterator_base<Predicate, Iterator>::type
+ {
+ typedef typename detail::filter_iterator_base<
+ Predicate, Iterator
+ >::type super_t;
+
+ friend class iterator_core_access;
+
+ public:
+ filter_iterator() { }
+
+ filter_iterator(Predicate f, Iterator x, Iterator end = Iterator())
+ : super_t(x), m_predicate(f), m_end(end)
+ {
+ satisfy_predicate();
+ }
+
+ filter_iterator(Iterator x, Iterator end = Iterator())
+ : super_t(x), m_predicate(), m_end(end)
+ {
+ // Pro8 is a little too aggressive about instantiating the
+ // body of this function.
+#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ // Don't allow use of this constructor if Predicate is a
+ // function pointer type, since it will be 0.
+ BOOST_STATIC_ASSERT(is_class<Predicate>::value);
+#endif
+ satisfy_predicate();
+ }
+
+ template<class OtherIterator>
+ filter_iterator(
+ filter_iterator<Predicate, OtherIterator> const& t
+ , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
+ )
+ : super_t(t.base()), m_predicate(t.predicate()), m_end(t.end()) {}
+
+ Predicate predicate() const { return m_predicate; }
+
+ Iterator end() const { return m_end; }
+
+ private:
+ void increment()
+ {
+ ++(this->base_reference());
+ satisfy_predicate();
+ }
+
+ void decrement()
+ {
+ while(!this->m_predicate(*--(this->base_reference()))){};
+ }
+
+ void satisfy_predicate()
+ {
+ while (this->base() != this->m_end && !this->m_predicate(*this->base()))
+ ++(this->base_reference());
+ }
+
+ // Probably should be the initial base class so it can be
+ // optimized away via EBO if it is an empty class.
+ Predicate m_predicate;
+ Iterator m_end;
+ };
+
+ template <class Predicate, class Iterator>
+ filter_iterator<Predicate,Iterator>
+ make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator())
+ {
+ return filter_iterator<Predicate,Iterator>(f,x,end);
+ }
+
+ template <class Predicate, class Iterator>
+ filter_iterator<Predicate,Iterator>
+ make_filter_iterator(
+ typename iterators::enable_if<
+ is_class<Predicate>
+ , Iterator
+ >::type x
+ , Iterator end = Iterator()
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ , Predicate* = 0
+#endif
+ )
+ {
+ return filter_iterator<Predicate,Iterator>(x,end);
+ }
+
+} // namespace boost
+
+#endif // BOOST_FILTER_ITERATOR_23022003THW_HPP
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_INDIRECT_ITERATOR_23022003THW_HPP
+#define BOOST_INDIRECT_ITERATOR_23022003THW_HPP
+
+#include <boost/iterator.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+
+#include <boost/pointee.hpp>
+#include <boost/indirect_reference.hpp>
+#include <boost/detail/iterator.hpp>
+
+#include <boost/python/detail/indirect_traits.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/add_reference.hpp>
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/mpl/apply_if.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/aux_/has_xxx.hpp>
+
+#ifdef BOOST_MPL_NO_AUX_HAS_XXX
+# include <boost/shared_ptr.hpp>
+# include <boost/scoped_ptr.hpp>
+# include <boost/mpl/bool.hpp>
+# include <memory>
+#endif
+
+#include <boost/iterator/detail/config_def.hpp> // must be last #include
+
+namespace boost
+{
+ template <class Iter, class Value, class Category, class Reference, class Difference>
+ class indirect_iterator;
+
+ namespace detail
+ {
+ template <class Iter, class Value, class Category, class Reference, class Difference>
+ struct indirect_base
+ {
+ typedef typename iterator_traits<Iter>::value_type dereferenceable;
+
+ typedef iterator_adaptor<
+ indirect_iterator<Iter, Value, Category, Reference, Difference>
+ , Iter
+ , typename ia_dflt_help<
+ Value, pointee<dereferenceable>
+ >::type
+ , Category
+ , typename ia_dflt_help<
+ Reference
+ , mpl::apply_if<
+ is_same<Value,use_default>
+ , indirect_reference<dereferenceable>
+ , add_reference<Value>
+ >
+ >::type
+ , Difference
+ > type;
+ };
+
+ template <>
+ struct indirect_base<int, int, int, int, int> {};
+ } // namespace detail
+
+
+ template <
+ class Iterator
+ , class Value = use_default
+ , class Category = use_default
+ , class Reference = use_default
+ , class Difference = use_default
+ >
+ class indirect_iterator
+ : public detail::indirect_base<
+ Iterator, Value, Category, Reference, Difference
+ >::type
+ {
+ typedef typename detail::indirect_base<
+ Iterator, Value, Category, Reference, Difference
+ >::type super_t;
+
+ friend class iterator_core_access;
+
+ public:
+ indirect_iterator() {}
+
+ indirect_iterator(Iterator iter)
+ : super_t(iter) {}
+
+ template <
+ class Iterator2, class Value2, class Category2
+ , class Reference2, class Difference2
+ >
+ indirect_iterator(
+ indirect_iterator<
+ Iterator2, Value2, Category2, Reference2, Difference2
+ > const& y
+ , typename enable_if_convertible<Iterator2, Iterator>::type* = 0
+ )
+ : super_t(y.base())
+ {}
+
+ private:
+ typename super_t::reference dereference() const
+ {
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+ return const_cast<super_t::reference>(**this->base());
+# else
+ return **this->base();
+# endif
+ }
+ };
+
+ template <class Iter>
+ inline
+ indirect_iterator<Iter> make_indirect_iterator(Iter x)
+ {
+ return indirect_iterator<Iter>(x);
+ }
+
+ template <class Traits, class Iter>
+ inline
+ indirect_iterator<Iter,Traits> make_indirect_iterator(Iter x, Traits* = 0)
+ {
+ return indirect_iterator<Iter, Traits>(x);
+ }
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_INDIRECT_ITERATOR_23022003THW_HPP
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_INTEROPERABLE_23022003THW_HPP
+# define BOOST_INTEROPERABLE_23022003THW_HPP
+
+# include <boost/mpl/bool.hpp>
+# include <boost/mpl/or.hpp>
+
+# include <boost/type_traits/is_convertible.hpp>
+
+# include <boost/iterator/detail/config_def.hpp> // must appear last
+
+namespace boost
+{
+
+ //
+ // Meta function that determines whether two
+ // iterator types are considered interoperable.
+ //
+ // Two iterator types A,B are considered interoperable if either
+ // A is convertible to B or vice versa.
+ // This interoperability definition is in sync with the
+ // standards requirements on constant/mutable container
+ // iterators (23.1 [lib.container.requirements]).
+ //
+ // For compilers that don't support is_convertible
+ // is_interoperable gives false positives. See comments
+ // on operator implementation for consequences.
+ //
+ template <typename A, typename B>
+ struct is_interoperable
+# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
+ : mpl::true_
+# else
+ : mpl::or_<
+ is_convertible< A, B >
+ , is_convertible< B, A > >
+# endif
+ {
+ };
+
+} // namespace boost
+
+# include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_INTEROPERABLE_23022003THW_HPP
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
+#define BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
+
+#include <boost/static_assert.hpp>
+#include <boost/iterator.hpp>
+#include <boost/detail/iterator.hpp>
+
+#include <boost/iterator/iterator_categories.hpp>
+#include <boost/iterator/iterator_facade.hpp>
+#include <boost/iterator/detail/enable_if.hpp>
+
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/or.hpp>
+
+#include <boost/python/detail/is_xxx.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+
+#ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+# include <boost/type_traits/remove_reference.hpp>
+#else
+# include <boost/type_traits/add_reference.hpp>
+#endif
+
+#include <boost/iterator/detail/config_def.hpp>
+
+#include <boost/iterator/iterator_traits.hpp>
+
+namespace boost
+{
+ // Used as a default template argument internally, merely to
+ // indicate "use the default", this can also be passed by users
+ // explicitly in order to specify that the default should be used.
+ struct use_default;
+
+# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ // the incompleteness of use_default causes massive problems for
+ // is_convertible (naturally). This workaround is fortunately not
+ // needed for vc6/vc7.
+ template<class To>
+ struct is_convertible<use_default,To>
+ : mpl::false_ {};
+# endif
+
+ namespace detail
+ {
+
+ //
+ // Result type used in enable_if_convertible meta function.
+ // This can be an incomplete type, as only pointers to
+ // enable_if_convertible< ... >::type are used.
+ // We could have used void for this, but conversion to
+ // void* is just to easy.
+ //
+ struct enable_type;
+ }
+
+
+ //
+ // enable_if for use in adapted iterators constructors.
+ //
+ // In order to provide interoperability between adapted constant and
+ // mutable iterators, adapted iterators will usually provide templated
+ // conversion constructors of the following form
+ //
+ // template <class BaseIterator>
+ // class adapted_iterator :
+ // public iterator_adaptor< adapted_iterator<Iterator>, Iterator >
+ // {
+ // public:
+ //
+ // ...
+ //
+ // template <class OtherIterator>
+ // adapted_iterator(
+ // OtherIterator const& it
+ // , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0);
+ //
+ // ...
+ // };
+ //
+ // enable_if_convertible is used to remove those overloads from the overload
+ // set that cannot be instantiated. For all practical purposes only overloads
+ // for constant/mutable interaction will remain. This has the advantage that
+ // meta functions like boost::is_convertible do not return false positives,
+ // as they can only look at the signature of the conversion constructor
+ // and not at the actual instantiation.
+ //
+ // enable_if_interoperable can be safely used in user code. It falls back to
+ // always enabled for compilers that don't support enable_if or is_convertible.
+ // There is no need for compiler specific workarounds in user code.
+ //
+ // The operators implementation relies on boost::is_convertible not returning
+ // false positives for user/library defined iterator types. See comments
+ // on operator implementation for consequences.
+ //
+# if defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE)
+
+ template <class From, class To>
+ struct enable_if_convertible
+ {
+ typedef detail::enable_type type;
+ };
+
+# elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300
+
+ // For some reason vc7.1 needs us to "cut off" instantiation
+ // of is_convertible in a few cases.
+ template<typename From, typename To>
+ struct enable_if_convertible
+ : iterators::enable_if<
+ mpl::or_<
+ is_same<From,To>
+ , is_convertible<From, To>
+ >
+ , detail::enable_type
+ >
+ {};
+
+# else
+
+ template<typename From, typename To>
+ struct enable_if_convertible
+ : iterators::enable_if<
+ is_convertible<From, To>
+ , detail::enable_type
+ >
+ {};
+
+# endif
+
+ //
+ // Default template argument handling for iterator_adaptor
+ //
+ namespace detail
+ {
+ // If T is use_default, return the result of invoking
+ // DefaultNullaryFn, otherwise return T.
+ template <class T, class DefaultNullaryFn>
+ struct ia_dflt_help
+ : mpl::apply_if<
+ is_same<T, use_default>
+ , DefaultNullaryFn
+ , mpl::identity<T>
+ >
+ {
+ };
+
+ // A metafunction which computes an iterator_adaptor's base class,
+ // a specialization of iterator_facade.
+ template <
+ class Derived
+ , class Base
+ , class Value
+ , class Traversal
+ , class Reference
+ , class Difference
+ >
+ struct iterator_adaptor_base
+ {
+ typedef iterator_facade<
+ Derived
+
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+ , typename detail::ia_dflt_help<
+ Value
+ , mpl::apply_if<
+ is_same<Reference,use_default>
+ , iterator_value<Base>
+ , remove_reference<Reference>
+ >
+ >::type
+# else
+ , typename detail::ia_dflt_help<
+ Value, iterator_value<Base>
+ >::type
+# endif
+
+ , typename detail::ia_dflt_help<
+ Traversal
+ , iterator_traversal<Base>
+ >::type
+
+ , typename detail::ia_dflt_help<
+ Reference
+ , mpl::apply_if<
+ is_same<Value,use_default>
+ , iterator_reference<Base>
+ , add_reference<Value>
+ >
+ >::type
+
+ , typename detail::ia_dflt_help<
+ Difference, iterator_difference<Base>
+ >::type
+ >
+ type;
+ };
+ template <class T> int static_assert_convertible_to(T);
+ }
+
+ //
+ // Iterator Adaptor
+ //
+ // The parameter ordering changed slightly with respect to former
+ // versions of iterator_adaptor The idea is that when the user needs
+ // to fiddle with the reference type it is highly likely that the
+ // iterator category has to be adjusted as well. Any of the
+ // following four template arguments may be ommitted or explicitly
+ // replaced by use_default.
+ //
+ // Value - if supplied, the value_type of the resulting iterator, unless
+ // const. If const, a conforming compiler strips constness for the
+ // value_type. If not supplied, iterator_traits<Base>::value_type is used
+ //
+ // Category - the traversal category of the resulting iterator. If not
+ // supplied, iterator_traversal<Base>::type is used.
+ //
+ // Reference - the reference type of the resulting iterator, and in
+ // particular, the result type of operator*(). If not supplied but
+ // Value is supplied, Value& is used. Otherwise
+ // iterator_traits<Base>::reference is used.
+ //
+ // Difference - the difference_type of the resulting iterator. If not
+ // supplied, iterator_traits<Base>::difference_type is used.
+ //
+ template <
+ class Derived
+ , class Base
+ , class Value = use_default
+ , class Traversal = use_default
+ , class Reference = use_default
+ , class Difference = use_default
+ >
+ class iterator_adaptor
+ : public detail::iterator_adaptor_base<
+ Derived, Base, Value, Traversal, Reference, Difference
+ >::type
+ {
+ friend class iterator_core_access;
+
+ typedef typename detail::iterator_adaptor_base<
+ Derived, Base, Value, Traversal, Reference, Difference
+ >::type super_t;
+
+ public:
+ iterator_adaptor() {}
+
+ explicit iterator_adaptor(Base const &iter)
+ : m_iterator(iter)
+ {
+ }
+
+ Base const& base() const
+ { return m_iterator; }
+
+ protected:
+ //
+ // lvalue access to the Base object for Derived
+ //
+ Base const& base_reference() const
+ { return m_iterator; }
+
+ Base& base_reference()
+ { return m_iterator; }
+
+ private:
+ //
+ // Core iterator interface for iterator_facade. This is private
+ // to prevent temptation for Derived classes to use it, which
+ // will often result in an error. Derived classes should use
+ // base_reference(), above, to get direct access to m_iterator.
+ //
+ typename super_t::reference dereference() const
+ { return *m_iterator; }
+
+ template <
+ class OtherDerived, class OtherIterator, class V, class C, class R, class D
+ >
+ bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const
+ {
+ // Maybe readd with same_distance
+ // BOOST_STATIC_ASSERT(
+ // (detail::same_category_and_difference<Derived,OtherDerived>::value)
+ // );
+ return m_iterator == x.base();
+ }
+
+ typedef typename iterator_category_to_traversal<
+ typename super_t::iterator_category
+ >::type my_traversal;
+
+# define BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(cat) \
+ typedef int assertion[sizeof(detail::static_assert_convertible_to<cat>(my_traversal()))];
+// BOOST_STATIC_ASSERT((is_convertible<my_traversal,cat>::value));
+
+ void advance(typename super_t::difference_type n)
+ {
+ BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(random_access_traversal_tag)
+ m_iterator += n;
+ }
+
+ void increment() { ++m_iterator; }
+
+ void decrement()
+ {
+ BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(bidirectional_traversal_tag)
+ --m_iterator;
+ }
+
+ template <
+ class OtherDerived, class OtherIterator, class V, class C, class R, class D
+ >
+ typename super_t::difference_type distance_to(
+ iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const
+ {
+ BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(random_access_traversal_tag)
+ // Maybe readd with same_distance
+ // BOOST_STATIC_ASSERT(
+ // (detail::same_category_and_difference<Derived,OtherDerived>::value)
+ // );
+ return y.base() - m_iterator;
+ }
+
+# undef BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL
+
+ private: // data members
+ Base m_iterator;
+ };
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
--- /dev/null
+// (C) Copyright Jeremy Siek 2002. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+
+#ifndef BOOST_ITERATOR_CATEGORIES_HPP
+# define BOOST_ITERATOR_CATEGORIES_HPP
+
+# include <boost/config.hpp>
+# include <boost/detail/iterator.hpp>
+# include <boost/iterator/detail/config_def.hpp>
+
+# include <boost/detail/workaround.hpp>
+
+# include <boost/mpl/apply_if.hpp>
+# include <boost/mpl/identity.hpp>
+# include <boost/mpl/placeholders.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
+
+# include <boost/type_traits/is_convertible.hpp>
+
+# include <boost/static_assert.hpp>
+
+namespace boost {
+
+//
+// Traversal Categories
+//
+struct incrementable_traversal_tag {};
+
+struct single_pass_traversal_tag
+ : incrementable_traversal_tag {};
+
+struct forward_traversal_tag
+ : single_pass_traversal_tag {};
+
+struct bidirectional_traversal_tag
+ : forward_traversal_tag {};
+
+struct random_access_traversal_tag
+ : bidirectional_traversal_tag {};
+
+namespace detail
+{
+ //
+ // Convert a "strictly old-style" iterator category to a traversal
+ // tag. This is broken out into a separate metafunction to reduce
+ // the cost of instantiating iterator_category_to_traversal, below,
+ // for new-style types.
+ //
+ template <class Cat>
+ struct old_category_to_traversal
+ : mpl::apply_if<
+ is_convertible<Cat,std::random_access_iterator_tag>
+ , mpl::identity<random_access_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Cat,std::bidirectional_iterator_tag>
+ , mpl::identity<bidirectional_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Cat,std::forward_iterator_tag>
+ , mpl::identity<forward_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Cat,std::input_iterator_tag>
+ , mpl::identity<single_pass_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Cat,std::output_iterator_tag>
+ , mpl::identity<incrementable_traversal_tag>
+ , void
+ >
+ >
+ >
+ >
+ >
+ {};
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ template <>
+ struct old_category_to_traversal<int>
+ {
+ typedef int type;
+ };
+# endif
+
+ template <class Traversal>
+ struct pure_traversal_tag
+ : mpl::apply_if<
+ is_convertible<Traversal,random_access_traversal_tag>
+ , mpl::identity<random_access_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Traversal,bidirectional_traversal_tag>
+ , mpl::identity<bidirectional_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Traversal,forward_traversal_tag>
+ , mpl::identity<forward_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Traversal,single_pass_traversal_tag>
+ , mpl::identity<single_pass_traversal_tag>
+ , mpl::apply_if<
+ is_convertible<Traversal,incrementable_traversal_tag>
+ , mpl::identity<incrementable_traversal_tag>
+ , void
+ >
+ >
+ >
+ >
+ >
+ {
+ };
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ template <>
+ struct pure_traversal_tag<int>
+ {
+ typedef int type;
+ };
+# endif
+
+} // namespace detail
+
+
+//
+// Convert an iterator category into a traversal tag
+//
+template <class Cat>
+struct iterator_category_to_traversal
+ : mpl::apply_if< // if already convertible to a traversal tag, we're done.
+ is_convertible<Cat,incrementable_traversal_tag>
+ , mpl::identity<Cat>
+ , detail::old_category_to_traversal<Cat>
+ >
+{};
+
+// Trait to get an iterator's traversal category
+template <class Iterator = mpl::_1>
+struct iterator_traversal
+ : iterator_category_to_traversal<
+ typename boost::detail::iterator_traits<Iterator>::iterator_category
+ >
+{};
+
+# ifdef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
+// Hack because BOOST_MPL_AUX_LAMBDA_SUPPORT doesn't seem to work
+// out well. Instantiating the nested apply template also
+// requires instantiating iterator_traits on the
+// placeholder. Instead we just specialize it as a metafunction
+// class.
+template <>
+struct iterator_traversal<mpl::_1>
+{
+ template <class T>
+ struct apply : iterator_traversal<T>
+ {};
+};
+template <>
+struct iterator_traversal<mpl::_>
+ : iterator_traversal<mpl::_1>
+{};
+# endif
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ITERATOR_CATEGORIES_HPP
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_ITERATOR_FACADE_23022003THW_HPP
+#define BOOST_ITERATOR_FACADE_23022003THW_HPP
+
+#include <boost/static_assert.hpp>
+
+#include <boost/iterator.hpp>
+#include <boost/iterator/interoperable.hpp>
+#include <boost/iterator/iterator_traits.hpp>
+
+#include <boost/iterator/detail/facade_iterator_category.hpp>
+#include <boost/iterator/detail/enable_if.hpp>
+
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_pointer.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_pod.hpp>
+
+#include <boost/mpl/apply_if.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/apply.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+# include <boost/mpl/if.hpp>
+#endif
+
+#include <boost/iterator/detail/config_def.hpp> // this goes last
+
+namespace boost
+{
+ // This forward declaration is required for the friend declaration
+ // in iterator_core_access
+ template <class I, class V, class TC, class R, class D> class iterator_facade;
+
+ namespace detail
+ {
+ // A binary metafunction class that always returns bool. VC6
+ // ICEs on mpl::always<bool>, probably because of the default
+ // parameters.
+ struct always_bool2
+ {
+ template <class T, class U>
+ struct apply
+ {
+ typedef bool type;
+ };
+ };
+
+ //
+ // enable if for use in operator implementation.
+ //
+ template <
+ class Facade1
+ , class Facade2
+ , class Return
+ >
+ struct enable_if_interoperable
+ : ::boost::iterators::enable_if<
+ mpl::or_<
+ is_convertible<Facade1, Facade2>
+ , is_convertible<Facade2, Facade1>
+ >
+ , Return
+ >
+ {
+ };
+
+ //
+ // Generates associated types for an iterator_facade with the
+ // given parameters.
+ //
+ template <
+ class ValueParam
+ , class CategoryOrTraversal
+ , class Reference
+ , class Difference
+ >
+ struct iterator_facade_types
+ {
+ typedef typename facade_iterator_category<
+ CategoryOrTraversal, ValueParam, Reference
+ >::type iterator_category;
+
+ typedef typename remove_const<ValueParam>::type value_type;
+
+ typedef typename mpl::apply_if<
+ detail::iterator_writability_disabled<ValueParam,Reference>
+ , add_pointer<typename add_const<value_type>::type>
+ , add_pointer<value_type>
+ >::type pointer;
+
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && (BOOST_WORKAROUND(_STLPORT_VERSION, BOOST_TESTED_AT(0x452)) \
+ || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(310))) \
+ || BOOST_WORKAROUND(BOOST_RWSTD_VER, BOOST_TESTED_AT(0x20101)) \
+ || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 310)
+
+ // To interoperate with some broken library/compiler
+ // combinations, user-defined iterators must be derived from
+ // std::iterator. It is possible to implement a standard
+ // library for broken compilers without this limitation.
+# define BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE 1
+
+ typedef
+ iterator<iterator_category, value_type, Difference, pointer, Reference>
+ base;
+# endif
+ };
+
+
+ // operator->() needs special support for input iterators to strictly meet the
+ // standard's requirements. If *i is not a reference type, we must still
+ // produce a (constant) lvalue to which a pointer can be formed. We do that by
+ // returning an instantiation of this special proxy class template.
+
+ template <class T>
+ struct operator_arrow_proxy
+ {
+ operator_arrow_proxy(T const* px) : m_value(*px) {}
+ const T* operator->() const { return &m_value; }
+ // This function is needed for MWCW and BCC, which won't call operator->
+ // again automatically per 13.3.1.2 para 8
+ operator const T*() const { return &m_value; }
+ T m_value;
+ };
+
+ // A metafunction that gets the result type for operator->. Also
+ // has a static function make() which builds the result from a
+ // Reference
+ template <class Value, class Reference, class Pointer>
+ struct operator_arrow_result
+ {
+ // CWPro8.3 won't accept "operator_arrow_result::type", and we
+ // need that type below, so metafunction forwarding would be a
+ // losing proposition here.
+ typedef typename mpl::if_<
+ is_reference<Reference>
+ , Pointer
+ , operator_arrow_proxy<Value>
+ >::type type;
+
+ static type make(Reference x)
+ {
+ return type(&x);
+ }
+ };
+
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+ // Deal with ETI
+ template<>
+ struct operator_arrow_result<int, int, int>
+ {
+ typedef int type;
+ };
+# endif
+
+ //
+ // Iterator is actually an iterator_facade, so we do not have to
+ // go through iterator_traits to access the traits.
+ //
+ template <class Iterator>
+ class operator_brackets_proxy
+ {
+ typedef typename Iterator::reference reference;
+ typedef typename Iterator::value_type value_type;
+
+ public:
+ operator_brackets_proxy(Iterator const& iter)
+ : m_iter(iter)
+ {}
+
+ operator reference() const
+ {
+ return *m_iter;
+ }
+
+ operator_brackets_proxy& operator=(value_type const& val)
+ {
+ *m_iter = val;
+ return *this;
+ }
+
+ private:
+ Iterator m_iter;
+ };
+
+ template <class Value, class Reference>
+ struct use_operator_brackets_proxy
+ : mpl::and_<
+ // Really we want an is_copy_constructible trait here,
+ // but is_POD will have to suffice in the meantime.
+ boost::is_POD<Value>
+ , iterator_writability_disabled<Value,Reference>
+ >
+ {};
+
+ template <class Iterator, class Value, class Reference>
+ struct operator_brackets_result
+ {
+ typedef typename mpl::if_<
+ use_operator_brackets_proxy<Value,Reference>
+ , Value
+ , operator_brackets_proxy<Iterator>
+ >::type type;
+ };
+
+ template <class Iterator>
+ operator_brackets_proxy<Iterator> make_operator_brackets_result(Iterator const& iter, mpl::false_)
+ {
+ return operator_brackets_proxy<Iterator>(iter);
+ }
+
+ template <class Iterator>
+ typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::true_)
+ {
+ return *iter;
+ }
+
+ struct choose_difference_type
+ {
+ template <class I1, class I2>
+ struct apply
+ :
+# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP
+ iterator_difference<I1>
+# elif BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ mpl::if_<
+ is_convertible<I2,I1>
+ , typename I1::difference_type
+ , typename I2::difference_type
+ >
+# else
+ mpl::apply_if<
+ is_convertible<I2,I1>
+ , iterator_difference<I1>
+ , iterator_difference<I2>
+ >
+# endif
+ {};
+
+ };
+ } // namespace detail
+
+
+ // Macros which describe the declarations of binary operators
+# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
+# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
+ template < \
+ class Derived1, class V1, class TC1, class R1, class D1 \
+ , class Derived2, class V2, class TC2, class R2, class D2 \
+ > \
+ prefix typename mpl::apply2<result_type,Derived1,Derived2>::type \
+ operator op( \
+ iterator_facade<Derived1, V1, TC1, R1, D1> const& lhs \
+ , iterator_facade<Derived2, V2, TC2, R2, D2> const& rhs)
+# else
+# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
+ template < \
+ class Derived1, class V1, class TC1, class R1, class D1 \
+ , class Derived2, class V2, class TC2, class R2, class D2 \
+ > \
+ prefix typename detail::enable_if_interoperable< \
+ Derived1, Derived2 \
+ , typename mpl::apply2<result_type,Derived1,Derived2>::type \
+ >::type \
+ operator op( \
+ iterator_facade<Derived1, V1, TC1, R1, D1> const& lhs \
+ , iterator_facade<Derived2, V2, TC2, R2, D2> const& rhs)
+# endif
+
+# define BOOST_ITERATOR_FACADE_PLUS_HEAD(prefix,args) \
+ template <class Derived, class V, class TC, class R, class D> \
+ prefix Derived operator+ args
+
+ //
+ // Helper class for granting access to the iterator core interface.
+ //
+ // The simple core interface is used by iterator_facade. The core
+ // interface of a user/library defined iterator type should not be made public
+ // so that it does not clutter the public interface. Instead iterator_core_access
+ // should be made friend so that iterator_facade can access the core
+ // interface through iterator_core_access.
+ //
+ class iterator_core_access
+ {
+# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+ // Tasteless as this may seem, making all members public allows member templates
+ // to work in the absence of member template friends.
+ public:
+# else
+
+ template <class I, class V, class TC, class R, class D> friend class iterator_facade;
+
+# define BOOST_ITERATOR_FACADE_RELATION(op) \
+ BOOST_ITERATOR_FACADE_INTEROP_HEAD(friend,op, detail::always_bool2);
+
+ BOOST_ITERATOR_FACADE_RELATION(==)
+ BOOST_ITERATOR_FACADE_RELATION(!=)
+
+ BOOST_ITERATOR_FACADE_RELATION(<)
+ BOOST_ITERATOR_FACADE_RELATION(>)
+ BOOST_ITERATOR_FACADE_RELATION(<=)
+ BOOST_ITERATOR_FACADE_RELATION(>=)
+# undef BOOST_ITERATOR_FACADE_RELATION
+
+ BOOST_ITERATOR_FACADE_INTEROP_HEAD(
+ friend, -, detail::choose_difference_type)
+ ;
+
+ BOOST_ITERATOR_FACADE_PLUS_HEAD(
+ friend
+ , (iterator_facade<Derived, V, TC, R, D> const&
+ , typename Derived::difference_type)
+ )
+ ;
+
+ BOOST_ITERATOR_FACADE_PLUS_HEAD(
+ friend
+ , (typename Derived::difference_type
+ , iterator_facade<Derived, V, TC, R, D> const&)
+ )
+ ;
+
+# endif
+
+ template <class Facade>
+ static typename Facade::reference dereference(Facade const& f)
+ {
+ return f.dereference();
+ }
+
+ template <class Facade>
+ static void increment(Facade& f)
+ {
+ f.increment();
+ }
+
+ template <class Facade>
+ static void decrement(Facade& f)
+ {
+ f.decrement();
+ }
+
+ template <class Facade1, class Facade2>
+ static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::true_)
+ {
+ return f1.equal(f2);
+ }
+
+ template <class Facade1, class Facade2>
+ static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::false_)
+ {
+ return f2.equal(f1);
+ }
+
+ template <class Facade>
+ static void advance(Facade& f, typename Facade::difference_type n)
+ {
+ f.advance(n);
+ }
+
+ template <class Facade1, class Facade2>
+ static typename Facade1::difference_type distance_from(
+ Facade1 const& f1, Facade2 const& f2, mpl::true_)
+ {
+ return -f1.distance_to(f2);
+ }
+
+ template <class Facade1, class Facade2>
+ static typename Facade2::difference_type distance_from(
+ Facade1 const& f1, Facade2 const& f2, mpl::false_)
+ {
+ return f2.distance_to(f1);
+ }
+
+ private:
+ // objects of this class are useless
+ iterator_core_access(); //undefined
+ };
+
+ //
+ // iterator_facade - use as a public base class for defining new
+ // standard-conforming iterators.
+ //
+ template <
+ class Derived // The derived iterator type being constructed
+ , class Value
+ , class CategoryOrTraversal
+ , class Reference = Value&
+ , class Difference = std::ptrdiff_t
+ >
+ class iterator_facade
+# ifdef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
+ : public detail::iterator_facade_types<
+ Value, CategoryOrTraversal, Reference, Difference
+ >::base
+# undef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
+# endif
+ {
+ private:
+ //
+ // Curiously Recurring Template interface.
+ //
+ typedef Derived derived_t;
+
+ Derived& derived()
+ {
+ return static_cast<Derived&>(*this);
+ }
+
+ Derived const& derived() const
+ {
+ return static_cast<Derived const&>(*this);
+ }
+
+ typedef detail::iterator_facade_types<
+ Value, CategoryOrTraversal, Reference, Difference
+ > associated_types;
+
+ public:
+
+ typedef typename associated_types::value_type value_type;
+ typedef Reference reference;
+ typedef Difference difference_type;
+ typedef typename associated_types::pointer pointer;
+ typedef typename associated_types::iterator_category iterator_category;
+
+ reference operator*() const
+ {
+ return iterator_core_access::dereference(this->derived());
+ }
+
+ typename detail::operator_arrow_result<
+ value_type
+ , reference
+ , pointer
+ >::type
+ operator->() const
+ {
+ return detail::operator_arrow_result<
+ value_type
+ , reference
+ , pointer
+ >::make(*this->derived());
+ }
+
+ typename detail::operator_brackets_result<Derived,Value,Reference>::type
+ operator[](difference_type n) const
+ {
+ typedef detail::use_operator_brackets_proxy<Value,Reference> use_proxy;
+
+ return detail::make_operator_brackets_result<Derived>(
+ this->derived() + n
+ , use_proxy()
+ );
+ }
+
+ Derived& operator++()
+ {
+ iterator_core_access::increment(this->derived());
+ return this->derived();
+ }
+
+ Derived operator++(int)
+ {
+ Derived tmp(this->derived());
+ ++*this;
+ return tmp;
+ }
+
+ Derived& operator--()
+ {
+ iterator_core_access::decrement(this->derived());
+ return this->derived();
+ }
+
+ Derived operator--(int)
+ {
+ Derived tmp(this->derived());
+ --*this;
+ return tmp;
+ }
+
+ Derived& operator+=(difference_type n)
+ {
+ iterator_core_access::advance(this->derived(), n);
+ return this->derived();
+ }
+
+ Derived& operator-=(difference_type n)
+ {
+ iterator_core_access::advance(this->derived(), -n);
+ return this->derived();
+ }
+
+ Derived operator-(difference_type x) const
+ {
+ Derived result(this->derived());
+ return result -= x;
+ }
+
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+ // There appears to be a bug which trashes the data of classes
+ // derived from iterator_facade when they are assigned unless we
+ // define this assignment operator. This bug is only revealed
+ // (so far) in STLPort debug mode, but it's clearly a codegen
+ // problem so we apply the workaround for all MSVC6.
+ iterator_facade& operator=(iterator_facade const&)
+ {
+ return *this;
+ }
+# endif
+ };
+
+ //
+ // Operator implementation. The library supplied operators
+ // enables the user to provide fully interoperable constant/mutable
+ // iterator types. I.e. the library provides all operators
+ // for all mutable/constant iterator combinations.
+ //
+ // Note though that this kind of interoperability for constant/mutable
+ // iterators is not required by the standard for container iterators.
+ // All the standard asks for is a conversion mutable -> constant.
+ // Most standard library implementations nowadays provide fully interoperable
+ // iterator implementations, but there are still heavily used implementations
+ // that do not provide them. (Actually it's even worse, they do not provide
+ // them for only a few iterators.)
+ //
+ // ?? Maybe a BOOST_ITERATOR_NO_FULL_INTEROPERABILITY macro should
+ // enable the user to turn off mixed type operators
+ //
+ // The library takes care to provide only the right operator overloads.
+ // I.e.
+ //
+ // bool operator==(Iterator, Iterator);
+ // bool operator==(ConstIterator, Iterator);
+ // bool operator==(Iterator, ConstIterator);
+ // bool operator==(ConstIterator, ConstIterator);
+ //
+ // ...
+ //
+ // In order to do so it uses c++ idioms that are not yet widely supported
+ // by current compiler releases. The library is designed to degrade gracefully
+ // in the face of compiler deficiencies. In general compiler
+ // deficiencies result in less strict error checking and more obscure
+ // error messages, functionality is not affected.
+ //
+ // For full operation compiler support for "Substitution Failure Is Not An Error"
+ // (aka. enable_if) and boost::is_convertible is required.
+ //
+ // The following problems occur if support is lacking.
+ //
+ // Pseudo code
+ //
+ // ---------------
+ // AdaptorA<Iterator1> a1;
+ // AdaptorA<Iterator2> a2;
+ //
+ // // This will result in a no such overload error in full operation
+ // // If enable_if or is_convertible is not supported
+ // // The instantiation will fail with an error hopefully indicating that
+ // // there is no operator== for Iterator1, Iterator2
+ // // The same will happen if no enable_if is used to remove
+ // // false overloads from the templated conversion constructor
+ // // of AdaptorA.
+ //
+ // a1 == a2;
+ // ----------------
+ //
+ // AdaptorA<Iterator> a;
+ // AdaptorB<Iterator> b;
+ //
+ // // This will result in a no such overload error in full operation
+ // // If enable_if is not supported the static assert used
+ // // in the operator implementation will fail.
+ // // This will accidently work if is_convertible is not supported.
+ //
+ // a == b;
+ // ----------------
+ //
+
+# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP
+# define BOOST_ITERATOR_CONVERTIBLE(a,b) mpl::true_()
+# else
+# define BOOST_ITERATOR_CONVERTIBLE(a,b) is_convertible<a,b>()
+# endif
+
+# define BOOST_ITERATOR_FACADE_INTEROP(op, result_type, return_prefix, base_op) \
+ BOOST_ITERATOR_FACADE_INTEROP_HEAD(inline, op, result_type) \
+ { \
+ /* For those compilers that do not support enable_if */ \
+ BOOST_STATIC_ASSERT(( \
+ is_interoperable< Derived1, Derived2 >::value \
+ )); \
+ return_prefix iterator_core_access::base_op( \
+ static_cast<Derived1 const&>(lhs) \
+ , static_cast<Derived2 const&>(rhs) \
+ , BOOST_ITERATOR_CONVERTIBLE(Derived2,Derived1) \
+ ); \
+ }
+
+# define BOOST_ITERATOR_FACADE_RELATION(op, return_prefix, base_op) \
+ BOOST_ITERATOR_FACADE_INTEROP( \
+ op \
+ , detail::always_bool2 \
+ , return_prefix \
+ , base_op \
+ )
+
+ BOOST_ITERATOR_FACADE_RELATION(==, return, equal)
+ BOOST_ITERATOR_FACADE_RELATION(!=, return !, equal)
+
+ BOOST_ITERATOR_FACADE_RELATION(<, return 0 >, distance_from)
+ BOOST_ITERATOR_FACADE_RELATION(>, return 0 <, distance_from)
+ BOOST_ITERATOR_FACADE_RELATION(<=, return 0 >=, distance_from)
+ BOOST_ITERATOR_FACADE_RELATION(>=, return 0 <=, distance_from)
+# undef BOOST_ITERATOR_FACADE_RELATION
+
+ // operator- requires an additional part in the static assertion
+ BOOST_ITERATOR_FACADE_INTEROP(
+ -
+ , detail::choose_difference_type
+ , return
+ , distance_from
+ )
+# undef BOOST_ITERATOR_FACADE_INTEROP
+# undef BOOST_ITERATOR_FACADE_INTEROP_HEAD
+
+# define BOOST_ITERATOR_FACADE_PLUS(args) \
+ BOOST_ITERATOR_FACADE_PLUS_HEAD(inline, args) \
+ { \
+ Derived tmp(static_cast<Derived const&>(i)); \
+ return tmp += n; \
+ }
+
+BOOST_ITERATOR_FACADE_PLUS((
+ iterator_facade<Derived, V, TC, R, D> const& i
+ , typename Derived::difference_type n
+))
+
+BOOST_ITERATOR_FACADE_PLUS((
+ typename Derived::difference_type n
+ , iterator_facade<Derived, V, TC, R, D> const& i
+))
+# undef BOOST_ITERATOR_FACADE_PLUS
+# undef BOOST_ITERATOR_FACADE_PLUS_HEAD
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ITERATOR_FACADE_23022003THW_HPP
--- /dev/null
+// Copyright David Abrahams 2003. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef ITERATOR_TRAITS_DWA200347_HPP
+# define ITERATOR_TRAITS_DWA200347_HPP
+
+# include <boost/detail/iterator.hpp>
+# include <boost/detail/workaround.hpp>
+
+namespace boost {
+
+// Unfortunately, g++ 2.95.x chokes when we define a class template
+// iterator_category which has the same name as its
+// std::iterator_category() function, probably due in part to the
+// "std:: is visible globally" hack it uses. Use
+// BOOST_ITERATOR_CATEGORY to write code that's portable to older
+// GCCs.
+
+# if BOOST_WORKAROUND(__GNUC__, <= 2)
+# define BOOST_ITERATOR_CATEGORY iterator_category_
+# else
+# define BOOST_ITERATOR_CATEGORY iterator_category
+# endif
+
+
+template <class Iterator>
+struct iterator_value
+{
+ typedef typename detail::iterator_traits<Iterator>::value_type type;
+};
+
+template <class Iterator>
+struct iterator_reference
+{
+ typedef typename detail::iterator_traits<Iterator>::reference type;
+};
+
+
+template <class Iterator>
+struct iterator_pointer
+{
+ typedef typename detail::iterator_traits<Iterator>::pointer type;
+};
+
+template <class Iterator>
+struct iterator_difference
+{
+ typedef typename detail::iterator_traits<Iterator>::difference_type type;
+};
+
+template <class Iterator>
+struct BOOST_ITERATOR_CATEGORY
+{
+ typedef typename detail::iterator_traits<Iterator>::iterator_category type;
+};
+
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+template <>
+struct iterator_value<int>
+{
+ typedef void type;
+};
+
+template <>
+struct iterator_reference<int>
+{
+ typedef void type;
+};
+
+template <>
+struct iterator_pointer<int>
+{
+ typedef void type;
+};
+
+template <>
+struct iterator_difference<int>
+{
+ typedef void type;
+};
+
+template <>
+struct BOOST_ITERATOR_CATEGORY<int>
+{
+ typedef void type;
+};
+# endif
+
+} // namespace boost::iterator
+
+#endif // ITERATOR_TRAITS_DWA200347_HPP
--- /dev/null
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
+#define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
+
+#include <boost/function.hpp>
+#include <boost/iterator.hpp>
+#include <boost/iterator/detail/enable_if.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/iterator/iterator_categories.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/function_traits.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include <boost/type_traits/is_function.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
+# include <boost/type_traits/is_base_and_derived.hpp>
+
+#endif
+#include <boost/iterator/detail/config_def.hpp>
+
+
+namespace boost
+{
+ template <class UnaryFunction, class Iterator, class Reference = use_default, class Value = use_default>
+ class transform_iterator;
+
+ namespace detail
+ {
+
+ template <class UnaryFunction>
+ struct function_object_result
+ {
+ typedef typename UnaryFunction::result_type type;
+ };
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template <class Return, class Argument>
+ struct function_object_result<Return(*)(Argument)>
+ {
+ typedef Return type;
+ };
+#endif
+
+ // Compute the iterator_adaptor instantiation to be used for transform_iterator
+ template <class UnaryFunction, class Iterator, class Reference, class Value>
+ struct transform_iterator_base
+ {
+ private:
+ // By default, dereferencing the iterator yields the same as
+ // the function. Do we need to adjust the way
+ // function_object_result is computed for the standard
+ // proposal (e.g. using Doug's result_of)?
+ typedef typename ia_dflt_help<
+ Reference
+ , function_object_result<UnaryFunction>
+ >::type reference;
+
+ // To get the default for Value: remove any reference on the
+ // result type, but retain any constness to signal
+ // non-writability. Note that if we adopt Thomas' suggestion
+ // to key non-writability *only* on the Reference argument,
+ // we'd need to strip constness here as well.
+ typedef typename ia_dflt_help<
+ Value
+ , remove_reference<reference>
+ >::type cv_value_type;
+
+ public:
+ typedef iterator_adaptor<
+ transform_iterator<UnaryFunction, Iterator, Reference, Value>
+ , Iterator
+ , cv_value_type
+ , use_default // Leave the traversal category alone
+ , reference
+ > type;
+ };
+ }
+
+ template <class UnaryFunction, class Iterator, class Reference, class Value>
+ class transform_iterator
+ : public detail::transform_iterator_base<UnaryFunction, Iterator, Reference, Value>::type
+ {
+ typedef typename
+ detail::transform_iterator_base<UnaryFunction, Iterator, Reference, Value>::type
+ super_t;
+
+ friend class iterator_core_access;
+
+ public:
+ transform_iterator() { }
+
+ transform_iterator(Iterator const& x, UnaryFunction f)
+ : super_t(x), m_f(f) { }
+
+ explicit transform_iterator(Iterator const& x)
+ : super_t(x)
+ {
+ // Pro8 is a little too aggressive about instantiating the
+ // body of this function.
+#if !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ // don't provide this constructor if UnaryFunction is a
+ // function pointer type, since it will be 0. Too dangerous.
+ BOOST_STATIC_ASSERT(is_class<UnaryFunction>::value);
+#endif
+ }
+
+ template<
+ class OtherUnaryFunction
+ , class OtherIterator
+ , class OtherReference
+ , class OtherValue>
+ transform_iterator(
+ transform_iterator<OtherUnaryFunction, OtherIterator, OtherReference, OtherValue> const& t
+ , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
+ , typename enable_if_convertible<OtherUnaryFunction, UnaryFunction>::type* = 0
+#endif
+ )
+ : super_t(t.base()), m_f(t.functor())
+ {}
+
+ UnaryFunction functor() const
+ { return m_f; }
+
+ private:
+ typename super_t::reference dereference() const
+ { return m_f(*this->base()); }
+
+ // Probably should be the initial base class so it can be
+ // optimized away via EBO if it is an empty class.
+ UnaryFunction m_f;
+ };
+
+ template <class UnaryFunction, class Iterator>
+ transform_iterator<UnaryFunction, Iterator>
+ make_transform_iterator(Iterator it, UnaryFunction fun)
+ {
+ return transform_iterator<UnaryFunction, Iterator>(it, fun);
+ }
+
+ // Version which allows explicit specification of the UnaryFunction
+ // type.
+ //
+ // This generator is not provided if UnaryFunction is a function
+ // pointer type, because it's too dangerous: the default-constructed
+ // function pointer in the iterator be 0, leading to a runtime
+ // crash.
+ template <class UnaryFunction, class Iterator>
+ typename iterators::enable_if<
+ is_class<UnaryFunction> // We should probably find a cheaper test than is_class<>
+ , transform_iterator<UnaryFunction, Iterator>
+ >::type
+ make_transform_iterator(Iterator it)
+ {
+ return transform_iterator<UnaryFunction, Iterator>(it, UnaryFunction());
+ }
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+ template <class Return, class Argument, class Iterator>
+ transform_iterator< Return (*)(Argument), Iterator, Return>
+ make_transform_iterator(Iterator it, Return (*fun)(Argument))
+ {
+ return transform_iterator<Return (*)(Argument), Iterator, Return>(it, fun);
+ }
+#endif
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
-// (C) Copyright David Abrahams 2000. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
-//
-// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// Permission to copy, use, modify,
// sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
-// See http://www.boost.org/libs/utility/iterator_adaptors.htm for documentation.
-
-// Revision History:
-
-// 01 Feb 2002 Jeremy Siek
-// Added more comments in default_iterator_policies.
-// 08 Jan 2001 David Abrahams
-// Moved concept checks into a separate class, which makes MSVC
-// better at dealing with them.
-// 07 Jan 2001 David Abrahams
-// Choose proxy for operator->() only if the reference type is not a reference.
-// Updated workarounds for __MWERKS__ == 0x2406
-// 20 Dec 2001 David Abrahams
-// Adjusted is_convertible workarounds for __MWERKS__ == 0x2406
-// 03 Nov 2001 Jeremy Siek
-// Changed the named template parameter interface and internal.
-// 04 Oct 2001 Jeremy Siek
-// Changed projection_iterator to not rely on the default reference,
-// working around a limitation of detail::iterator_traits.
-// 04 Oct 2001 David Abrahams
-// Applied indirect_iterator patch from George A. Heintzelman <georgeh@aya.yale.edu>
-// Changed name of "bind" to "select" to avoid problems with MSVC.
-// 26 Sep 2001 David Abrahams
-// Added borland bug fix
-// 08 Mar 2001 Jeremy Siek
-// Added support for optional named template parameters.
-// 19 Feb 2001 David Abrahams
-// Rolled back reverse_iterator_pair_generator again, as it doesn't
-// save typing on a conforming compiler.
-// 18 Feb 2001 David Abrahams
-// Reinstated reverse_iterator_pair_generator
-// 16 Feb 2001 David Abrahams
-// Add an implicit conversion operator to operator_arrow_proxy
-// as CW and BCC workarounds.
-// 11 Feb 2001 David Abrahams
-// Switch to use of BOOST_STATIC_CONSTANT where possible
-// 11 Feb 2001 Jeremy Siek
-// Removed workaround for older MIPSpro compiler. The workaround
-// was preventing the proper functionality of the underlying
-// iterator being carried forward into the iterator adaptor.
-// Also added is_bidirectional enum to avoid EDG compiler error.
-// 11 Feb 2001 David Abrahams
-// Borland fixes up the wazoo. It finally works!
-// 10 Feb 2001 David Abrahams
-// Removed traits argument from iterator_adaptor<> and switched to
-// explicit trait specification for maximum ease-of-use.
-// Added comments to detail::iterator_defaults<>
-// Began using detail::iterator_defaults<> unconditionally for code clarity
-// Changed uses of `Iterator' to `Base' where non-iterators can be used.
-//
-// 10 Feb 2001 David Abrahams
-// Rolled in supposed Borland fixes from John Maddock, but not seeing any
-// improvement yet
-// Changed argument order to indirect_ generator, for convenience in the
-// case of input iterators (where Reference must be a value type).
-// Removed derivation of filter_iterator_policies from
-// default_iterator_policies, since the iterator category is likely to be
-// reduced (we don't want to allow illegal operations like decrement).
-// Support for a simpler filter iterator interface.
-//
-// 09 Feb 2001 David Abrahams
-// Improved interface to indirect_ and reverse_ iterators
-// Rolled back Jeremy's new constructor for now; it was causing
-// problems with counting_iterator_test
-// Attempted fix for Borland
-//
-// 09 Feb 2001 Jeremy Siek
-// Added iterator constructor to allow const adaptor
-// from non-const adaptee.
-// Changed make_xxx to pass iterators by-value to
-// get arrays converted to pointers.
-// Removed InnerIterator template parameter from
-// indirect_iterator_generator.
-// Rearranged parameters for make_filter_iterator
-//
-// 07 Feb 2001 Jeremy Siek
-// Removed some const iterator adaptor generators.
-// Added make_xxx_iterator() helper functions for remaining
-// iterator adaptors.
-// Removed some traits template parameters where they
-// where no longer needed thanks to detail::iterator_traits.
-// Moved some of the compile-time logic into enums for
-// EDG compatibility.
-//
-// 07 Feb 2001 David Abrahams
-// Removed iterator_adaptor_pair_generator and
-// reverse_iterator_pair_generator (more such culling to come)
-// Improved comments
-// Changed all uses of std::iterator_traits as default arguments
-// to boost::detail::iterator_traits for improved utility in
-// non-generic contexts
-// Fixed naming convention of non-template parameter names
-//
-// 06 Feb 2001 David Abrahams
-// Produce operator-> proxy objects for InputIterators
-// Added static assertions to do some basic concept checks
-// Renamed single-type generators -> xxx_generator
-// Renamed const/nonconst iterator generators -> xxx_pair_generator
-// Added make_transform_iterator(iter, function)
-// The existence of boost::detail::iterator_traits allowed many
-// template arguments to be defaulted. Some arguments had to be
-// moved to accomplish it.
-//
-// 04 Feb 2001 MWERKS bug workaround, concept checking for proper
-// reference types (David Abrahams)
-
-#ifndef BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_
-# define BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_
-
-# include <boost/iterator.hpp>
-# include <boost/utility.hpp>
-# include <boost/compressed_pair.hpp>
-# include <boost/concept_check.hpp>
-# include <boost/type.hpp>
-# include <boost/static_assert.hpp>
-# include <boost/type_traits.hpp>
-# include <boost/type_traits/conversion_traits.hpp>
-# include <boost/detail/iterator.hpp>
-# include <boost/detail/select_type.hpp>
-# include <boost/detail/workaround.hpp>
-
-# if BOOST_WORKAROUND(__GNUC__, == 2) && __GNUC_MINOR__ <= 96 && !defined(__STL_USE_NAMESPACES)
-# define BOOST_RELOPS_AMBIGUITY_BUG 1
-# endif
-
-namespace boost {
-
-//============================================================================
-// Concept checking classes that express the requirements for iterator
-// policies and adapted types. These classes are mostly for
-// documentation purposes, and are not used in this header file. They
-// merely provide a more succinct statement of what is expected of the
-// iterator policies.
-
-template <class Policies, class Adapted, class Traits>
-struct TrivialIteratorPoliciesConcept
-{
- typedef typename Traits::reference reference;
- void constraints() {
- function_requires< AssignableConcept<Policies> >();
- function_requires< DefaultConstructibleConcept<Policies> >();
- function_requires< AssignableConcept<Adapted> >();
- function_requires< DefaultConstructibleConcept<Adapted> >();
-
- const_constraints();
- }
- void const_constraints() const {
- reference r = p.dereference(x);
- b = p.equal(x, x);
- ignore_unused_variable_warning(r);
- }
- Policies p;
- Adapted x;
- mutable bool b;
-};
-
-// Add InputIteratorPoliciesConcept?
-
-template <class Policies, class Adapted, class Traits>
-struct ForwardIteratorPoliciesConcept
-{
- typedef typename Traits::iterator_category iterator_category;
- void constraints() {
- function_requires<
- TrivialIteratorPoliciesConcept<Policies, Adapted, Traits>
- >();
-
- p.increment(x);
- std::forward_iterator_tag t = iterator_category();
- ignore_unused_variable_warning(t);
- }
- Policies p;
- Adapted x;
- iterator_category category;
-};
-
-template <class Policies, class Adapted, class Traits>
-struct BidirectionalIteratorPoliciesConcept
-{
- typedef typename Traits::iterator_category iterator_category;
- void constraints() {
- function_requires<
- ForwardIteratorPoliciesConcept<Policies, Adapted, Traits>
- >();
-
- p.decrement(x);
- std::bidirectional_iterator_tag t = iterator_category();
- ignore_unused_variable_warning(t);
- }
- Policies p;
- Adapted x;
-};
-
-template <class Policies, class Adapted, class Traits>
-struct RandomAccessIteratorPoliciesConcept
-{
- typedef typename Traits::difference_type DifferenceType;
- typedef typename Traits::iterator_category iterator_category;
- void constraints() {
- function_requires<
- BidirectionalIteratorPoliciesConcept<Policies, Adapted, Traits>
- >();
-
- p.advance(x, n);
- std::random_access_iterator_tag t = iterator_category();
- const_constraints();
- ignore_unused_variable_warning(t);
- }
- void const_constraints() const {
- n = p.distance(x, x);
- }
- Policies p;
- Adapted x;
- mutable DifferenceType n;
- mutable bool b;
-};
-
-
-//============================================================================
-// Default policies for iterator adaptors. You can use this as a base
-// class if you want to customize particular policies.
-struct default_iterator_policies
-{
- // Some of the member functions were defined static, but Borland
- // got confused and thought they were non-const. Also, Sun C++
- // does not like static function templates.
- //
- // The reason some members were defined static is because there is
- // not state (data members) needed by those members of the
- // default_iterator_policies class. If your policies class member
- // functions need to access state stored in the policies object,
- // then the member functions should not be static (they can't be).
-
- template <class Base>
- void initialize(Base&)
- { }
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
- { return *x.base(); }
-
- template <class IteratorAdaptor>
- void increment(IteratorAdaptor& x)
- { ++x.base(); }
-
- template <class IteratorAdaptor>
- void decrement(IteratorAdaptor& x)
- { --x.base(); }
-
- template <class IteratorAdaptor, class DifferenceType>
- void advance(IteratorAdaptor& x, DifferenceType n)
- { x.base() += n; }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- typename IteratorAdaptor1::difference_type
- distance(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return y.base() - x.base(); }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return x.base() == y.base(); }
-};
-
-// putting the comparisons in a base class avoids the g++
-// ambiguous overload bug due to the relops operators
-
-#ifdef BOOST_RELOPS_AMBIGUITY_BUG
-template <class Derived, class Base>
-struct iterator_comparisons : Base { };
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator==(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().equal(x, y);
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator!=(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return !x.policies().equal(x, y);
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator<(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) < 0;
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator>(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) > 0;
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator>=(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) >= 0;
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator<=(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) <= 0;
-}
-#endif
-
-namespace detail {
-
- // operator->() needs special support for input iterators to strictly meet the
- // standard's requirements. If *i is not a reference type, we must still
- // produce a (constant) lvalue to which a pointer can be formed. We do that by
- // returning an instantiation of this special proxy class template.
-
- template <class T>
- struct operator_arrow_proxy
- {
- operator_arrow_proxy(const T& x) : m_value(x) {}
- const T* operator->() const { return &m_value; }
- // This function is needed for MWCW and BCC, which won't call operator->
- // again automatically per 13.3.1.2 para 8
- operator const T*() const { return &m_value; }
- T m_value;
- };
-
- template <class Iter>
- inline operator_arrow_proxy<typename Iter::value_type>
- operator_arrow(const Iter& i, std::input_iterator_tag) {
- typedef typename Iter::value_type value_t; // VC++ needs this typedef
- return operator_arrow_proxy<value_t>(*i);
- }
-
- template <class Iter>
- inline typename Iter::pointer
- operator_arrow(const Iter& i, std::forward_iterator_tag) {
- return &(*i);
- }
-
- template <class Value, class Reference, class Pointer>
- struct operator_arrow_result_generator
- {
- typedef operator_arrow_proxy<Value> proxy;
- // Borland chokes unless it's an actual enum (!)
- enum { use_proxy = !boost::is_reference<Reference>::value };
-
- typedef typename boost::detail::if_true<(use_proxy)>::template
- then<
- proxy,
- // else
- Pointer
- >::type type;
- };
-
-
-# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
-
- // Select default pointer and reference types for adapted non-pointer
- // iterators based on the iterator and the value_type. Poor man's partial
- // specialization is in use here.
- template <bool is_pointer>
- struct iterator_defaults_select
- {
- template <class Iterator,class Value>
- struct traits
- {
- // The assumption is that iterator_traits can deduce these types
- // properly as long as the iterator is not a pointer.
- typedef typename boost::detail::iterator_traits<Iterator>::pointer pointer;
- typedef typename boost::detail::iterator_traits<Iterator>::reference reference;
- };
- };
-
- // Select default pointer and reference types for adapted pointer iterators
- // given a (possibly-const) value_type.
- template <>
- struct iterator_defaults_select<true>
- {
- template <class Iterator,class Value>
- struct traits
- {
- typedef Value* pointer;
- typedef Value& reference;
- };
- };
-
- // Consolidate selection of the default pointer and reference type
- template <class Iterator,class Value>
- struct iterator_defaults
- {
- BOOST_STATIC_CONSTANT(bool, is_ptr = boost::is_pointer<Iterator>::value);
-
- typedef typename iterator_defaults_select<is_ptr>::template traits<Iterator,Value> traits;
- typedef typename traits::pointer pointer;
- typedef typename traits::reference reference;
- };
-# else
- template <class Iterator,class Value>
- struct iterator_defaults : iterator_traits<Iterator>
- {
- // Trying to factor the common is_same expression into an enum or a
- // static bool constant confused Borland.
- typedef typename if_true<(
- ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
- )>::template then<
- typename iterator_traits<Iterator>::pointer,
- Value*
- >::type pointer;
-
- typedef typename if_true<(
- ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
- )>::template then<
- typename iterator_traits<Iterator>::reference,
- Value&
- >::type reference;
-
- };
-# endif
-
- //===========================================================================
- // Specify the defaults for iterator_adaptor's template parameters
-
- struct default_argument { };
- // This class template is a workaround for MSVC.
- struct dummy_default_gen {
- template <class Base, class Traits>
- struct select { typedef default_argument type; };
- };
- // This class template is a workaround for MSVC.
- template <class Gen> struct default_generator {
- typedef dummy_default_gen type;
- };
-
- struct default_value_type {
- template <class Base, class Traits>
- struct select {
- typedef typename boost::detail::iterator_traits<Base>::value_type type;
- };
- };
- template <> struct default_generator<default_value_type>
- { typedef default_value_type type; }; // VC++ workaround
-
- struct default_difference_type {
- template <class Base, class Traits>
- struct select {
- typedef typename boost::detail::iterator_traits<Base>::difference_type type;
- };
- };
- template <> struct default_generator<default_difference_type>
- { typedef default_difference_type type; }; // VC++ workaround
-
- struct default_iterator_category {
- template <class Base, class Traits>
- struct select {
- typedef typename boost::detail::iterator_traits<Base>::iterator_category type;
- };
- };
- template <> struct default_generator<default_iterator_category>
- { typedef default_iterator_category type; }; // VC++ workaround
-
- struct default_pointer {
- template <class Base, class Traits>
- struct select {
- typedef typename Traits::value_type Value;
- typedef typename boost::detail::iterator_defaults<Base,Value>::pointer
- type;
- };
- };
- template <> struct default_generator<default_pointer>
- { typedef default_pointer type; }; // VC++ workaround
-
- struct default_reference {
- template <class Base, class Traits>
- struct select {
- typedef typename Traits::value_type Value;
- typedef typename boost::detail::iterator_defaults<Base,Value>::reference
- type;
- };
- };
- template <> struct default_generator<default_reference>
- { typedef default_reference type; }; // VC++ workaround
-
-} // namespace detail
-
-
- //===========================================================================
- // Support for named template parameters
-
-struct named_template_param_base { };
-
-namespace detail {
- struct value_type_tag { };
- struct reference_tag { };
- struct pointer_tag { };
- struct difference_type_tag { };
- struct iterator_category_tag { };
-
- // avoid using std::pair because A or B might be a reference type, and g++
- // complains about forming references to references inside std::pair
- template <class A, class B>
- struct cons_type {
- typedef A first_type;
- typedef B second_type;
- };
-
-} // namespace detail
-
-template <class Value> struct value_type_is : public named_template_param_base
-{
- typedef detail::cons_type<detail::value_type_tag, Value> type;
-};
-template <class Reference> struct reference_is : public named_template_param_base
-{
- typedef detail::cons_type<detail::reference_tag, Reference> type;
-};
-template <class Pointer> struct pointer_is : public named_template_param_base
-{
- typedef detail::cons_type<detail::pointer_tag, Pointer> type;
-};
-template <class Difference> struct difference_type_is
- : public named_template_param_base
-{
- typedef detail::cons_type<detail::difference_type_tag, Difference> type;
-};
-template <class IteratorCategory> struct iterator_category_is
- : public named_template_param_base
-{
- typedef detail::cons_type<detail::iterator_category_tag, IteratorCategory> type;
-};
-
-namespace detail {
-
- struct end_of_list { };
-
- // Given an associative list, find the value with the matching key.
- // An associative list is a list of key-value pairs. The list is
- // built out of cons_type's and is terminated by end_of_list.
-
-# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || BOOST_WORKAROUND(__BORLANDC__, != 0)
- template <class AssocList, class Key>
- struct find_param;
-
- struct find_param_continue {
- template <class AssocList, class Key2> struct select {
- typedef typename AssocList::first_type Head;
- typedef typename Head::first_type Key1;
- typedef typename Head::second_type Value;
- typedef typename if_true<(is_same<Key1, Key2>::value)>::template
- then<Value,
- typename find_param<typename AssocList::second_type, Key2>::type
- >::type type;
- };
- };
- struct find_param_end {
- template <class AssocList, class Key>
- struct select { typedef detail::default_argument type; };
- };
- template <class AssocList> struct find_param_helper1
- { typedef find_param_continue type; };
- template <> struct find_param_helper1<end_of_list>
- { typedef find_param_end type; };
-
- template <class AssocList, class Key>
- struct find_param {
- typedef typename find_param_helper1<AssocList>::type select1;
- typedef typename select1::template select<AssocList, Key>::type type;
- };
-# else
- template <class AssocList, class Key> struct find_param;
-
- template <class Key>
- struct find_param<end_of_list, Key> { typedef default_argument type; };
-
- // Found a matching Key, return the associated Value
- template <class Key, class Value, class Rest>
- struct find_param<detail::cons_type< detail::cons_type<Key, Value>, Rest>, Key> {
- typedef Value type;
- };
-
- // Non-matching keys, continue the search
- template <class Key1, class Value, class Rest, class Key2>
- struct find_param<detail::cons_type< detail::cons_type<Key1, Value>, Rest>, Key2> {
- typedef typename find_param<Rest, Key2>::type type;
- };
-# endif
-
- struct make_named_arg {
- template <class Key, class Value>
- struct select { typedef typename Value::type type; };
- };
- struct make_key_value {
- template <class Key, class Value>
- struct select { typedef detail::cons_type<Key, Value> type; };
- };
-
- template <class Value>
- struct is_named_parameter
- {
- enum { value = is_convertible< typename add_reference< Value >::type, add_reference< named_template_param_base >::type >::value };
- };
-
-# if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) // workaround for broken is_convertible implementation
- template <class T> struct is_named_parameter<value_type_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<reference_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<pointer_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<difference_type_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<iterator_category_is<T> > { enum { value = true }; };
-# endif
-
- template <class Key, class Value>
- struct make_arg {
-# if BOOST_WORKAROUND(__BORLANDC__, > 0)
- // Borland C++ doesn't like the extra indirection of is_named_parameter
- typedef typename
- if_true<(is_convertible<Value,named_template_param_base>::value)>::
- template then<make_named_arg, make_key_value>::type Make;
-# else
- enum { is_named = is_named_parameter<Value>::value };
- typedef typename if_true<(is_named)>::template
- then<make_named_arg, make_key_value>::type Make;
-# endif
- typedef typename Make::template select<Key, Value>::type type;
- };
-
- // Mechanism for resolving the default argument for a template parameter.
-
- template <class T> struct is_default { typedef type_traits::no_type type; };
- template <> struct is_default<default_argument>
- { typedef type_traits::yes_type type; };
-
- struct choose_default {
- template <class Arg, class DefaultGen, class Base, class Traits>
- struct select {
- typedef typename default_generator<DefaultGen>::type Gen;
- typedef typename Gen::template select<Base,Traits>::type type;
- };
- };
- struct choose_arg {
- template <class Arg, class DefaultGen, class Base, class Traits>
- struct select {
- typedef Arg type;
- };
- };
-
- template <class UseDefault>
- struct choose_arg_or_default { typedef choose_arg type; };
- template <> struct choose_arg_or_default<type_traits::yes_type> {
- typedef choose_default type;
- };
-
- template <class Arg, class DefaultGen, class Base, class Traits>
- class resolve_default {
- typedef typename choose_arg_or_default<typename is_default<Arg>::type>::type
- Selector;
- public:
- typedef typename Selector
- ::template select<Arg, DefaultGen, Base, Traits>::type type;
- };
-
- template <class Base, class Value, class Reference, class Pointer,
- class Category, class Distance>
- class iterator_adaptor_traits_gen
- {
- // Form an associative list out of the template parameters
- // If the argument is a normal parameter (not named) then make_arg
- // creates a key-value pair. If the argument is a named parameter,
- // then make_arg extracts the key-value pair defined inside the
- // named parameter.
- typedef detail::cons_type< typename make_arg<value_type_tag, Value>::type,
- detail::cons_type<typename make_arg<reference_tag, Reference>::type,
- detail::cons_type<typename make_arg<pointer_tag, Pointer>::type,
- detail::cons_type<typename make_arg<iterator_category_tag, Category>::type,
- detail::cons_type<typename make_arg<difference_type_tag, Distance>::type,
- end_of_list> > > > > ArgList;
-
- // Search the list for particular parameters
- typedef typename find_param<ArgList, value_type_tag>::type Val;
- typedef typename find_param<ArgList, difference_type_tag>::type Diff;
- typedef typename find_param<ArgList, iterator_category_tag>::type Cat;
- typedef typename find_param<ArgList, pointer_tag>::type Ptr;
- typedef typename find_param<ArgList, reference_tag>::type Ref;
-
- typedef boost::iterator<Category, Value, Distance, Pointer, Reference>
- Traits0;
-
- // Compute the defaults if necessary
- typedef typename resolve_default<Val, default_value_type, Base, Traits0>::type
- value_type;
- // if getting default value type from iterator_traits, then it won't be const
- typedef typename resolve_default<Diff, default_difference_type, Base,
- Traits0>::type difference_type;
- typedef typename resolve_default<Cat, default_iterator_category, Base,
- Traits0>::type iterator_category;
-
- typedef boost::iterator<iterator_category, value_type, difference_type,
- Pointer, Reference> Traits1;
-
- // Compute the defaults for pointer and reference. This is done as a
- // separate step because the defaults for pointer and reference depend
- // on value_type.
- typedef typename resolve_default<Ptr, default_pointer, Base, Traits1>::type
- pointer;
- typedef typename resolve_default<Ref, default_reference, Base, Traits1>::type
- reference;
-
- public:
- typedef boost::iterator<iterator_category,
- typename remove_const<value_type>::type,
- difference_type, pointer, reference> type;
- };
-
- // This is really a partial concept check for iterators. Should it
- // be moved or done differently?
- template <class Category, class Value, class Difference, class Pointer, class Reference>
- struct validator
- {
- BOOST_STATIC_CONSTANT(
- bool, is_input_or_output_iter
- = (boost::is_convertible<Category*,std::input_iterator_tag*>::value
- | boost::is_convertible<Category*,std::output_iterator_tag*>::value));
-
- // Iterators should satisfy one of the known categories
- BOOST_STATIC_ASSERT(is_input_or_output_iter);
-
- // Iterators >= ForwardIterator must produce real references
- // as required by the C++ standard requirements in Table 74.
- BOOST_STATIC_CONSTANT(
- bool, forward_iter_with_real_reference
- = ((!boost::is_convertible<Category*,std::forward_iterator_tag*>::value)
- | boost::is_same<Reference,Value&>::value
- | boost::is_same<Reference,typename add_const<Value>::type&>::value));
-
- BOOST_STATIC_ASSERT(forward_iter_with_real_reference);
- };
-
- template <class T, class Result> struct dependent
- {
- typedef Result type;
- };
-
-} // namespace detail
-
-
-
-// This macro definition is only temporary in this file
-# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-# define BOOST_ARG_DEPENDENT_TYPENAME typename
-# else
-# define BOOST_ARG_DEPENDENT_TYPENAME
-# endif
-
-//============================================================================
-//iterator_adaptor - Adapts a generic piece of data as an iterator. Adaptation
-// is especially easy if the data being adapted is itself an iterator
-//
-// Base - the base (usually iterator) type being wrapped.
-//
-// Policies - a set of policies determining how the resulting iterator
-// works.
-//
-// Value - if supplied, the value_type of the resulting iterator, unless
-// const. If const, a conforming compiler strips constness for the
-// value_type. If not supplied, iterator_traits<Base>::value_type is used
-//
-// Reference - the reference type of the resulting iterator, and in
-// particular, the result type of operator*(). If not supplied but
-// Value is supplied, Value& is used. Otherwise
-// iterator_traits<Base>::reference is used.
-//
-// Pointer - the pointer type of the resulting iterator, and in
-// particular, the result type of operator->(). If not
-// supplied but Value is supplied, Value* is used. Otherwise
-// iterator_traits<Base>::pointer is used.
-//
-// Category - the iterator_category of the resulting iterator. If not
-// supplied, iterator_traits<Base>::iterator_category is used.
-//
-// Distance - the difference_type of the resulting iterator. If not
-// supplied, iterator_traits<Base>::difference_type is used.
-template <class Base, class Policies,
- class Value = ::boost::detail::default_argument,
- class Reference = ::boost::detail::default_argument,
- class Pointer = ::boost::detail::default_argument,
- class Category = ::boost::detail::default_argument,
- class Distance = ::boost::detail::default_argument
- >
-struct iterator_adaptor :
-#ifdef BOOST_RELOPS_AMBIGUITY_BUG
- iterator_comparisons<
- iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance>,
- typename detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category, Distance>::type
- >
-#else
- detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance>::type
-#endif
-{
- typedef iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance> self;
- public:
- typedef detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance> TraitsGen;
- typedef typename TraitsGen::type Traits;
-
- typedef typename Traits::difference_type difference_type;
- typedef typename Traits::value_type value_type;
- typedef typename Traits::pointer pointer;
- typedef typename Traits::reference reference;
- typedef typename Traits::iterator_category iterator_category;
-
- typedef Base base_type;
- typedef Policies policies_type;
-
- private:
- typedef detail::validator<
- iterator_category,value_type,difference_type,pointer,reference
- > concept_check;
-
- public:
- iterator_adaptor()
- {
- }
-
- explicit
- iterator_adaptor(const Base& it, const Policies& p = Policies())
- : m_iter_p(it, p) {
- policies().initialize(base());
- }
-
- template <class Iter2, class Value2, class Pointer2, class Reference2>
- iterator_adaptor (
- const iterator_adaptor<Iter2,Policies,Value2,Reference2,Pointer2,Category,Distance>& src)
- : m_iter_p(src.base(), src.policies())
- {
- policies().initialize(base());
- }
-
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(__BORLANDC__, > 0)
- // This is required to prevent a bug in how VC++ generates
- // the assignment operator for compressed_pair
- iterator_adaptor& operator= (const iterator_adaptor& x) {
- m_iter_p = x.m_iter_p;
- return *this;
- }
-#endif
- reference operator*() const {
- return policies().dereference(*this);
- }
-
-#if BOOST_WORKAROUND(BOOST_MSVC, > 0)
-# pragma warning(push)
-# pragma warning( disable : 4284 )
-#endif
-
- typename boost::detail::operator_arrow_result_generator<value_type,reference,pointer>::type
- operator->() const
- { return detail::operator_arrow(*this, iterator_category()); }
-
-#if BOOST_WORKAROUND(BOOST_MSVC, > 0)
-# pragma warning(pop)
-#endif
-
- template <class diff_type>
- typename detail::dependent<diff_type, value_type>::type operator[](diff_type n) const
- { return *(*this + n); }
-
- self& operator++() {
-#if !BOOST_WORKAROUND(__MWERKS__, < 0x2405)
- policies().increment(*this);
-#else
- // Odd bug, MWERKS couldn't deduce the type for the member template
- // Workaround by explicitly specifying the type.
- policies().increment<self>(*this);
-#endif
- return *this;
- }
-
- self operator++(int) { self tmp(*this); ++*this; return tmp; }
-
- self& operator--() {
-#if !BOOST_WORKAROUND(__MWERKS__, < 0x2405)
- policies().decrement(*this);
-#else
- policies().decrement<self>(*this);
-#endif
- return *this;
- }
-
- self operator--(int) { self tmp(*this); --*this; return tmp; }
-
- self& operator+=(difference_type n) {
- policies().advance(*this, n);
- return *this;
- }
-
- self& operator-=(difference_type n) {
- policies().advance(*this, -n);
- return *this;
- }
-
- base_type const& base() const { return m_iter_p.first(); }
-
- // Moved from global scope to avoid ambiguity with the operator-() which
- // subtracts iterators from one another.
- self operator-(difference_type x) const
- { self result(*this); return result -= x; }
-private:
- compressed_pair<Base,Policies> m_iter_p;
-
-public: // implementation details (too many compilers have trouble when these are private).
- base_type& base() { return m_iter_p.first(); }
- Policies& policies() { return m_iter_p.second(); }
- const Policies& policies() const { return m_iter_p.second(); }
-};
-
-template <class Base, class Policies, class Value, class Reference, class Pointer,
- class Category, class Distance1, class Distance2>
-iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
-operator+(
- iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p,
- Distance2 x)
-{
- return p += x;
-}
-
-template <class Base, class Policies, class Value, class Reference, class Pointer,
- class Category, class Distance1, class Distance2>
-iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
-operator+(
- Distance2 x,
- iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p)
-{
- return p += x;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2, class Category,
- class Distance>
-typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>::difference_type
-operator-(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- typedef typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,
- Pointer1,Category,Distance>::difference_type difference_type;
- return x.policies().distance(y, x);
-}
-
-#ifndef BOOST_RELOPS_AMBIGUITY_BUG
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator==(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().equal(x, y);
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator<(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) < 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator>(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) > 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator>=(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) >= 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator<=(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) <= 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator!=(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return !x.policies().equal(x, y);
-}
-#endif
-
-//=============================================================================
-// Transform Iterator Adaptor
-//
-// Upon deference, apply some unary function object and return the
-// result by value.
-
-template <class AdaptableUnaryFunction>
-struct transform_iterator_policies : public default_iterator_policies
-{
- transform_iterator_policies() { }
- transform_iterator_policies(const AdaptableUnaryFunction& f) : m_f(f) { }
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference
- dereference(const IteratorAdaptor& iter) const
- { return m_f(*iter.base()); }
-
- AdaptableUnaryFunction m_f;
-};
-
-template <class AdaptableUnaryFunction, class Iterator>
-class transform_iterator_generator
-{
- typedef typename AdaptableUnaryFunction::result_type value_type;
-public:
- typedef iterator_adaptor<Iterator,
- transform_iterator_policies<AdaptableUnaryFunction>,
- value_type, value_type, value_type*, std::input_iterator_tag>
- type;
-};
-
-template <class AdaptableUnaryFunction, class Iterator>
-inline typename transform_iterator_generator<AdaptableUnaryFunction,Iterator>::type
-make_transform_iterator(
- Iterator base,
- const AdaptableUnaryFunction& f = AdaptableUnaryFunction())
-{
- typedef typename transform_iterator_generator<AdaptableUnaryFunction,Iterator>::type result_t;
- return result_t(base, f);
-}
-
-//=============================================================================
-// Indirect Iterators Adaptor
-
-// Given a pointer to pointers (or iterator to iterators),
-// apply a double dereference inside operator*().
-//
-// We use the term "outer" to refer to the first level iterator type
-// and "inner" to refer to the second level iterator type. For
-// example, given T**, T* is the inner iterator type and T** is the
-// outer iterator type. Also, const T* would be the const inner
-// iterator.
-
-// We tried to implement this with transform_iterator, but that required
-// using boost::remove_ref, which is not compiler portable.
-
-struct indirect_iterator_policies : public default_iterator_policies
-{
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
- { return **x.base(); }
-};
-
-namespace detail {
-# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) // strangely instantiated even when unused! Maybe try a recursive template someday ;-)
- template <class T>
- struct traits_of_value_type {
- typedef typename boost::detail::iterator_traits<T>::value_type outer_value;
- typedef typename boost::detail::iterator_traits<outer_value>::value_type value_type;
- typedef typename boost::detail::iterator_traits<outer_value>::reference reference;
- typedef typename boost::detail::iterator_traits<outer_value>::pointer pointer;
- };
-# endif
-}
-
-template <class OuterIterator, // Mutable or Immutable, does not matter
- class Value
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
- OuterIterator>::value_type
-#endif
- , class Reference
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
- OuterIterator>::reference
-#else
- = Value &
-#endif
- , class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<
- OuterIterator>::iterator_category
- , class Pointer
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
- OuterIterator>::pointer
-#else
- = Value*
-#endif
- >
-struct indirect_iterator_generator
-{
- typedef iterator_adaptor<OuterIterator,
- indirect_iterator_policies,Value,Reference,Pointer,Category> type;
-};
-
-template <class OuterIterator, // Mutable or Immutable, does not matter
- class Value
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
- OuterIterator>::value_type
-#endif
- , class Reference
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
- OuterIterator>::reference
-#else
- = Value &
-#endif
- , class ConstReference = Value const&
- , class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<
- OuterIterator>::iterator_category
- , class Pointer
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
- OuterIterator>::pointer
-#else
- = Value*
-#endif
- , class ConstPointer = Value const*
- >
-struct indirect_iterator_pair_generator
-{
- typedef typename indirect_iterator_generator<OuterIterator,
- Value, Reference,Category,Pointer>::type iterator;
- typedef typename indirect_iterator_generator<OuterIterator,
- Value, ConstReference,Category,ConstPointer>::type const_iterator;
-};
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-template <class OuterIterator>
-inline typename indirect_iterator_generator<OuterIterator>::type
-make_indirect_iterator(OuterIterator base)
-{
- typedef typename indirect_iterator_generator
- <OuterIterator>::type result_t;
- return result_t(base);
-}
-#endif
-
-//=============================================================================
-// Reverse Iterators Adaptor
-
-struct reverse_iterator_policies : public default_iterator_policies
-{
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
- { return *boost::prior(x.base()); }
-
- template <class BidirectionalIterator>
- void increment(BidirectionalIterator& x) const
- { --x.base(); }
-
- template <class BidirectionalIterator>
- void decrement(BidirectionalIterator& x) const
- { ++x.base(); }
-
- template <class BidirectionalIterator, class DifferenceType>
- void advance(BidirectionalIterator& x, DifferenceType n) const
- { x.base() -= n; }
-
- template <class Iterator1, class Iterator2>
- typename Iterator1::difference_type distance(
- const Iterator1& x, const Iterator2& y) const
- { return x.base() - y.base(); }
-
- template <class Iterator1, class Iterator2>
- bool equal(const Iterator1& x, const Iterator2& y) const
- { return x.base() == y.base(); }
-};
-
-template <class BidirectionalIterator,
- class Value = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<BidirectionalIterator>::value_type,
- class Reference = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<BidirectionalIterator,Value>::reference,
- class Pointer = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<BidirectionalIterator,Value>::pointer,
- class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<BidirectionalIterator>::iterator_category,
- class Distance = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<BidirectionalIterator>::difference_type
- >
-struct reverse_iterator_generator
-{
- typedef iterator_adaptor<BidirectionalIterator,reverse_iterator_policies,
- Value,Reference,Pointer,Category,Distance> type;
-};
-
-template <class BidirectionalIterator>
-inline typename reverse_iterator_generator<BidirectionalIterator>::type
-make_reverse_iterator(BidirectionalIterator base)
-{
- typedef typename reverse_iterator_generator<BidirectionalIterator>::type result_t;
- return result_t(base);
-}
-
-//=============================================================================
-// Projection Iterators Adaptor
-
-template <class AdaptableUnaryFunction>
-struct projection_iterator_policies : public default_iterator_policies
-{
- projection_iterator_policies() { }
- projection_iterator_policies(const AdaptableUnaryFunction& f) : m_f(f) { }
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(IteratorAdaptor const& iter) const {
- return m_f(*iter.base());
- }
-
- AdaptableUnaryFunction m_f;
-};
-
-template <class AdaptableUnaryFunction, class Iterator>
-class projection_iterator_generator {
- typedef typename AdaptableUnaryFunction::result_type value_type;
- typedef projection_iterator_policies<AdaptableUnaryFunction> policies;
-public:
- typedef iterator_adaptor<Iterator,policies,value_type,value_type&,value_type*> type;
-};
-
-template <class AdaptableUnaryFunction, class Iterator>
-class const_projection_iterator_generator {
- typedef typename AdaptableUnaryFunction::result_type value_type;
- typedef projection_iterator_policies<AdaptableUnaryFunction> policies;
-public:
- typedef iterator_adaptor<Iterator,policies,value_type,const value_type&,const value_type*> type;
-};
-
-template <class AdaptableUnaryFunction, class Iterator, class ConstIterator>
-struct projection_iterator_pair_generator {
- typedef typename projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type iterator;
- typedef typename const_projection_iterator_generator<AdaptableUnaryFunction, ConstIterator>::type const_iterator;
-};
-
-
-template <class AdaptableUnaryFunction, class Iterator>
-inline typename projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type
-make_projection_iterator(
- Iterator iter,
- const AdaptableUnaryFunction& f = AdaptableUnaryFunction())
-{
- typedef typename projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type result_t;
- return result_t(iter, f);
-}
-
-template <class AdaptableUnaryFunction, class Iterator>
-inline typename const_projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type
-make_const_projection_iterator(
- Iterator iter,
- const AdaptableUnaryFunction& f = AdaptableUnaryFunction())
-{
- typedef typename const_projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type result_t;
- return result_t(iter, f);
-}
-
-//=============================================================================
-// Filter Iterator Adaptor
-
-template <class Predicate, class Iterator>
-class filter_iterator_policies
-{
-public:
- filter_iterator_policies() { }
-
- filter_iterator_policies(const Predicate& p, const Iterator& end)
- : m_predicate(p), m_end(end) { }
-
- void initialize(Iterator& x) {
- satisfy_predicate(x);
- }
-
- // The Iter template argument is neccessary for compatibility with a MWCW
- // bug workaround
- template <class IteratorAdaptor>
- void increment(IteratorAdaptor& x) {
- ++x.base();
- satisfy_predicate(x.base());
- }
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
- { return *x.base(); }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return x.base() == y.base(); }
-
- private:
- void satisfy_predicate(Iterator& iter);
- Predicate m_predicate;
- Iterator m_end;
-};
-
-template <class Predicate, class Iterator>
-void filter_iterator_policies<Predicate,Iterator>::satisfy_predicate(
- Iterator& iter)
-{
- while (m_end != iter && !m_predicate(*iter))
- ++iter;
-}
-
-
-
-namespace detail {
- // A type generator returning Base if T is derived from Base, and T otherwise.
- template <class Base, class T>
- struct reduce_to_base_class
- {
- typedef typename if_true<(
- ::boost::is_convertible<T*,Base*>::value
- )>::template then<Base,T>::type type;
- };
-
- // "Steps down" the category of iterators below bidirectional so the category
- // can be used with filter iterators.
- template <class Iterator>
- struct non_bidirectional_category
- {
-# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
- typedef typename reduce_to_base_class<
- std::forward_iterator_tag,
- typename iterator_traits<Iterator>::iterator_category
- >::type type;
- private:
- // For some reason, putting this assertion in filter_iterator_generator fails inexplicably under MSVC
- BOOST_STATIC_CONSTANT(
- bool, is_bidirectional
- = (!boost::is_convertible<type*, std::bidirectional_iterator_tag*>::value));
- BOOST_STATIC_ASSERT(is_bidirectional);
-# else
- // is_convertible doesn't work with MWERKS
- typedef typename iterator_traits<Iterator>::iterator_category input_category;
- public:
- typedef typename if_true<(
- boost::is_same<input_category,std::random_access_iterator_tag>::value
- || boost::is_same<input_category,std::bidirectional_iterator_tag>::value
- )>::template then<
- std::forward_iterator_tag,
- input_category
- >::type type;
-# endif
- };
-}
-
-template <class Predicate, class Iterator,
- class Value = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<Iterator>::value_type,
- class Reference = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<Iterator,Value>::reference,
- class Pointer = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<Iterator,Value>::pointer,
- class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::non_bidirectional_category<Iterator>::type,
- class Distance = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<Iterator>::difference_type
- >
-class filter_iterator_generator {
- BOOST_STATIC_CONSTANT(bool, is_bidirectional
- = (boost::is_convertible<Category*, std::bidirectional_iterator_tag*>::value));
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) // I don't have any idea why this occurs, but it doesn't seem to hurt too badly.
- BOOST_STATIC_ASSERT(!is_bidirectional);
-#endif
- typedef filter_iterator_policies<Predicate,Iterator> policies_type;
- public:
- typedef iterator_adaptor<Iterator,policies_type,
- Value,Reference,Pointer,Category,Distance> type;
-};
-
-// This keeps MSVC happy; it doesn't like to deduce default template arguments
-// for template function return types
-namespace detail {
- template <class Predicate, class Iterator>
- struct filter_generator {
- typedef typename boost::filter_iterator_generator<Predicate,Iterator>::type type;
- };
-}
-
-template <class Predicate, class Iterator>
-inline typename detail::filter_generator<Predicate, Iterator>::type
-make_filter_iterator(Iterator first, Iterator last, const Predicate& p = Predicate())
-{
- typedef filter_iterator_generator<Predicate, Iterator> Gen;
- typedef filter_iterator_policies<Predicate,Iterator> policies_t;
- typedef typename Gen::type result_t;
- return result_t(first, policies_t(p, last));
-}
-
-} // namespace boost
-# undef BOOST_ARG_DEPENDENT_TYPENAME
-
-
-#endif
-
+#ifndef BOOST_ITERATOR_ADAPTOR_13062003HK_HPP
+#define BOOST_ITERATOR_ADAPTOR_13062003HK_HPP
+#define BOOST_ITERATOR_ADAPTORS_VERSION 0x0200
+#include <boost/iterator/iterator_adaptor.hpp>
+#endif // BOOST_ITERATOR_ADAPTOR_13062003HK_HPP
// last_value function object (documented as part of Boost.Signals)
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org/libs/signals
#ifndef BOOST_LAST_VALUE_HPP
template<typename T>
struct last_value {
typedef T result_type;
-
+
template<typename InputIterator>
T operator()(InputIterator first, InputIterator last) const
{
return value;
}
};
-
+
template<>
struct last_value<void> {
struct unusable {};
public:
typedef unusable result_type;
-
+
template<typename InputIterator>
result_type
operator()(InputIterator first, InputIterator last) const
#ifndef BOOST_MEM_FN_HPP_INCLUDED
#define BOOST_MEM_FN_HPP_INCLUDED
-#if _MSC_VER+0 >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
#include <boost/config.hpp>
#include <boost/get_pointer.hpp>
+#include <boost/detail/workaround.hpp>
namespace boost
{
return call(u, &u);
}
-#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300)
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
R & operator()(T & t) const
{
+++ /dev/null
-// Boost min_rand.hpp header file ------------------------------------------//
-
-// (C) Copyright Beman Dawes 1998. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// Version 1.1, 25 May 99 Add operator()() to meet Generator requirements
-// Version 1.0, 9 Nov 98 Initial version
-
-#ifndef BOOST_MIN_RAND_HPP
-#define BOOST_MIN_RAND_HPP
-
-#include <cassert>
-
-namespace boost {
-
-// min_rand ----------------------------------------------------------------//
-
-// see min_rand.html for documentation
-
-class min_rand {
-
- // Don't even think about changing the values of the constants below.
- // See the article cited in the documentation for rationale.
- enum constants {
- modulus = 2147483647L,
- multiplier = 48271L, // 16807L for original "minimal standard"
- validation = 399268537L, // 1043618065L for original "minimal standard"
- q = modulus / multiplier,
- r = modulus % multiplier
- };
-
- long value; // invariant: 0 < value <= modulus
-
- public:
-
- // compiler generated copy constructor and operator= are valid and useful
-
- explicit min_rand( long seed_value=1 ) : value( seed_value )
- { assert( value > 0 && value <= modulus ); }
-
- operator long() const { return value; }
- double fvalue() const { return double(value) / modulus; }
-
- min_rand& operator=( long new_value ) {
- value = new_value;
- assert( value > 0 && value <= modulus );
- return *this;
- }
-
- long operator++() { value = multiplier*(value%q) - r*(value/q);
- if ( value <= 0 ) value += modulus;
- assert( value > 0 && value <= modulus );
- return value;
- }
- long operator++(int) { long temp = value; operator++(); return temp; }
-
- long ten_thousandth() const { return validation; }
-
- // satisfy std::RandomNumberGenerator and std::Generator requirements:
- typedef long argument_type;
- typedef long result_type;
- long operator()( long n ) { return operator++() % n; }
- long operator()() { return operator++(); }
-
- }; // min_rand
-
-} // namespace boost
-
-#endif // BOOST_MIN_RAND_HPP
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/always.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_ALWAYS_HPP_INCLUDED
+#define BOOST_MPL_ALWAYS_HPP_INCLUDED
+
+#include "boost/mpl/aux_/preprocessor/def_params_tail.hpp"
+#include "boost/mpl/void.hpp"
+#include "boost/mpl/aux_/arity_spec.hpp"
+#include "boost/mpl/aux_/lambda_spec.hpp"
+
+namespace boost {
+namespace mpl {
+
+template< typename Value >
+struct always
+{
+ template<
+ typename T
+ BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(1, typename T, void_)
+ >
+ struct apply
+ {
+ typedef Value type;
+ };
+};
+
+
+BOOST_MPL_AUX_ARITY_SPEC(1,always)
+BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1,always)
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_ALWAYS_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AND_HPP_INCLUDED
+#define BOOST_MPL_AND_HPP_INCLUDED
+
+// + file: boost/mpl/and.hpp
+// + last modified: 25/feb/03
+
+// Copyright (c) 2000-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+
+#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# include "boost/mpl/bool.hpp"
+# include "boost/mpl/aux_/nested_type_wknd.hpp"
+# include "boost/mpl/aux_/void_spec.hpp"
+# include "boost/mpl/aux_/lambda_support.hpp"
+
+# define BOOST_MPL_PREPROCESSED_HEADER and.hpp
+# include "boost/mpl/aux_/include_preprocessed.hpp"
+
+#else
+
+# define AUX_LOGICAL_OP_NAME and_
+# define AUX_LOGICAL_OP_VALUE1 false
+# define AUX_LOGICAL_OP_VALUE2 true
+# include "boost/mpl/aux_/logical_op.hpp"
+
+#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_AND_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/apply.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2000-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_APPLY_HPP_INCLUDED
+#define BOOST_MPL_APPLY_HPP_INCLUDED
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include "boost/mpl/arg_fwd.hpp"
+# include "boost/mpl/void.hpp"
+# include "boost/mpl/aux_/arity.hpp"
+# include "boost/mpl/aux_/msvc_never_true.hpp"
+# include "boost/type_traits/same_traits.hpp"
+#endif
+
+#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+
+#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER apply.hpp
+# include "boost/mpl/aux_/include_preprocessed.hpp"
+
+#else
+
+# include "boost/mpl/limits/arity.hpp"
+# include "boost/mpl/aux_/lambda_support.hpp"
+# include "boost/mpl/aux_/preprocessor/params.hpp"
+# include "boost/mpl/aux_/preprocessor/default_params.hpp"
+# include "boost/mpl/aux_/preprocessor/partial_spec_params.hpp"
+# include "boost/mpl/aux_/preprocessor/enum.hpp"
+# include "boost/mpl/aux_/preprocessor/add.hpp"
+# include "boost/mpl/aux_/config/dtp.hpp"
+# include "boost/mpl/aux_/config/nttp.hpp"
+# include "boost/mpl/aux_/config/eti.hpp"
+# include "boost/mpl/aux_/config/lambda.hpp"
+
+# include "boost/preprocessor/comma_if.hpp"
+# include "boost/preprocessor/inc.hpp"
+# include "boost/preprocessor/iterate.hpp"
+
+# include "boost/config.hpp"
+
+// agurt, 15/jan/02: top-level 'apply' template gives an ICE on MSVC
+// (for known reasons)
+#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1200)
+# define BOOST_MPL_NO_APPLY_TEMPLATE
+#endif
+
+namespace boost {
+namespace mpl {
+
+// local macros, #undef-ined at the end of the header
+# define AUX_APPLY_PARAMS(param) \
+ BOOST_MPL_PP_PARAMS( \
+ BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ , param \
+ ) \
+ /**/
+
+# define AUX_APPLY_DEFAULT_PARAMS(param, value) \
+ BOOST_MPL_PP_DEFAULT_PARAMS( \
+ BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ , param \
+ , value \
+ ) \
+ /**/
+
+# define AUX_APPLY_N_PARAMS(n, param) \
+ BOOST_MPL_PP_PARAMS(n, param) \
+ /**/
+
+# define AUX_APPLY_N_COMMA_PARAMS(n, param) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_MPL_PP_PARAMS(n, param) \
+ /**/
+
+# define AUX_APPLY_N_PARTIAL_SPEC_PARAMS(n, param, def) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
+ /**/
+
+# define AUX_APPLY_N_SPEC_PARAMS(n, param) \
+ BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \
+ /**/
+
+# if !defined(BOOST_MPL_NO_APPLY_TEMPLATE)
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+// forward declaration
+template<
+ typename F, AUX_APPLY_DEFAULT_PARAMS(typename T, void_)
+ >
+struct apply;
+#else
+namespace aux {
+template< BOOST_MPL_AUX_NTTP_DECL(int, arity_) > struct apply_impl_chooser;
+}
+#endif
+
+# endif // BOOST_MPL_NO_APPLY_TEMPLATE
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY, "boost/mpl/apply.hpp"))
+#include BOOST_PP_ITERATE()
+
+# if !defined(BOOST_MPL_NO_APPLY_TEMPLATE)
+// real C++ version is already taken care of
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+namespace aux {
+// apply_count_args
+#define BOOST_MPL_AUX_COUNT_ARGS_PREFIX apply
+#define BOOST_MPL_AUX_COUNT_ARGS_DEFAULT void_
+#define BOOST_MPL_AUX_COUNT_ARGS_ARITY BOOST_MPL_METAFUNCTION_MAX_ARITY
+#include "boost/mpl/aux_/count_args.hpp"
+} // namespace aux
+
+template<
+ typename F, AUX_APPLY_DEFAULT_PARAMS(typename T, void_)
+ >
+struct apply
+ : aux::apply_impl_chooser<
+ aux::apply_count_args< AUX_APPLY_PARAMS(T) >::value
+ >::template result_< F, AUX_APPLY_PARAMS(T) >::type
+{
+};
+
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# endif // BOOST_MPL_NO_APPLY_TEMPLATE
+
+# undef AUX_APPLY_N_SPEC_PARAMS
+# undef AUX_APPLY_N_PARTIAL_SPEC_PARAMS
+# undef AUX_APPLY_N_COMMA_PARAMS
+# undef AUX_APPLY_N_PARAMS
+# undef AUX_APPLY_DEFAULT_PARAMS
+# undef AUX_APPLY_PARAMS
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_APPLY_HPP_INCLUDED
+
+///// iteration, depth == 1
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+# define i BOOST_PP_FRAME_ITERATION(1)
+# if i == 0
+
+template< typename F >
+struct apply0 : F
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1, apply0, (F))
+};
+
+#if defined(BOOST_MPL_MSVC_ETI_BUG)
+//: workaround for the ETI bug
+template<>
+struct apply0<int>
+{
+ typedef int type;
+};
+#endif
+
+# else // i > 0
+
+# if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+// MSVC version
+
+namespace aux {
+// msvc_apply##i
+#define BOOST_MPL_AUX_MSVC_DTW_NAME BOOST_PP_CAT(msvc_apply,i)
+#define BOOST_MPL_AUX_MSVC_DTW_ORIGINAL_NAME apply
+#define BOOST_MPL_AUX_MSVC_DTW_ARITY i
+#include "boost/mpl/aux_/msvc_dtw.hpp"
+} // namespace aux
+
+template<
+ typename F, AUX_APPLY_N_PARAMS(i, typename T)
+ >
+struct BOOST_PP_CAT(apply,i)
+{
+ // Metafunction forwarding confuses vc6
+ typedef typename BOOST_PP_CAT(aux::msvc_apply,i)<F>::template result_<
+ AUX_APPLY_N_PARAMS(i, T)
+ >::type type;
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ BOOST_PP_INC(i)
+ , BOOST_PP_CAT(apply,i)
+ , (F, AUX_APPLY_N_PARAMS(i,T))
+ )
+};
+
+# elif defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+// MWCW/Borland version
+
+namespace aux {
+template<
+ int N, typename F, AUX_APPLY_N_PARAMS(i, typename T)
+ >
+struct BOOST_PP_CAT(apply_impl,i);
+}
+
+#define BOOST_PP_ITERATION_PARAMS_2 \
+ (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY - i, "boost/mpl/apply.hpp"))
+#include BOOST_PP_ITERATE()
+
+template<
+ typename F, AUX_APPLY_N_PARAMS(i, typename T)
+ >
+struct BOOST_PP_CAT(apply,i)
+ : BOOST_PP_CAT(aux::apply_impl,i)<
+ ::boost::mpl::aux::arity<F,i>::value
+ , F
+ , AUX_APPLY_N_PARAMS(i, T)
+ >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ BOOST_PP_INC(i)
+ , BOOST_PP_CAT(apply,i)
+ , (F, AUX_APPLY_N_PARAMS(i,T))
+ )
+};
+
+# else
+// ISO98 C++, with minor concession to vc7
+
+template<
+ typename F, AUX_APPLY_N_PARAMS(i, typename T)
+ >
+struct BOOST_PP_CAT(apply,i)
+{
+ // Metafunction forwarding confuses vc7
+ typedef typename F::template apply<
+ AUX_APPLY_N_PARAMS(i, T)
+ >::type type;
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ BOOST_PP_INC(i)
+ , BOOST_PP_CAT(apply,i)
+ , (F, AUX_APPLY_N_PARAMS(i,T))
+ )
+};
+
+# endif // workarounds
+
+#if defined(BOOST_MPL_MSVC_ETI_BUG)
+//: workaround for ETI bug
+template<>
+struct BOOST_PP_CAT(apply,i)<AUX_APPLY_N_SPEC_PARAMS(i, int)>
+{
+ typedef int type;
+};
+#endif
+
+# endif // i > 0
+
+# if !defined(BOOST_MPL_NO_APPLY_TEMPLATE)
+# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+#if i == BOOST_MPL_METAFUNCTION_MAX_ARITY
+
+//: primary template (not a specialization!)
+template<
+ typename F AUX_APPLY_N_COMMA_PARAMS(i, typename T)
+ >
+struct apply
+ : BOOST_PP_CAT(apply,i)< F AUX_APPLY_N_COMMA_PARAMS(i, T) >
+{
+};
+
+#else
+
+template<
+ typename F AUX_APPLY_N_COMMA_PARAMS(i, typename T)
+ >
+struct apply< F AUX_APPLY_N_PARTIAL_SPEC_PARAMS(i, T, void_) >
+ : BOOST_PP_CAT(apply,i)< F AUX_APPLY_N_COMMA_PARAMS(i, T) >
+{
+};
+
+#endif // i == BOOST_MPL_METAFUNCTION_MAX_ARITY
+
+# else
+
+namespace aux {
+
+template<>
+struct apply_impl_chooser<i>
+{
+ template<
+ typename F, AUX_APPLY_PARAMS(typename T)
+ >
+ struct result_
+ {
+ typedef BOOST_PP_CAT(apply,i)<
+ F AUX_APPLY_N_COMMA_PARAMS(i, T)
+ > type;
+ };
+};
+
+} // namespace aux
+
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# endif // BOOST_MPL_NO_APPLY_TEMPLATE
+
+# undef i
+
+///// iteration, depth == 2
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+# define j BOOST_PP_FRAME_ITERATION(2)
+
+namespace aux {
+
+template<
+ typename F, AUX_APPLY_N_PARAMS(i, typename T)
+ >
+struct BOOST_PP_CAT(apply_impl,i)<
+ BOOST_MPL_PP_ADD(i, j)
+ , F
+ , AUX_APPLY_N_PARAMS(i, T)
+ >
+{
+ typedef typename F::template apply<
+ AUX_APPLY_N_PARAMS(i, T)
+ BOOST_PP_COMMA_IF(j) BOOST_MPL_PP_ENUM(j, void_)
+ > type;
+};
+
+} // namespace aux
+
+# undef j
+
+#endif // BOOST_PP_IS_ITERATING
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost/mpl/apply_if.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2000-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_APPLY_IF_HPP_INCLUDED
+#define BOOST_MPL_APPLY_IF_HPP_INCLUDED
+
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/aux_/apply.hpp"
+#include "boost/mpl/aux_/void_spec.hpp"
+#include "boost/mpl/aux_/lambda_support.hpp"
+
+namespace boost {
+namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(C)
+ , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(F1)
+ , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(F2)
+ >
+struct apply_if
+{
+ private:
+ typedef typename if_<C,F1,F2>::type nullary_func_;
+
+ public:
+ typedef typename BOOST_MPL_AUX_APPLY0(nullary_func_)::type type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,apply_if,(C,F1,F2))
+};
+
+// (almost) copy & paste in order to save one more
+// recursively nested template instantiation to user
+template<
+ bool C
+ , typename F1
+ , typename F2
+ >
+struct apply_if_c
+{
+ private:
+ typedef typename if_c<C,F1,F2>::type nullary_func_;
+
+ public:
+ typedef typename BOOST_MPL_AUX_APPLY0(nullary_func_)::type type;
+};
+
+BOOST_MPL_AUX_VOID_SPEC(3, apply_if)
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_APPLY_IF_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/arg.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Peter Dimov, Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_ARG_HPP_INCLUDED
+#define BOOST_MPL_ARG_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/static_constant.hpp"
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include "boost/mpl/arg_fwd.hpp"
+# include "boost/mpl/void.hpp"
+# include "boost/mpl/aux_/arity_spec.hpp"
+# include "boost/mpl/aux_/arg_typedef.hpp"
+# include "boost/static_assert.hpp"
+#endif
+
+#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+
+#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER arg.hpp
+# include "boost/mpl/aux_/include_preprocessed.hpp"
+
+#else
+# include "boost/mpl/limits/arity.hpp"
+# include "boost/mpl/aux_/preprocessor/default_params.hpp"
+# include "boost/mpl/aux_/preprocessor/params.hpp"
+# include "boost/mpl/aux_/config/lambda.hpp"
+# include "boost/mpl/aux_/config/dtp.hpp"
+# include "boost/mpl/aux_/config/nttp.hpp"
+
+# include "boost/preprocessor/iterate.hpp"
+# include "boost/preprocessor/inc.hpp"
+# include "boost/preprocessor/cat.hpp"
+
+namespace boost {
+namespace mpl {
+
+// local macro, #undef-ined at the end of the header
+#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+# define AUX_ARG_N_DEFAULT_PARAMS(param,value) \
+ BOOST_MPL_PP_DEFAULT_PARAMS( \
+ BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ , param \
+ , value \
+ ) \
+ /**/
+#else
+# define AUX_ARG_N_DEFAULT_PARAMS(param,value) \
+ BOOST_MPL_PP_PARAMS( \
+ BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ , param \
+ ) \
+ /**/
+#endif
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY, "boost/mpl/arg.hpp"))
+#include BOOST_PP_ITERATE()
+
+
+# undef AUX_ARG_N_DEFAULT_PARAMS
+
+BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1,int,arg)
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_ARG_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i BOOST_PP_FRAME_ITERATION(1)
+
+#if i > 0
+
+template<> struct arg<i>
+{
+ BOOST_STATIC_CONSTANT(int, value = i);
+ typedef arg<BOOST_PP_INC(i)> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ AUX_ARG_N_DEFAULT_PARAMS(typename U, void_)
+ >
+ struct apply
+ {
+ typedef BOOST_PP_CAT(U,i) type;
+#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x561 && defined(BOOST_STRICT_CONFIG))
+ private:
+ BOOST_STATIC_CONSTANT(bool, nv = !is_void_<type>::value);
+ BOOST_STATIC_ASSERT(nv);
+#endif
+ };
+};
+
+#else
+
+template<> struct arg<-1>
+{
+ BOOST_STATIC_CONSTANT(int, value = -1);
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ AUX_ARG_N_DEFAULT_PARAMS(typename U, void_)
+ >
+ struct apply
+ {
+ typedef U1 type;
+#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x561 && defined(BOOST_STRICT_CONFIG))
+ private:
+ BOOST_STATIC_CONSTANT(bool, nv = !is_void_<type>::value);
+ BOOST_STATIC_ASSERT(nv);
+#endif
+ };
+};
+
+#endif // i > 0
+
+#undef i
+#endif // BOOST_PP_IS_ITERATING
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/arg_fwd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Peter Dimov, Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_ARG_FWD_HPP_INCLUDED
+#define BOOST_MPL_ARG_FWD_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/nttp.hpp"
+
+namespace boost {
+namespace mpl {
+
+template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct arg;
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_ARG_FWD_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/apply.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_APPLY_HPP_INCLUDED
+#define BOOST_MPL_AUX_APPLY_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/dtp.hpp"
+#include "boost/config.hpp"
+
+#define BOOST_MPL_AUX_APPLY(arity, args) \
+ BOOST_PP_CAT(BOOST_MPL_AUX_APPLY,arity) args \
+/**/
+
+// agurt, 14/nov/02: temporary fix, need to research a couple of ICEs to
+// get rid of this mess
+#if defined(BOOST_MSVC) && BOOST_MSVC == 1300 && !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include "boost/mpl/apply.hpp"
+#endif
+
+#if defined(BOOST_MPL_USE_APPLY_INTERNALLY) \
+ || defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
+ || defined(BOOST_MSVC) && (BOOST_MSVC < 1300 || BOOST_MSVC == 1300 && defined(BOOST_MPL_PREPROCESSING_MODE))
+
+# if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include "boost/mpl/apply.hpp"
+# endif
+
+// tokenization takes place before macro expansion (see 2.1 [lex.phases]
+// para 3-4), so, strictly speaking, spaces between '<', 'f', and '>' tokens
+// below (BOOST_MPL_AUX_APPLY0) are not required; they are needed in practice,
+// though, because there is at least one compiler (MSVC 6.5) that does not
+// conform to the standard here
+# define BOOST_MPL_AUX_APPLY0(f) apply0< f >
+# define BOOST_MPL_AUX_APPLY1(f,a1) apply1<f,a1>
+# define BOOST_MPL_AUX_APPLY2(f,a1,a2) apply2<f,a1,a2>
+# define BOOST_MPL_AUX_APPLY3(f,a1,a2,a3) apply3<f,a1,a2,a3>
+# define BOOST_MPL_AUX_APPLY4(f,a1,a2,a3,a4) apply4<f,a1,a2,a3,a4>
+# define BOOST_MPL_AUX_APPLY5(f,a1,a2,a3,a4,a5) apply5<f,a1,a2,a3,a4,a5>
+# define BOOST_MPL_AUX_APPLY6(f,a1,a2,a3,a4,a5,a6) apply6<f,a1,a2,a3,a4,a5,a6>
+# define BOOST_MPL_AUX_APPLY7(f,a1,a2,a3,a4,a5,a6,a7) apply7<f,a1,a2,a3,a4,a5,a6,a7>
+# define BOOST_MPL_AUX_APPLY8(f,a1,a2,a3,a4,a5,a6,a7,a8) apply8<f,a1,a2,a3,a4,a5,a6,a7,a8>
+# define BOOST_MPL_AUX_APPLY9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) apply9<f,a1,a2,a3,a4,a5,a6,a7,a8,a9>
+
+#else
+
+# define BOOST_MPL_AUX_APPLY0(f) f
+# define BOOST_MPL_AUX_APPLY1(f,a1) f::template apply<a1>
+# define BOOST_MPL_AUX_APPLY2(f,a1,a2) f::template apply<a1,a2>
+# define BOOST_MPL_AUX_APPLY3(f,a1,a2,a3) f::template apply<a1,a2,a3>
+# define BOOST_MPL_AUX_APPLY4(f,a1,a2,a3,a4) f::template apply<a1,a2,a3,a4>
+# define BOOST_MPL_AUX_APPLY5(f,a1,a2,a3,a4,a5) f::template apply<a1,a2,a3,a4,a5>
+# define BOOST_MPL_AUX_APPLY6(f,a1,a2,a3,a4,a5,a6) f::template apply<a1,a2,a3,a4,a5,a6>
+# define BOOST_MPL_AUX_APPLY7(f,a1,a2,a3,a4,a5,a6,a7) f::template apply<a1,a2,a3,a4,a5,a6,a7>
+# define BOOST_MPL_AUX_APPLY8(f,a1,a2,a3,a4,a5,a6,a7,a8) f::template apply<a1,a2,a3,a4,a5,a6,a7,a8>
+# define BOOST_MPL_AUX_APPLY9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) f::template apply<a1,a2,a3,a4,a5,a6,a7,a8,a9>
+
+#endif
+
+#endif // BOOST_MPL_AUX_APPLY_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/arg_typedef.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_ARG_TYPEDEF_HPP_INCLUDED
+#define BOOST_MPL_AUX_ARG_TYPEDEF_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/lambda.hpp"
+
+#if defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+# define BOOST_MPL_AUX_ARG_TYPEDEF(T, name) typedef T name;
+#else
+# define BOOST_MPL_AUX_ARG_TYPEDEF(T, name) /**/
+#endif
+
+#endif // BOOST_MPL_AUX_ARG_TYPEDEF_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/arity_spec.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED
+#define BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/dtp.hpp"
+#include "boost/mpl/aux_/preprocessor/params.hpp"
+#include "boost/mpl/aux_/arity.hpp"
+#include "boost/mpl/limits/arity.hpp"
+#include "boost/config.hpp"
+
+#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+# define BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,type,name) \
+namespace aux { \
+template< BOOST_MPL_AUX_NTTP_DECL(int, N), BOOST_MPL_PP_PARAMS(i,type T) > \
+struct arity< \
+ name< BOOST_MPL_PP_PARAMS(i,T) > \
+ , N \
+ > \
+{ \
+ BOOST_STATIC_CONSTANT(int \
+ , value = BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ ); \
+}; \
+} \
+/**/
+#else
+# define BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,type,name) /**/
+#endif
+
+# define BOOST_MPL_AUX_ARITY_SPEC(i,name) \
+ BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,typename,name) \
+/**/
+
+#endif // BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/config/dtp.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_CONFIG_COMPILER_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_COMPILER_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/dtp.hpp"
+#include "boost/mpl/aux_/config/ttp.hpp"
+#include "boost/config.hpp"
+
+#if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+# define BOOST_MPL_COMPILER_DIR msvc60
+
+#elif defined(BOOST_MSVC) && BOOST_MSVC == 1300
+# define BOOST_MPL_COMPILER_DIR msvc70
+
+#elif defined(__GNUC__) && !defined(__EDG_VERSION__)
+# define BOOST_MPL_COMPILER_DIR gcc
+
+#elif defined(__BORLANDC__)
+# if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+# define BOOST_MPL_COMPILER_DIR bcc551
+# else
+# define BOOST_MPL_COMPILER_DIR bcc
+# endif
+
+#elif defined(__MWERKS__)
+# if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+# define BOOST_MPL_COMPILER_DIR mwcw
+# else
+# define BOOST_MPL_COMPILER_DIR plain
+# endif
+
+#elif defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# define BOOST_MPL_COMPILER_DIR no_ctps
+
+#elif defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS)
+# define BOOST_MPL_COMPILER_DIR no_ttp
+
+#else
+# define BOOST_MPL_COMPILER_DIR plain
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_COMPILER_HPP_INCLUDED
#include "boost/config.hpp"
-#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
- && !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION)
+#if !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG))
+
# define BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION
+
#endif
// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is defined in "boost/config.hpp"
// the owner class is a class template), and Borland 5.6 isn't even
// able to compile a definition of nested class template with DTP
-#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 && \
- (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
- && !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && defined(__BORLANDC__) && __BORLANDC__ >= 0x560 && \
+ (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG))
+
# define BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES
+
#endif
-#if defined(__MWERKS__) && __MWERKS__ <= 0x3001 \
- || defined(__BORLANDC__) && (__BORLANDC__ <= 0x570 || !defined(BOOST_STRICT_CONFIG)) \
- || defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
- && !defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+
+#if !defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( defined(__MWERKS__) && __MWERKS__ <= 0x3001 \
+ || defined(__BORLANDC__) && (__BORLANDC__ <= 0x570 || !defined(BOOST_STRICT_CONFIG)) \
+ || defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
+ )
+
# define BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES
+
#endif
#endif // BOOST_MPL_AUX_CONFIG_DTP_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/overload_resolution.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
+
+#ifndef BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED
+
+// + file: boost/mpl/aux_/config/overload_resolution.hpp
+// + last modified: 23/jun/03
+
+// Copyright (c) 2002-03
// Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#ifndef BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED
-#define BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED
+#include "boost/mpl/aux_/config/workaround.hpp"
-#include "boost/config.hpp"
+#if !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
+ || BOOST_WORKAROUND(__MWERKS__, < 0x3001) \
+ )
-#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
- || defined(__MWERKS__) && __MWERKS__ < 0x3001 \
- && !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION)
# define BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION
+
#endif
#endif // BOOST_MPL_AUX_CONFIG_OVERLOAD_RESOLUTION_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/preprocessor.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2000-02
-// Aleksey Gurtovoy
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
#ifndef BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED
-#include "boost/config.hpp"
+// Copyright (c) 2000-04 Aleksey Gurtovoy
+//
+// Use, modification and distribution are subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
+// at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/preprocessor.hpp,v $
+// $Date: 2004/01/20 16:26:31 $
+// $Revision: 1.4.2.1 $
+
+#include "boost/mpl/aux_/config/workaround.hpp"
+
+#if !defined(BOOST_MPL_BROKEN_PP_MACRO_EXPANSION) \
+ && ( BOOST_WORKAROUND(__MWERKS__, <= 0x3003) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
+ || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
+ )
-#if defined(__MWERKS__) && (__MWERKS__ <= 0x3003 || !defined(BOOST_STRICT_CONFIG)) \
- || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
- || defined(__IBMCPP__) && (__IBMCPP__ <= 502 || !defined(BOOST_STRICT_CONFIG))
# define BOOST_MPL_BROKEN_PP_MACRO_EXPANSION
+
#endif
//#define BOOST_MPL_NO_OWN_PP_PRIMITIVES
+#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING) \
+ && BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x833))
+
+# define BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING
+
+#endif
+
#endif // BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED
#include "boost/config.hpp"
-#if defined(BOOST_NO_TEMPLATE_TEMPLATES) \
- && (!defined(BOOST_MSVC) || BOOST_MSVC < 1300)
+#if defined(BOOST_NO_TEMPLATE_TEMPLATES) \
+ && ( !defined(BOOST_MSVC) || BOOST_MSVC < 1300 )
+
# define BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS
+
#endif
-#if defined(__GNUC__) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ <= 2 \
- || !defined(BOOST_STRICT_CONFIG)) \
- || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
- && !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+
+#if !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( defined(__GNUC__) && !defined(__EDG_VERSION__) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ <= 2 \
+ || !defined(BOOST_STRICT_CONFIG)) \
+ || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
+ )
+
# define BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+
#endif
#endif // BOOST_MPL_AUX_CONFIG_TTP_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/config/use_preprocessed.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2002
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
+
+//#define BOOST_MPL_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/has_xxx.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// Aleksey Gurtovoy
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
#ifndef BOOST_MPL_AUX_HAS_XXX_HPP_INCLUDED
#define BOOST_MPL_AUX_HAS_XXX_HPP_INCLUDED
+// Copyright (C) Aleksey Gurtovoy 2002-2003
+// Copyright (C) David Abrahams 2002-2003
+//
+// Use, modification and distribution are subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
+// at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /home/lyx/cvs/lyx-devel/boost/boost/mpl/aux_/Attic/has_xxx.hpp,v $
+// $Date: 2004/02/05 09:14:17 $
+// $Revision: 1.2 $
+
#include "boost/mpl/aux_/type_wrapper.hpp"
#include "boost/mpl/aux_/yes_no.hpp"
#include "boost/mpl/aux_/config/msvc_typename.hpp"
#include "boost/mpl/aux_/config/overload_resolution.hpp"
#include "boost/mpl/aux_/config/static_constant.hpp"
+#include "boost/detail/workaround.hpp"
-#if !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION) && (!defined(__GNUC__) || __GNUC__ == 3)
+#if !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION) \
+ && !BOOST_WORKAROUND(__GNUC__, <= 2) \
+ && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x833))
-# if (!defined(BOOST_MSVC) || BOOST_MSVC > 1300)
+# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
// the implementation below is based on a USENET newsgroup's posting by
// Rani Sharoni (comp.lang.c++.moderated, 2002-03-17 07:45:09 PST)
-# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
-template< typename T > \
-boost::mpl::aux::yes_tag \
-trait##_helper( \
- boost::mpl::aux::type_wrapper<T> const volatile* \
- , boost::mpl::aux::type_wrapper<BOOST_MSVC_TYPENAME T::name>* = 0 \
- ); \
-\
-boost::mpl::aux::no_tag \
-trait##_helper(...); \
-\
-template< typename T > \
-struct trait \
-{ \
- typedef boost::mpl::aux::type_wrapper<T> t_; \
- BOOST_STATIC_CONSTANT(bool, value = \
- sizeof((trait##_helper)(static_cast<t_*>(0))) \
- == sizeof(boost::mpl::aux::yes_tag) \
- ); \
-}; \
+# if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
+template< typename T > \
+boost::mpl::aux::yes_tag \
+trait##_helper( \
+ boost::mpl::aux::type_wrapper<T> const volatile* \
+ , boost::mpl::aux::type_wrapper<BOOST_MSVC_TYPENAME T::name>* = 0 \
+ ); \
+ \
+boost::mpl::aux::no_tag \
+trait##_helper(...); \
+ \
+template< typename T > \
+struct trait \
+{ \
+ typedef boost::mpl::aux::type_wrapper<T> t_; \
+ BOOST_STATIC_CONSTANT(bool, value = \
+ sizeof((trait##_helper)(static_cast<t_*>(0))) \
+ == sizeof(boost::mpl::aux::yes_tag) \
+ ); \
+}; \
+/**/
+
+# else // conforming compilers
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
+template< typename T > \
+struct trait \
+{ \
+ struct helpers \
+ { \
+ template< typename U > \
+ static boost::mpl::aux::yes_tag \
+ test( \
+ boost::mpl::aux::type_wrapper<U> const volatile* \
+ , boost::mpl::aux::type_wrapper<BOOST_MSVC_TYPENAME U::name>* = 0 \
+ ); \
+ \
+ static boost::mpl::aux::no_tag \
+ test(...); \
+ }; \
+ \
+ typedef boost::mpl::aux::type_wrapper<T> t_; \
+ \
+ BOOST_STATIC_CONSTANT( \
+ bool, value = \
+ sizeof(helpers::test(static_cast<t_*>(0))) \
+ == sizeof(boost::mpl::aux::yes_tag) \
+ ); \
+}; \
/**/
+# endif
+
# else
-#include "boost/mpl/if.hpp"
-#include "boost/mpl/bool.hpp"
-#include "boost/preprocessor/cat.hpp"
+# include "boost/mpl/if.hpp"
+# include "boost/mpl/bool.hpp"
+# include "boost/preprocessor/cat.hpp"
// agurt, 11/sep/02: MSVC version, based on a USENET newsgroup's posting by
// John Madsen (comp.lang.c++.moderated, 1999-11-12 19:17:06 GMT);
struct has_xxx_tag;
-template< typename T >
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+ template <class U>
+ struct msvc_incomplete_array
+ {
+ typedef char (&type)[sizeof(U) + 1];
+ };
+# endif
+
+template <typename T>
struct msvc_is_incomplete
{
- struct incomplete_;
- BOOST_STATIC_CONSTANT(bool, value =
- sizeof(void (T::*)()) == sizeof(void (incomplete_::*)())
- );
+ // MSVC is capable of some kinds of SFINAE. If U is an incomplete
+ // type, it won't pick the second overload
+ static char tester(...);
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+ template <class U>
+ static typename msvc_incomplete_array<U>::type tester(type_wrapper<U>);
+# else
+ template <class U>
+ static char (& tester(type_wrapper<U>) )[sizeof(U)+1];
+# endif
+
+ BOOST_STATIC_CONSTANT(
+ bool, value = sizeof(tester(type_wrapper<T>())) == 1);
};
template<>
}}}
-# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, unused) \
-template< typename T, typename name = ::boost::mpl::aux::has_xxx_tag > \
-struct BOOST_PP_CAT(trait,_impl) : T \
-{ \
- private: \
- static boost::mpl::aux::no_tag test(void(*)(::boost::mpl::aux::has_xxx_tag)); \
- static boost::mpl::aux::yes_tag test(...); \
-\
- public: \
- BOOST_STATIC_CONSTANT(bool, value = \
- sizeof(test(static_cast<void(*)(name)>(0))) \
- != sizeof(boost::mpl::aux::no_tag) \
- ); \
-}; \
-\
-template< typename T > struct trait \
- : boost::mpl::if_c< \
- boost::mpl::aux::msvc_is_incomplete<T>::value \
- , boost::mpl::bool_<false> \
- , BOOST_PP_CAT(trait,_impl)<T> \
- >::type \
-{ \
-}; \
-\
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, void) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, bool) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, char) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed char) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned char) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed short) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned short) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed int) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned int) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed long) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned long) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, float) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, double) \
-BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, long double) \
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, unused) \
+template< typename T, typename name = ::boost::mpl::aux::has_xxx_tag > \
+struct BOOST_PP_CAT(trait,_impl) : T \
+{ \
+ private: \
+ static boost::mpl::aux::no_tag test(void(*)(::boost::mpl::aux::has_xxx_tag)); \
+ static boost::mpl::aux::yes_tag test(...); \
+ \
+ public: \
+ BOOST_STATIC_CONSTANT(bool, value = \
+ sizeof(test(static_cast<void(*)(name)>(0))) \
+ != sizeof(boost::mpl::aux::no_tag) \
+ ); \
+}; \
+ \
+template< typename T > struct trait \
+ : boost::mpl::if_c< \
+ boost::mpl::aux::msvc_is_incomplete<T>::value \
+ , boost::mpl::bool_<false> \
+ , BOOST_PP_CAT(trait,_impl)<T> \
+ >::type \
+{ \
+}; \
+ \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, void) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, bool) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, char) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed char) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned char) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed short) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned short) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed int) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned int) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, signed long) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, unsigned long) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, float) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, double) \
+BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, long double) \
/**/
-# define BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, T) \
-template<> struct trait<T> \
-{ \
- BOOST_STATIC_CONSTANT(bool,value = false); \
-}; \
+# define BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, T) \
+template<> struct trait<T> \
+{ \
+ BOOST_STATIC_CONSTANT(bool,value = false); \
+}; \
/**/
-#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
-# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
- BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, unused) \
- BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, wchar_t) \
- /**/
-#else
-# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
- BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, unused) \
- /**/
-#endif
+# if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
+ BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, unused) \
+ BOOST_MPL_AUX_HAS_XXX_TRAIT_SPEC(trait, wchar_t) \
+ /**/
+
+# else
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, unused) \
+ BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, unused) \
+ /**/
+
+# endif
# endif // BOOST_MSVC > 1300
#else
// agurt, 11/jan/03: signals a stub-only implementation
-# define BOOST_NO_MPL_AUX_HAS_XXX
-
-# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_value) \
-template< typename T > \
-struct trait \
-{ \
- BOOST_STATIC_CONSTANT(bool, value = default_value); \
-}; \
+# define BOOST_MPL_NO_AUX_HAS_XXX
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_value) \
+template< typename T > \
+struct trait \
+{ \
+ BOOST_STATIC_CONSTANT(bool, value = default_value); \
+}; \
/**/
#endif // BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION
-#define BOOST_MPL_HAS_XXX_TRAIT_DEF(name) \
-BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_##name, name, false) \
+#define BOOST_MPL_HAS_XXX_TRAIT_DEF(name) \
+BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_##name, name, false) \
/**/
#endif // BOOST_MPL_AUX_HAS_XXX_HPP_INCLUDED
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__GNUC__, < 3)
-# define BOOST_MPL_AUX_ICE_CAST(T, expr) T(expr)
+# define BOOST_MPL_AUX_ICE_CAST(T, expr) (T)(expr)
#elif BOOST_WORKAROUND(__MWERKS__, <= 0x3001)
# define BOOST_MPL_AUX_ICE_CAST(T, expr) (T)(expr)
#else
--- /dev/null
+
+// Copyright (c) 2001-04 Aleksey Gurtovoy
+//
+// Use, modification and distribution are subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
+// at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/include_preprocessed.hpp,v $
+// $Date: 2004/01/20 16:26:31 $
+// $Revision: 1.3.6.1 $
+
+// no include guards, the header is intended for multiple inclusion!
+
+#include "boost/mpl/aux_/config/compiler.hpp"
+#include "boost/mpl/aux_/config/preprocessor.hpp"
+#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/stringize.hpp"
+
+#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
+# define AUX_PREPROCESSED_HEADER \
+ BOOST_MPL_COMPILER_DIR/BOOST_MPL_PREPROCESSED_HEADER \
+/**/
+#else
+# define AUX_PREPROCESSED_HEADER \
+ BOOST_PP_CAT(BOOST_MPL_COMPILER_DIR,/)##BOOST_MPL_PREPROCESSED_HEADER \
+/**/
+#endif
+
+# include BOOST_PP_STRINGIZE(boost/mpl/aux_/preprocessed/AUX_PREPROCESSED_HEADER)
+# undef AUX_PREPROCESSED_HEADER
+
+#undef BOOST_MPL_PREPROCESSED_HEADER
// + file: boost/mpl/aux_/intergal_wrapper.hpp
-// + last modified: 27/jan/03
+// + last modified: 12/apr/03
// Copyright (c) 2000-03
// Aleksey Gurtovoy
// no include guards, the header is intended for multiple inclusion!
-#include "boost/mpl/aux_/ice_cast.hpp"
+#include "boost/mpl/aux_/static_cast.hpp"
#include "boost/mpl/aux_/config/nttp.hpp"
#include "boost/mpl/aux_/config/static_constant.hpp"
#include "boost/mpl/aux_/config/workaround.hpp"
#endif
#if !defined(AUX_WRAPPER_INST)
-# define AUX_WRAPPER_INST(value) mpl::AUX_WRAPPER_NAME< value >
+# if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
+# define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< value >
+# else
+# define AUX_WRAPPER_INST(value) mpl::AUX_WRAPPER_NAME< value >
+# endif
#endif
namespace boost { namespace mpl {
// either
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
private:
- BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
- BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
+ BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
+ BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
public:
typedef AUX_WRAPPER_INST(next_value) next;
typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800))
- typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
- typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
+ typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
+ typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else
- typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
- typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
+ typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
+ typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
#endif
// enables uniform function call syntax for families of overloaded
// functions that return objects of both arithmetic ('int', 'long',
// 'double', etc.) and wrapped integral types (for an example, see
// "mpl/example/power.cpp")
- operator AUX_WRAPPER_VALUE_TYPE() const { return this->value; }
+ operator AUX_WRAPPER_VALUE_TYPE() const { return static_cast<AUX_WRAPPER_VALUE_TYPE>(this->value); }
};
+#if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
+template< AUX_WRAPPER_PARAMS(N) >
+AUX_WRAPPER_VALUE_TYPE const AUX_WRAPPER_INST(N)::value;
+#endif
+
}} // namespace boost::mpl
#undef AUX_WRAPPER_NAME
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/is_msvc_eti_arg.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_IS_MSVC_ETI_ARG_HPP_INCLUDED
+#define BOOST_MPL_AUX_IS_MSVC_ETI_ARG_HPP_INCLUDED
+
+#include "boost/mpl/aux_/yes_no.hpp"
+#include "boost/mpl/aux_/config/eti.hpp"
+#include "boost/mpl/aux_/config/static_constant.hpp"
+
+namespace boost { namespace mpl { namespace aux {
+
+#if defined(BOOST_MPL_MSVC_ETI_BUG)
+
+#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
+
+template< typename T >
+struct is_msvc_eti_arg
+{
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+#else
+
+struct eti_int_convertible
+{
+ eti_int_convertible(int);
+};
+
+template< typename T >
+struct is_msvc_eti_arg
+{
+ static no_tag test(...);
+ static yes_tag test(eti_int_convertible);
+ static T& get();
+
+ BOOST_STATIC_CONSTANT(bool, value =
+ sizeof(test(get())) == sizeof(yes_tag)
+ );
+};
+
+#endif // BOOST_MPL_MSVC_60_ETI_BUG
+
+template<>
+struct is_msvc_eti_arg<int>
+{
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+#endif // BOOST_MPL_MSVC_ETI_BUG
+
+}}} // namespace boost::mpl::aux
+
+#endif // BOOST_MPL_AUX_IS_MSVC_ETI_ARG_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/lambda_spec.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_LAMBDA_SPEC_HPP_INCLUDED
+#define BOOST_MPL_AUX_LAMBDA_SPEC_HPP_INCLUDED
+
+#include "boost/mpl/void.hpp"
+#include "boost/mpl/lambda_fwd.hpp"
+#include "boost/mpl/int_fwd.hpp"
+#include "boost/mpl/aux_/preprocessor/params.hpp"
+#include "boost/mpl/aux_/lambda_arity_param.hpp"
+#include "boost/mpl/aux_/config/lambda.hpp"
+
+#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+
+# define BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(i, name) \
+template< \
+ BOOST_MPL_PP_PARAMS(i, typename T) \
+ , typename Tag \
+ > \
+struct lambda< \
+ name< BOOST_MPL_PP_PARAMS(i, T) > \
+ , Tag \
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \
+ > \
+{ \
+ typedef name< BOOST_MPL_PP_PARAMS(i, T) > type; \
+}; \
+/**/
+
+#else
+
+# define BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(i, name) /**/
+
+#endif
+
+#endif // BOOST_MPL_AUX_LAMBDA_SPEC_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/msvc_msvc_eti_base.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2001-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED
+#define BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED
+
+#include "boost/mpl/aux_/config/eti.hpp"
+#include "boost/mpl/aux_/is_msvc_eti_arg.hpp"
+
+namespace boost { namespace mpl { namespace aux {
+
+#if defined(BOOST_MPL_MSVC_ETI_BUG)
+
+template< bool > struct msvc_eti_base_impl
+{
+ template< typename T > struct result_
+ {
+ typedef T type;
+ };
+};
+
+template<> struct msvc_eti_base_impl<true>
+{
+ template< typename T > struct result_
+ {
+ typedef result_ type;
+ };
+};
+
+template< typename T > struct msvc_eti_base
+ : msvc_eti_base_impl< is_msvc_eti_arg<T>::value >
+ ::template result_<T>
+{
+};
+
+#else
+
+template< typename T > struct msvc_eti_base
+{
+ typedef T type;
+};
+
+#endif // BOOST_MPL_MSVC_ETI_BUG
+
+}}} // namespace boost::mpl::aux
+
+#endif // BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/msvc_never_true.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2000-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_MSVC_NEVER_TRUE_HPP_INCLUDED
+#define BOOST_MPL_AUX_MSVC_NEVER_TRUE_HPP_INCLUDED
+
+#include "boost/config.hpp"
+
+#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
+
+namespace boost {
+namespace mpl {
+namespace aux {
+
+template< typename T >
+struct msvc_never_true
+{
+ enum { value = false };
+};
+
+} // namespace aux
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MSVC < 1300
+
+#endif // BOOST_MPL_AUX_MSVC_NEVER_TRUE_HPP_INCLUDED
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/aux_/nested_type_wknd.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2000-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_AUX_NESTED_TYPE_WKND_HPP_INCLUDED
+#define BOOST_MPL_AUX_NESTED_TYPE_WKND_HPP_INCLUDED
+
+#include "boost/config.hpp"
+
+#if defined(__GNUC__) && (__GNUC__ < 3 || __GNUC__ == 3 && __GNUC_MINOR__ <= 2 \
+ || !defined(BOOST_STRICT_CONFIG)) \
+ || defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
+ || defined(__SUNPRO_CC)
+
+namespace boost { namespace mpl { namespace aux {
+
+template< typename T >
+struct nested_type_wknd
+ : T::type
+{
+};
+
+}}} // namespace boost::mpl::aux
+
+# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) ::boost::mpl::aux::nested_type_wknd<T>
+
+#else
+
+# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) T::type
+
+#endif // __GNUC__
+
+#endif // BOOST_MPL_AUX_NESTED_TYPE_WKND_HPP_INCLUDED
--- /dev/null
+// preprocessed version of 'boost/mpl/aux_/config/use_preprocessed.hpp' header
+// see the original for copyright information
+
+namespace boost { namespace mpl {
+
+namespace aux {
+
+template< bool C_, typename T1, typename T2, typename T3, typename T4 >
+struct and_impl
+ : false_
+{
+};
+
+template< typename T1, typename T2, typename T3, typename T4 >
+struct and_impl< true,T1,T2,T3,T4 >
+ : and_impl<
+ BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
+ , T2, T3, T4
+ , true_
+ >
+{
+};
+
+template<>
+struct and_impl<
+ true
+ , true_, true_, true_, true_
+ >
+ : true_
+{
+};
+
+} // namespace aux
+
+template<
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
+ , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
+ , typename T3 = true_, typename T4 = true_, typename T5 = true_
+ >
+struct and_
+
+ : aux::and_impl<
+ BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
+ , T2, T3, T4, T5
+ >
+
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 5
+ , and_
+ , (T1, T2, T3, T4, T5)
+ )
+};
+
+BOOST_MPL_AUX_VOID_SPEC_EXT(
+ 2
+ , 5
+ , and_
+ )
+
+}} // namespace boost::mpl
+
--- /dev/null
+// preprocessed version of 'boost/mpl/apply.hpp' header
+// see the original for copyright information
+
+namespace boost {
+namespace mpl {
+
+template<
+ typename F, typename T1 = void_, typename T2 = void_
+ , typename T3 = void_, typename T4 = void_, typename T5 = void_
+ >
+struct apply;
+
+template< typename F >
+struct apply0 : F
+{
+};
+
+template<
+ typename F
+ >
+struct apply< F,void_,void_,void_,void_,void_ >
+ : apply0<F>
+{
+};
+
+template<
+ typename F, typename T1
+ >
+struct apply1
+ : F::template apply<
+ T1
+ >
+{
+};
+
+template<
+ typename F, typename T1
+ >
+struct apply< F,T1,void_,void_,void_,void_ >
+ : apply1< F,T1 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2
+ >
+struct apply2
+ : F::template apply<
+ T1, T2
+ >
+{
+};
+
+template<
+ typename F, typename T1, typename T2
+ >
+struct apply< F,T1,T2,void_,void_,void_ >
+ : apply2< F,T1,T2 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ >
+struct apply3
+ : F::template apply<
+ T1, T2, T3
+ >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ >
+struct apply< F,T1,T2,T3,void_,void_ >
+ : apply3< F,T1,T2,T3 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ >
+struct apply4
+ : F::template apply<
+ T1, T2, T3, T4
+ >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ >
+struct apply< F,T1,T2,T3,T4,void_ >
+ : apply4< F,T1,T2,T3,T4 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct apply5
+ : F::template apply<
+ T1, T2, T3, T4, T5
+ >
+{
+};
+
+// primary template (not a specialization!)
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct apply
+ : apply5< F,T1,T2,T3,T4,T5 >
+{
+};
+
+} // namespace mpl
+} // namespace boost
+
--- /dev/null
+// preprocessed version of 'boost/mpl/arg.hpp' header
+// see the original for copyright information
+
+namespace boost {
+namespace mpl {
+
+template<> struct arg<-1>
+{
+ static int const value = -1;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ typedef U1 type;
+
+ private:
+ static bool const nv = !is_void_<type>::value;
+ BOOST_STATIC_ASSERT(nv);
+
+ };
+};
+
+template<> struct arg<1>
+{
+ static int const value = 1;
+ typedef arg<2> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ typedef U1 type;
+
+ private:
+ static bool const nv = !is_void_<type>::value;
+ BOOST_STATIC_ASSERT(nv);
+
+ };
+};
+
+template<> struct arg<2>
+{
+ static int const value = 2;
+ typedef arg<3> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ typedef U2 type;
+
+ private:
+ static bool const nv = !is_void_<type>::value;
+ BOOST_STATIC_ASSERT(nv);
+
+ };
+};
+
+template<> struct arg<3>
+{
+ static int const value = 3;
+ typedef arg<4> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ typedef U3 type;
+
+ private:
+ static bool const nv = !is_void_<type>::value;
+ BOOST_STATIC_ASSERT(nv);
+
+ };
+};
+
+template<> struct arg<4>
+{
+ static int const value = 4;
+ typedef arg<5> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ typedef U4 type;
+
+ private:
+ static bool const nv = !is_void_<type>::value;
+ BOOST_STATIC_ASSERT(nv);
+
+ };
+};
+
+template<> struct arg<5>
+{
+ static int const value = 5;
+ typedef arg<6> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ typedef U5 type;
+
+ private:
+ static bool const nv = !is_void_<type>::value;
+ BOOST_STATIC_ASSERT(nv);
+
+ };
+};
+
+BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1, int, arg)
+
+} // namespace mpl
+} // namespace boost
+
--- /dev/null
+// preprocessed version of 'boost/mpl/aux_/config/use_preprocessed.hpp' header
+// see the original for copyright information
+
+namespace boost { namespace mpl {
+
+namespace aux {
+
+template< bool C_, typename T1, typename T2, typename T3, typename T4 >
+struct or_impl
+ : true_
+{
+};
+
+template< typename T1, typename T2, typename T3, typename T4 >
+struct or_impl< false,T1,T2,T3,T4 >
+ : or_impl<
+ BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
+ , T2, T3, T4
+ , false_
+ >
+{
+};
+
+template<>
+struct or_impl<
+ false
+ , false_, false_, false_, false_
+ >
+ : false_
+{
+};
+
+} // namespace aux
+
+template<
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
+ , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
+ , typename T3 = false_, typename T4 = false_, typename T5 = false_
+ >
+struct or_
+
+ : aux::or_impl<
+ BOOST_MPL_AUX_NESTED_TYPE_WKND(T1)::value
+ , T2, T3, T4, T5
+ >
+
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 5
+ , or_
+ , (T1, T2, T3, T4, T5)
+ )
+};
+
+BOOST_MPL_AUX_VOID_SPEC_EXT(
+ 2
+ , 5
+ , or_
+ )
+
+}} // namespace boost::mpl
+
--- /dev/null
+// preprocessed version of 'boost/mpl/aux_/config/use_preprocessed.hpp' header
+// see the original for copyright information
+
+namespace boost {
+namespace mpl {
+
+typedef arg< -1 > _;
+
+namespace placeholders {
+using boost::mpl::_;
+}
+
+// agurt, 17/mar/02: one more placeholder for the last 'apply#'
+// specialization
+
+typedef arg<1> _1;
+
+namespace placeholders {
+using boost::mpl::_1;
+}
+
+typedef arg<2> _2;
+
+namespace placeholders {
+using boost::mpl::_2;
+}
+
+typedef arg<3> _3;
+
+namespace placeholders {
+using boost::mpl::_3;
+}
+
+typedef arg<4> _4;
+
+namespace placeholders {
+using boost::mpl::_4;
+}
+
+typedef arg<5> _5;
+
+namespace placeholders {
+using boost::mpl::_5;
+}
+
+typedef arg<6> _6;
+
+namespace placeholders {
+using boost::mpl::_6;
+}
+
+} // namespace mpl
+} // namespace boost
+
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
+#define BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
+
+// + file: boost/mpl/aux_/static_cast.hpp
+// + last modified: 02/may/03
+
+// Copyright (c) 2001-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+#include "boost/mpl/aux_/config/workaround.hpp"
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
+ || BOOST_WORKAROUND(__GNUC__, < 3) \
+ || BOOST_WORKAROUND(__MWERKS__, <= 0x3001)
+# define BOOST_MPL_AUX_STATIC_CAST(T, expr) (T)(expr)
+#else
+# define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
+#endif
+
+#endif // BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
// Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
#ifndef BOOST_MPL_AUX_TEMPLATE_ARITY_FWD_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux/type_wrapper.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2000-02
+
+#ifndef BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
+#define BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
+
+// + file: boost/mpl/aux_/type_wrapper.hpp
+// + last modified: 09/may/03
+
+// Copyright (c) 2000-03
// Peter Dimov, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#ifndef BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
-#define BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
+#include "boost/mpl/aux_/config/ctps.hpp"
namespace boost {
namespace mpl {
typedef T type;
};
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+// agurt 08/may/03: a complicated way to extract the wrapped type; need it
+// mostly for the sake of GCC (3.2.x), which ICEs if you try to extract the
+// nested 'type' from 'type_wrapper<T>' when the latter was the result of a
+// 'typeof' expression
+template< typename T > struct wrapped_type;
+
+template< typename T > struct wrapped_type< type_wrapper<T> >
+{
+ typedef T type;
+};
+#else
+template< typename W > struct wrapped_type
+{
+ typedef typename W::type type;
+};
+#endif
+
} // namespace aux
} // namespace mpl
} // namespace boost
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
template<>
struct value_wknd<int>
- : int_<0>
+ : int_<1>
{
};
#endif
template<> \
struct lambda< \
name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \
+ , void_ \
, true \
> \
{ \
template<> \
struct lambda< \
name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \
+ , void_ \
BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \
> \
{ \
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/yes_no.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2001-02
-// Peter Dimov, Aleksey Gurtovoy
-//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
#ifndef BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
#define BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
-namespace boost {
-namespace mpl {
-namespace aux {
+// + file: boost/mpl/aux_/yes_no.hpp
+// + last modified: 05/nov/03
+
+// Copyright Aleksey Gurtovoy 2000-03
+//
+// Use, modification and distribution are subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy
+// at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+
+#include "boost/mpl/aux_/config/workaround.hpp"
+#include "boost/mpl/aux_/config/msvc.hpp"
+
+namespace boost { namespace mpl { namespace aux {
typedef char (&no_tag)[1];
typedef char (&yes_tag)[2];
-} // namespace aux
-} // namespace mpl
-} // namespace boost
+template< bool C_ > struct yes_no_tag
+{
+ typedef no_tag type;
+};
+
+template<> struct yes_no_tag<true>
+{
+ typedef yes_tag type;
+};
+
+
+template< long n > struct weighted_tag
+{
+#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ typedef char (&type)[n];
+#else
+ char buf[n];
+ typedef weighted_tag type;
+#endif
+};
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
+ || BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+template<> struct weighted_tag<0>
+{
+ typedef char (&type)[1];
+};
+#endif
+
+}}} // namespace boost::mpl::aux
#endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
#define BOOST_MPL_BOOL_HPP_INCLUDED
// + file: boost/mpl/bool.hpp
-// + last modified: 08/mar/03
+// + last modified: 12/apr/03
// Copyright (c) 2000-03
// Aleksey Gurtovoy
operator bool() const { return this->value; }
};
+#if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
+template< bool C_ >
+bool const bool_<C_>::value;
+#endif
+
}} // namespace boost::mpl
#endif // BOOST_MPL_BOOL_HPP_INCLUDED
+
#ifndef BOOST_MPL_BOOL_FWD_HPP_INCLUDED
#define BOOST_MPL_BOOL_FWD_HPP_INCLUDED
// Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
--- /dev/null
+//-----------------------------------------------------------------------------
+// boost mpl/identity.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2000-02
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+
+#ifndef BOOST_MPL_IDENTITY_HPP_INCLUDED
+#define BOOST_MPL_IDENTITY_HPP_INCLUDED
+
+#include "boost/mpl/aux_/void_spec.hpp"
+#include "boost/mpl/aux_/lambda_support.hpp"
+
+namespace boost {
+namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T)
+ >
+struct identity
+{
+ typedef T type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,identity,(T))
+};
+
+template<
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T)
+ >
+struct make_identity
+{
+ typedef identity<T> type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,make_identity,(T))
+};
+
+BOOST_MPL_AUX_VOID_SPEC(1, identity)
+BOOST_MPL_AUX_VOID_SPEC(1, make_identity)
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_IDENTITY_HPP_INCLUDED
#define BOOST_MPL_IF_HPP_INCLUDED
// + file: boost/mpl/if.hpp
-// + last modified: 10/mar/03
+// + last modified: 17/sep/03
// Copyright (c) 2000-03 Boost.org
//
//
// See http://www.boost.org/libs/mpl for documentation.
+#include "boost/mpl/void.hpp"
#include "boost/mpl/aux_/value_wknd.hpp"
-#include "boost/mpl/aux_/ice_cast.hpp"
+#include "boost/mpl/aux_/static_cast.hpp"
#include "boost/mpl/aux_/void_spec.hpp"
#include "boost/mpl/aux_/lambda_support.hpp"
#include "boost/mpl/aux_/config/workaround.hpp"
#include "boost/config.hpp"
+#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+# include "boost/mpl/arg_fwd.hpp"
+#endif
+
namespace boost {
namespace mpl {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN
+
template<
bool C
, typename T1
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561))
BOOST_MPL_AUX_VALUE_WKND(C)::value
#else
- BOOST_MPL_AUX_ICE_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(C)::value)
+ BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(C)::value)
#endif
, T1
, T2
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2))
};
-#elif defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
-
-// MSVC6.5-specific version
-
-template<
- bool C_
- , typename T1
- , typename T2
- >
-struct if_c
-{
- private:
- template<bool> struct answer { typedef T1 type; };
- template<> struct answer<false> { typedef T2 type; };
-
- public:
- typedef typename answer< C_ >::type type;
-};
-
-// (almost) copy & paste in order to save one more
-// recursively nested template instantiation to user
-template<
- typename C_
- , typename T1
- , typename T2
- >
-struct if_
-{
- private:
- template<bool> struct answer { typedef T1 type; };
- template<> struct answer<false> { typedef T2 type; };
-
- // agurt, 17/sep/02: in some situations MSVC 7.0 doesn't
- // handle 'answer<C::value>' expression very well
- enum { c_ = C_::value };
-
- public:
- typedef typename answer< BOOST_MPL_AUX_ICE_CAST(bool, c_) >::type type;
-
- BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C_,T1,T2))
-};
-
#else
// no partial class template specialization
} // namespace aux
template<
- bool C
+ bool C_
, typename T1
, typename T2
>
struct if_c
{
- typedef typename aux::if_impl< C >
+ typedef typename aux::if_impl< C_ >
::template result_<T1,T2>::type type;
};
// (almost) copy & paste in order to save one more
// recursively nested template instantiation to user
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(C)
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(C_)
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
>
struct if_
{
- typedef typename aux::if_impl< BOOST_MPL_AUX_ICE_CAST(bool, C::value) >
+ enum { msvc70_wknd_ = C_::value };
+
+ typedef typename aux::if_impl< BOOST_MPL_AUX_STATIC_CAST(bool, msvc70_wknd_) >
::template result_<T1,T2>::type type;
- BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2))
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C_,T1,T2))
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-BOOST_MPL_AUX_VOID_SPEC(3, if_)
+BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END
+
+BOOST_MPL_AUX_ALGORITHM_VOID_SPEC(3, if_)
+
+
+#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+
+// Aleksey, check it out: lazy if_ evaluation in lambdas!
+// I think this doesn't handle the case of
+//
+// _1<foo<_2>, bar<_2>, baz<_2> >
+//
+// (or however it is that you express that... when the ordinary bind3
+// computes the function based on the actual arguments). That leads me
+// to think that some kind of true currying might be a better
+// approach, e.g.:
+//
+//
+// boost::mpl::bind3<
+// boost::mpl::quote3<boost::mpl::if_>
+// , boost::mpl::bind1<boost::mpl::quote1<boost::is_reference>, boost::mpl::arg<1> >
+// , boost::mpl::arg<1>
+// , boost::mpl::bind1<boost::mpl::quote1<add_ptr>, boost::mpl::arg<1> >
+// >::apply<...>
+//
+// becomes:
+//
+// boost::mpl::bind<
+// boost::mpl::quote3<boost::mpl::if_>
+// >::bind<
+// , boost::mpl::bind1<boost::mpl::quote1<boost::is_reference>,
+// boost::mpl::arg<1> >
+// >::bind<
+// boost::mpl::arg<1>
+// >::bind<
+// boost::mpl::bind1<boost::mpl::quote1<add_ptr>, boost::mpl::arg<1> >
+// >::apply<...>
+//
+// so that after the 2nd bind we have a different function depending
+// on the result of is_reference.
+
+template <class T1, class T2, class T3, class T4> struct bind3;
+template <template <class T1, class T2, class T3> class F, class tag> struct quote3;
+
+namespace aux
+{
+ template <
+ typename T
+ , BOOST_MPL_PP_PARAMS(BOOST_MPL_METAFUNCTION_MAX_ARITY, typename U)
+ > struct resolve_bind_arg;
+
+ template<
+ typename T
+ , typename Arg
+ >
+ struct replace_unnamed_arg;
+}
+
+template<
+ typename T1, typename T2, typename T3
+ >
+struct bind3<quote3<if_, void_>, T1, T2, T3>
+{
+ template<
+ typename U1 = void_, typename U2 = void_, typename U3 = void_
+ , typename U4 = void_, typename U5 = void_
+ >
+ struct apply
+ {
+ private:
+ typedef quote3<if_, void_> a0;
+ typedef mpl::arg< 1> n1;
+
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next_arg n2;
+ typedef typename aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 >::type t1;
+
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next_arg n3;
+ typedef typename aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > f2;
+
+ typedef aux::replace_unnamed_arg< T3,n3 > r3;
+ typedef typename r3::type a3;
+ typedef typename r3::next_arg n4;
+ typedef typename aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > f3;
+
+ typedef typename if_<t1,f2,f3>::type f_;
+ public:
+ typedef typename f_::type type;
+ };
+};
+#endif
} // namespace mpl
} // namespace boost
-//-----------------------------------------------------------------------------
-// boost mpl/labmda_fwd.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2001-02
+
+#ifndef BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED
+#define BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED
+
+// + file: boost/mpl/labmda_fwd.hpp
+// + last modified: 02/aug/03
+
+// Copyright (c) 2001-03
// Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
-
-#ifndef BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED
-#define BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED
+//
+// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/aux_/lambda_arity_param.hpp"
#include "boost/mpl/aux_/config/lambda.hpp"
namespace mpl {
#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
-template< typename T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity) >
+
+template<
+ typename T
+ , typename Tag
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity)
+ >
struct lambda;
+
#else
-template< typename T, bool Protect > struct lambda;
+
+template<
+ typename T
+ , typename Tag
+ , bool Protect
+ >
+struct lambda;
+
#endif
} // namespace mpl
--- /dev/null
+
+#ifndef BOOST_MPL_NOT_HPP_INCLUDED
+#define BOOST_MPL_NOT_HPP_INCLUDED
+
+// + file: boost/mpl/not.hpp
+// + last modified: 25/feb/03
+
+// Copyright (c) 2000-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+#include "boost/mpl/bool.hpp"
+#include "boost/mpl/aux_/nested_type_wknd.hpp"
+#include "boost/mpl/aux_/void_spec.hpp"
+#include "boost/mpl/aux_/lambda_support.hpp"
+
+namespace boost {
+namespace mpl {
+
+namespace aux {
+
+template< long C_ > // 'long' is intentional here
+struct not_impl
+ : bool_<!C_>
+{
+};
+
+} // namespace aux
+
+
+template<
+ typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T)
+ >
+struct not_
+ : aux::not_impl<
+ BOOST_MPL_AUX_NESTED_TYPE_WKND(T)::value
+ >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,not_,(T))
+};
+
+BOOST_MPL_AUX_VOID_SPEC(1,not_)
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_NOT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_OR_HPP_INCLUDED
+#define BOOST_MPL_OR_HPP_INCLUDED
+
+// + file: boost/mpl/or.hpp
+// + last modified: 25/feb/03
+
+// Copyright (c) 2000-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+
+#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# include "boost/mpl/bool.hpp"
+# include "boost/mpl/aux_/nested_type_wknd.hpp"
+# include "boost/mpl/aux_/void_spec.hpp"
+# include "boost/mpl/aux_/lambda_support.hpp"
+
+# define BOOST_MPL_PREPROCESSED_HEADER or.hpp
+# include "boost/mpl/aux_/include_preprocessed.hpp"
+
+#else
+
+# define AUX_LOGICAL_OP_NAME or_
+# define AUX_LOGICAL_OP_VALUE1 true
+# define AUX_LOGICAL_OP_VALUE2 false
+# include "boost/mpl/aux_/logical_op.hpp"
+
+#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_OR_HPP_INCLUDED
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
+#define BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
+
+// + file: boost/mpl/placeholders.hpp
+// + last modified: 25/feb/03
+
+// Copyright (c) 2001-03
+// Peter Dimov, Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include "boost/mpl/arg.hpp"
+#endif
+
+#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+
+#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER placeholders.hpp
+# include "boost/mpl/aux_/include_preprocessed.hpp"
+
+#else
+
+# include "boost/mpl/aux_/config/nttp.hpp"
+# include "boost/mpl/limits/arity.hpp"
+# include "boost/preprocessor/iterate.hpp"
+# include "boost/preprocessor/cat.hpp"
+
+namespace boost {
+namespace mpl {
+
+// watch out for GNU gettext users, who #define _(x)
+#if !defined(_) || defined(BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+typedef arg<-1> _;
+
+namespace placeholders {
+using boost::mpl::_;
+}
+#endif
+
+//: agurt, 17/mar/02: one more placeholder for the last 'apply#'
+//: specialization
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(1, BOOST_MPL_METAFUNCTION_MAX_ARITY + 1, "boost/mpl/placeholders.hpp"))
+#include BOOST_PP_ITERATE()
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i BOOST_PP_FRAME_ITERATION(1)
+
+typedef arg<i> BOOST_PP_CAT(_,i);
+
+namespace placeholders {
+using boost::mpl::BOOST_PP_CAT(_,i);
+}
+
+#undef i
+#endif // BOOST_PP_IS_ITERATING
-//-----------------------------------------------------------------------------
-// boost mpl/void.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2001-02
+
+#ifndef BOOST_MPL_VOID_HPP_INCLUDED
+#define BOOST_MPL_VOID_HPP_INCLUDED
+
+// + file: boost/mpl/void.hpp
+// + last modified: 05/may/03
+
+// Copyright (c) 2001-03
// Peter Dimov, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#ifndef BOOST_MPL_VOID_HPP_INCLUDED
-#define BOOST_MPL_VOID_HPP_INCLUDED
-
+#include "boost/mpl/void_fwd.hpp"
#include "boost/mpl/bool.hpp"
-#include "boost/config.hpp"
+#include "boost/mpl/aux_/config/msvc.hpp"
+#include "boost/mpl/aux_/config/workaround.hpp"
namespace boost {
namespace mpl {
// instantiated so that it can be passed in as an object that can be
// used to select an overloaded function. Possible use includes signaling
// a zero arity functor evaluation call.
-struct void_ {};
+struct void_ { typedef void_ type; };
template< typename T >
struct is_void_
: false_
{
-#if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using false_::value;
#endif
};
struct is_void_<void_>
: true_
{
-#if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using true_::value;
#endif
};
--- /dev/null
+
+#ifndef BOOST_MPL_VOID_FWD_HPP_INCLUDED
+#define BOOST_MPL_VOID_FWD_HPP_INCLUDED
+
+// + file: boost/mpl/void_fwd.hpp
+// + last modified: 05/may/03
+
+// Copyright (c) 2001-03
+// Aleksey Gurtovoy
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appears in all copies and
+// that both the copyright notice and this permission notice appear in
+// supporting documentation. No representations are made about the
+// suitability of this software for any purpose. It is provided "as is"
+// without express or implied warranty.
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+namespace boost {
+namespace mpl {
+
+struct void_;
+
+} // namespace mpl
+} // namespace boost
+
+#endif // BOOST_MPL_VOID_FWD_HPP_INCLUDED
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_MULTI_ARRAY_RG071801_HPP
template<typename T, std::size_t NumDims,
typename Allocator>
-class multi_array :
+class multi_array :
public multi_array_ref<T,NumDims>
{
typedef multi_array_ref<T,NumDims> super_type;
-public:
+public:
typedef typename super_type::value_type value_type;
typedef typename super_type::reference reference;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::iterator iterator;
typedef typename super_type::const_iterator const_iterator;
- typedef typename super_type::iter_base iter_base;
- typedef typename super_type::const_iter_base const_iter_base;
typedef typename super_type::reverse_iterator reverse_iterator;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
typedef typename super_type::element element;
typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
};
+ explicit multi_array() :
+ super_type((T*)initial_base_) {
+ allocate_space();
+ }
+
template <class ExtentList>
- explicit multi_array(ExtentList const& extents) :
+ explicit multi_array(
+ ExtentList const& extents
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+ , typename detail::multi_array::disable_non_sub_array<ExtentList>::type* = 0
+#endif
+ ) :
super_type((T*)initial_base_,extents) {
boost::function_requires<
detail::multi_array::CollectionConcept<ExtentList> >();
allocate_space();
}
-
+
template <class ExtentList>
explicit multi_array(ExtentList const& extents,
- const general_storage_order<NumDims>& so) :
+ const general_storage_order<NumDims>& so) :
super_type((T*)initial_base_,extents,so) {
boost::function_requires<
detail::multi_array::CollectionConcept<ExtentList> >();
allocate_space();
std::copy(rhs.begin(),rhs.end(),this->begin());
}
-
- // Since assignment is a deep copy, multi_array_ref
+
+ // Since assignment is a deep copy, multi_array_ref
// contains all the necessary code.
template <typename ConstMultiArray>
multi_array& operator=(const ConstMultiArray& other) {
boost::array<size_type,NumDims> min_extents;
const size_type& (*min)(const size_type&, const size_type&) =
- std::min<size_type>;
+ std::min;
std::transform(new_array.extent_list_.begin(),new_array.extent_list_.end(),
this->extent_list_.begin(),
min_extents.begin(),
min);
-
+
// typedef boost::array<index,NumDims> index_list;
// Build index_gen objects to create views with the same shape
detail::multi_array::populate_index_ranges());
// Build same-shape views of the two arrays
- typename multi_array::array_view<3>::type view_old = (*this)[old_idxes];
- typename multi_array::array_view<3>::type view_new = new_array[new_idxes];
+ typename
+ multi_array::BOOST_NESTED_TEMPLATE array_view<NumDims>::type view_old = (*this)[old_idxes];
+ typename
+ multi_array::BOOST_NESTED_TEMPLATE array_view<NumDims>::type view_new = new_array[new_idxes];
// Set the right portion of the new array
view_new = view_old;
allocator_.destroy(i);
allocator_.deallocate(base_,allocated_elements_);
}
- }
-
+ }
+
typedef boost::array<size_type,NumDims> size_list;
typedef boost::array<index,NumDims> index_list;
// representations about the suitability of this software for any
// purpose. It is provided "as is" without express or implied warranty.
//
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#include "boost/iterator.hpp"
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BASE_RG071801_HPP
#define BASE_RG071801_HPP
#include "boost/multi_array/storage_order.hpp"
#include "boost/multi_array/types.hpp"
#include "boost/config.hpp"
-#include "boost/multi_array/iterator_adaptors.hpp"
+#include "boost/mpl/apply_if.hpp"
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/size_t.hpp"
+#include "boost/mpl/aux_/msvc_eti_base.hpp"
+#include "boost/iterator/reverse_iterator.hpp"
#include "boost/static_assert.hpp"
#include "boost/type.hpp"
#include <cassert>
template <typename T, std::size_t NumDims, typename TPtr = const T*>
class const_sub_array;
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct iterator_generator;
-
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct const_iterator_generator;
-
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct reverse_iterator_generator;
-
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct const_reverse_iterator_generator;
-
-template <typename T,typename TPtr>
-struct iterator_base;
-
-template <typename T, std::size_t NumDims>
-struct iterator_policies;
+template <typename T, typename TPtr, typename NumDims, typename Reference>
+class array_iterator;
template <typename T, std::size_t NumDims, typename TPtr = const T*>
class const_multi_array_view;
// choose value accessor begins
//
+template <typename T, std::size_t NumDims>
struct choose_value_accessor_n {
- template <typename T, std::size_t NumDims>
- struct bind {
- typedef value_accessor_n<T,NumDims> type;
- };
+ typedef value_accessor_n<T,NumDims> type;
};
+template <typename T>
struct choose_value_accessor_one {
- template <typename T, std::size_t NumDims>
- struct bind {
- typedef value_accessor_one<T> type;
- };
+ typedef value_accessor_one<T> type;
};
-
-template <std::size_t NumDims>
-struct value_accessor_gen_helper {
- typedef choose_value_accessor_n choice;
+template <typename T, typename NumDims>
+struct value_accessor_generator {
+ BOOST_STATIC_CONSTANT(std::size_t, dimensionality = NumDims::value);
+
+ typedef typename
+ mpl::apply_if_c<(dimensionality == 1),
+ choose_value_accessor_one<T>,
+ choose_value_accessor_n<T,dimensionality>
+ >::type type;
};
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+
+struct eti_value_accessor
+{
+ typedef int index;
+ typedef int size_type;
+ typedef int element;
+ typedef int index_range;
+ typedef int value_type;
+ typedef int reference;
+ typedef int const_reference;
+};
+
template <>
-struct value_accessor_gen_helper<1> {
- typedef choose_value_accessor_one choice;
+struct value_accessor_generator<int,int>
+{
+ typedef eti_value_accessor type;
};
-template <typename T, std::size_t NumDims>
-struct value_accessor_generator {
-private:
- typedef typename value_accessor_gen_helper<NumDims>::choice Choice;
-public:
- typedef typename Choice::template bind<T,NumDims>::type type;
-};
+template <class T, class NumDims>
+struct associated_types
+ : mpl::aux::msvc_eti_base<
+ typename value_accessor_generator<T,NumDims>::type
+ >::type
+{};
-//
-// choose value accessor ends
-/////////////////////////////////////////////////////////////////////////
+template <>
+struct associated_types<int,int> : eti_value_accessor {};
+#else
+template <class T, class NumDims>
+struct associated_types
+ : value_accessor_generator<T,NumDims>::type
+{};
+
+#endif
+
+//
+// choose value accessor ends
/////////////////////////////////////////////////////////////////////////
-// multi_array/sub_array base stuffs
-/////////////////////////////////////////////////////////////////////////
-template <std::size_t NumDims>
-struct iterator_tag_selector {
- typedef std::input_iterator_tag type;
-};
-template <>
-struct iterator_tag_selector<1> {
- typedef std::random_access_iterator_tag type;
-};
////////////////////////////////////////////////////////////////////////
// multi_array_base
////////////////////////////////////////////////////////////////////////
template <typename T, std::size_t NumDims>
-class multi_array_impl_base :
- public value_accessor_generator<T,NumDims>::type {
- typedef typename value_accessor_generator<T,NumDims>::type super_type;
+class multi_array_impl_base
+ :
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ public mpl::aux::msvc_eti_base<
+ typename value_accessor_generator<T,mpl::size_t<NumDims> >::type
+ >::type
+#else
+ public value_accessor_generator<T,mpl::size_t<NumDims> >::type
+#endif
+{
+ typedef associated_types<T,mpl::size_t<NumDims> > types;
public:
- typedef typename super_type::index index;
- typedef typename super_type::size_type size_type;
- typedef typename super_type::element element;
- typedef typename super_type::index_range index_range;
- typedef typename super_type::value_type value_type;
- typedef typename super_type::reference reference;
- typedef typename super_type::const_reference const_reference;
+ typedef typename types::index index;
+ typedef typename types::size_type size_type;
+ typedef typename types::element element;
+ typedef typename types::index_range index_range;
+ typedef typename types::value_type value_type;
+ typedef typename types::reference reference;
+ typedef typename types::const_reference const_reference;
template <std::size_t NDims>
struct subarray {
//
// iterator support
//
+ typedef array_iterator<T,T*,mpl::size_t<NumDims>,reference> iterator;
+ typedef array_iterator<T,T const*,mpl::size_t<NumDims>,const_reference> const_iterator;
- typedef typename iterator_tag_selector<NumDims>::type iterator_tag;
-
- typedef typename
- iterator_generator<T,NumDims,value_type,
- reference,iterator_tag,index>::type iterator;
-
- typedef typename
- const_iterator_generator<T,NumDims,value_type,
- const_reference,iterator_tag,index>::type const_iterator;
-
- typedef typename
- reverse_iterator_generator<T,NumDims,value_type,
- reference,iterator_tag,index>::type reverse_iterator;
-
- typedef typename
- const_reverse_iterator_generator<T,NumDims,value_type,
- const_reference,iterator_tag,index>::type const_reverse_iterator;
+ typedef ::boost::reverse_iterator<iterator> reverse_iterator;
+ typedef ::boost::reverse_iterator<const_iterator> const_reverse_iterator;
+ BOOST_STATIC_CONSTANT(std::size_t, dimensionality = NumDims);
protected:
- typedef iterator_base<T,T*> iter_base;
- typedef iterator_base<T,const T*> const_iter_base;
multi_array_impl_base() { }
~multi_array_impl_base() { }
index start = current_range.get_start(default_start);
index finish = current_range.get_finish(default_finish);
index index_factor = current_range.stride();
- index len = (finish - start) / index_factor;
+ index len = (finish - start + (index_factor - 1)) / index_factor;
// the array data pointer is modified to account for non-zero
// bases during slicing (see [Garcia] for the math involved)
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef COLLECTION_CONCEPT_RG103101_HPP
#define COLLECTION_CONCEPT_RG103101_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
#define BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
//
#include "boost/concept_check.hpp"
+#include "boost/iterator/iterator_concepts.hpp"
namespace boost {
namespace detail {
struct ConstMultiArrayConcept
{
void constraints() {
- // function_requires< CopyConstructibleConcept<Array> >();
+ // function_requires< CopyConstructibleConcept<Array> >();
+ function_requires< boost_concepts::ForwardTraversalConcept<iterator> >();
+ function_requires< boost_concepts::ReadableIteratorConcept<iterator> >();
+ function_requires< boost_concepts::ForwardTraversalConcept<const_iterator> >();
+ function_requires< boost_concepts::ReadableIteratorConcept<const_iterator> >();
// RG - a( CollectionArchetype) when available...
a[ id ];
void constraints() {
// function_requires< CopyConstructibleConcept<Array> >();
+ function_requires< boost_concepts::ForwardTraversalConcept<iterator> >();
+ function_requires< boost_concepts::ReadableIteratorConcept<iterator> >();
+ function_requires< boost_concepts::WritableIteratorConcept<iterator> >();
+ function_requires< boost_concepts::ForwardTraversalConcept<const_iterator> >();
+ function_requires< boost_concepts::ReadableIteratorConcept<const_iterator> >();
+
// RG - a( CollectionArchetype) when available...
value_type vt = a[ id ];
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef COPY_ARRAY_RG092101_HPP
#define COPY_ARRAY_RG092101_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_EXTENT_GEN_RG071801_HPP
#define BOOST_EXTENT_GEN_RG071801_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_EXTENT_RANGE_RG071801_HPP
#define BOOST_EXTENT_RANGE_RG071801_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_INDEX_GEN_RG071801_HPP
#define BOOST_INDEX_GEN_RG071801_HPP
template <int NumRanges, int NumDims>
struct index_gen {
private:
- typedef index Index;
+ typedef ::boost::detail::multi_array::index Index;
typedef std::size_t SizeType;
typedef index_range<Index,SizeType> range;
public:
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_INDEX_RANGE_RG071801_HPP
#define BOOST_INDEX_RANGE_RG071801_HPP
explicit index_range(index start, index finish, index stride=1)
: start_(start), finish_(finish), stride_(stride),
- degenerate_(start_ == finish_)
+ degenerate_(false)
{ }
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef ITERATOR_RG071801_HPP
#define ITERATOR_RG071801_HPP
//
#include "boost/multi_array/base.hpp"
-#include "boost/multi_array/iterator_adaptors.hpp"
-#include "boost/iterator_adaptors.hpp"
+#include "boost/iterator/iterator_facade.hpp"
+#include "boost/mpl/aux_/msvc_eti_base.hpp"
#include <cstddef>
#include <iterator>
// iterator components
/////////////////////////////////////////////////////////////////////////
-template <typename T, typename TPtr>
-struct iterator_base : private multi_array_base {
- typedef multi_array_base super_type;
- typedef super_type::index index;
- typedef super_type::size_type size_type;
+template <class T>
+struct operator_arrow_proxy
+{
+ operator_arrow_proxy(T const& px) : value_(px) {}
+ T* operator->() const { return &value_; }
+ // This function is needed for MWCW and BCC, which won't call operator->
+ // again automatically per 13.3.1.2 para 8
+ operator T*() const { return &value_; }
+ mutable T value_;
+};
+
+template <typename T, typename TPtr, typename NumDims, typename Reference>
+class array_iterator;
+
+template <typename T, typename TPtr, typename NumDims, typename Reference>
+class array_iterator
+ : public
+ iterator_facade<
+ array_iterator<T,TPtr,NumDims,Reference>
+ , typename associated_types<T,NumDims>::value_type
+ , boost::random_access_traversal_tag
+ , Reference
+ >
+ , private
+#if BOOST_WORKAROUND(BOOST_MSVC,==1200)
+ mpl::aux::msvc_eti_base<typename
+#endif
+ value_accessor_generator<T,NumDims>::type
+#if BOOST_WORKAROUND(BOOST_MSVC,==1200)
+ >::type
+#endif
+{
+ friend class iterator_core_access;
+ typedef detail::multi_array::associated_types<T,NumDims> access_t;
+
+ typedef iterator_facade<
+ array_iterator<T,TPtr,NumDims,Reference>
+ , typename detail::multi_array::associated_types<T,NumDims>::value_type
+ , boost::random_access_traversal_tag
+ , Reference
+ > facade_type;
+
+ typedef typename access_t::index index;
+ typedef typename access_t::size_type size_type;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+ template <typename, typename, typename, typename>
+ friend class array_iterator;
+#else
+ public:
+#endif
index idx_;
TPtr base_;
const size_type* extents_;
const index* strides_;
const index* index_base_;
+
+public:
+ // Typedefs to circumvent ambiguities between parent classes
+ typedef typename facade_type::reference reference;
+ typedef typename facade_type::value_type value_type;
+ typedef typename facade_type::difference_type difference_type;
+
+ array_iterator() {}
- iterator_base(int idx, TPtr base, const size_type* extents,
+ array_iterator(int idx, TPtr base, const size_type* extents,
const index* strides,
const index* index_base) :
idx_(idx), base_(base), extents_(extents),
- strides_(strides), index_base_(index_base) {
+ strides_(strides), index_base_(index_base) { }
+
+ template <typename OPtr, typename ORef>
+ array_iterator(
+ const array_iterator<T,OPtr,NumDims,ORef>& rhs
+ , typename boost::enable_if_convertible<OPtr,TPtr>::type* = 0
+ )
+ : idx_(rhs.idx_), base_(rhs.base_), extents_(rhs.extents_),
+ strides_(rhs.strides_), index_base_(rhs.index_base_) { }
+
+
+ // RG - we make our own operator->
+ operator_arrow_proxy<reference>
+ operator->() const
+ {
+ return operator_arrow_proxy<reference>(this->dereference());
}
+
- template <typename OPtr>
- iterator_base(const iterator_base<T,OPtr>& rhs) :
- idx_(rhs.idx_), base_(rhs.base_), extents_(rhs.extents_),
- strides_(rhs.strides_), index_base_(rhs.index_base_) {
- }
-
- // default constructor required
- iterator_base() {}
-};
-
-template<typename T, std::size_t NumDims>
-struct iterator_policies :
- public boost::detail::multi_array::default_iterator_policies,
- private value_accessor_generator<T,NumDims>::type {
-private:
- typedef typename value_accessor_generator<T,NumDims>::type super_type;
-public:
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference
- dereference(const IteratorAdaptor& iter) const {
- typedef typename IteratorAdaptor::reference reference;
- return super_type::access(boost::type<reference>(),
- iter.base().idx_,
- iter.base().base_,
- iter.base().extents_,
- iter.base().strides_,
- iter.base().index_base_);
+ reference dereference() const
+ {
+ typedef typename value_accessor_generator<T,NumDims>::type accessor;
+ return accessor::access(boost::type<reference>(),
+ idx_,
+ base_,
+ extents_,
+ strides_,
+ index_base_);
}
- template <class IteratorAdaptor>
- static void increment(IteratorAdaptor& x) { ++x.base().idx_; }
+ void increment() { ++idx_; }
+ void decrement() { --idx_; }
template <class IteratorAdaptor>
- static void decrement(IteratorAdaptor& x) { --x.base().idx_; }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- bool equal(IteratorAdaptor1& lhs, IteratorAdaptor2& rhs) const {
- return (lhs.base().idx_ == rhs.base().idx_) &&
- (lhs.base().base_ == rhs.base().base_) &&
- (lhs.base().extents_ == rhs.base().extents_) &&
- (lhs.base().strides_ == rhs.base().strides_) &&
- (lhs.base().index_base_ == rhs.base().index_base_);
+ bool equal(IteratorAdaptor& rhs) const {
+ return (idx_ == rhs.idx_) &&
+ (base_ == rhs.base_) &&
+ (extents_ == rhs.extents_) &&
+ (strides_ == rhs.strides_) &&
+ (index_base_ == rhs.index_base_);
}
- template <class IteratorAdaptor, class DifferenceType>
- static void advance(IteratorAdaptor& x, DifferenceType n) {
- x.base().idx_ += n;
+ template <class DifferenceType>
+ void advance(DifferenceType n) {
+ idx_ += n;
}
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- typename IteratorAdaptor1::difference_type
- distance(IteratorAdaptor1& lhs, IteratorAdaptor2& rhs) const {
- return rhs.base().idx_ - lhs.base().idx_;
+ template <class IteratorAdaptor>
+ typename facade_type::difference_type
+ distance_to(IteratorAdaptor& rhs) const {
+ return rhs.idx_ - idx_;
}
-};
-
-
-template <typename T, typename base_type,
- std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct iterator_gen_helper {
-private:
- typedef iterator_policies<T,NumDims> policies;
- typedef value_type* pointer_type;
- typedef tag category;
-public:
- typedef boost::detail::multi_array::iterator_adaptor<base_type,policies,value_type,
- reference_type,pointer_type,category,difference_type> type;
-};
-
-
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct iterator_generator {
-private:
- typedef iterator_base<T,T*> base_type;
-public:
- typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
- reference_type,tag,difference_type>::type type;
-};
-
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct const_iterator_generator {
-private:
- typedef iterator_base<T,const T*> base_type;
-public:
- typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
- reference_type,tag,difference_type>::type type;
-};
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct reverse_iterator_generator {
-private:
- typedef iterator_base<T,T*> base_type;
- typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
- reference_type,tag,difference_type>::type it_type;
-public:
- typedef typename boost::reverse_iterator_generator<it_type>::type type;
-};
-template <typename T, std::size_t NumDims, typename value_type,
- typename reference_type, typename tag, typename difference_type>
-struct const_reverse_iterator_generator {
-private:
- typedef iterator_base<T,const T*> base_type;
- typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
- reference_type,tag,difference_type>::type it_type;
-public:
- typedef typename boost::reverse_iterator_generator<it_type>::type type;
};
} // namespace multi_array
+++ /dev/null
-// (C) Copyright David Abrahams 2000. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
-//
-// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
-//
-
-// Thes code is modified from its original form to meet the needs of
-// Boost.MultiArray.
-
-// Revision History:
-
-// 27 Mar 2002 Ronald Garcia
-// Forked from the main tree iterator adaptors. Necessary to
-// allow iterator::operator->*() to work with multi_array iterators.
-// 01 Feb 2002 Jeremy Siek
-// Added more comments in default_iterator_policies.
-// 08 Jan 2001 David Abrahams
-// Moved concept checks into a separate class, which makes MSVC
-// better at dealing with them.
-// 07 Jan 2001 David Abrahams
-// Choose proxy for operator->() only if the reference type is not a reference.
-// Updated workarounds for __MWERKS__ == 0x2406
-// 20 Dec 2001 David Abrahams
-// Adjusted is_convertible workarounds for __MWERKS__ == 0x2406
-// 03 Nov 2001 Jeremy Siek
-// Changed the named template parameter interface and internal.
-// 04 Oct 2001 Jeremy Siek
-// Changed projection_iterator to not rely on the default reference,
-// working around a limitation of detail::iterator_traits.
-// 04 Oct 2001 David Abrahams
-// Applied indirect_iterator patch from George A. Heintzelman <georgeh@aya.yale.edu>
-// Changed name of "bind" to "select" to avoid problems with MSVC.
-// 26 Sep 2001 David Abrahams
-// Added borland bug fix
-// 08 Mar 2001 Jeremy Siek
-// Added support for optional named template parameters.
-// 19 Feb 2001 David Abrahams
-// Rolled back reverse_iterator_pair_generator again, as it doesn't
-// save typing on a conforming compiler.
-// 18 Feb 2001 David Abrahams
-// Reinstated reverse_iterator_pair_generator
-// 16 Feb 2001 David Abrahams
-// Add an implicit conversion operator to operator_arrow_proxy
-// as CW and BCC workarounds.
-// 11 Feb 2001 David Abrahams
-// Switch to use of BOOST_STATIC_CONSTANT where possible
-// 11 Feb 2001 Jeremy Siek
-// Removed workaround for older MIPSpro compiler. The workaround
-// was preventing the proper functionality of the underlying
-// iterator being carried forward into the iterator adaptor.
-// Also added is_bidirectional enum to avoid EDG compiler error.
-// 11 Feb 2001 David Abrahams
-// Borland fixes up the wazoo. It finally works!
-// 10 Feb 2001 David Abrahams
-// Removed traits argument from iterator_adaptor<> and switched to
-// explicit trait specification for maximum ease-of-use.
-// Added comments to detail::iterator_defaults<>
-// Began using detail::iterator_defaults<> unconditionally for code clarity
-// Changed uses of `Iterator' to `Base' where non-iterators can be used.
-//
-// 10 Feb 2001 David Abrahams
-// Rolled in supposed Borland fixes from John Maddock, but not seeing any
-// improvement yet
-// Changed argument order to indirect_ generator, for convenience in the
-// case of input iterators (where Reference must be a value type).
-// Removed derivation of filter_iterator_policies from
-// default_iterator_policies, since the iterator category is likely to be
-// reduced (we don't want to allow illegal operations like decrement).
-// Support for a simpler filter iterator interface.
-//
-// 09 Feb 2001 David Abrahams
-// Improved interface to indirect_ and reverse_ iterators
-// Rolled back Jeremy's new constructor for now; it was causing
-// problems with counting_iterator_test
-// Attempted fix for Borland
-//
-// 09 Feb 2001 Jeremy Siek
-// Added iterator constructor to allow const adaptor
-// from non-const adaptee.
-// Changed make_xxx to pass iterators by-value to
-// get arrays converted to pointers.
-// Removed InnerIterator template parameter from
-// indirect_iterator_generator.
-// Rearranged parameters for make_filter_iterator
-//
-// 07 Feb 2001 Jeremy Siek
-// Removed some const iterator adaptor generators.
-// Added make_xxx_iterator() helper functions for remaining
-// iterator adaptors.
-// Removed some traits template parameters where they
-// where no longer needed thanks to detail::iterator_traits.
-// Moved some of the compile-time logic into enums for
-// EDG compatibility.
-//
-// 07 Feb 2001 David Abrahams
-// Removed iterator_adaptor_pair_generator and
-// reverse_iterator_pair_generator (more such culling to come)
-// Improved comments
-// Changed all uses of std::iterator_traits as default arguments
-// to boost::detail::iterator_traits for improved utility in
-// non-generic contexts
-// Fixed naming convention of non-template parameter names
-//
-// 06 Feb 2001 David Abrahams
-// Produce operator-> proxy objects for InputIterators
-// Added static assertions to do some basic concept checks
-// Renamed single-type generators -> xxx_generator
-// Renamed const/nonconst iterator generators -> xxx_pair_generator
-// Added make_transform_iterator(iter, function)
-// The existence of boost::detail::iterator_traits allowed many
-// template arguments to be defaulted. Some arguments had to be
-// moved to accomplish it.
-//
-// 04 Feb 2001 MWERKS bug workaround, concept checking for proper
-// reference types (David Abrahams)
-
-#ifndef BOOST_ITERATOR_ADAPTOR_RG032702_HPP_
-# define BOOST_ITERATOR_ADAPTOR_RG032702_HPP_
-
-# include <boost/iterator.hpp>
-# include <boost/utility.hpp>
-# include <boost/compressed_pair.hpp>
-# include <boost/concept_check.hpp>
-# include <boost/type.hpp>
-# include <boost/static_assert.hpp>
-# include <boost/type_traits.hpp>
-# include <boost/detail/iterator.hpp>
-# include <boost/detail/select_type.hpp>
-
-// I was having some problems with VC6. I couldn't tell whether our hack for
-// stock GCC was causing problems so I needed an easy way to turn it on and
-// off. Now we can test the hack with various compilers and still have an
-// "out" if it doesn't work. -dwa 7/31/00
-# if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 && !defined(__STL_USE_NAMESPACES)
-# define BOOST_RELOPS_AMBIGUITY_BUG 1
-# endif
-
-namespace boost {
-namespace detail {
-namespace multi_array {
-
-//============================================================================
-// Default policies for iterator adaptors. You can use this as a base
-// class if you want to customize particular policies.
-struct default_iterator_policies
-{
- // Some of the member functions were defined static, but Borland
- // got confused and thought they were non-const. Also, Sun C++
- // does not like static function templates.
- //
- // The reason some members were defined static is because there is
- // not state (data members) needed by those members of the
- // default_iterator_policies class. If your policies class member
- // functions need to access state stored in the policies object,
- // then the member functions should not be static (they can't be).
-
- template <class Base>
- void initialize(Base&)
- { }
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
- { return *x.base(); }
-
- template <class IteratorAdaptor>
- void increment(IteratorAdaptor& x)
- { ++x.base(); }
-
- template <class IteratorAdaptor>
- void decrement(IteratorAdaptor& x)
- { --x.base(); }
-
- template <class IteratorAdaptor, class DifferenceType>
- void advance(IteratorAdaptor& x, DifferenceType n)
- { x.base() += n; }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- typename IteratorAdaptor1::difference_type
- distance(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return y.base() - x.base(); }
-
- template <class IteratorAdaptor1, class IteratorAdaptor2>
- bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
- { return x.base() == y.base(); }
-};
-
-// putting the comparisons in a base class avoids the g++
-// ambiguous overload bug due to the relops operators
-
-#ifdef BOOST_RELOPS_AMBIGUITY_BUG
-template <class Derived, class Base>
-struct iterator_comparisons : Base { };
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator==(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().equal(x, y);
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator!=(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return !x.policies().equal(x, y);
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator<(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) < 0;
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator>(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) > 0;
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator>=(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) >= 0;
-}
-
-template <class D1, class D2, class Base1, class Base2>
-inline bool operator<=(const iterator_comparisons<D1,Base1>& xb,
- const iterator_comparisons<D2,Base2>& yb)
-{
- const D1& x = static_cast<const D1&>(xb);
- const D2& y = static_cast<const D2&>(yb);
- return x.policies().distance(y, x) <= 0;
-}
-#endif
-
-namespace detail {
-
- // operator->() needs special support for input iterators to strictly meet the
- // standard's requirements. If *i is not a reference type, we must still
- // produce a (constant) lvalue to which a pointer can be formed. We do that by
- // returning an instantiation of this special proxy class template.
-
- template <class T>
- struct operator_arrow_proxy
- {
- operator_arrow_proxy(const T& x) : m_value(x) {}
- // RG removed const below
- T* operator->() const { return &m_value; }
- // This function is needed for MWCW and BCC, which won't call operator->
- // again automatically per 13.3.1.2 para 8
-
- // RG - removed const below
- operator T*() const { return &m_value; }
- mutable T m_value;
- };
-
- template <class Iter>
- inline operator_arrow_proxy<typename Iter::reference>
- operator_arrow(const Iter& i, std::input_iterator_tag) {
- // RG - THIS is the change I needed to make!
- // My input iterators need to return proxy references rather than values
- typedef typename Iter::reference value_t; // VC++ needs this typedef
- return operator_arrow_proxy<value_t>(*i);
- }
-
- template <class Iter>
- inline typename Iter::pointer
- operator_arrow(const Iter& i, std::forward_iterator_tag) {
- return &(*i);
- }
-
- template <class Value, class Reference, class Pointer>
- struct operator_arrow_result_generator
- {
- //RG - another important change!
- typedef operator_arrow_proxy<Reference> proxy;
- // Borland chokes unless it's an actual enum (!)
- enum { use_proxy = !boost::is_reference<Reference>::value };
-
- typedef typename boost::detail::if_true<(use_proxy)>::template
- then<
- proxy,
- // else
- Pointer
- >::type type;
- };
-
-# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_STD_ITERATOR_TRAITS)
-
-
- // Select default pointer and reference types for adapted non-pointer
- // iterators based on the iterator and the value_type. Poor man's partial
- // specialization is in use here.
- template <bool is_pointer>
- struct iterator_defaults_select
- {
- template <class Iterator,class Value>
- struct traits
- {
- // The assumption is that iterator_traits can deduce these types
- // properly as long as the iterator is not a pointer.
- typedef typename boost::detail::iterator_traits<Iterator>::pointer pointer;
- typedef typename boost::detail::iterator_traits<Iterator>::reference reference;
- };
- };
-
- // Select default pointer and reference types for adapted pointer iterators
- // given a (possibly-const) value_type.
- template <>
- struct iterator_defaults_select<true>
- {
- template <class Iterator,class Value>
- struct traits
- {
- typedef Value* pointer;
- typedef Value& reference;
- };
- };
-
- // Consolidate selection of the default pointer and reference type
- template <class Iterator,class Value>
- struct iterator_defaults
- {
- BOOST_STATIC_CONSTANT(bool, is_ptr = boost::is_pointer<Iterator>::value);
-
- typedef typename iterator_defaults_select<is_ptr>::template traits<Iterator,Value> traits;
- typedef typename traits::pointer pointer;
- typedef typename traits::reference reference;
- };
-# else
- template <class Iterator,class Value>
- struct iterator_defaults : iterator_traits<Iterator>
- {
- // Trying to factor the common is_same expression into an enum or a
- // static bool constant confused Borland.
- typedef typename if_true<(
- ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
- )>::template then<
- typename iterator_traits<Iterator>::pointer,
- Value*
- >::type pointer;
-
- typedef typename if_true<(
- ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
- )>::template then<
- typename iterator_traits<Iterator>::reference,
- Value&
- >::type reference;
-
- };
-# endif
-
- //===========================================================================
- // Specify the defaults for iterator_adaptor's template parameters
-
- struct default_argument { };
- // This class template is a workaround for MSVC.
- struct dummy_default_gen {
- template <class Base, class Traits>
- struct select { typedef default_argument type; };
- };
- // This class template is a workaround for MSVC.
- template <class Gen> struct default_generator {
- typedef dummy_default_gen type;
- };
-
- struct default_value_type {
- template <class Base, class Traits>
- struct select {
- typedef typename boost::detail::iterator_traits<Base>::value_type type;
- };
- };
- template <> struct default_generator<default_value_type>
- { typedef default_value_type type; }; // VC++ workaround
-
- struct default_difference_type {
- template <class Base, class Traits>
- struct select {
- typedef typename boost::detail::iterator_traits<Base>::difference_type type;
- };
- };
- template <> struct default_generator<default_difference_type>
- { typedef default_difference_type type; }; // VC++ workaround
-
- struct default_iterator_category {
- template <class Base, class Traits>
- struct select {
- typedef typename boost::detail::iterator_traits<Base>::iterator_category type;
- };
- };
- template <> struct default_generator<default_iterator_category>
- { typedef default_iterator_category type; }; // VC++ workaround
-
- struct default_pointer {
- template <class Base, class Traits>
- struct select {
- typedef typename Traits::value_type Value;
- typedef typename boost::detail::multi_array::detail::iterator_defaults<Base,Value>::pointer
- type;
- };
- };
- template <> struct default_generator<default_pointer>
- { typedef default_pointer type; }; // VC++ workaround
-
- struct default_reference {
- template <class Base, class Traits>
- struct select {
- typedef typename Traits::value_type Value;
- typedef typename boost::detail::multi_array::detail::iterator_defaults<Base,Value>::reference
- type;
- };
- };
- template <> struct default_generator<default_reference>
- { typedef default_reference type; }; // VC++ workaround
-
-} // namespace detail
-
-
- //===========================================================================
- // Support for named template parameters
-
-struct named_template_param_base { };
-
-namespace detail {
- struct value_type_tag { };
- struct reference_tag { };
- struct pointer_tag { };
- struct difference_type_tag { };
- struct iterator_category_tag { };
-
- // avoid using std::pair because A or B might be a reference type, and g++
- // complains about forming references to references inside std::pair
- template <class A, class B>
- struct cons_type {
- typedef A first_type;
- typedef B second_type;
- };
-
-} // namespace detail
-
-template <class Value> struct value_type_is : public named_template_param_base
-{
- typedef detail::cons_type<detail::value_type_tag, Value> type;
-};
-template <class Reference> struct reference_is : public named_template_param_base
-{
- typedef detail::cons_type<detail::reference_tag, Reference> type;
-};
-template <class Pointer> struct pointer_is : public named_template_param_base
-{
- typedef detail::cons_type<detail::pointer_tag, Pointer> type;
-};
-template <class Difference> struct difference_type_is
- : public named_template_param_base
-{
- typedef detail::cons_type<detail::difference_type_tag, Difference> type;
-};
-template <class IteratorCategory> struct iterator_category_is
- : public named_template_param_base
-{
- typedef detail::cons_type<detail::iterator_category_tag, IteratorCategory> type;
-};
-
-namespace detail {
-
- struct end_of_list { };
-
- // Given an associative list, find the value with the matching key.
- // An associative list is a list of key-value pairs. The list is
- // built out of cons_type's and is terminated by end_of_list.
-
-# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(__BORLANDC__)
- template <class AssocList, class Key>
- struct find_param;
-
- struct find_param_continue {
- template <class AssocList, class Key2> struct select {
- typedef typename AssocList::first_type Head;
- typedef typename Head::first_type Key1;
- typedef typename Head::second_type Value;
- typedef typename if_true<(is_same<Key1, Key2>::value)>::template
- then<Value,
- typename find_param<typename AssocList::second_type, Key2>::type
- >::type type;
- };
- };
- struct find_param_end {
- template <class AssocList, class Key>
- struct select { typedef detail::default_argument type; };
- };
- template <class AssocList> struct find_param_helper1
- { typedef find_param_continue type; };
- template <> struct find_param_helper1<end_of_list>
- { typedef find_param_end type; };
-
- template <class AssocList, class Key>
- struct find_param {
- typedef typename find_param_helper1<AssocList>::type select1;
- typedef typename select1::template select<AssocList, Key>::type type;
- };
-# else
- template <class AssocList, class Key> struct find_param;
-
- template <class Key>
- struct find_param<end_of_list, Key> { typedef default_argument type; };
-
- // Found a matching Key, return the associated Value
- template <class Key, class Value, class Rest>
- struct find_param<detail::cons_type< detail::cons_type<Key, Value>, Rest>, Key> {
- typedef Value type;
- };
-
- // Non-matching keys, continue the search
- template <class Key1, class Value, class Rest, class Key2>
- struct find_param<detail::cons_type< detail::cons_type<Key1, Value>, Rest>, Key2> {
- typedef typename find_param<Rest, Key2>::type type;
- };
-# endif
-
- struct make_named_arg {
- template <class Key, class Value>
- struct select { typedef typename Value::type type; };
- };
- struct make_key_value {
- template <class Key, class Value>
- struct select { typedef detail::cons_type<Key, Value> type; };
- };
-
- template <class Value>
- struct is_named_parameter
- {
- enum { value = is_convertible<Value, named_template_param_base>::value };
- };
-
-# if defined(__MWERKS__) && __MWERKS__ <= 0x2406 // workaround for broken is_convertible implementation
- template <class T> struct is_named_parameter<value_type_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<reference_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<pointer_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<difference_type_is<T> > { enum { value = true }; };
- template <class T> struct is_named_parameter<iterator_category_is<T> > { enum { value = true }; };
-# endif
-
- template <class Key, class Value>
- struct make_arg {
-# ifdef __BORLANDC__
- // Borland C++ doesn't like the extra indirection of is_named_parameter
- typedef typename
- if_true<(is_convertible<Value,named_template_param_base>::value)>::
- template then<make_named_arg, make_key_value>::type Make;
-# else
- enum { is_named = is_named_parameter<Value>::value };
- typedef typename if_true<(is_named)>::template
- then<make_named_arg, make_key_value>::type Make;
-# endif
- typedef typename Make::template select<Key, Value>::type type;
- };
-
- // Mechanism for resolving the default argument for a template parameter.
-
- template <class T> struct is_default { typedef type_traits::no_type type; };
- template <> struct is_default<default_argument>
- { typedef type_traits::yes_type type; };
-
- struct choose_default {
- template <class Arg, class DefaultGen, class Base, class Traits>
- struct select {
- typedef typename default_generator<DefaultGen>::type Gen;
- typedef typename Gen::template select<Base,Traits>::type type;
- };
- };
- struct choose_arg {
- template <class Arg, class DefaultGen, class Base, class Traits>
- struct select {
- typedef Arg type;
- };
- };
-
- template <class UseDefault>
- struct choose_arg_or_default { typedef choose_arg type; };
- template <> struct choose_arg_or_default<type_traits::yes_type> {
- typedef choose_default type;
- };
-
- template <class Arg, class DefaultGen, class Base, class Traits>
- class resolve_default {
- typedef typename choose_arg_or_default<typename is_default<Arg>::type>::type
- Selector;
- public:
- typedef typename Selector
- ::template select<Arg, DefaultGen, Base, Traits>::type type;
- };
-
- template <class Base, class Value, class Reference, class Pointer,
- class Category, class Distance>
- class iterator_adaptor_traits_gen
- {
- // Form an associative list out of the template parameters
- // If the argument is a normal parameter (not named) then make_arg
- // creates a key-value pair. If the argument is a named parameter,
- // then make_arg extracts the key-value pair defined inside the
- // named parameter.
- typedef detail::cons_type< typename make_arg<value_type_tag, Value>::type,
- detail::cons_type<typename make_arg<reference_tag, Reference>::type,
- detail::cons_type<typename make_arg<pointer_tag, Pointer>::type,
- detail::cons_type<typename make_arg<iterator_category_tag, Category>::type,
- detail::cons_type<typename make_arg<difference_type_tag, Distance>::type,
- end_of_list> > > > > ArgList;
-
- // Search the list for particular parameters
- typedef typename find_param<ArgList, value_type_tag>::type Val;
- typedef typename find_param<ArgList, difference_type_tag>::type Diff;
- typedef typename find_param<ArgList, iterator_category_tag>::type Cat;
- typedef typename find_param<ArgList, pointer_tag>::type Ptr;
- typedef typename find_param<ArgList, reference_tag>::type Ref;
-
- typedef boost::iterator<Category, Value, Distance, Pointer, Reference>
- Traits0;
-
- // Compute the defaults if necessary
- typedef typename resolve_default<Val, default_value_type, Base, Traits0>::type
- value_type;
- // if getting default value type from iterator_traits, then it won't be const
- typedef typename resolve_default<Diff, default_difference_type, Base,
- Traits0>::type difference_type;
- typedef typename resolve_default<Cat, default_iterator_category, Base,
- Traits0>::type iterator_category;
-
- typedef boost::iterator<iterator_category, value_type, difference_type,
- Pointer, Reference> Traits1;
-
- // Compute the defaults for pointer and reference. This is done as a
- // separate step because the defaults for pointer and reference depend
- // on value_type.
- typedef typename resolve_default<Ptr, default_pointer, Base, Traits1>::type
- pointer;
- typedef typename resolve_default<Ref, default_reference, Base, Traits1>::type
- reference;
-
- public:
- typedef boost::iterator<iterator_category,
- typename remove_const<value_type>::type,
- difference_type, pointer, reference> type;
- };
-
- // This is really a partial concept check for iterators. Should it
- // be moved or done differently?
- template <class Category, class Value, class Difference, class Pointer, class Reference>
- struct validator
- {
- BOOST_STATIC_CONSTANT(
- bool, is_input_or_output_iter
- = (boost::is_convertible<Category*,std::input_iterator_tag*>::value
- | boost::is_convertible<Category*,std::output_iterator_tag*>::value));
-
- // Iterators should satisfy one of the known categories
- BOOST_STATIC_ASSERT(is_input_or_output_iter);
-
- // Iterators >= ForwardIterator must produce real references
- // as required by the C++ standard requirements in Table 74.
- BOOST_STATIC_CONSTANT(
- bool, forward_iter_with_real_reference
- = ((!boost::is_convertible<Category*,std::forward_iterator_tag*>::value)
- | boost::is_same<Reference,Value&>::value
- | boost::is_same<Reference,typename add_const<Value>::type&>::value));
-
- BOOST_STATIC_ASSERT(forward_iter_with_real_reference);
- };
-} // namespace detail
-
-
-
-// This macro definition is only temporary in this file
-# if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
-# define BOOST_ARG_DEPENDENT_TYPENAME typename
-# else
-# define BOOST_ARG_DEPENDENT_TYPENAME
-# endif
-
-//============================================================================
-//iterator_adaptor - Adapts a generic piece of data as an iterator. Adaptation
-// is especially easy if the data being adapted is itself an iterator
-//
-// Base - the base (usually iterator) type being wrapped.
-//
-// Policies - a set of policies determining how the resulting iterator
-// works.
-//
-// Value - if supplied, the value_type of the resulting iterator, unless
-// const. If const, a conforming compiler strips constness for the
-// value_type. If not supplied, iterator_traits<Base>::value_type is used
-//
-// Reference - the reference type of the resulting iterator, and in
-// particular, the result type of operator*(). If not supplied but
-// Value is supplied, Value& is used. Otherwise
-// iterator_traits<Base>::reference is used.
-//
-// Pointer - the pointer type of the resulting iterator, and in
-// particular, the result type of operator->(). If not
-// supplied but Value is supplied, Value* is used. Otherwise
-// iterator_traits<Base>::pointer is used.
-//
-// Category - the iterator_category of the resulting iterator. If not
-// supplied, iterator_traits<Base>::iterator_category is used.
-//
-// Distance - the difference_type of the resulting iterator. If not
-// supplied, iterator_traits<Base>::difference_type is used.
-template <class Base, class Policies,
- class Value = ::boost::detail::multi_array::detail::default_argument,
- class Reference = ::boost::detail::multi_array::detail::default_argument,
- class Pointer = ::boost::detail::multi_array::detail::default_argument,
- class Category = ::boost::detail::multi_array::detail::default_argument,
- class Distance = ::boost::detail::multi_array::detail::default_argument
- >
-struct iterator_adaptor :
-#ifdef BOOST_RELOPS_AMBIGUITY_BUG
- iterator_comparisons<
- iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance>,
- typename detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category, Distance>::type
- >
-#else
- detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance>::type
-#endif
-{
- typedef iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance> self;
- public:
- typedef detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance> TraitsGen;
- typedef typename TraitsGen::type Traits;
-
- typedef typename Traits::difference_type difference_type;
- typedef typename Traits::value_type value_type;
- typedef typename Traits::pointer pointer;
- typedef typename Traits::reference reference;
- typedef typename Traits::iterator_category iterator_category;
-
- typedef Base base_type;
- typedef Policies policies_type;
-
- private:
- typedef detail::validator<
- iterator_category,value_type,difference_type,pointer,reference
- > concept_check;
-
- public:
- iterator_adaptor()
- {
- }
-
- explicit
- iterator_adaptor(const Base& it, const Policies& p = Policies())
- : m_iter_p(it, p) {
- policies().initialize(base());
- }
-
- template <class Iter2, class Value2, class Pointer2, class Reference2>
- iterator_adaptor (
- const iterator_adaptor<Iter2,Policies,Value2,Reference2,Pointer2,Category,Distance>& src)
- : m_iter_p(src.base(), src.policies())
- {
- policies().initialize(base());
- }
-
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__BORLANDC__)
- // This is required to prevent a bug in how VC++ generates
- // the assignment operator for compressed_pair
- iterator_adaptor& operator= (const iterator_adaptor& x) {
- m_iter_p = x.m_iter_p;
- return *this;
- }
-#endif
- reference operator*() const {
- return policies().dereference(*this);
- }
-
-#ifdef BOOST_MSVC
-# pragma warning(push)
-# pragma warning( disable : 4284 )
-#endif
-
- typename boost::detail::multi_array::detail::operator_arrow_result_generator<value_type,reference,pointer>::type
- operator->() const
- { return detail::operator_arrow(*this, iterator_category()); }
-
-#ifdef BOOST_MSVC
-# pragma warning(pop)
-#endif
-
- value_type operator[](difference_type n) const
- { return *(*this + n); }
-
- self& operator++() {
-#if !defined(__MWERKS__) || __MWERKS__ >= 0x2405
- policies().increment(*this);
-#else
- // Odd bug, MWERKS couldn't deduce the type for the member template
- // Workaround by explicitly specifying the type.
- policies().increment<self>(*this);
-#endif
- return *this;
- }
-
- self operator++(int) { self tmp(*this); ++*this; return tmp; }
-
- self& operator--() {
-#if !defined(__MWERKS__) || __MWERKS__ >= 0x2405
- policies().decrement(*this);
-#else
- policies().decrement<self>(*this);
-#endif
- return *this;
- }
-
- self operator--(int) { self tmp(*this); --*this; return tmp; }
-
- self& operator+=(difference_type n) {
- policies().advance(*this, n);
- return *this;
- }
-
- self& operator-=(difference_type n) {
- policies().advance(*this, -n);
- return *this;
- }
-
- base_type const& base() const { return m_iter_p.first(); }
-
- // Moved from global scope to avoid ambiguity with the operator-() which
- // subtracts iterators from one another.
- self operator-(difference_type x) const
- { self result(*this); return result -= x; }
-private:
- compressed_pair<Base,Policies> m_iter_p;
-
-public: // implementation details (too many compilers have trouble when these are private).
- base_type& base() { return m_iter_p.first(); }
- Policies& policies() { return m_iter_p.second(); }
- const Policies& policies() const { return m_iter_p.second(); }
-};
-
-template <class Base, class Policies, class Value, class Reference, class Pointer,
- class Category, class Distance1, class Distance2>
-iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
-operator+(
- iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p,
- Distance2 x)
-{
- return p += x;
-}
-
-template <class Base, class Policies, class Value, class Reference, class Pointer,
- class Category, class Distance1, class Distance2>
-iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
-operator+(
- Distance2 x,
- iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p)
-{
- return p += x;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2, class Category,
- class Distance>
-typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>::difference_type
-operator-(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- typedef typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,
- Pointer1,Category,Distance>::difference_type difference_type;
- return x.policies().distance(y, x);
-}
-
-#ifndef BOOST_RELOPS_AMBIGUITY_BUG
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator==(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().equal(x, y);
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator<(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) < 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator>(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) > 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator>=(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) >= 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator<=(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return x.policies().distance(y, x) <= 0;
-}
-
-template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
- class Reference1, class Reference2, class Pointer1, class Pointer2,
- class Category, class Distance>
-inline bool
-operator!=(
- const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
- const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
-{
- return !x.policies().equal(x, y);
-}
-#endif
-
-
-} // namespace multi_array
-} // namespace detail
-} // namespace boost
-# undef BOOST_ARG_DEPENDENT_TYPENAME
-
-
-#endif
-
-
-
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_MULTI_ARRAY_REF_RG071801_HPP
#define BOOST_MULTI_ARRAY_REF_RG071801_HPP
typedef typename super_type::value_type value_type;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::const_iterator const_iterator;
- typedef typename super_type::const_iter_base const_iter_base;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
typedef typename super_type::element element;
typedef typename super_type::size_type size_type;
typedef typename super_type::difference_type difference_type;
typedef typename super_type::index index;
typedef typename super_type::extent_range extent_range;
-
+ typedef general_storage_order<NumDims> storage_order_type;
// template typedefs
template <std::size_t NDims>
// make const_multi_array_ref a friend of itself
template <typename,std::size_t,typename>
friend class const_multi_array_ref;
+
+// template <typename From, typename To> // needed for enable_if_convertible tests
+// friend class boost::detail::is_convertible_basic_impl;
#endif
template <typename OPtr>
return index_base_list_.data();
}
+
+ const storage_order_type& storage_order() const {
+ return storage_;
+ }
+
template <typename IndexList>
const element& operator()(IndexList indices) const {
boost::function_requires<
}
const_iterator begin() const {
- return const_iterator(const_iter_base(*index_bases(),origin(),
- shape(),strides(),index_bases()));
+ return const_iterator(*index_bases(),origin(),
+ shape(),strides(),index_bases());
}
const_iterator end() const {
- return const_iterator(const_iter_base(*index_bases()+*shape(),origin(),
- shape(),strides(),index_bases()));
+ return const_iterator(*index_bases()+*shape(),origin(),
+ shape(),strides(),index_bases());
}
const_reverse_iterator rbegin() const {
return !(*this < rhs);
}
+protected:
+ // This is only supplied to support multi_array's default constructor
+ explicit const_multi_array_ref(TPtr base) :
+ base_(base), storage_(c_storage_order()) {
+ index_base_list_.assign(0);
+ boost::array<size_type,NumDims> filler;
+ filler.assign(0);
+ init_multi_array_ref(filler.begin());
+ }
+
+
// This ensures that const_multi_array_ref types with different TPtr
// types can convert to each other
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
void set_base_ptr(TPtr new_base) { base_ = new_base; }
template <typename OPtr>
- const_multi_array_ref(const detail::multi_array::
- const_sub_array<T,NumDims,OPtr>& rhs)
- : base_(rhs.origin()),
+ const_multi_array_ref(
+ const detail::multi_array::const_sub_array<T,NumDims,OPtr>& rhs
+ )
+ : base_(0), // playing it "safe"; so we learn of errors
storage_(c_storage_order()),
origin_offset_(0), directional_offset_(0),
num_elements_(rhs.num_elements())
typedef boost::array<index,NumDims> index_list;
TPtr base_;
- general_storage_order<NumDims> storage_;
+ storage_order_type storage_;
size_list extent_list_;
index_list stride_list_;
index_list index_base_list_;
// Calculate the array size
num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
1,std::multiplies<index>());
+#if 0
assert(num_elements_ != 0);
-
+#endif
this->compute_strides(stride_list_,extent_list_,storage_);
origin_offset_ =
}
};
-
template <typename T, std::size_t NumDims>
class multi_array_ref :
public const_multi_array_ref<T,NumDims,T*>
typedef typename super_type::value_type value_type;
typedef typename super_type::reference reference;
typedef typename super_type::iterator iterator;
- typedef typename super_type::iter_base iter_base;
typedef typename super_type::reverse_iterator reverse_iterator;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::const_iterator const_iterator;
- typedef typename super_type::const_iter_base const_iter_base;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
typedef typename super_type::element element;
typedef typename super_type::size_type size_type;
iterator begin() {
- return iterator(iter_base(*this->index_bases(),origin(),this->shape(),
- this->strides(),this->index_bases()));
+ return iterator(*this->index_bases(),origin(),this->shape(),
+ this->strides(),this->index_bases());
}
iterator end() {
- return iterator(iter_base(*this->index_bases()+*this->shape(),origin(),
- this->shape(),this->strides(),
- this->index_bases()));
+ return iterator(*this->index_bases()+*this->shape(),origin(),
+ this->shape(),this->strides(),
+ this->index_bases());
}
// RG - rbegin() and rend() written naively to thwart MSVC ICE.
const_reverse_iterator rend() const {
return super_type::rend();
}
+
+protected:
+ // This is only supplied to support multi_array's default constructor
+ explicit multi_array_ref(T* base) :
+ super_type(base) {
+ }
+
+
};
} // namespace boost
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef RANGE_LIST_RG072501_HPP
#define RANGE_LIST_RG072501_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_STORAGE_ORDER_RG071801_HPP
#define BOOST_STORAGE_ORDER_RG071801_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef SUBARRAY_RG071801_HPP
#define SUBARRAY_RG071801_HPP
typedef typename super_type::value_type value_type;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::const_iterator const_iterator;
- typedef typename super_type::const_iter_base const_iter_base;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
typedef typename super_type::element element;
typedef typename super_type::size_type size_type;
}
const_iterator begin() const {
- return const_iterator(const_iter_base(*index_bases(),origin(),
- shape(),strides(),index_bases()));
+ return const_iterator(*index_bases(),origin(),
+ shape(),strides(),index_bases());
}
const_iterator end() const {
- return const_iterator(const_iter_base(*index_bases()+*shape(),origin(),
- shape(),strides(),index_bases()));
+ return const_iterator(*index_bases()+*shape(),origin(),
+ shape(),strides(),index_bases());
}
const_reverse_iterator rbegin() const {
const_sub_array& operator=(const const_sub_array&);
};
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// Compilers that don't support partial ordering may need help to
+// disambiguate multi_array's templated constructors. Even vc6/7 are
+// capable of some limited SFINAE, so we take the most-general version
+// out of the overload set with disable_non_sub_array.
+//
+template <typename T, std::size_t NumDims, typename TPtr>
+char is_sub_array_help(const_sub_array<T,NumDims,TPtr>&);
+
+char ( &is_sub_array_help(...) )[2];
+
+template <class T>
+struct is_sub_array
+{
+ static T x;
+ BOOST_STATIC_CONSTANT(bool, value = sizeof((is_sub_array_help)(x)) == 1);
+};
+
+template <bool sub_array = false>
+struct disable_non_sub_array_impl
+{
+ // forming a pointer to a reference triggers SFINAE
+ typedef int& type;
+};
+
+template <>
+struct disable_non_sub_array_impl<true>
+{
+ typedef int type;
+};
+
+template <class T>
+struct disable_non_sub_array
+{
+ typedef typename disable_non_sub_array_impl<is_sub_array<T>::value>::type type;
+};
+#endif
+
//
// sub_array
// multi_array's proxy class to allow multiple overloads of
typedef typename super_type::size_type size_type;
typedef typename super_type::iterator iterator;
typedef typename super_type::reverse_iterator reverse_iterator;
- typedef typename super_type::iter_base iter_base;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::const_iterator const_iterator;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
- typedef typename super_type::const_iter_base const_iter_base;
// template typedefs
template <std::size_t NDims>
}
iterator begin() {
- return iterator(iter_base(*this->index_bases(),origin(),
- this->shape(),this->strides(),this->index_bases()));
+ return iterator(*this->index_bases(),origin(),
+ this->shape(),this->strides(),this->index_bases());
}
iterator end() {
- return iterator(iter_base(*this->index_bases()+*this->shape(),origin(),
- this->shape(),this->strides(),this->index_bases()));
+ return iterator(*this->index_bases()+*this->shape(),origin(),
+ this->shape(),this->strides(),this->index_bases());
}
// RG - rbegin() and rend() written naively to thwart MSVC ICE.
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
+
#ifndef BOOST_MULTI_ARRAY_TYPES_RG071801_HPP
#define BOOST_MULTI_ARRAY_TYPES_RG071801_HPP
-// Copyright (C) 2002 Ronald Garcia
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-//
+// Copyright 2002 The Trustees of Indiana University.
+
+// 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)
+
+// Boost.MultiArray Library
+// Authors: Ronald Garcia
+// Jeremy Siek
+// Andrew Lumsdaine
+// See http://www.boost.org/libs/multi_array for documentation.
#ifndef BOOST_MULTI_ARRAY_VIEW_RG071301_HPP
#define BOOST_MULTI_ARRAY_VIEW_RG071301_HPP
typedef typename super_type::value_type value_type;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::const_iterator const_iterator;
- typedef typename super_type::const_iter_base const_iter_base;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
typedef typename super_type::element element;
typedef typename super_type::size_type size_type;
origin());
}
const_iterator begin() const {
- return const_iterator(const_iter_base(*index_bases(),origin(),
- shape(),strides(),index_bases()));
+ return const_iterator(*index_bases(),origin(),
+ shape(),strides(),index_bases());
}
const_iterator end() const {
- return const_iterator(const_iter_base(*index_bases()+*shape(),origin(),
- shape(),strides(),index_bases()));
+ return const_iterator(*index_bases()+*shape(),origin(),
+ shape(),strides(),index_bases());
}
const_reverse_iterator rbegin() const {
// Calculate the array size
num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
size_type(1),std::multiplies<size_type>());
+#if 0
assert(num_elements_ != 0);
+#endif
}
typedef boost::array<size_type,NumDims> size_list;
typedef typename super_type::value_type value_type;
typedef typename super_type::reference reference;
typedef typename super_type::iterator iterator;
- typedef typename super_type::iter_base iter_base;
typedef typename super_type::reverse_iterator reverse_iterator;
typedef typename super_type::const_reference const_reference;
typedef typename super_type::const_iterator const_iterator;
- typedef typename super_type::const_iter_base const_iter_base;
typedef typename super_type::const_reverse_iterator const_reverse_iterator;
typedef typename super_type::element element;
typedef typename super_type::size_type size_type;
iterator begin() {
- return iterator(iter_base(*this->index_bases(),origin(),
- this->shape(),this->strides(),
- this->index_bases()));
+ return iterator(*this->index_bases(),origin(),
+ this->shape(),this->strides(),
+ this->index_bases());
}
iterator end() {
- return iterator(iter_base(*this->index_bases()+*this->shape(),origin(),
- this->shape(),this->strides(),
- this->index_bases()));
+ return iterator(*this->index_bases()+*this->shape(),origin(),
+ this->shape(),this->strides(),
+ this->index_bases());
}
reverse_iterator rbegin() {
// See http://www.boost.org/libs/utility for documentation.
+// Revision History
+// 13 Dec 2003 Added next(x, n) and prior(x, n) (Daniel Walker)
+
#ifndef BOOST_NEXT_PRIOR_HPP_INCLUDED
#define BOOST_NEXT_PRIOR_HPP_INCLUDED
+#include <iterator>
+
namespace boost {
// Helper functions for classes like bidirectional iterators not supporting
// Usage:
// const std::list<T>::iterator p = get_some_iterator();
// const std::list<T>::iterator prev = boost::prior(p);
+// const std::list<T>::iterator next = boost::next(prev, 2);
// Contributed by Dave Abrahams
template <class T>
inline T next(T x) { return ++x; }
+template <class T, class Distance>
+inline T next(T x, Distance n)
+{
+ std::advance(x, n);
+ return x;
+}
+
template <class T>
inline T prior(T x) { return --x; }
+template <class T, class Distance>
+inline T prior(T x, Distance n)
+{
+ std::advance(x, -n);
+ return x;
+}
+
} // namespace boost
#endif // BOOST_NEXT_PRIOR_HPP_INCLUDED
--- /dev/null
+// (C) Copyright Gennaro Prota 2003. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+
+
+#ifndef BOOST_NON_TYPE_HPP_GP_20030417
+#define BOOST_NON_TYPE_HPP_GP_20030417
+
+
+namespace boost {
+
+ // Just a simple "envelope" for non-type template parameters. Useful
+ // to work around some MSVC deficiencies.
+
+ template <typename T, T n>
+ struct non_type { };
+
+
+}
+
+
+#endif // include guard
#include <boost/config.hpp>
#include <boost/iterator.hpp>
+#include <boost/detail/workaround.hpp>
#if defined(__sgi) && !defined(__GNUC__)
-#pragma set woff 1234
+# pragma set woff 1234
#endif
#if defined(BOOST_MSVC)
friend bool operator!=(const T& x, const T& y) { return !(x == y); }
};
+// A macro which produces "name_2left" from "name".
+#define BOOST_OPERATOR2_LEFT(name) name##2##_##left
+
// NRVO-friendly implementation (contributed by Daniel Frey) ---------------//
#if defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
{ T nrv( lhs ); nrv OP##= rhs; return nrv; } \
};
-#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
-template <class T, class U, class B = ::boost::detail::empty_base> \
-struct NAME##2 : B \
-{ \
- friend T operator OP( const T& lhs, const U& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-}; \
- \
-template <class T, class U, class B = ::boost::detail::empty_base> \
-struct NAME##2_left : B \
-{ \
- friend T operator OP( const U& lhs, const T& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
-}; \
- \
-template <class T, class B = ::boost::detail::empty_base> \
-struct NAME##1 : B \
-{ \
- friend T operator OP( const T& lhs, const T& rhs ) \
- { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
+#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
+template <class T, class U, class B = ::boost::detail::empty_base> \
+struct NAME##2 : B \
+{ \
+ friend T operator OP( const T& lhs, const U& rhs ) \
+ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
+}; \
+ \
+template <class T, class U, class B = ::boost::detail::empty_base> \
+struct BOOST_OPERATOR2_LEFT(NAME) : B \
+{ \
+ friend T operator OP( const U& lhs, const T& rhs ) \
+ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
+}; \
+ \
+template <class T, class B = ::boost::detail::empty_base> \
+struct NAME##1 : B \
+{ \
+ friend T operator OP( const T& lhs, const T& rhs ) \
+ { T nrv( lhs ); nrv OP##= rhs; return nrv; } \
};
#else // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
-// For compilers without NRVO the following code is optimal, but not symmetric!
-// Note that the implementation of NAME##2_left only looks cool, but doesn't
-// provide optimization opportunities to the compiler :)
+// For compilers without NRVO the following code is optimal, but not
+// symmetric! Note that the implementation of
+// BOOST_OPERATOR2_LEFT(NAME) only looks cool, but doesn't provide
+// optimization opportunities to the compiler :)
#define BOOST_BINARY_OPERATOR_COMMUTATIVE( NAME, OP ) \
template <class T, class U, class B = ::boost::detail::empty_base> \
friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
};
-#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
-template <class T, class U, class B = ::boost::detail::empty_base> \
-struct NAME##2 : B \
-{ \
- friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
-}; \
- \
-template <class T, class U, class B = ::boost::detail::empty_base> \
-struct NAME##2_left : B \
-{ \
- friend T operator OP( const U& lhs, const T& rhs ) \
- { return T( lhs ) OP##= rhs; } \
-}; \
- \
-template <class T, class B = ::boost::detail::empty_base> \
-struct NAME##1 : B \
-{ \
- friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
+#define BOOST_BINARY_OPERATOR_NON_COMMUTATIVE( NAME, OP ) \
+template <class T, class U, class B = ::boost::detail::empty_base> \
+struct NAME##2 : B \
+{ \
+ friend T operator OP( T lhs, const U& rhs ) { return lhs OP##= rhs; } \
+}; \
+ \
+template <class T, class U, class B = ::boost::detail::empty_base> \
+struct BOOST_OPERATOR2_LEFT(NAME) : B \
+{ \
+ friend T operator OP( const U& lhs, const T& rhs ) \
+ { return T( lhs ) OP##= rhs; } \
+}; \
+ \
+template <class T, class B = ::boost::detail::empty_base> \
+struct NAME##1 : B \
+{ \
+ friend T operator OP( T lhs, const T& rhs ) { return lhs OP##= rhs; } \
};
#endif // defined(BOOST_HAS_NRVO) || defined(BOOST_FORCE_SYMMETRIC_OPERATORS)
#undef BOOST_BINARY_OPERATOR_COMMUTATIVE
#undef BOOST_BINARY_OPERATOR_NON_COMMUTATIVE
+#undef BOOST_OPERATOR2_LEFT
// incrementable and decrementable contributed by Jeremy Siek
-// (C) 2003, Fernando Luis Cacciola Carballal.
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
//
-// This material is provided "as is", with absolutely no warranty expressed
-// or implied. Any use is at your own risk.
-//
-// Permission to use or copy this software for any purpose is hereby granted
-// without fee, provided the above notices are retained on all copies.
-// Permission to modify the code and to distribute modified code is granted,
-// provided the above notices are retained, and a notice that the code was
-// modified is included with the above copyright notice.
+// 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)
//
// See http://www.boost.org/lib/optional for documentation.
//
#include "boost/config.hpp"
#include "boost/assert.hpp"
+#include "boost/type.hpp"
#include "boost/type_traits/alignment_of.hpp"
#include "boost/type_traits/type_with_alignment.hpp"
+#include "boost/type_traits/remove_reference.hpp"
+#include "boost/type_traits/is_reference.hpp"
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/bool.hpp"
+#include "boost/mpl/not.hpp"
+#include "boost/detail/reference_content.hpp"
+#include "boost/detail/none_t.hpp"
+#include "boost/utility/compare_pointees.hpp"
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
// VC6.0 has the following bug:
#define BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
#endif
-namespace boost
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION,<=700)
+// AFAICT only VC7.1 correctly resolves the overload set
+// that includes the in-place factory taking functions,
+// so for the other VC versions, in-place factory support
+// is disabled
+#define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+#endif
+
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
+// BCB (5.5.1) cannot parse the nested template struct in an inplace factory.
+#define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+#endif
+
+#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \
+ && BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
+// BCB (up to 5.64) has the following bug:
+// If there is a member function/operator template of the form
+// template<class Expr> mfunc( Expr expr ) ;
+// some calls are resolved to this even if there are other better matches.
+// The effect of this bug is that calls to converting ctors and assignments
+// are incrorrectly sink to this general catch-all member function template as shown above.
+#define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
+#endif
+
+
+namespace boost {
+
+class InPlaceFactoryBase ;
+class TypedInPlaceFactoryBase ;
+
+namespace optional_detail {
+
+// This local class is used instead of that in "aligned_storage.hpp"
+// because I've found the 'official' class to ICE BCB5.5
+// when some types are used with optional<>
+// (due to sizeof() passed down as a non-type template parameter)
+template <class T>
+class aligned_storage
{
- namespace optional_detail
- {
- template <class T>
- class aligned_storage
+ // Borland ICEs if unnamed unions are used for this!
+ union dummy_u
{
- // Borland ICEs if unnamed unions are used for this!
- union dummy_u
- {
- char data[ sizeof(T) ];
- BOOST_DEDUCED_TYPENAME type_with_alignment<
- ::boost::alignment_of<T>::value >::type aligner_;
- } dummy_ ;
-
- public:
-
- void const* address() const { return &dummy_.data[0]; }
- void * address() { return &dummy_.data[0]; }
- } ;
- }
+ char data[ sizeof(T) ];
+ BOOST_DEDUCED_TYPENAME type_with_alignment<
+ ::boost::alignment_of<T>::value >::type aligner_;
+ } dummy_ ;
+
+ public:
+
+ void const* address() const { return &dummy_.data[0]; }
+ void * address() { return &dummy_.data[0]; }
+} ;
template<class T>
-class optional
+struct types_when_isnt_ref
{
- typedef optional<T> this_type ;
+ typedef T const& reference_const_type ;
+ typedef T & reference_type ;
+ typedef T const* pointer_const_type ;
+ typedef T * pointer_type ;
+ typedef T const& argument_type ;
+} ;
+template<class T>
+struct types_when_is_ref
+{
+ typedef BOOST_DEDUCED_TYPENAME remove_reference<T>::type raw_type ;
- typedef optional_detail::aligned_storage<T> storage_type ;
+ typedef raw_type& reference_const_type ;
+ typedef raw_type& reference_type ;
+ typedef raw_type* pointer_const_type ;
+ typedef raw_type* pointer_type ;
+ typedef raw_type& argument_type ;
+} ;
- typedef void (this_type::*unspecified_bool_type)();
-
- public :
+struct optional_tag {} ;
+
+template<class T>
+class optional_base : public optional_tag
+{
+ private :
+
+ typedef BOOST_DEDUCED_TYPENAME detail::make_reference_content<T>::type internal_type ;
+
+ typedef aligned_storage<internal_type> storage_type ;
+
+ typedef types_when_isnt_ref<T> types_when_not_ref ;
+ typedef types_when_is_ref<T> types_when_ref ;
+
+ typedef optional_base<T> this_type ;
+
+ protected :
typedef T value_type ;
+
+ typedef mpl::true_ is_reference_tag ;
+ typedef mpl::false_ is_not_reference_tag ;
+
+ typedef BOOST_DEDUCED_TYPENAME is_reference<T>::type is_reference_predicate ;
+
+ typedef BOOST_DEDUCED_TYPENAME mpl::if_<is_reference_predicate,types_when_ref,types_when_not_ref>::type types ;
+
+ typedef bool (this_type::*unspecified_bool_type)() const;
+
+ typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::argument_type argument_type ;
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional_base()
+ :
+ m_initialized(false) {}
// Creates an optional<T> uninitialized.
// No-throw
- optional ()
+ optional_base ( detail::none_t const& )
:
m_initialized(false) {}
// Creates an optional<T> initialized with 'val'.
// Can throw if T::T(T const&) does
- explicit optional ( T const& val )
+ optional_base ( argument_type val )
:
m_initialized(false)
{
construct(val);
}
+ // Creates a deep copy of another optional<T>
+ // Can throw if T::T(T const&) does
+ optional_base ( optional_base const& rhs )
+ :
+ m_initialized(false)
+ {
+ if ( rhs.is_initialized() )
+ construct(rhs.get_impl());
+ }
+
+ // This is used for both converting and in-place constructions.
+ // Derived classes use the 'tag' to select the appropriate
+ // implementation (the correct 'construct()' overload)
+ template<class Expr>
+ explicit optional_base ( Expr const& expr, Expr const* tag )
+ :
+ m_initialized(false)
+ {
+ construct(expr,tag);
+ }
+
+ // No-throw (assuming T::~T() doesn't)
+ ~optional_base() { destroy() ; }
+
+ // Assigns from another optional<T> (deep-copies the rhs value)
+ // Basic Guarantee: If T::T( T const& ) throws, this is left UNINITIALIZED
+ void assign ( optional_base const& rhs )
+ {
+ destroy();
+ if ( rhs.is_initialized() )
+ construct(rhs.get_impl());
+ }
+
+ // Assigns from a T (deep-copies the rhs value)
+ // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED
+ void assign ( argument_type val )
+ {
+ destroy();
+ construct(val);
+ }
+
+ // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED
+ // No-throw (assuming T::~T() doesn't)
+ void assign ( detail::none_t const& ) { destroy(); }
+
+#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+ template<class Expr>
+ void assign_expr ( Expr const& expr, Expr const* tag )
+ {
+ destroy();
+ construct(expr,tag);
+ }
+#endif
+
+ public :
+
+ // Destroys the current value, if any, leaving this UNINITIALIZED
+ // No-throw (assuming T::~T() doesn't)
+ void reset() { destroy(); }
+
+ // Replaces the current value -if any- with 'val'
+ // Basic Guarantee: If T::T( T const& ) throws this is left UNINITIALIZED.
+ void reset ( argument_type val ) { assign(val); }
+
+ // Returns a pointer to the value if this is initialized, otherwise,
+ // returns NULL.
+ // No-throw
+ pointer_const_type get_ptr() const { return m_initialized ? get_ptr_impl() : 0 ; }
+ pointer_type get_ptr() { return m_initialized ? get_ptr_impl() : 0 ; }
+
+ bool is_initialized() const { return m_initialized ; }
+
+ protected :
+
+ void construct ( argument_type val )
+ {
+ new (m_storage.address()) internal_type(val) ;
+ m_initialized = true ;
+ }
+
+#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+ // Constructs in-place using the given factory
+ template<class Expr>
+ void construct ( Expr const& factory, InPlaceFactoryBase const* )
+ {
+ BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
+ factory.BOOST_NESTED_TEMPLATE apply<value_type>(m_storage.address()) ;
+ m_initialized = true ;
+ }
+
+ // Constructs in-place using the given typed factory
+ template<class Expr>
+ void construct ( Expr const& factory, TypedInPlaceFactoryBase const* )
+ {
+ BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
+ factory.apply(m_storage.address()) ;
+ m_initialized = true ;
+ }
+#endif
+
+ // Constructs using any expression implicitely convertible to the single argument
+ // of a one-argument T constructor.
+ // Converting constructions of optional<T> from optional<U> uses this function with
+ // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
+ template<class Expr>
+ void construct ( Expr const& expr, void const* )
+ {
+ new (m_storage.address()) internal_type(expr) ;
+ m_initialized = true ;
+ }
+
+#ifdef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
+ // BCB5.64 (and probably lower versions) workaround.
+ // The in-place factories are supported by means of catch-all constructors
+ // and assignment operators (the functions are parameterized in terms of
+ // an arbitrary 'Expr' type)
+ // This compiler incorrectly resolves the overload set and sinks optional<T> and optional<U>
+ // to the 'Expr'-taking functions even though explicit overloads are present for them.
+ // Thus, the following overload is needed to properly handle the case when the 'lhs'
+ // is another optional.
+ //
+ // For VC<=70 compilers this workaround dosen't work becasue the comnpiler issues and error
+ // instead of choosing the wrong overload
+ //
+ // Notice that 'Expr' will be optional<T> or optional<U> (but not optional_base<..>)
+ template<class Expr>
+ void construct ( Expr const& expr, optional_tag const* )
+ {
+ if ( expr.is_initialized() )
+ {
+ // An exception can be thrown here.
+ // It it happens, THIS will be left uninitialized.
+ new (m_storage.address()) internal_type(expr.get()) ;
+ m_initialized = true ;
+ }
+ }
+#endif
+
+ void destroy()
+ {
+ if ( m_initialized )
+ destroy_impl(is_reference_predicate()) ;
+ }
+
+ unspecified_bool_type safe_bool() const { return m_initialized ? &this_type::is_initialized : 0 ; }
+
+ reference_const_type get_impl() const { return dereference(get_object(), is_reference_predicate() ) ; }
+ reference_type get_impl() { return dereference(get_object(), is_reference_predicate() ) ; }
+
+ pointer_const_type get_ptr_impl() const { return cast_ptr(get_object(), is_reference_predicate() ) ; }
+ pointer_type get_ptr_impl() { return cast_ptr(get_object(), is_reference_predicate() ) ; }
+
+ private :
+
+ // internal_type can be either T or reference_content<T>
+ internal_type const* get_object() const { return static_cast<internal_type const*>(m_storage.address()); }
+ internal_type * get_object() { return static_cast<internal_type *> (m_storage.address()); }
+
+ // reference_content<T> lacks an implicit conversion to T&, so the following is needed to obtain a proper reference.
+ reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; }
+ reference_type dereference( internal_type* p, is_not_reference_tag ) { return *p ; }
+ reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; }
+ reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; }
+
+ void destroy_impl ( is_not_reference_tag ) { get_impl().~T() ; m_initialized = false ; }
+ void destroy_impl ( is_reference_tag ) { m_initialized = false ; }
+
+ // If T is of reference type, trying to get a pointer to the held value must result in a compile-time error.
+ // Decent compilers should disallow conversions from reference_content<T>* to T*, but just in case,
+ // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.
+ pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; }
+ pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; }
+
+ bool m_initialized ;
+ storage_type m_storage ;
+} ;
+
+} // namespace optional_detail
+
+template<class T>
+class optional : public optional_detail::optional_base<T>
+{
+ typedef optional_detail::optional_base<T> base ;
+
+ typedef BOOST_DEDUCED_TYPENAME base::unspecified_bool_type unspecified_bool_type ;
+
+ public :
+
+ typedef optional<T> this_type ;
+
+ typedef BOOST_DEDUCED_TYPENAME base::value_type value_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::reference_type reference_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::reference_const_type reference_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::pointer_type pointer_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::pointer_const_type pointer_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::argument_type argument_type ;
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional() : base() {}
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional( detail::none_t const& none_ ) : base(none_) {}
+
+ // Creates an optional<T> initialized with 'val'.
+ // Can throw if T::T(T const&) does
+ optional ( argument_type val ) : base(val) {}
+
#ifndef BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
// NOTE: MSVC needs templated versions first
template<class U>
explicit optional ( optional<U> const& rhs )
:
- m_initialized(false)
+ base()
{
- if ( rhs )
- construct(*rhs);
+ if ( rhs.is_initialized() )
+ this->construct(rhs.get());
}
#endif
+#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+ // Creates an optional<T> with an expression which can be either
+ // (a) An instance of InPlaceFactory (i.e. in_place(a,b,...,n);
+ // (b) An instance of TypedInPlaceFactory ( i.e. in_place<T>(a,b,...,n);
+ // (c) Any expression implicitely convertible to the single type
+ // of a one-argument T's constructor.
+ // (d*) Weak compilers (BCB) might also resolved Expr as optional<T> and optional<U>
+ // even though explicit overloads are present for these.
+ // Depending on the above some T ctor is called.
+ // Can throw is the resolved T ctor throws.
+ template<class Expr>
+ explicit optional ( Expr const& expr ) : base(expr,&expr) {}
+#endif
+
// Creates a deep copy of another optional<T>
// Can throw if T::T(T const&) does
- optional ( optional const& rhs )
- :
- m_initialized(false)
- {
- if ( rhs )
- construct(*rhs);
- }
+ optional ( optional const& rhs ) : base(rhs) {}
// No-throw (assuming T::~T() doesn't)
- ~optional() { destroy() ; }
+ ~optional() {}
+
+#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
+ // Assigns from an expression. See corresponding constructor.
+ // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
+ template<class Expr>
+ optional& operator= ( Expr expr )
+ {
+ this->assign_expr(expr,&expr);
+ return *this ;
+ }
+#endif
#ifndef BOOST_OPTIONAL_NO_CONVERTING_ASSIGNMENT
// Assigns from another convertible optional<U> (converts && deep-copies the rhs value)
template<class U>
optional& operator= ( optional<U> const& rhs )
{
- destroy(); // no-throw
+ this->destroy(); // no-throw
- if ( rhs )
+ if ( rhs.is_initialized() )
{
// An exception can be thrown here.
// It it happens, THIS will be left uninitialized.
- construct(*rhs);
+ this->assign(rhs.get());
}
return *this ;
}
// Assigns from another optional<T> (deep-copies the rhs value)
// Basic Guarantee: If T::T( T const& ) throws, this is left UNINITIALIZED
+ // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw)
optional& operator= ( optional const& rhs )
{
- destroy(); // no-throw
-
- if ( rhs )
- {
- // An exception can be thrown here.
- // It it happens, THIS will be left uninitialized.
- construct(*rhs);
- }
+ this->assign( rhs ) ;
return *this ;
}
- // Destroys the current value, if any, leaving this UNINITIALIZED
- // No-throw (assuming T::~T() doesn't)
- void reset()
+ // Assigns from a T (deep-copies the rhs value)
+ // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED
+ optional& operator= ( argument_type val )
{
- destroy();
+ this->assign( val ) ;
+ return *this ;
}
- // Replaces the current value -if any- with 'val'
- // Basic Guarantee: If T::T( T const& ) throws this is left UNINITIALIZED.
- void reset ( T const& val )
+ // Assigns from a "none"
+ // Which destroys the current value, if any, leaving this UNINITIALIZED
+ // No-throw (assuming T::~T() doesn't)
+ optional& operator= ( detail::none_t const& none_ )
{
- destroy();
- construct(val);
+ this->assign( none_ ) ;
+ return *this ;
}
- // Returns a pointer to the value if this is initialized, otherwise,
- // returns NULL.
+ // Returns a reference to the value if this is initialized, otherwise,
+ // the behaviour is UNDEFINED
// No-throw
- T const* get() const { return m_initialized ? static_cast<T const*>(m_storage.address()) : 0 ; }
- T* get() { return m_initialized ? static_cast<T*> (m_storage.address()) : 0 ; }
+ reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
+ reference_type get() { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
// Returns a pointer to the value if this is initialized, otherwise,
// the behaviour is UNDEFINED
// No-throw
- T const* operator->() const { BOOST_ASSERT(m_initialized) ; return static_cast<T const*>(m_storage.address()) ; }
- T* operator->() { BOOST_ASSERT(m_initialized) ; return static_cast<T*> (m_storage.address()) ; }
+ pointer_const_type operator->() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
+ pointer_type operator->() { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
// Returns a reference to the value if this is initialized, otherwise,
// the behaviour is UNDEFINED
// No-throw
- T const& operator *() const { BOOST_ASSERT(m_initialized) ; return *static_cast<T const*>(m_storage.address()) ; }
- T& operator *() { BOOST_ASSERT(m_initialized) ; return *static_cast<T*> (m_storage.address()) ; }
+ reference_const_type operator *() const { return this->get() ; }
+ reference_type operator *() { return this->get() ; }
// implicit conversion to "bool"
// No-throw
- operator unspecified_bool_type() const { return m_initialized ? &this_type::destroy : 0 ; }
+ operator unspecified_bool_type() const { return this->safe_bool() ; }
// This is provided for those compilers which don't like the conversion to bool
// on some contexts.
- bool operator!() const { return !m_initialized ; }
-
- private :
-
- void construct ( T const& val )
- {
- new (m_storage.address()) T(val) ;
- m_initialized = true ;
- }
-
- void destroy()
- {
- if ( m_initialized )
- {
- get()->~T() ;
- m_initialized = false ;
- }
- }
-
- bool m_initialized ;
- storage_type m_storage ;
+ bool operator!() const { return !this->is_initialized() ; }
} ;
-// Returns a pointer to the value if this is initialized, otherwise, returns NULL.
+// Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
// No-throw
template<class T>
inline
-T const* get_pointer ( optional<T> const& opt )
+BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type
+get ( optional<T> const& opt )
{
return opt.get() ;
}
template<class T>
inline
-T* get_pointer ( optional<T>& opt )
+BOOST_DEDUCED_TYPENAME optional<T>::reference_type
+get ( optional<T>& opt )
{
return opt.get() ;
}
-// template<class OP> bool equal_pointees(OP const& x, OP const& y);
-//
-// Being OP a model of OptionalPointee (either a pointer or an optional):
-//
-// If both x and y have valid pointees, returns the result of (*x == *y)
-// If only one has a valid pointee, returns false.
-// If none have valid pointees, returns true.
+// Returns a pointer to the value if this is initialized, otherwise, returns NULL.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_const_type
+get ( optional<T> const* opt )
+{
+ return opt->get_ptr() ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_type
+get ( optional<T>* opt )
+{
+ return opt->get_ptr() ;
+}
+
+// Returns a pointer to the value if this is initialized, otherwise, returns NULL.
// No-throw
-template<class OptionalPointee>
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_const_type
+get_pointer ( optional<T> const& opt )
+{
+ return opt.get_ptr() ;
+}
+
+template<class T>
inline
-bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_type
+get_pointer ( optional<T>& opt )
{
- return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
+ return opt.get_ptr() ;
}
-// optional's operator == and != have deep-semantics (compare values).
-// WARNING: This is UNLIKE pointers. Use equal_pointees() in generic code instead.
+// optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
+// WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
+
template<class T>
inline
bool operator == ( optional<T> const& x, optional<T> const& y )
{ return equal_pointees(x,y); }
+template<class T>
+inline
+bool operator < ( optional<T> const& x, optional<T> const& y )
+{ return less_pointees(x,y); }
+
template<class T>
inline
bool operator != ( optional<T> const& x, optional<T> const& y )
{ return !( x == y ) ; }
+template<class T>
+inline
+bool operator > ( optional<T> const& x, optional<T> const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( optional<T> const& x, optional<T> const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( optional<T> const& x, optional<T> const& y )
+{ return !( x < y ) ; }
+
+template<class T>
+inline
+bool operator == ( optional<T> const& x, detail::none_t const& )
+{ return equal_pointees(x, optional<T>() ); }
+
+template<class T>
+inline
+bool operator < ( optional<T> const& x, detail::none_t const& )
+{ return less_pointees(x,optional<T>() ); }
+
+template<class T>
+inline
+bool operator != ( optional<T> const& x, detail::none_t const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( optional<T> const& x, detail::none_t const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( optional<T> const& x, detail::none_t const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( optional<T> const& x, detail::none_t const& y )
+{ return !( x < y ) ; }
+
+template<class T>
+inline
+bool operator == ( detail::none_t const& x, optional<T> const& y )
+{ return equal_pointees(optional<T>() ,y); }
+
+template<class T>
+inline
+bool operator < ( detail::none_t const& x, optional<T> const& y )
+{ return less_pointees(optional<T>() ,y); }
+
+template<class T>
+inline
+bool operator != ( detail::none_t const& x, optional<T> const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( detail::none_t const& x, optional<T> const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( detail::none_t const& x, optional<T> const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( detail::none_t const& x, optional<T> const& y )
+{ return !( x < y ) ; }
//
// The following swap implementation follows the GCC workaround as found in
}
}
-#undef BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
-
} // namespace optional_detail
template<class T> inline void swap ( optional<T>& x, optional<T>& y )
optional_detail::optional_swap(x,y);
}
-
} // namespace boost
#endif
--- /dev/null
+// Copyright David Abrahams 2004. 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 POINTEE_DWA200415_HPP
+# define POINTEE_DWA200415_HPP
+
+// dereferenceable_traits provides access to the value_type and
+// reference of a Dereferenceable type.
+
+# include <boost/detail/is_incrementable.hpp>
+# include <boost/iterator/iterator_traits.hpp>
+# include <boost/type_traits/add_const.hpp>
+# include <boost/type_traits/remove_cv.hpp>
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/apply_if.hpp>
+
+namespace boost {
+
+namespace detail
+{
+ template <class P>
+ struct smart_ptr_pointee
+ {
+ typedef typename P::element_type type;
+ };
+
+ template <class Iterator>
+ struct iterator_pointee
+ {
+ typedef typename iterator_traits<Iterator>::value_type value_type;
+
+ struct impl
+ {
+ template <class T>
+ static char test(T const&);
+
+ static char (& test(value_type&) )[2];
+
+ static Iterator& x;
+ };
+
+ BOOST_STATIC_CONSTANT(bool, is_constant = sizeof(impl::test(*impl::x)) == 1);
+
+ typedef typename mpl::if_c<
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+ ::boost::detail::iterator_pointee<Iterator>::is_constant
+# else
+ is_constant
+# endif
+ , typename add_const<value_type>::type
+ , value_type
+ >::type type;
+ };
+}
+
+template <class P>
+struct pointee
+ : mpl::apply_if<
+ detail::is_incrementable<P>
+ , detail::iterator_pointee<P>
+ , detail::smart_ptr_pointee<P>
+ >
+{
+};
+
+} // namespace boost
+
+#endif // POINTEE_DWA200415_HPP
# define BOOST_PP_CONFIG_EDG() 0x0020
#
# ifndef BOOST_PP_CONFIG_FLAGS
-# if defined(__SPIRIT_PP__)
+# if defined(__SPIRIT_PP__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
# elif defined(__EDG__) || defined(__EDG_VERSION__)
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
--- /dev/null
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * Permission to copy, use, modify, sell and distribute this software is
+# * granted provided this copyright notice appears in all copies. This
+# * software is provided "as is" without express or implied warranty, and
+# * with no claim as to its suitability for any purpose.
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_CONTROL_DETAIL_WHILE_HPP
+# define BOOST_PREPROCESSOR_CONTROL_DETAIL_WHILE_HPP
+#
+# include <boost/preprocessor/control/iif.hpp>
+# include <boost/preprocessor/logical/bool.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
+#
+# define BOOST_PP_WHILE_1(p, o, s) BOOST_PP_WHILE_1_C(BOOST_PP_BOOL(p(2, s)), p, o, s)
+# define BOOST_PP_WHILE_2(p, o, s) BOOST_PP_WHILE_2_C(BOOST_PP_BOOL(p(3, s)), p, o, s)
+# define BOOST_PP_WHILE_3(p, o, s) BOOST_PP_WHILE_3_C(BOOST_PP_BOOL(p(4, s)), p, o, s)
+# define BOOST_PP_WHILE_4(p, o, s) BOOST_PP_WHILE_4_C(BOOST_PP_BOOL(p(5, s)), p, o, s)
+# define BOOST_PP_WHILE_5(p, o, s) BOOST_PP_WHILE_5_C(BOOST_PP_BOOL(p(6, s)), p, o, s)
+# define BOOST_PP_WHILE_6(p, o, s) BOOST_PP_WHILE_6_C(BOOST_PP_BOOL(p(7, s)), p, o, s)
+# define BOOST_PP_WHILE_7(p, o, s) BOOST_PP_WHILE_7_C(BOOST_PP_BOOL(p(8, s)), p, o, s)
+# define BOOST_PP_WHILE_8(p, o, s) BOOST_PP_WHILE_8_C(BOOST_PP_BOOL(p(9, s)), p, o, s)
+# define BOOST_PP_WHILE_9(p, o, s) BOOST_PP_WHILE_9_C(BOOST_PP_BOOL(p(10, s)), p, o, s)
+# define BOOST_PP_WHILE_10(p, o, s) BOOST_PP_WHILE_10_C(BOOST_PP_BOOL(p(11, s)), p, o, s)
+# define BOOST_PP_WHILE_11(p, o, s) BOOST_PP_WHILE_11_C(BOOST_PP_BOOL(p(12, s)), p, o, s)
+# define BOOST_PP_WHILE_12(p, o, s) BOOST_PP_WHILE_12_C(BOOST_PP_BOOL(p(13, s)), p, o, s)
+# define BOOST_PP_WHILE_13(p, o, s) BOOST_PP_WHILE_13_C(BOOST_PP_BOOL(p(14, s)), p, o, s)
+# define BOOST_PP_WHILE_14(p, o, s) BOOST_PP_WHILE_14_C(BOOST_PP_BOOL(p(15, s)), p, o, s)
+# define BOOST_PP_WHILE_15(p, o, s) BOOST_PP_WHILE_15_C(BOOST_PP_BOOL(p(16, s)), p, o, s)
+# define BOOST_PP_WHILE_16(p, o, s) BOOST_PP_WHILE_16_C(BOOST_PP_BOOL(p(17, s)), p, o, s)
+# define BOOST_PP_WHILE_17(p, o, s) BOOST_PP_WHILE_17_C(BOOST_PP_BOOL(p(18, s)), p, o, s)
+# define BOOST_PP_WHILE_18(p, o, s) BOOST_PP_WHILE_18_C(BOOST_PP_BOOL(p(19, s)), p, o, s)
+# define BOOST_PP_WHILE_19(p, o, s) BOOST_PP_WHILE_19_C(BOOST_PP_BOOL(p(20, s)), p, o, s)
+# define BOOST_PP_WHILE_20(p, o, s) BOOST_PP_WHILE_20_C(BOOST_PP_BOOL(p(21, s)), p, o, s)
+# define BOOST_PP_WHILE_21(p, o, s) BOOST_PP_WHILE_21_C(BOOST_PP_BOOL(p(22, s)), p, o, s)
+# define BOOST_PP_WHILE_22(p, o, s) BOOST_PP_WHILE_22_C(BOOST_PP_BOOL(p(23, s)), p, o, s)
+# define BOOST_PP_WHILE_23(p, o, s) BOOST_PP_WHILE_23_C(BOOST_PP_BOOL(p(24, s)), p, o, s)
+# define BOOST_PP_WHILE_24(p, o, s) BOOST_PP_WHILE_24_C(BOOST_PP_BOOL(p(25, s)), p, o, s)
+# define BOOST_PP_WHILE_25(p, o, s) BOOST_PP_WHILE_25_C(BOOST_PP_BOOL(p(26, s)), p, o, s)
+# define BOOST_PP_WHILE_26(p, o, s) BOOST_PP_WHILE_26_C(BOOST_PP_BOOL(p(27, s)), p, o, s)
+# define BOOST_PP_WHILE_27(p, o, s) BOOST_PP_WHILE_27_C(BOOST_PP_BOOL(p(28, s)), p, o, s)
+# define BOOST_PP_WHILE_28(p, o, s) BOOST_PP_WHILE_28_C(BOOST_PP_BOOL(p(29, s)), p, o, s)
+# define BOOST_PP_WHILE_29(p, o, s) BOOST_PP_WHILE_29_C(BOOST_PP_BOOL(p(30, s)), p, o, s)
+# define BOOST_PP_WHILE_30(p, o, s) BOOST_PP_WHILE_30_C(BOOST_PP_BOOL(p(31, s)), p, o, s)
+# define BOOST_PP_WHILE_31(p, o, s) BOOST_PP_WHILE_31_C(BOOST_PP_BOOL(p(32, s)), p, o, s)
+# define BOOST_PP_WHILE_32(p, o, s) BOOST_PP_WHILE_32_C(BOOST_PP_BOOL(p(33, s)), p, o, s)
+# define BOOST_PP_WHILE_33(p, o, s) BOOST_PP_WHILE_33_C(BOOST_PP_BOOL(p(34, s)), p, o, s)
+# define BOOST_PP_WHILE_34(p, o, s) BOOST_PP_WHILE_34_C(BOOST_PP_BOOL(p(35, s)), p, o, s)
+# define BOOST_PP_WHILE_35(p, o, s) BOOST_PP_WHILE_35_C(BOOST_PP_BOOL(p(36, s)), p, o, s)
+# define BOOST_PP_WHILE_36(p, o, s) BOOST_PP_WHILE_36_C(BOOST_PP_BOOL(p(37, s)), p, o, s)
+# define BOOST_PP_WHILE_37(p, o, s) BOOST_PP_WHILE_37_C(BOOST_PP_BOOL(p(38, s)), p, o, s)
+# define BOOST_PP_WHILE_38(p, o, s) BOOST_PP_WHILE_38_C(BOOST_PP_BOOL(p(39, s)), p, o, s)
+# define BOOST_PP_WHILE_39(p, o, s) BOOST_PP_WHILE_39_C(BOOST_PP_BOOL(p(40, s)), p, o, s)
+# define BOOST_PP_WHILE_40(p, o, s) BOOST_PP_WHILE_40_C(BOOST_PP_BOOL(p(41, s)), p, o, s)
+# define BOOST_PP_WHILE_41(p, o, s) BOOST_PP_WHILE_41_C(BOOST_PP_BOOL(p(42, s)), p, o, s)
+# define BOOST_PP_WHILE_42(p, o, s) BOOST_PP_WHILE_42_C(BOOST_PP_BOOL(p(43, s)), p, o, s)
+# define BOOST_PP_WHILE_43(p, o, s) BOOST_PP_WHILE_43_C(BOOST_PP_BOOL(p(44, s)), p, o, s)
+# define BOOST_PP_WHILE_44(p, o, s) BOOST_PP_WHILE_44_C(BOOST_PP_BOOL(p(45, s)), p, o, s)
+# define BOOST_PP_WHILE_45(p, o, s) BOOST_PP_WHILE_45_C(BOOST_PP_BOOL(p(46, s)), p, o, s)
+# define BOOST_PP_WHILE_46(p, o, s) BOOST_PP_WHILE_46_C(BOOST_PP_BOOL(p(47, s)), p, o, s)
+# define BOOST_PP_WHILE_47(p, o, s) BOOST_PP_WHILE_47_C(BOOST_PP_BOOL(p(48, s)), p, o, s)
+# define BOOST_PP_WHILE_48(p, o, s) BOOST_PP_WHILE_48_C(BOOST_PP_BOOL(p(49, s)), p, o, s)
+# define BOOST_PP_WHILE_49(p, o, s) BOOST_PP_WHILE_49_C(BOOST_PP_BOOL(p(50, s)), p, o, s)
+# define BOOST_PP_WHILE_50(p, o, s) BOOST_PP_WHILE_50_C(BOOST_PP_BOOL(p(51, s)), p, o, s)
+# define BOOST_PP_WHILE_51(p, o, s) BOOST_PP_WHILE_51_C(BOOST_PP_BOOL(p(52, s)), p, o, s)
+# define BOOST_PP_WHILE_52(p, o, s) BOOST_PP_WHILE_52_C(BOOST_PP_BOOL(p(53, s)), p, o, s)
+# define BOOST_PP_WHILE_53(p, o, s) BOOST_PP_WHILE_53_C(BOOST_PP_BOOL(p(54, s)), p, o, s)
+# define BOOST_PP_WHILE_54(p, o, s) BOOST_PP_WHILE_54_C(BOOST_PP_BOOL(p(55, s)), p, o, s)
+# define BOOST_PP_WHILE_55(p, o, s) BOOST_PP_WHILE_55_C(BOOST_PP_BOOL(p(56, s)), p, o, s)
+# define BOOST_PP_WHILE_56(p, o, s) BOOST_PP_WHILE_56_C(BOOST_PP_BOOL(p(57, s)), p, o, s)
+# define BOOST_PP_WHILE_57(p, o, s) BOOST_PP_WHILE_57_C(BOOST_PP_BOOL(p(58, s)), p, o, s)
+# define BOOST_PP_WHILE_58(p, o, s) BOOST_PP_WHILE_58_C(BOOST_PP_BOOL(p(59, s)), p, o, s)
+# define BOOST_PP_WHILE_59(p, o, s) BOOST_PP_WHILE_59_C(BOOST_PP_BOOL(p(60, s)), p, o, s)
+# define BOOST_PP_WHILE_60(p, o, s) BOOST_PP_WHILE_60_C(BOOST_PP_BOOL(p(61, s)), p, o, s)
+# define BOOST_PP_WHILE_61(p, o, s) BOOST_PP_WHILE_61_C(BOOST_PP_BOOL(p(62, s)), p, o, s)
+# define BOOST_PP_WHILE_62(p, o, s) BOOST_PP_WHILE_62_C(BOOST_PP_BOOL(p(63, s)), p, o, s)
+# define BOOST_PP_WHILE_63(p, o, s) BOOST_PP_WHILE_63_C(BOOST_PP_BOOL(p(64, s)), p, o, s)
+# define BOOST_PP_WHILE_64(p, o, s) BOOST_PP_WHILE_64_C(BOOST_PP_BOOL(p(65, s)), p, o, s)
+# define BOOST_PP_WHILE_65(p, o, s) BOOST_PP_WHILE_65_C(BOOST_PP_BOOL(p(66, s)), p, o, s)
+# define BOOST_PP_WHILE_66(p, o, s) BOOST_PP_WHILE_66_C(BOOST_PP_BOOL(p(67, s)), p, o, s)
+# define BOOST_PP_WHILE_67(p, o, s) BOOST_PP_WHILE_67_C(BOOST_PP_BOOL(p(68, s)), p, o, s)
+# define BOOST_PP_WHILE_68(p, o, s) BOOST_PP_WHILE_68_C(BOOST_PP_BOOL(p(69, s)), p, o, s)
+# define BOOST_PP_WHILE_69(p, o, s) BOOST_PP_WHILE_69_C(BOOST_PP_BOOL(p(70, s)), p, o, s)
+# define BOOST_PP_WHILE_70(p, o, s) BOOST_PP_WHILE_70_C(BOOST_PP_BOOL(p(71, s)), p, o, s)
+# define BOOST_PP_WHILE_71(p, o, s) BOOST_PP_WHILE_71_C(BOOST_PP_BOOL(p(72, s)), p, o, s)
+# define BOOST_PP_WHILE_72(p, o, s) BOOST_PP_WHILE_72_C(BOOST_PP_BOOL(p(73, s)), p, o, s)
+# define BOOST_PP_WHILE_73(p, o, s) BOOST_PP_WHILE_73_C(BOOST_PP_BOOL(p(74, s)), p, o, s)
+# define BOOST_PP_WHILE_74(p, o, s) BOOST_PP_WHILE_74_C(BOOST_PP_BOOL(p(75, s)), p, o, s)
+# define BOOST_PP_WHILE_75(p, o, s) BOOST_PP_WHILE_75_C(BOOST_PP_BOOL(p(76, s)), p, o, s)
+# define BOOST_PP_WHILE_76(p, o, s) BOOST_PP_WHILE_76_C(BOOST_PP_BOOL(p(77, s)), p, o, s)
+# define BOOST_PP_WHILE_77(p, o, s) BOOST_PP_WHILE_77_C(BOOST_PP_BOOL(p(78, s)), p, o, s)
+# define BOOST_PP_WHILE_78(p, o, s) BOOST_PP_WHILE_78_C(BOOST_PP_BOOL(p(79, s)), p, o, s)
+# define BOOST_PP_WHILE_79(p, o, s) BOOST_PP_WHILE_79_C(BOOST_PP_BOOL(p(80, s)), p, o, s)
+# define BOOST_PP_WHILE_80(p, o, s) BOOST_PP_WHILE_80_C(BOOST_PP_BOOL(p(81, s)), p, o, s)
+# define BOOST_PP_WHILE_81(p, o, s) BOOST_PP_WHILE_81_C(BOOST_PP_BOOL(p(82, s)), p, o, s)
+# define BOOST_PP_WHILE_82(p, o, s) BOOST_PP_WHILE_82_C(BOOST_PP_BOOL(p(83, s)), p, o, s)
+# define BOOST_PP_WHILE_83(p, o, s) BOOST_PP_WHILE_83_C(BOOST_PP_BOOL(p(84, s)), p, o, s)
+# define BOOST_PP_WHILE_84(p, o, s) BOOST_PP_WHILE_84_C(BOOST_PP_BOOL(p(85, s)), p, o, s)
+# define BOOST_PP_WHILE_85(p, o, s) BOOST_PP_WHILE_85_C(BOOST_PP_BOOL(p(86, s)), p, o, s)
+# define BOOST_PP_WHILE_86(p, o, s) BOOST_PP_WHILE_86_C(BOOST_PP_BOOL(p(87, s)), p, o, s)
+# define BOOST_PP_WHILE_87(p, o, s) BOOST_PP_WHILE_87_C(BOOST_PP_BOOL(p(88, s)), p, o, s)
+# define BOOST_PP_WHILE_88(p, o, s) BOOST_PP_WHILE_88_C(BOOST_PP_BOOL(p(89, s)), p, o, s)
+# define BOOST_PP_WHILE_89(p, o, s) BOOST_PP_WHILE_89_C(BOOST_PP_BOOL(p(90, s)), p, o, s)
+# define BOOST_PP_WHILE_90(p, o, s) BOOST_PP_WHILE_90_C(BOOST_PP_BOOL(p(91, s)), p, o, s)
+# define BOOST_PP_WHILE_91(p, o, s) BOOST_PP_WHILE_91_C(BOOST_PP_BOOL(p(92, s)), p, o, s)
+# define BOOST_PP_WHILE_92(p, o, s) BOOST_PP_WHILE_92_C(BOOST_PP_BOOL(p(93, s)), p, o, s)
+# define BOOST_PP_WHILE_93(p, o, s) BOOST_PP_WHILE_93_C(BOOST_PP_BOOL(p(94, s)), p, o, s)
+# define BOOST_PP_WHILE_94(p, o, s) BOOST_PP_WHILE_94_C(BOOST_PP_BOOL(p(95, s)), p, o, s)
+# define BOOST_PP_WHILE_95(p, o, s) BOOST_PP_WHILE_95_C(BOOST_PP_BOOL(p(96, s)), p, o, s)
+# define BOOST_PP_WHILE_96(p, o, s) BOOST_PP_WHILE_96_C(BOOST_PP_BOOL(p(97, s)), p, o, s)
+# define BOOST_PP_WHILE_97(p, o, s) BOOST_PP_WHILE_97_C(BOOST_PP_BOOL(p(98, s)), p, o, s)
+# define BOOST_PP_WHILE_98(p, o, s) BOOST_PP_WHILE_98_C(BOOST_PP_BOOL(p(99, s)), p, o, s)
+# define BOOST_PP_WHILE_99(p, o, s) BOOST_PP_WHILE_99_C(BOOST_PP_BOOL(p(100, s)), p, o, s)
+# define BOOST_PP_WHILE_100(p, o, s) BOOST_PP_WHILE_100_C(BOOST_PP_BOOL(p(101, s)), p, o, s)
+# define BOOST_PP_WHILE_101(p, o, s) BOOST_PP_WHILE_101_C(BOOST_PP_BOOL(p(102, s)), p, o, s)
+# define BOOST_PP_WHILE_102(p, o, s) BOOST_PP_WHILE_102_C(BOOST_PP_BOOL(p(103, s)), p, o, s)
+# define BOOST_PP_WHILE_103(p, o, s) BOOST_PP_WHILE_103_C(BOOST_PP_BOOL(p(104, s)), p, o, s)
+# define BOOST_PP_WHILE_104(p, o, s) BOOST_PP_WHILE_104_C(BOOST_PP_BOOL(p(105, s)), p, o, s)
+# define BOOST_PP_WHILE_105(p, o, s) BOOST_PP_WHILE_105_C(BOOST_PP_BOOL(p(106, s)), p, o, s)
+# define BOOST_PP_WHILE_106(p, o, s) BOOST_PP_WHILE_106_C(BOOST_PP_BOOL(p(107, s)), p, o, s)
+# define BOOST_PP_WHILE_107(p, o, s) BOOST_PP_WHILE_107_C(BOOST_PP_BOOL(p(108, s)), p, o, s)
+# define BOOST_PP_WHILE_108(p, o, s) BOOST_PP_WHILE_108_C(BOOST_PP_BOOL(p(109, s)), p, o, s)
+# define BOOST_PP_WHILE_109(p, o, s) BOOST_PP_WHILE_109_C(BOOST_PP_BOOL(p(110, s)), p, o, s)
+# define BOOST_PP_WHILE_110(p, o, s) BOOST_PP_WHILE_110_C(BOOST_PP_BOOL(p(111, s)), p, o, s)
+# define BOOST_PP_WHILE_111(p, o, s) BOOST_PP_WHILE_111_C(BOOST_PP_BOOL(p(112, s)), p, o, s)
+# define BOOST_PP_WHILE_112(p, o, s) BOOST_PP_WHILE_112_C(BOOST_PP_BOOL(p(113, s)), p, o, s)
+# define BOOST_PP_WHILE_113(p, o, s) BOOST_PP_WHILE_113_C(BOOST_PP_BOOL(p(114, s)), p, o, s)
+# define BOOST_PP_WHILE_114(p, o, s) BOOST_PP_WHILE_114_C(BOOST_PP_BOOL(p(115, s)), p, o, s)
+# define BOOST_PP_WHILE_115(p, o, s) BOOST_PP_WHILE_115_C(BOOST_PP_BOOL(p(116, s)), p, o, s)
+# define BOOST_PP_WHILE_116(p, o, s) BOOST_PP_WHILE_116_C(BOOST_PP_BOOL(p(117, s)), p, o, s)
+# define BOOST_PP_WHILE_117(p, o, s) BOOST_PP_WHILE_117_C(BOOST_PP_BOOL(p(118, s)), p, o, s)
+# define BOOST_PP_WHILE_118(p, o, s) BOOST_PP_WHILE_118_C(BOOST_PP_BOOL(p(119, s)), p, o, s)
+# define BOOST_PP_WHILE_119(p, o, s) BOOST_PP_WHILE_119_C(BOOST_PP_BOOL(p(120, s)), p, o, s)
+# define BOOST_PP_WHILE_120(p, o, s) BOOST_PP_WHILE_120_C(BOOST_PP_BOOL(p(121, s)), p, o, s)
+# define BOOST_PP_WHILE_121(p, o, s) BOOST_PP_WHILE_121_C(BOOST_PP_BOOL(p(122, s)), p, o, s)
+# define BOOST_PP_WHILE_122(p, o, s) BOOST_PP_WHILE_122_C(BOOST_PP_BOOL(p(123, s)), p, o, s)
+# define BOOST_PP_WHILE_123(p, o, s) BOOST_PP_WHILE_123_C(BOOST_PP_BOOL(p(124, s)), p, o, s)
+# define BOOST_PP_WHILE_124(p, o, s) BOOST_PP_WHILE_124_C(BOOST_PP_BOOL(p(125, s)), p, o, s)
+# define BOOST_PP_WHILE_125(p, o, s) BOOST_PP_WHILE_125_C(BOOST_PP_BOOL(p(126, s)), p, o, s)
+# define BOOST_PP_WHILE_126(p, o, s) BOOST_PP_WHILE_126_C(BOOST_PP_BOOL(p(127, s)), p, o, s)
+# define BOOST_PP_WHILE_127(p, o, s) BOOST_PP_WHILE_127_C(BOOST_PP_BOOL(p(128, s)), p, o, s)
+# define BOOST_PP_WHILE_128(p, o, s) BOOST_PP_WHILE_128_C(BOOST_PP_BOOL(p(129, s)), p, o, s)
+# define BOOST_PP_WHILE_129(p, o, s) BOOST_PP_WHILE_129_C(BOOST_PP_BOOL(p(130, s)), p, o, s)
+# define BOOST_PP_WHILE_130(p, o, s) BOOST_PP_WHILE_130_C(BOOST_PP_BOOL(p(131, s)), p, o, s)
+# define BOOST_PP_WHILE_131(p, o, s) BOOST_PP_WHILE_131_C(BOOST_PP_BOOL(p(132, s)), p, o, s)
+# define BOOST_PP_WHILE_132(p, o, s) BOOST_PP_WHILE_132_C(BOOST_PP_BOOL(p(133, s)), p, o, s)
+# define BOOST_PP_WHILE_133(p, o, s) BOOST_PP_WHILE_133_C(BOOST_PP_BOOL(p(134, s)), p, o, s)
+# define BOOST_PP_WHILE_134(p, o, s) BOOST_PP_WHILE_134_C(BOOST_PP_BOOL(p(135, s)), p, o, s)
+# define BOOST_PP_WHILE_135(p, o, s) BOOST_PP_WHILE_135_C(BOOST_PP_BOOL(p(136, s)), p, o, s)
+# define BOOST_PP_WHILE_136(p, o, s) BOOST_PP_WHILE_136_C(BOOST_PP_BOOL(p(137, s)), p, o, s)
+# define BOOST_PP_WHILE_137(p, o, s) BOOST_PP_WHILE_137_C(BOOST_PP_BOOL(p(138, s)), p, o, s)
+# define BOOST_PP_WHILE_138(p, o, s) BOOST_PP_WHILE_138_C(BOOST_PP_BOOL(p(139, s)), p, o, s)
+# define BOOST_PP_WHILE_139(p, o, s) BOOST_PP_WHILE_139_C(BOOST_PP_BOOL(p(140, s)), p, o, s)
+# define BOOST_PP_WHILE_140(p, o, s) BOOST_PP_WHILE_140_C(BOOST_PP_BOOL(p(141, s)), p, o, s)
+# define BOOST_PP_WHILE_141(p, o, s) BOOST_PP_WHILE_141_C(BOOST_PP_BOOL(p(142, s)), p, o, s)
+# define BOOST_PP_WHILE_142(p, o, s) BOOST_PP_WHILE_142_C(BOOST_PP_BOOL(p(143, s)), p, o, s)
+# define BOOST_PP_WHILE_143(p, o, s) BOOST_PP_WHILE_143_C(BOOST_PP_BOOL(p(144, s)), p, o, s)
+# define BOOST_PP_WHILE_144(p, o, s) BOOST_PP_WHILE_144_C(BOOST_PP_BOOL(p(145, s)), p, o, s)
+# define BOOST_PP_WHILE_145(p, o, s) BOOST_PP_WHILE_145_C(BOOST_PP_BOOL(p(146, s)), p, o, s)
+# define BOOST_PP_WHILE_146(p, o, s) BOOST_PP_WHILE_146_C(BOOST_PP_BOOL(p(147, s)), p, o, s)
+# define BOOST_PP_WHILE_147(p, o, s) BOOST_PP_WHILE_147_C(BOOST_PP_BOOL(p(148, s)), p, o, s)
+# define BOOST_PP_WHILE_148(p, o, s) BOOST_PP_WHILE_148_C(BOOST_PP_BOOL(p(149, s)), p, o, s)
+# define BOOST_PP_WHILE_149(p, o, s) BOOST_PP_WHILE_149_C(BOOST_PP_BOOL(p(150, s)), p, o, s)
+# define BOOST_PP_WHILE_150(p, o, s) BOOST_PP_WHILE_150_C(BOOST_PP_BOOL(p(151, s)), p, o, s)
+# define BOOST_PP_WHILE_151(p, o, s) BOOST_PP_WHILE_151_C(BOOST_PP_BOOL(p(152, s)), p, o, s)
+# define BOOST_PP_WHILE_152(p, o, s) BOOST_PP_WHILE_152_C(BOOST_PP_BOOL(p(153, s)), p, o, s)
+# define BOOST_PP_WHILE_153(p, o, s) BOOST_PP_WHILE_153_C(BOOST_PP_BOOL(p(154, s)), p, o, s)
+# define BOOST_PP_WHILE_154(p, o, s) BOOST_PP_WHILE_154_C(BOOST_PP_BOOL(p(155, s)), p, o, s)
+# define BOOST_PP_WHILE_155(p, o, s) BOOST_PP_WHILE_155_C(BOOST_PP_BOOL(p(156, s)), p, o, s)
+# define BOOST_PP_WHILE_156(p, o, s) BOOST_PP_WHILE_156_C(BOOST_PP_BOOL(p(157, s)), p, o, s)
+# define BOOST_PP_WHILE_157(p, o, s) BOOST_PP_WHILE_157_C(BOOST_PP_BOOL(p(158, s)), p, o, s)
+# define BOOST_PP_WHILE_158(p, o, s) BOOST_PP_WHILE_158_C(BOOST_PP_BOOL(p(159, s)), p, o, s)
+# define BOOST_PP_WHILE_159(p, o, s) BOOST_PP_WHILE_159_C(BOOST_PP_BOOL(p(160, s)), p, o, s)
+# define BOOST_PP_WHILE_160(p, o, s) BOOST_PP_WHILE_160_C(BOOST_PP_BOOL(p(161, s)), p, o, s)
+# define BOOST_PP_WHILE_161(p, o, s) BOOST_PP_WHILE_161_C(BOOST_PP_BOOL(p(162, s)), p, o, s)
+# define BOOST_PP_WHILE_162(p, o, s) BOOST_PP_WHILE_162_C(BOOST_PP_BOOL(p(163, s)), p, o, s)
+# define BOOST_PP_WHILE_163(p, o, s) BOOST_PP_WHILE_163_C(BOOST_PP_BOOL(p(164, s)), p, o, s)
+# define BOOST_PP_WHILE_164(p, o, s) BOOST_PP_WHILE_164_C(BOOST_PP_BOOL(p(165, s)), p, o, s)
+# define BOOST_PP_WHILE_165(p, o, s) BOOST_PP_WHILE_165_C(BOOST_PP_BOOL(p(166, s)), p, o, s)
+# define BOOST_PP_WHILE_166(p, o, s) BOOST_PP_WHILE_166_C(BOOST_PP_BOOL(p(167, s)), p, o, s)
+# define BOOST_PP_WHILE_167(p, o, s) BOOST_PP_WHILE_167_C(BOOST_PP_BOOL(p(168, s)), p, o, s)
+# define BOOST_PP_WHILE_168(p, o, s) BOOST_PP_WHILE_168_C(BOOST_PP_BOOL(p(169, s)), p, o, s)
+# define BOOST_PP_WHILE_169(p, o, s) BOOST_PP_WHILE_169_C(BOOST_PP_BOOL(p(170, s)), p, o, s)
+# define BOOST_PP_WHILE_170(p, o, s) BOOST_PP_WHILE_170_C(BOOST_PP_BOOL(p(171, s)), p, o, s)
+# define BOOST_PP_WHILE_171(p, o, s) BOOST_PP_WHILE_171_C(BOOST_PP_BOOL(p(172, s)), p, o, s)
+# define BOOST_PP_WHILE_172(p, o, s) BOOST_PP_WHILE_172_C(BOOST_PP_BOOL(p(173, s)), p, o, s)
+# define BOOST_PP_WHILE_173(p, o, s) BOOST_PP_WHILE_173_C(BOOST_PP_BOOL(p(174, s)), p, o, s)
+# define BOOST_PP_WHILE_174(p, o, s) BOOST_PP_WHILE_174_C(BOOST_PP_BOOL(p(175, s)), p, o, s)
+# define BOOST_PP_WHILE_175(p, o, s) BOOST_PP_WHILE_175_C(BOOST_PP_BOOL(p(176, s)), p, o, s)
+# define BOOST_PP_WHILE_176(p, o, s) BOOST_PP_WHILE_176_C(BOOST_PP_BOOL(p(177, s)), p, o, s)
+# define BOOST_PP_WHILE_177(p, o, s) BOOST_PP_WHILE_177_C(BOOST_PP_BOOL(p(178, s)), p, o, s)
+# define BOOST_PP_WHILE_178(p, o, s) BOOST_PP_WHILE_178_C(BOOST_PP_BOOL(p(179, s)), p, o, s)
+# define BOOST_PP_WHILE_179(p, o, s) BOOST_PP_WHILE_179_C(BOOST_PP_BOOL(p(180, s)), p, o, s)
+# define BOOST_PP_WHILE_180(p, o, s) BOOST_PP_WHILE_180_C(BOOST_PP_BOOL(p(181, s)), p, o, s)
+# define BOOST_PP_WHILE_181(p, o, s) BOOST_PP_WHILE_181_C(BOOST_PP_BOOL(p(182, s)), p, o, s)
+# define BOOST_PP_WHILE_182(p, o, s) BOOST_PP_WHILE_182_C(BOOST_PP_BOOL(p(183, s)), p, o, s)
+# define BOOST_PP_WHILE_183(p, o, s) BOOST_PP_WHILE_183_C(BOOST_PP_BOOL(p(184, s)), p, o, s)
+# define BOOST_PP_WHILE_184(p, o, s) BOOST_PP_WHILE_184_C(BOOST_PP_BOOL(p(185, s)), p, o, s)
+# define BOOST_PP_WHILE_185(p, o, s) BOOST_PP_WHILE_185_C(BOOST_PP_BOOL(p(186, s)), p, o, s)
+# define BOOST_PP_WHILE_186(p, o, s) BOOST_PP_WHILE_186_C(BOOST_PP_BOOL(p(187, s)), p, o, s)
+# define BOOST_PP_WHILE_187(p, o, s) BOOST_PP_WHILE_187_C(BOOST_PP_BOOL(p(188, s)), p, o, s)
+# define BOOST_PP_WHILE_188(p, o, s) BOOST_PP_WHILE_188_C(BOOST_PP_BOOL(p(189, s)), p, o, s)
+# define BOOST_PP_WHILE_189(p, o, s) BOOST_PP_WHILE_189_C(BOOST_PP_BOOL(p(190, s)), p, o, s)
+# define BOOST_PP_WHILE_190(p, o, s) BOOST_PP_WHILE_190_C(BOOST_PP_BOOL(p(191, s)), p, o, s)
+# define BOOST_PP_WHILE_191(p, o, s) BOOST_PP_WHILE_191_C(BOOST_PP_BOOL(p(192, s)), p, o, s)
+# define BOOST_PP_WHILE_192(p, o, s) BOOST_PP_WHILE_192_C(BOOST_PP_BOOL(p(193, s)), p, o, s)
+# define BOOST_PP_WHILE_193(p, o, s) BOOST_PP_WHILE_193_C(BOOST_PP_BOOL(p(194, s)), p, o, s)
+# define BOOST_PP_WHILE_194(p, o, s) BOOST_PP_WHILE_194_C(BOOST_PP_BOOL(p(195, s)), p, o, s)
+# define BOOST_PP_WHILE_195(p, o, s) BOOST_PP_WHILE_195_C(BOOST_PP_BOOL(p(196, s)), p, o, s)
+# define BOOST_PP_WHILE_196(p, o, s) BOOST_PP_WHILE_196_C(BOOST_PP_BOOL(p(197, s)), p, o, s)
+# define BOOST_PP_WHILE_197(p, o, s) BOOST_PP_WHILE_197_C(BOOST_PP_BOOL(p(198, s)), p, o, s)
+# define BOOST_PP_WHILE_198(p, o, s) BOOST_PP_WHILE_198_C(BOOST_PP_BOOL(p(199, s)), p, o, s)
+# define BOOST_PP_WHILE_199(p, o, s) BOOST_PP_WHILE_199_C(BOOST_PP_BOOL(p(200, s)), p, o, s)
+# define BOOST_PP_WHILE_200(p, o, s) BOOST_PP_WHILE_200_C(BOOST_PP_BOOL(p(201, s)), p, o, s)
+# define BOOST_PP_WHILE_201(p, o, s) BOOST_PP_WHILE_201_C(BOOST_PP_BOOL(p(202, s)), p, o, s)
+# define BOOST_PP_WHILE_202(p, o, s) BOOST_PP_WHILE_202_C(BOOST_PP_BOOL(p(203, s)), p, o, s)
+# define BOOST_PP_WHILE_203(p, o, s) BOOST_PP_WHILE_203_C(BOOST_PP_BOOL(p(204, s)), p, o, s)
+# define BOOST_PP_WHILE_204(p, o, s) BOOST_PP_WHILE_204_C(BOOST_PP_BOOL(p(205, s)), p, o, s)
+# define BOOST_PP_WHILE_205(p, o, s) BOOST_PP_WHILE_205_C(BOOST_PP_BOOL(p(206, s)), p, o, s)
+# define BOOST_PP_WHILE_206(p, o, s) BOOST_PP_WHILE_206_C(BOOST_PP_BOOL(p(207, s)), p, o, s)
+# define BOOST_PP_WHILE_207(p, o, s) BOOST_PP_WHILE_207_C(BOOST_PP_BOOL(p(208, s)), p, o, s)
+# define BOOST_PP_WHILE_208(p, o, s) BOOST_PP_WHILE_208_C(BOOST_PP_BOOL(p(209, s)), p, o, s)
+# define BOOST_PP_WHILE_209(p, o, s) BOOST_PP_WHILE_209_C(BOOST_PP_BOOL(p(210, s)), p, o, s)
+# define BOOST_PP_WHILE_210(p, o, s) BOOST_PP_WHILE_210_C(BOOST_PP_BOOL(p(211, s)), p, o, s)
+# define BOOST_PP_WHILE_211(p, o, s) BOOST_PP_WHILE_211_C(BOOST_PP_BOOL(p(212, s)), p, o, s)
+# define BOOST_PP_WHILE_212(p, o, s) BOOST_PP_WHILE_212_C(BOOST_PP_BOOL(p(213, s)), p, o, s)
+# define BOOST_PP_WHILE_213(p, o, s) BOOST_PP_WHILE_213_C(BOOST_PP_BOOL(p(214, s)), p, o, s)
+# define BOOST_PP_WHILE_214(p, o, s) BOOST_PP_WHILE_214_C(BOOST_PP_BOOL(p(215, s)), p, o, s)
+# define BOOST_PP_WHILE_215(p, o, s) BOOST_PP_WHILE_215_C(BOOST_PP_BOOL(p(216, s)), p, o, s)
+# define BOOST_PP_WHILE_216(p, o, s) BOOST_PP_WHILE_216_C(BOOST_PP_BOOL(p(217, s)), p, o, s)
+# define BOOST_PP_WHILE_217(p, o, s) BOOST_PP_WHILE_217_C(BOOST_PP_BOOL(p(218, s)), p, o, s)
+# define BOOST_PP_WHILE_218(p, o, s) BOOST_PP_WHILE_218_C(BOOST_PP_BOOL(p(219, s)), p, o, s)
+# define BOOST_PP_WHILE_219(p, o, s) BOOST_PP_WHILE_219_C(BOOST_PP_BOOL(p(220, s)), p, o, s)
+# define BOOST_PP_WHILE_220(p, o, s) BOOST_PP_WHILE_220_C(BOOST_PP_BOOL(p(221, s)), p, o, s)
+# define BOOST_PP_WHILE_221(p, o, s) BOOST_PP_WHILE_221_C(BOOST_PP_BOOL(p(222, s)), p, o, s)
+# define BOOST_PP_WHILE_222(p, o, s) BOOST_PP_WHILE_222_C(BOOST_PP_BOOL(p(223, s)), p, o, s)
+# define BOOST_PP_WHILE_223(p, o, s) BOOST_PP_WHILE_223_C(BOOST_PP_BOOL(p(224, s)), p, o, s)
+# define BOOST_PP_WHILE_224(p, o, s) BOOST_PP_WHILE_224_C(BOOST_PP_BOOL(p(225, s)), p, o, s)
+# define BOOST_PP_WHILE_225(p, o, s) BOOST_PP_WHILE_225_C(BOOST_PP_BOOL(p(226, s)), p, o, s)
+# define BOOST_PP_WHILE_226(p, o, s) BOOST_PP_WHILE_226_C(BOOST_PP_BOOL(p(227, s)), p, o, s)
+# define BOOST_PP_WHILE_227(p, o, s) BOOST_PP_WHILE_227_C(BOOST_PP_BOOL(p(228, s)), p, o, s)
+# define BOOST_PP_WHILE_228(p, o, s) BOOST_PP_WHILE_228_C(BOOST_PP_BOOL(p(229, s)), p, o, s)
+# define BOOST_PP_WHILE_229(p, o, s) BOOST_PP_WHILE_229_C(BOOST_PP_BOOL(p(230, s)), p, o, s)
+# define BOOST_PP_WHILE_230(p, o, s) BOOST_PP_WHILE_230_C(BOOST_PP_BOOL(p(231, s)), p, o, s)
+# define BOOST_PP_WHILE_231(p, o, s) BOOST_PP_WHILE_231_C(BOOST_PP_BOOL(p(232, s)), p, o, s)
+# define BOOST_PP_WHILE_232(p, o, s) BOOST_PP_WHILE_232_C(BOOST_PP_BOOL(p(233, s)), p, o, s)
+# define BOOST_PP_WHILE_233(p, o, s) BOOST_PP_WHILE_233_C(BOOST_PP_BOOL(p(234, s)), p, o, s)
+# define BOOST_PP_WHILE_234(p, o, s) BOOST_PP_WHILE_234_C(BOOST_PP_BOOL(p(235, s)), p, o, s)
+# define BOOST_PP_WHILE_235(p, o, s) BOOST_PP_WHILE_235_C(BOOST_PP_BOOL(p(236, s)), p, o, s)
+# define BOOST_PP_WHILE_236(p, o, s) BOOST_PP_WHILE_236_C(BOOST_PP_BOOL(p(237, s)), p, o, s)
+# define BOOST_PP_WHILE_237(p, o, s) BOOST_PP_WHILE_237_C(BOOST_PP_BOOL(p(238, s)), p, o, s)
+# define BOOST_PP_WHILE_238(p, o, s) BOOST_PP_WHILE_238_C(BOOST_PP_BOOL(p(239, s)), p, o, s)
+# define BOOST_PP_WHILE_239(p, o, s) BOOST_PP_WHILE_239_C(BOOST_PP_BOOL(p(240, s)), p, o, s)
+# define BOOST_PP_WHILE_240(p, o, s) BOOST_PP_WHILE_240_C(BOOST_PP_BOOL(p(241, s)), p, o, s)
+# define BOOST_PP_WHILE_241(p, o, s) BOOST_PP_WHILE_241_C(BOOST_PP_BOOL(p(242, s)), p, o, s)
+# define BOOST_PP_WHILE_242(p, o, s) BOOST_PP_WHILE_242_C(BOOST_PP_BOOL(p(243, s)), p, o, s)
+# define BOOST_PP_WHILE_243(p, o, s) BOOST_PP_WHILE_243_C(BOOST_PP_BOOL(p(244, s)), p, o, s)
+# define BOOST_PP_WHILE_244(p, o, s) BOOST_PP_WHILE_244_C(BOOST_PP_BOOL(p(245, s)), p, o, s)
+# define BOOST_PP_WHILE_245(p, o, s) BOOST_PP_WHILE_245_C(BOOST_PP_BOOL(p(246, s)), p, o, s)
+# define BOOST_PP_WHILE_246(p, o, s) BOOST_PP_WHILE_246_C(BOOST_PP_BOOL(p(247, s)), p, o, s)
+# define BOOST_PP_WHILE_247(p, o, s) BOOST_PP_WHILE_247_C(BOOST_PP_BOOL(p(248, s)), p, o, s)
+# define BOOST_PP_WHILE_248(p, o, s) BOOST_PP_WHILE_248_C(BOOST_PP_BOOL(p(249, s)), p, o, s)
+# define BOOST_PP_WHILE_249(p, o, s) BOOST_PP_WHILE_249_C(BOOST_PP_BOOL(p(250, s)), p, o, s)
+# define BOOST_PP_WHILE_250(p, o, s) BOOST_PP_WHILE_250_C(BOOST_PP_BOOL(p(251, s)), p, o, s)
+# define BOOST_PP_WHILE_251(p, o, s) BOOST_PP_WHILE_251_C(BOOST_PP_BOOL(p(252, s)), p, o, s)
+# define BOOST_PP_WHILE_252(p, o, s) BOOST_PP_WHILE_252_C(BOOST_PP_BOOL(p(253, s)), p, o, s)
+# define BOOST_PP_WHILE_253(p, o, s) BOOST_PP_WHILE_253_C(BOOST_PP_BOOL(p(254, s)), p, o, s)
+# define BOOST_PP_WHILE_254(p, o, s) BOOST_PP_WHILE_254_C(BOOST_PP_BOOL(p(255, s)), p, o, s)
+# define BOOST_PP_WHILE_255(p, o, s) BOOST_PP_WHILE_255_C(BOOST_PP_BOOL(p(256, s)), p, o, s)
+# define BOOST_PP_WHILE_256(p, o, s) BOOST_PP_WHILE_256_C(BOOST_PP_BOOL(p(257, s)), p, o, s)
+#
+# define BOOST_PP_WHILE_1_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_2, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(2, s))
+# define BOOST_PP_WHILE_2_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_3, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(3, s))
+# define BOOST_PP_WHILE_3_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_4, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(4, s))
+# define BOOST_PP_WHILE_4_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_5, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(5, s))
+# define BOOST_PP_WHILE_5_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_6, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(6, s))
+# define BOOST_PP_WHILE_6_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_7, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(7, s))
+# define BOOST_PP_WHILE_7_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_8, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(8, s))
+# define BOOST_PP_WHILE_8_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_9, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(9, s))
+# define BOOST_PP_WHILE_9_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_10, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(10, s))
+# define BOOST_PP_WHILE_10_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_11, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(11, s))
+# define BOOST_PP_WHILE_11_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_12, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(12, s))
+# define BOOST_PP_WHILE_12_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_13, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(13, s))
+# define BOOST_PP_WHILE_13_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_14, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(14, s))
+# define BOOST_PP_WHILE_14_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_15, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(15, s))
+# define BOOST_PP_WHILE_15_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_16, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(16, s))
+# define BOOST_PP_WHILE_16_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_17, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(17, s))
+# define BOOST_PP_WHILE_17_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_18, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(18, s))
+# define BOOST_PP_WHILE_18_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_19, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(19, s))
+# define BOOST_PP_WHILE_19_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_20, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(20, s))
+# define BOOST_PP_WHILE_20_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_21, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(21, s))
+# define BOOST_PP_WHILE_21_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_22, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(22, s))
+# define BOOST_PP_WHILE_22_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_23, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(23, s))
+# define BOOST_PP_WHILE_23_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_24, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(24, s))
+# define BOOST_PP_WHILE_24_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_25, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(25, s))
+# define BOOST_PP_WHILE_25_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_26, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(26, s))
+# define BOOST_PP_WHILE_26_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_27, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(27, s))
+# define BOOST_PP_WHILE_27_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_28, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(28, s))
+# define BOOST_PP_WHILE_28_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_29, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(29, s))
+# define BOOST_PP_WHILE_29_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_30, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(30, s))
+# define BOOST_PP_WHILE_30_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_31, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(31, s))
+# define BOOST_PP_WHILE_31_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_32, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(32, s))
+# define BOOST_PP_WHILE_32_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_33, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(33, s))
+# define BOOST_PP_WHILE_33_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_34, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(34, s))
+# define BOOST_PP_WHILE_34_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_35, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(35, s))
+# define BOOST_PP_WHILE_35_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_36, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(36, s))
+# define BOOST_PP_WHILE_36_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_37, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(37, s))
+# define BOOST_PP_WHILE_37_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_38, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(38, s))
+# define BOOST_PP_WHILE_38_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_39, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(39, s))
+# define BOOST_PP_WHILE_39_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_40, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(40, s))
+# define BOOST_PP_WHILE_40_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_41, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(41, s))
+# define BOOST_PP_WHILE_41_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_42, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(42, s))
+# define BOOST_PP_WHILE_42_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_43, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(43, s))
+# define BOOST_PP_WHILE_43_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_44, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(44, s))
+# define BOOST_PP_WHILE_44_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_45, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(45, s))
+# define BOOST_PP_WHILE_45_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_46, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(46, s))
+# define BOOST_PP_WHILE_46_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_47, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(47, s))
+# define BOOST_PP_WHILE_47_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_48, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(48, s))
+# define BOOST_PP_WHILE_48_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_49, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(49, s))
+# define BOOST_PP_WHILE_49_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_50, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(50, s))
+# define BOOST_PP_WHILE_50_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_51, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(51, s))
+# define BOOST_PP_WHILE_51_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_52, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(52, s))
+# define BOOST_PP_WHILE_52_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_53, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(53, s))
+# define BOOST_PP_WHILE_53_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_54, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(54, s))
+# define BOOST_PP_WHILE_54_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_55, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(55, s))
+# define BOOST_PP_WHILE_55_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_56, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(56, s))
+# define BOOST_PP_WHILE_56_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_57, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(57, s))
+# define BOOST_PP_WHILE_57_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_58, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(58, s))
+# define BOOST_PP_WHILE_58_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_59, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(59, s))
+# define BOOST_PP_WHILE_59_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_60, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(60, s))
+# define BOOST_PP_WHILE_60_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_61, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(61, s))
+# define BOOST_PP_WHILE_61_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_62, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(62, s))
+# define BOOST_PP_WHILE_62_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_63, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(63, s))
+# define BOOST_PP_WHILE_63_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_64, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(64, s))
+# define BOOST_PP_WHILE_64_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_65, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(65, s))
+# define BOOST_PP_WHILE_65_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_66, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(66, s))
+# define BOOST_PP_WHILE_66_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_67, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(67, s))
+# define BOOST_PP_WHILE_67_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_68, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(68, s))
+# define BOOST_PP_WHILE_68_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_69, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(69, s))
+# define BOOST_PP_WHILE_69_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_70, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(70, s))
+# define BOOST_PP_WHILE_70_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_71, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(71, s))
+# define BOOST_PP_WHILE_71_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_72, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(72, s))
+# define BOOST_PP_WHILE_72_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_73, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(73, s))
+# define BOOST_PP_WHILE_73_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_74, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(74, s))
+# define BOOST_PP_WHILE_74_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_75, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(75, s))
+# define BOOST_PP_WHILE_75_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_76, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(76, s))
+# define BOOST_PP_WHILE_76_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_77, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(77, s))
+# define BOOST_PP_WHILE_77_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_78, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(78, s))
+# define BOOST_PP_WHILE_78_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_79, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(79, s))
+# define BOOST_PP_WHILE_79_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_80, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(80, s))
+# define BOOST_PP_WHILE_80_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_81, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(81, s))
+# define BOOST_PP_WHILE_81_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_82, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(82, s))
+# define BOOST_PP_WHILE_82_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_83, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(83, s))
+# define BOOST_PP_WHILE_83_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_84, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(84, s))
+# define BOOST_PP_WHILE_84_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_85, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(85, s))
+# define BOOST_PP_WHILE_85_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_86, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(86, s))
+# define BOOST_PP_WHILE_86_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_87, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(87, s))
+# define BOOST_PP_WHILE_87_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_88, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(88, s))
+# define BOOST_PP_WHILE_88_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_89, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(89, s))
+# define BOOST_PP_WHILE_89_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_90, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(90, s))
+# define BOOST_PP_WHILE_90_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_91, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(91, s))
+# define BOOST_PP_WHILE_91_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_92, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(92, s))
+# define BOOST_PP_WHILE_92_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_93, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(93, s))
+# define BOOST_PP_WHILE_93_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_94, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(94, s))
+# define BOOST_PP_WHILE_94_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_95, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(95, s))
+# define BOOST_PP_WHILE_95_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_96, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(96, s))
+# define BOOST_PP_WHILE_96_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_97, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(97, s))
+# define BOOST_PP_WHILE_97_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_98, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(98, s))
+# define BOOST_PP_WHILE_98_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_99, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(99, s))
+# define BOOST_PP_WHILE_99_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_100, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(100, s))
+# define BOOST_PP_WHILE_100_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_101, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(101, s))
+# define BOOST_PP_WHILE_101_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_102, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(102, s))
+# define BOOST_PP_WHILE_102_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_103, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(103, s))
+# define BOOST_PP_WHILE_103_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_104, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(104, s))
+# define BOOST_PP_WHILE_104_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_105, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(105, s))
+# define BOOST_PP_WHILE_105_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_106, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(106, s))
+# define BOOST_PP_WHILE_106_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_107, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(107, s))
+# define BOOST_PP_WHILE_107_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_108, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(108, s))
+# define BOOST_PP_WHILE_108_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_109, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(109, s))
+# define BOOST_PP_WHILE_109_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_110, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(110, s))
+# define BOOST_PP_WHILE_110_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_111, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(111, s))
+# define BOOST_PP_WHILE_111_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_112, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(112, s))
+# define BOOST_PP_WHILE_112_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_113, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(113, s))
+# define BOOST_PP_WHILE_113_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_114, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(114, s))
+# define BOOST_PP_WHILE_114_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_115, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(115, s))
+# define BOOST_PP_WHILE_115_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_116, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(116, s))
+# define BOOST_PP_WHILE_116_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_117, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(117, s))
+# define BOOST_PP_WHILE_117_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_118, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(118, s))
+# define BOOST_PP_WHILE_118_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_119, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(119, s))
+# define BOOST_PP_WHILE_119_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_120, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(120, s))
+# define BOOST_PP_WHILE_120_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_121, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(121, s))
+# define BOOST_PP_WHILE_121_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_122, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(122, s))
+# define BOOST_PP_WHILE_122_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_123, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(123, s))
+# define BOOST_PP_WHILE_123_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_124, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(124, s))
+# define BOOST_PP_WHILE_124_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_125, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(125, s))
+# define BOOST_PP_WHILE_125_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_126, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(126, s))
+# define BOOST_PP_WHILE_126_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_127, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(127, s))
+# define BOOST_PP_WHILE_127_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_128, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(128, s))
+# define BOOST_PP_WHILE_128_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_129, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(129, s))
+# define BOOST_PP_WHILE_129_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_130, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(130, s))
+# define BOOST_PP_WHILE_130_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_131, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(131, s))
+# define BOOST_PP_WHILE_131_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_132, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(132, s))
+# define BOOST_PP_WHILE_132_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_133, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(133, s))
+# define BOOST_PP_WHILE_133_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_134, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(134, s))
+# define BOOST_PP_WHILE_134_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_135, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(135, s))
+# define BOOST_PP_WHILE_135_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_136, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(136, s))
+# define BOOST_PP_WHILE_136_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_137, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(137, s))
+# define BOOST_PP_WHILE_137_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_138, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(138, s))
+# define BOOST_PP_WHILE_138_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_139, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(139, s))
+# define BOOST_PP_WHILE_139_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_140, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(140, s))
+# define BOOST_PP_WHILE_140_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_141, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(141, s))
+# define BOOST_PP_WHILE_141_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_142, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(142, s))
+# define BOOST_PP_WHILE_142_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_143, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(143, s))
+# define BOOST_PP_WHILE_143_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_144, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(144, s))
+# define BOOST_PP_WHILE_144_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_145, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(145, s))
+# define BOOST_PP_WHILE_145_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_146, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(146, s))
+# define BOOST_PP_WHILE_146_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_147, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(147, s))
+# define BOOST_PP_WHILE_147_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_148, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(148, s))
+# define BOOST_PP_WHILE_148_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_149, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(149, s))
+# define BOOST_PP_WHILE_149_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_150, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(150, s))
+# define BOOST_PP_WHILE_150_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_151, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(151, s))
+# define BOOST_PP_WHILE_151_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_152, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(152, s))
+# define BOOST_PP_WHILE_152_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_153, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(153, s))
+# define BOOST_PP_WHILE_153_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_154, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(154, s))
+# define BOOST_PP_WHILE_154_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_155, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(155, s))
+# define BOOST_PP_WHILE_155_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_156, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(156, s))
+# define BOOST_PP_WHILE_156_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_157, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(157, s))
+# define BOOST_PP_WHILE_157_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_158, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(158, s))
+# define BOOST_PP_WHILE_158_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_159, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(159, s))
+# define BOOST_PP_WHILE_159_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_160, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(160, s))
+# define BOOST_PP_WHILE_160_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_161, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(161, s))
+# define BOOST_PP_WHILE_161_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_162, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(162, s))
+# define BOOST_PP_WHILE_162_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_163, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(163, s))
+# define BOOST_PP_WHILE_163_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_164, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(164, s))
+# define BOOST_PP_WHILE_164_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_165, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(165, s))
+# define BOOST_PP_WHILE_165_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_166, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(166, s))
+# define BOOST_PP_WHILE_166_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_167, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(167, s))
+# define BOOST_PP_WHILE_167_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_168, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(168, s))
+# define BOOST_PP_WHILE_168_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_169, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(169, s))
+# define BOOST_PP_WHILE_169_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_170, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(170, s))
+# define BOOST_PP_WHILE_170_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_171, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(171, s))
+# define BOOST_PP_WHILE_171_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_172, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(172, s))
+# define BOOST_PP_WHILE_172_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_173, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(173, s))
+# define BOOST_PP_WHILE_173_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_174, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(174, s))
+# define BOOST_PP_WHILE_174_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_175, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(175, s))
+# define BOOST_PP_WHILE_175_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_176, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(176, s))
+# define BOOST_PP_WHILE_176_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_177, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(177, s))
+# define BOOST_PP_WHILE_177_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_178, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(178, s))
+# define BOOST_PP_WHILE_178_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_179, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(179, s))
+# define BOOST_PP_WHILE_179_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_180, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(180, s))
+# define BOOST_PP_WHILE_180_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_181, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(181, s))
+# define BOOST_PP_WHILE_181_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_182, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(182, s))
+# define BOOST_PP_WHILE_182_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_183, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(183, s))
+# define BOOST_PP_WHILE_183_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_184, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(184, s))
+# define BOOST_PP_WHILE_184_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_185, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(185, s))
+# define BOOST_PP_WHILE_185_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_186, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(186, s))
+# define BOOST_PP_WHILE_186_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_187, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(187, s))
+# define BOOST_PP_WHILE_187_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_188, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(188, s))
+# define BOOST_PP_WHILE_188_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_189, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(189, s))
+# define BOOST_PP_WHILE_189_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_190, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(190, s))
+# define BOOST_PP_WHILE_190_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_191, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(191, s))
+# define BOOST_PP_WHILE_191_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_192, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(192, s))
+# define BOOST_PP_WHILE_192_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_193, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(193, s))
+# define BOOST_PP_WHILE_193_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_194, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(194, s))
+# define BOOST_PP_WHILE_194_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_195, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(195, s))
+# define BOOST_PP_WHILE_195_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_196, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(196, s))
+# define BOOST_PP_WHILE_196_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_197, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(197, s))
+# define BOOST_PP_WHILE_197_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_198, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(198, s))
+# define BOOST_PP_WHILE_198_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_199, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(199, s))
+# define BOOST_PP_WHILE_199_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_200, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(200, s))
+# define BOOST_PP_WHILE_200_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_201, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(201, s))
+# define BOOST_PP_WHILE_201_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_202, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(202, s))
+# define BOOST_PP_WHILE_202_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_203, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(203, s))
+# define BOOST_PP_WHILE_203_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_204, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(204, s))
+# define BOOST_PP_WHILE_204_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_205, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(205, s))
+# define BOOST_PP_WHILE_205_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_206, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(206, s))
+# define BOOST_PP_WHILE_206_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_207, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(207, s))
+# define BOOST_PP_WHILE_207_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_208, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(208, s))
+# define BOOST_PP_WHILE_208_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_209, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(209, s))
+# define BOOST_PP_WHILE_209_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_210, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(210, s))
+# define BOOST_PP_WHILE_210_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_211, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(211, s))
+# define BOOST_PP_WHILE_211_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_212, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(212, s))
+# define BOOST_PP_WHILE_212_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_213, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(213, s))
+# define BOOST_PP_WHILE_213_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_214, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(214, s))
+# define BOOST_PP_WHILE_214_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_215, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(215, s))
+# define BOOST_PP_WHILE_215_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_216, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(216, s))
+# define BOOST_PP_WHILE_216_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_217, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(217, s))
+# define BOOST_PP_WHILE_217_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_218, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(218, s))
+# define BOOST_PP_WHILE_218_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_219, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(219, s))
+# define BOOST_PP_WHILE_219_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_220, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(220, s))
+# define BOOST_PP_WHILE_220_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_221, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(221, s))
+# define BOOST_PP_WHILE_221_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_222, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(222, s))
+# define BOOST_PP_WHILE_222_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_223, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(223, s))
+# define BOOST_PP_WHILE_223_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_224, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(224, s))
+# define BOOST_PP_WHILE_224_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_225, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(225, s))
+# define BOOST_PP_WHILE_225_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_226, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(226, s))
+# define BOOST_PP_WHILE_226_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_227, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(227, s))
+# define BOOST_PP_WHILE_227_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_228, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(228, s))
+# define BOOST_PP_WHILE_228_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_229, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(229, s))
+# define BOOST_PP_WHILE_229_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_230, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(230, s))
+# define BOOST_PP_WHILE_230_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_231, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(231, s))
+# define BOOST_PP_WHILE_231_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_232, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(232, s))
+# define BOOST_PP_WHILE_232_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_233, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(233, s))
+# define BOOST_PP_WHILE_233_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_234, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(234, s))
+# define BOOST_PP_WHILE_234_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_235, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(235, s))
+# define BOOST_PP_WHILE_235_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_236, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(236, s))
+# define BOOST_PP_WHILE_236_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_237, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(237, s))
+# define BOOST_PP_WHILE_237_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_238, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(238, s))
+# define BOOST_PP_WHILE_238_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_239, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(239, s))
+# define BOOST_PP_WHILE_239_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_240, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(240, s))
+# define BOOST_PP_WHILE_240_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_241, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(241, s))
+# define BOOST_PP_WHILE_241_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_242, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(242, s))
+# define BOOST_PP_WHILE_242_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_243, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(243, s))
+# define BOOST_PP_WHILE_243_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_244, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(244, s))
+# define BOOST_PP_WHILE_244_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_245, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(245, s))
+# define BOOST_PP_WHILE_245_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_246, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(246, s))
+# define BOOST_PP_WHILE_246_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_247, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(247, s))
+# define BOOST_PP_WHILE_247_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_248, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(248, s))
+# define BOOST_PP_WHILE_248_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_249, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(249, s))
+# define BOOST_PP_WHILE_249_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_250, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(250, s))
+# define BOOST_PP_WHILE_250_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_251, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(251, s))
+# define BOOST_PP_WHILE_251_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_252, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(252, s))
+# define BOOST_PP_WHILE_252_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_253, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(253, s))
+# define BOOST_PP_WHILE_253_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_254, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(254, s))
+# define BOOST_PP_WHILE_254_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_255, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(255, s))
+# define BOOST_PP_WHILE_255_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_256, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(256, s))
+# define BOOST_PP_WHILE_256_C(c, p, o, s) BOOST_PP_IIF(c, BOOST_PP_WHILE_257, s BOOST_PP_TUPLE_EAT_3)(p, o, BOOST_PP_IIF(c, o, BOOST_PP_NIL BOOST_PP_TUPLE_EAT_2)(257, s))
+#
+#
+# endif
--- /dev/null
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * Permission to copy, use, modify, sell and distribute this software is
+# * granted provided this copyright notice appears in all copies. This
+# * software is provided "as is" without express or implied warranty, and
+# * with no claim as to its suitability for any purpose.
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_CONTROL_WHILE_HPP
+# define BOOST_PREPROCESSOR_CONTROL_WHILE_HPP
+#
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/debug/error.hpp>
+# include <boost/preprocessor/detail/auto_rec.hpp>
+# include <boost/preprocessor/list/fold_left.hpp>
+# include <boost/preprocessor/list/fold_right.hpp>
+# include <boost/preprocessor/logical/bitand.hpp>
+#
+# /* BOOST_PP_WHILE */
+#
+# if 0
+# define BOOST_PP_WHILE(pred, op, state)
+# endif
+#
+# define BOOST_PP_WHILE BOOST_PP_CAT(BOOST_PP_WHILE_, BOOST_PP_AUTO_REC(BOOST_PP_WHILE_P, 256))
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_WHILE_P(n) BOOST_PP_BITAND(BOOST_PP_CAT(BOOST_PP_WHILE_CHECK_, BOOST_PP_WHILE_ ## n(BOOST_PP_WHILE_F, BOOST_PP_NIL, BOOST_PP_NIL)), BOOST_PP_BITAND(BOOST_PP_CAT(BOOST_PP_LIST_FOLD_LEFT_CHECK_, BOOST_PP_LIST_FOLD_LEFT_ ## n(BOOST_PP_NIL, BOOST_PP_NIL, BOOST_PP_NIL)), BOOST_PP_CAT(BOOST_PP_LIST_FOLD_RIGHT_CHECK_, BOOST_PP_LIST_FOLD_RIGHT_ ## n(BOOST_PP_NIL, BOOST_PP_NIL, BOOST_PP_NIL))))
+# else
+# define BOOST_PP_WHILE_P(n) BOOST_PP_BITAND(BOOST_PP_CAT(BOOST_PP_WHILE_CHECK_, BOOST_PP_WHILE_ ## n(BOOST_PP_WHILE_F, BOOST_PP_NIL, BOOST_PP_NIL)), BOOST_PP_CAT(BOOST_PP_LIST_FOLD_LEFT_CHECK_, BOOST_PP_LIST_FOLD_LEFT_ ## n(BOOST_PP_NIL, BOOST_PP_NIL, BOOST_PP_NIL)))
+# endif
+#
+# define BOOST_PP_WHILE_F(d, _) 0
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# include <boost/preprocessor/control/detail/edg/while.hpp>
+# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
+# include <boost/preprocessor/control/detail/msvc/while.hpp>
+# else
+# include <boost/preprocessor/control/detail/while.hpp>
+# endif
+#
+# define BOOST_PP_WHILE_257(p, o, s) BOOST_PP_ERROR(0x0001)
+#
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_NIL 1
+#
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_1(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_2(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_3(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_4(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_5(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_6(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_7(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_8(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_9(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_10(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_11(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_12(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_13(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_14(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_15(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_16(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_17(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_18(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_19(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_20(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_21(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_22(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_23(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_24(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_25(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_26(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_27(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_28(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_29(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_30(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_31(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_32(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_33(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_34(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_35(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_36(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_37(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_38(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_39(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_40(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_41(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_42(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_43(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_44(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_45(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_46(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_47(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_48(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_49(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_50(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_51(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_52(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_53(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_54(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_55(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_56(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_57(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_58(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_59(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_60(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_61(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_62(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_63(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_64(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_65(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_66(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_67(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_68(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_69(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_70(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_71(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_72(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_73(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_74(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_75(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_76(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_77(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_78(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_79(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_80(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_81(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_82(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_83(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_84(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_85(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_86(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_87(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_88(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_89(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_90(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_91(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_92(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_93(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_94(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_95(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_96(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_97(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_98(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_99(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_100(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_101(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_102(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_103(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_104(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_105(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_106(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_107(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_108(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_109(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_110(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_111(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_112(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_113(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_114(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_115(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_116(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_117(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_118(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_119(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_120(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_121(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_122(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_123(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_124(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_125(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_126(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_127(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_128(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_129(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_130(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_131(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_132(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_133(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_134(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_135(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_136(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_137(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_138(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_139(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_140(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_141(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_142(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_143(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_144(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_145(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_146(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_147(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_148(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_149(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_150(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_151(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_152(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_153(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_154(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_155(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_156(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_157(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_158(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_159(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_160(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_161(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_162(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_163(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_164(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_165(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_166(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_167(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_168(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_169(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_170(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_171(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_172(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_173(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_174(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_175(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_176(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_177(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_178(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_179(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_180(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_181(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_182(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_183(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_184(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_185(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_186(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_187(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_188(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_189(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_190(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_191(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_192(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_193(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_194(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_195(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_196(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_197(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_198(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_199(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_200(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_201(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_202(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_203(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_204(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_205(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_206(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_207(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_208(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_209(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_210(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_211(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_212(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_213(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_214(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_215(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_216(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_217(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_218(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_219(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_220(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_221(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_222(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_223(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_224(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_225(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_226(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_227(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_228(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_229(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_230(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_231(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_232(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_233(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_234(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_235(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_236(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_237(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_238(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_239(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_240(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_241(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_242(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_243(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_244(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_245(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_246(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_247(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_248(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_249(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_250(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_251(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_252(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_253(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_254(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_255(p, o, s) 0
+# define BOOST_PP_WHILE_CHECK_BOOST_PP_WHILE_256(p, o, s) 0
+#
+# endif
--- /dev/null
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * Permission to copy, use, modify, sell and distribute this software is
+# * granted provided this copyright notice appears in all copies. This
+# * software is provided "as is" without express or implied warranty, and
+# * with no claim as to its suitability for any purpose.
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_LIST_DETAIL_FOLD_LEFT_HPP
+# define BOOST_PREPROCESSOR_LIST_DETAIL_FOLD_LEFT_HPP
+#
+# include <boost/preprocessor/control/expr_iif.hpp>
+# include <boost/preprocessor/control/iif.hpp>
+# include <boost/preprocessor/list/adt.hpp>
+# include <boost/preprocessor/tuple/eat.hpp>
+#
+# define BOOST_PP_LIST_FOLD_LEFT_1(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_2, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(2, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_2(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_3, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(3, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_3(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_4, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(4, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_4(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_5, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(5, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_5(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_6, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(6, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_6(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_7, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(7, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_7(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_8, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(8, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_8(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_9, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(9, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_9(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_10, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(10, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_10(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_11, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(11, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_11(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_12, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(12, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_12(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_13, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(13, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_13(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_14, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(14, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_14(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_15, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(15, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_15(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_16, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(16, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_16(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_17, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(17, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_17(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_18, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(18, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_18(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_19, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(19, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_19(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_20, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(20, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_20(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_21, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(21, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_21(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_22, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(22, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_22(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_23, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(23, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_23(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_24, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(24, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_24(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_25, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(25, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_25(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_26, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(26, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_26(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_27, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(27, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_27(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_28, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(28, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_28(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_29, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(29, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_29(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_30, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(30, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_30(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_31, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(31, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_31(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_32, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(32, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_32(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_33, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(33, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_33(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_34, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(34, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_34(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_35, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(35, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_35(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_36, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(36, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_36(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_37, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(37, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_37(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_38, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(38, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_38(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_39, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(39, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_39(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_40, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(40, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_40(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_41, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(41, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_41(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_42, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(42, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_42(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_43, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(43, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_43(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_44, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(44, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_44(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_45, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(45, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_45(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_46, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(46, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_46(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_47, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(47, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_47(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_48, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(48, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_48(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_49, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(49, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_49(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_50, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(50, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_50(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_51, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(51, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_51(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_52, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(52, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_52(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_53, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(53, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_53(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_54, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(54, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_54(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_55, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(55, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_55(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_56, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(56, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_56(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_57, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(57, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_57(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_58, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(58, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_58(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_59, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(59, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_59(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_60, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(60, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_60(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_61, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(61, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_61(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_62, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(62, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_62(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_63, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(63, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_63(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_64, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(64, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_64(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_65, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(65, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_65(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_66, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(66, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_66(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_67, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(67, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_67(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_68, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(68, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_68(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_69, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(69, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_69(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_70, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(70, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_70(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_71, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(71, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_71(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_72, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(72, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_72(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_73, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(73, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_73(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_74, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(74, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_74(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_75, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(75, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_75(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_76, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(76, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_76(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_77, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(77, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_77(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_78, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(78, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_78(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_79, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(79, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_79(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_80, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(80, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_80(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_81, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(81, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_81(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_82, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(82, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_82(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_83, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(83, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_83(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_84, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(84, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_84(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_85, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(85, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_85(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_86, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(86, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_86(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_87, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(87, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_87(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_88, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(88, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_88(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_89, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(89, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_89(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_90, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(90, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_90(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_91, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(91, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_91(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_92, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(92, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_92(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_93, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(93, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_93(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_94, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(94, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_94(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_95, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(95, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_95(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_96, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(96, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_96(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_97, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(97, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_97(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_98, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(98, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_98(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_99, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(99, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_99(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_100, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(100, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_100(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_101, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(101, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_101(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_102, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(102, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_102(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_103, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(103, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_103(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_104, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(104, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_104(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_105, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(105, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_105(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_106, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(106, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_106(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_107, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(107, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_107(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_108, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(108, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_108(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_109, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(109, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_109(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_110, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(110, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_110(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_111, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(111, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_111(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_112, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(112, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_112(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_113, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(113, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_113(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_114, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(114, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_114(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_115, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(115, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_115(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_116, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(116, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_116(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_117, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(117, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_117(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_118, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(118, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_118(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_119, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(119, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_119(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_120, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(120, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_120(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_121, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(121, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_121(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_122, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(122, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_122(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_123, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(123, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_123(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_124, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(124, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_124(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_125, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(125, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_125(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_126, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(126, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_126(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_127, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(127, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_127(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_128, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(128, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_128(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_129, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(129, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_129(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_130, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(130, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_130(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_131, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(131, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_131(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_132, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(132, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_132(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_133, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(133, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_133(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_134, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(134, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_134(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_135, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(135, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_135(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_136, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(136, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_136(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_137, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(137, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_137(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_138, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(138, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_138(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_139, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(139, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_139(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_140, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(140, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_140(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_141, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(141, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_141(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_142, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(142, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_142(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_143, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(143, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_143(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_144, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(144, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_144(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_145, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(145, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_145(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_146, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(146, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_146(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_147, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(147, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_147(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_148, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(148, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_148(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_149, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(149, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_149(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_150, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(150, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_150(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_151, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(151, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_151(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_152, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(152, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_152(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_153, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(153, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_153(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_154, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(154, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_154(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_155, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(155, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_155(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_156, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(156, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_156(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_157, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(157, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_157(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_158, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(158, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_158(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_159, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(159, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_159(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_160, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(160, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_160(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_161, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(161, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_161(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_162, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(162, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_162(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_163, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(163, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_163(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_164, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(164, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_164(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_165, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(165, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_165(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_166, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(166, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_166(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_167, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(167, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_167(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_168, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(168, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_168(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_169, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(169, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_169(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_170, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(170, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_170(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_171, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(171, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_171(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_172, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(172, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_172(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_173, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(173, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_173(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_174, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(174, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_174(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_175, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(175, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_175(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_176, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(176, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_176(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_177, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(177, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_177(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_178, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(178, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_178(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_179, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(179, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_179(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_180, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(180, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_180(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_181, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(181, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_181(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_182, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(182, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_182(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_183, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(183, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_183(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_184, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(184, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_184(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_185, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(185, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_185(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_186, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(186, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_186(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_187, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(187, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_187(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_188, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(188, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_188(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_189, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(189, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_189(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_190, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(190, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_190(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_191, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(191, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_191(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_192, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(192, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_192(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_193, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(193, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_193(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_194, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(194, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_194(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_195, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(195, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_195(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_196, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(196, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_196(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_197, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(197, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_197(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_198, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(198, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_198(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_199, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(199, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_199(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_200, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(200, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_200(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_201, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(201, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_201(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_202, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(202, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_202(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_203, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(203, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_203(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_204, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(204, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_204(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_205, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(205, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_205(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_206, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(206, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_206(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_207, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(207, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_207(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_208, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(208, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_208(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_209, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(209, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_209(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_210, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(210, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_210(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_211, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(211, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_211(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_212, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(212, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_212(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_213, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(213, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_213(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_214, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(214, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_214(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_215, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(215, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_215(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_216, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(216, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_216(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_217, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(217, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_217(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_218, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(218, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_218(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_219, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(219, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_219(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_220, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(220, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_220(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_221, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(221, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_221(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_222, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(222, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_222(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_223, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(223, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_223(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_224, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(224, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_224(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_225, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(225, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_225(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_226, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(226, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_226(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_227, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(227, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_227(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_228, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(228, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_228(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_229, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(229, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_229(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_230, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(230, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_230(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_231, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(231, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_231(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_232, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(232, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_232(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_233, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(233, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_233(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_234, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(234, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_234(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_235, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(235, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_235(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_236, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(236, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_236(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_237, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(237, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_237(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_238, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(238, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_238(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_239, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(239, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_239(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_240, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(240, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_240(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_241, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(241, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_241(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_242, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(242, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_242(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_243, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(243, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_243(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_244, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(244, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_244(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_245, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(245, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_245(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_246, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(246, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_246(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_247, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(247, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_247(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_248, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(248, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_248(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_249, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(249, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_249(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_250, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(250, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_250(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_251, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(251, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_251(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_252, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(252, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_252(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_253, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(253, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_253(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_254, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(254, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_254(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_255, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(255, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_255(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_256, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(256, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+# define BOOST_PP_LIST_FOLD_LEFT_256(o, s, l) BOOST_PP_IIF(BOOST_PP_LIST_IS_CONS(l), BOOST_PP_LIST_FOLD_LEFT_257, s BOOST_PP_TUPLE_EAT_3)(o, BOOST_PP_EXPR_IIF(BOOST_PP_LIST_IS_CONS(l), o)(257, s, BOOST_PP_LIST_FIRST(l)), BOOST_PP_LIST_REST(l))
+#
+# endif
--- /dev/null
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * Permission to copy, use, modify, sell and distribute this software is
+# * granted provided this copyright notice appears in all copies. This
+# * software is provided "as is" without express or implied warranty, and
+# * with no claim as to its suitability for any purpose.
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_LIST_DETAIL_FOLD_RIGHT_HPP
+# define BOOST_PREPROCESSOR_LIST_DETAIL_FOLD_RIGHT_HPP
+#
+# include <boost/preprocessor/list/fold_left.hpp>
+# include <boost/preprocessor/list/reverse.hpp>
+#
+# define BOOST_PP_LIST_FOLD_RIGHT_1(o, s, l) BOOST_PP_LIST_FOLD_LEFT_1(o, s, BOOST_PP_LIST_REVERSE_D(1, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_2(o, s, l) BOOST_PP_LIST_FOLD_LEFT_2(o, s, BOOST_PP_LIST_REVERSE_D(2, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_3(o, s, l) BOOST_PP_LIST_FOLD_LEFT_3(o, s, BOOST_PP_LIST_REVERSE_D(3, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_4(o, s, l) BOOST_PP_LIST_FOLD_LEFT_4(o, s, BOOST_PP_LIST_REVERSE_D(4, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_5(o, s, l) BOOST_PP_LIST_FOLD_LEFT_5(o, s, BOOST_PP_LIST_REVERSE_D(5, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_6(o, s, l) BOOST_PP_LIST_FOLD_LEFT_6(o, s, BOOST_PP_LIST_REVERSE_D(6, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_7(o, s, l) BOOST_PP_LIST_FOLD_LEFT_7(o, s, BOOST_PP_LIST_REVERSE_D(7, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_8(o, s, l) BOOST_PP_LIST_FOLD_LEFT_8(o, s, BOOST_PP_LIST_REVERSE_D(8, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_9(o, s, l) BOOST_PP_LIST_FOLD_LEFT_9(o, s, BOOST_PP_LIST_REVERSE_D(9, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_10(o, s, l) BOOST_PP_LIST_FOLD_LEFT_10(o, s, BOOST_PP_LIST_REVERSE_D(10, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_11(o, s, l) BOOST_PP_LIST_FOLD_LEFT_11(o, s, BOOST_PP_LIST_REVERSE_D(11, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_12(o, s, l) BOOST_PP_LIST_FOLD_LEFT_12(o, s, BOOST_PP_LIST_REVERSE_D(12, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_13(o, s, l) BOOST_PP_LIST_FOLD_LEFT_13(o, s, BOOST_PP_LIST_REVERSE_D(13, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_14(o, s, l) BOOST_PP_LIST_FOLD_LEFT_14(o, s, BOOST_PP_LIST_REVERSE_D(14, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_15(o, s, l) BOOST_PP_LIST_FOLD_LEFT_15(o, s, BOOST_PP_LIST_REVERSE_D(15, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_16(o, s, l) BOOST_PP_LIST_FOLD_LEFT_16(o, s, BOOST_PP_LIST_REVERSE_D(16, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_17(o, s, l) BOOST_PP_LIST_FOLD_LEFT_17(o, s, BOOST_PP_LIST_REVERSE_D(17, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_18(o, s, l) BOOST_PP_LIST_FOLD_LEFT_18(o, s, BOOST_PP_LIST_REVERSE_D(18, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_19(o, s, l) BOOST_PP_LIST_FOLD_LEFT_19(o, s, BOOST_PP_LIST_REVERSE_D(19, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_20(o, s, l) BOOST_PP_LIST_FOLD_LEFT_20(o, s, BOOST_PP_LIST_REVERSE_D(20, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_21(o, s, l) BOOST_PP_LIST_FOLD_LEFT_21(o, s, BOOST_PP_LIST_REVERSE_D(21, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_22(o, s, l) BOOST_PP_LIST_FOLD_LEFT_22(o, s, BOOST_PP_LIST_REVERSE_D(22, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_23(o, s, l) BOOST_PP_LIST_FOLD_LEFT_23(o, s, BOOST_PP_LIST_REVERSE_D(23, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_24(o, s, l) BOOST_PP_LIST_FOLD_LEFT_24(o, s, BOOST_PP_LIST_REVERSE_D(24, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_25(o, s, l) BOOST_PP_LIST_FOLD_LEFT_25(o, s, BOOST_PP_LIST_REVERSE_D(25, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_26(o, s, l) BOOST_PP_LIST_FOLD_LEFT_26(o, s, BOOST_PP_LIST_REVERSE_D(26, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_27(o, s, l) BOOST_PP_LIST_FOLD_LEFT_27(o, s, BOOST_PP_LIST_REVERSE_D(27, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_28(o, s, l) BOOST_PP_LIST_FOLD_LEFT_28(o, s, BOOST_PP_LIST_REVERSE_D(28, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_29(o, s, l) BOOST_PP_LIST_FOLD_LEFT_29(o, s, BOOST_PP_LIST_REVERSE_D(29, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_30(o, s, l) BOOST_PP_LIST_FOLD_LEFT_30(o, s, BOOST_PP_LIST_REVERSE_D(30, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_31(o, s, l) BOOST_PP_LIST_FOLD_LEFT_31(o, s, BOOST_PP_LIST_REVERSE_D(31, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_32(o, s, l) BOOST_PP_LIST_FOLD_LEFT_32(o, s, BOOST_PP_LIST_REVERSE_D(32, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_33(o, s, l) BOOST_PP_LIST_FOLD_LEFT_33(o, s, BOOST_PP_LIST_REVERSE_D(33, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_34(o, s, l) BOOST_PP_LIST_FOLD_LEFT_34(o, s, BOOST_PP_LIST_REVERSE_D(34, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_35(o, s, l) BOOST_PP_LIST_FOLD_LEFT_35(o, s, BOOST_PP_LIST_REVERSE_D(35, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_36(o, s, l) BOOST_PP_LIST_FOLD_LEFT_36(o, s, BOOST_PP_LIST_REVERSE_D(36, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_37(o, s, l) BOOST_PP_LIST_FOLD_LEFT_37(o, s, BOOST_PP_LIST_REVERSE_D(37, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_38(o, s, l) BOOST_PP_LIST_FOLD_LEFT_38(o, s, BOOST_PP_LIST_REVERSE_D(38, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_39(o, s, l) BOOST_PP_LIST_FOLD_LEFT_39(o, s, BOOST_PP_LIST_REVERSE_D(39, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_40(o, s, l) BOOST_PP_LIST_FOLD_LEFT_40(o, s, BOOST_PP_LIST_REVERSE_D(40, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_41(o, s, l) BOOST_PP_LIST_FOLD_LEFT_41(o, s, BOOST_PP_LIST_REVERSE_D(41, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_42(o, s, l) BOOST_PP_LIST_FOLD_LEFT_42(o, s, BOOST_PP_LIST_REVERSE_D(42, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_43(o, s, l) BOOST_PP_LIST_FOLD_LEFT_43(o, s, BOOST_PP_LIST_REVERSE_D(43, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_44(o, s, l) BOOST_PP_LIST_FOLD_LEFT_44(o, s, BOOST_PP_LIST_REVERSE_D(44, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_45(o, s, l) BOOST_PP_LIST_FOLD_LEFT_45(o, s, BOOST_PP_LIST_REVERSE_D(45, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_46(o, s, l) BOOST_PP_LIST_FOLD_LEFT_46(o, s, BOOST_PP_LIST_REVERSE_D(46, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_47(o, s, l) BOOST_PP_LIST_FOLD_LEFT_47(o, s, BOOST_PP_LIST_REVERSE_D(47, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_48(o, s, l) BOOST_PP_LIST_FOLD_LEFT_48(o, s, BOOST_PP_LIST_REVERSE_D(48, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_49(o, s, l) BOOST_PP_LIST_FOLD_LEFT_49(o, s, BOOST_PP_LIST_REVERSE_D(49, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_50(o, s, l) BOOST_PP_LIST_FOLD_LEFT_50(o, s, BOOST_PP_LIST_REVERSE_D(50, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_51(o, s, l) BOOST_PP_LIST_FOLD_LEFT_51(o, s, BOOST_PP_LIST_REVERSE_D(51, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_52(o, s, l) BOOST_PP_LIST_FOLD_LEFT_52(o, s, BOOST_PP_LIST_REVERSE_D(52, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_53(o, s, l) BOOST_PP_LIST_FOLD_LEFT_53(o, s, BOOST_PP_LIST_REVERSE_D(53, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_54(o, s, l) BOOST_PP_LIST_FOLD_LEFT_54(o, s, BOOST_PP_LIST_REVERSE_D(54, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_55(o, s, l) BOOST_PP_LIST_FOLD_LEFT_55(o, s, BOOST_PP_LIST_REVERSE_D(55, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_56(o, s, l) BOOST_PP_LIST_FOLD_LEFT_56(o, s, BOOST_PP_LIST_REVERSE_D(56, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_57(o, s, l) BOOST_PP_LIST_FOLD_LEFT_57(o, s, BOOST_PP_LIST_REVERSE_D(57, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_58(o, s, l) BOOST_PP_LIST_FOLD_LEFT_58(o, s, BOOST_PP_LIST_REVERSE_D(58, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_59(o, s, l) BOOST_PP_LIST_FOLD_LEFT_59(o, s, BOOST_PP_LIST_REVERSE_D(59, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_60(o, s, l) BOOST_PP_LIST_FOLD_LEFT_60(o, s, BOOST_PP_LIST_REVERSE_D(60, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_61(o, s, l) BOOST_PP_LIST_FOLD_LEFT_61(o, s, BOOST_PP_LIST_REVERSE_D(61, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_62(o, s, l) BOOST_PP_LIST_FOLD_LEFT_62(o, s, BOOST_PP_LIST_REVERSE_D(62, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_63(o, s, l) BOOST_PP_LIST_FOLD_LEFT_63(o, s, BOOST_PP_LIST_REVERSE_D(63, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_64(o, s, l) BOOST_PP_LIST_FOLD_LEFT_64(o, s, BOOST_PP_LIST_REVERSE_D(64, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_65(o, s, l) BOOST_PP_LIST_FOLD_LEFT_65(o, s, BOOST_PP_LIST_REVERSE_D(65, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_66(o, s, l) BOOST_PP_LIST_FOLD_LEFT_66(o, s, BOOST_PP_LIST_REVERSE_D(66, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_67(o, s, l) BOOST_PP_LIST_FOLD_LEFT_67(o, s, BOOST_PP_LIST_REVERSE_D(67, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_68(o, s, l) BOOST_PP_LIST_FOLD_LEFT_68(o, s, BOOST_PP_LIST_REVERSE_D(68, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_69(o, s, l) BOOST_PP_LIST_FOLD_LEFT_69(o, s, BOOST_PP_LIST_REVERSE_D(69, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_70(o, s, l) BOOST_PP_LIST_FOLD_LEFT_70(o, s, BOOST_PP_LIST_REVERSE_D(70, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_71(o, s, l) BOOST_PP_LIST_FOLD_LEFT_71(o, s, BOOST_PP_LIST_REVERSE_D(71, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_72(o, s, l) BOOST_PP_LIST_FOLD_LEFT_72(o, s, BOOST_PP_LIST_REVERSE_D(72, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_73(o, s, l) BOOST_PP_LIST_FOLD_LEFT_73(o, s, BOOST_PP_LIST_REVERSE_D(73, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_74(o, s, l) BOOST_PP_LIST_FOLD_LEFT_74(o, s, BOOST_PP_LIST_REVERSE_D(74, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_75(o, s, l) BOOST_PP_LIST_FOLD_LEFT_75(o, s, BOOST_PP_LIST_REVERSE_D(75, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_76(o, s, l) BOOST_PP_LIST_FOLD_LEFT_76(o, s, BOOST_PP_LIST_REVERSE_D(76, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_77(o, s, l) BOOST_PP_LIST_FOLD_LEFT_77(o, s, BOOST_PP_LIST_REVERSE_D(77, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_78(o, s, l) BOOST_PP_LIST_FOLD_LEFT_78(o, s, BOOST_PP_LIST_REVERSE_D(78, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_79(o, s, l) BOOST_PP_LIST_FOLD_LEFT_79(o, s, BOOST_PP_LIST_REVERSE_D(79, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_80(o, s, l) BOOST_PP_LIST_FOLD_LEFT_80(o, s, BOOST_PP_LIST_REVERSE_D(80, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_81(o, s, l) BOOST_PP_LIST_FOLD_LEFT_81(o, s, BOOST_PP_LIST_REVERSE_D(81, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_82(o, s, l) BOOST_PP_LIST_FOLD_LEFT_82(o, s, BOOST_PP_LIST_REVERSE_D(82, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_83(o, s, l) BOOST_PP_LIST_FOLD_LEFT_83(o, s, BOOST_PP_LIST_REVERSE_D(83, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_84(o, s, l) BOOST_PP_LIST_FOLD_LEFT_84(o, s, BOOST_PP_LIST_REVERSE_D(84, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_85(o, s, l) BOOST_PP_LIST_FOLD_LEFT_85(o, s, BOOST_PP_LIST_REVERSE_D(85, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_86(o, s, l) BOOST_PP_LIST_FOLD_LEFT_86(o, s, BOOST_PP_LIST_REVERSE_D(86, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_87(o, s, l) BOOST_PP_LIST_FOLD_LEFT_87(o, s, BOOST_PP_LIST_REVERSE_D(87, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_88(o, s, l) BOOST_PP_LIST_FOLD_LEFT_88(o, s, BOOST_PP_LIST_REVERSE_D(88, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_89(o, s, l) BOOST_PP_LIST_FOLD_LEFT_89(o, s, BOOST_PP_LIST_REVERSE_D(89, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_90(o, s, l) BOOST_PP_LIST_FOLD_LEFT_90(o, s, BOOST_PP_LIST_REVERSE_D(90, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_91(o, s, l) BOOST_PP_LIST_FOLD_LEFT_91(o, s, BOOST_PP_LIST_REVERSE_D(91, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_92(o, s, l) BOOST_PP_LIST_FOLD_LEFT_92(o, s, BOOST_PP_LIST_REVERSE_D(92, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_93(o, s, l) BOOST_PP_LIST_FOLD_LEFT_93(o, s, BOOST_PP_LIST_REVERSE_D(93, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_94(o, s, l) BOOST_PP_LIST_FOLD_LEFT_94(o, s, BOOST_PP_LIST_REVERSE_D(94, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_95(o, s, l) BOOST_PP_LIST_FOLD_LEFT_95(o, s, BOOST_PP_LIST_REVERSE_D(95, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_96(o, s, l) BOOST_PP_LIST_FOLD_LEFT_96(o, s, BOOST_PP_LIST_REVERSE_D(96, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_97(o, s, l) BOOST_PP_LIST_FOLD_LEFT_97(o, s, BOOST_PP_LIST_REVERSE_D(97, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_98(o, s, l) BOOST_PP_LIST_FOLD_LEFT_98(o, s, BOOST_PP_LIST_REVERSE_D(98, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_99(o, s, l) BOOST_PP_LIST_FOLD_LEFT_99(o, s, BOOST_PP_LIST_REVERSE_D(99, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_100(o, s, l) BOOST_PP_LIST_FOLD_LEFT_100(o, s, BOOST_PP_LIST_REVERSE_D(100, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_101(o, s, l) BOOST_PP_LIST_FOLD_LEFT_101(o, s, BOOST_PP_LIST_REVERSE_D(101, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_102(o, s, l) BOOST_PP_LIST_FOLD_LEFT_102(o, s, BOOST_PP_LIST_REVERSE_D(102, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_103(o, s, l) BOOST_PP_LIST_FOLD_LEFT_103(o, s, BOOST_PP_LIST_REVERSE_D(103, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_104(o, s, l) BOOST_PP_LIST_FOLD_LEFT_104(o, s, BOOST_PP_LIST_REVERSE_D(104, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_105(o, s, l) BOOST_PP_LIST_FOLD_LEFT_105(o, s, BOOST_PP_LIST_REVERSE_D(105, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_106(o, s, l) BOOST_PP_LIST_FOLD_LEFT_106(o, s, BOOST_PP_LIST_REVERSE_D(106, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_107(o, s, l) BOOST_PP_LIST_FOLD_LEFT_107(o, s, BOOST_PP_LIST_REVERSE_D(107, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_108(o, s, l) BOOST_PP_LIST_FOLD_LEFT_108(o, s, BOOST_PP_LIST_REVERSE_D(108, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_109(o, s, l) BOOST_PP_LIST_FOLD_LEFT_109(o, s, BOOST_PP_LIST_REVERSE_D(109, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_110(o, s, l) BOOST_PP_LIST_FOLD_LEFT_110(o, s, BOOST_PP_LIST_REVERSE_D(110, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_111(o, s, l) BOOST_PP_LIST_FOLD_LEFT_111(o, s, BOOST_PP_LIST_REVERSE_D(111, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_112(o, s, l) BOOST_PP_LIST_FOLD_LEFT_112(o, s, BOOST_PP_LIST_REVERSE_D(112, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_113(o, s, l) BOOST_PP_LIST_FOLD_LEFT_113(o, s, BOOST_PP_LIST_REVERSE_D(113, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_114(o, s, l) BOOST_PP_LIST_FOLD_LEFT_114(o, s, BOOST_PP_LIST_REVERSE_D(114, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_115(o, s, l) BOOST_PP_LIST_FOLD_LEFT_115(o, s, BOOST_PP_LIST_REVERSE_D(115, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_116(o, s, l) BOOST_PP_LIST_FOLD_LEFT_116(o, s, BOOST_PP_LIST_REVERSE_D(116, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_117(o, s, l) BOOST_PP_LIST_FOLD_LEFT_117(o, s, BOOST_PP_LIST_REVERSE_D(117, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_118(o, s, l) BOOST_PP_LIST_FOLD_LEFT_118(o, s, BOOST_PP_LIST_REVERSE_D(118, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_119(o, s, l) BOOST_PP_LIST_FOLD_LEFT_119(o, s, BOOST_PP_LIST_REVERSE_D(119, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_120(o, s, l) BOOST_PP_LIST_FOLD_LEFT_120(o, s, BOOST_PP_LIST_REVERSE_D(120, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_121(o, s, l) BOOST_PP_LIST_FOLD_LEFT_121(o, s, BOOST_PP_LIST_REVERSE_D(121, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_122(o, s, l) BOOST_PP_LIST_FOLD_LEFT_122(o, s, BOOST_PP_LIST_REVERSE_D(122, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_123(o, s, l) BOOST_PP_LIST_FOLD_LEFT_123(o, s, BOOST_PP_LIST_REVERSE_D(123, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_124(o, s, l) BOOST_PP_LIST_FOLD_LEFT_124(o, s, BOOST_PP_LIST_REVERSE_D(124, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_125(o, s, l) BOOST_PP_LIST_FOLD_LEFT_125(o, s, BOOST_PP_LIST_REVERSE_D(125, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_126(o, s, l) BOOST_PP_LIST_FOLD_LEFT_126(o, s, BOOST_PP_LIST_REVERSE_D(126, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_127(o, s, l) BOOST_PP_LIST_FOLD_LEFT_127(o, s, BOOST_PP_LIST_REVERSE_D(127, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_128(o, s, l) BOOST_PP_LIST_FOLD_LEFT_128(o, s, BOOST_PP_LIST_REVERSE_D(128, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_129(o, s, l) BOOST_PP_LIST_FOLD_LEFT_129(o, s, BOOST_PP_LIST_REVERSE_D(129, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_130(o, s, l) BOOST_PP_LIST_FOLD_LEFT_130(o, s, BOOST_PP_LIST_REVERSE_D(130, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_131(o, s, l) BOOST_PP_LIST_FOLD_LEFT_131(o, s, BOOST_PP_LIST_REVERSE_D(131, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_132(o, s, l) BOOST_PP_LIST_FOLD_LEFT_132(o, s, BOOST_PP_LIST_REVERSE_D(132, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_133(o, s, l) BOOST_PP_LIST_FOLD_LEFT_133(o, s, BOOST_PP_LIST_REVERSE_D(133, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_134(o, s, l) BOOST_PP_LIST_FOLD_LEFT_134(o, s, BOOST_PP_LIST_REVERSE_D(134, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_135(o, s, l) BOOST_PP_LIST_FOLD_LEFT_135(o, s, BOOST_PP_LIST_REVERSE_D(135, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_136(o, s, l) BOOST_PP_LIST_FOLD_LEFT_136(o, s, BOOST_PP_LIST_REVERSE_D(136, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_137(o, s, l) BOOST_PP_LIST_FOLD_LEFT_137(o, s, BOOST_PP_LIST_REVERSE_D(137, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_138(o, s, l) BOOST_PP_LIST_FOLD_LEFT_138(o, s, BOOST_PP_LIST_REVERSE_D(138, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_139(o, s, l) BOOST_PP_LIST_FOLD_LEFT_139(o, s, BOOST_PP_LIST_REVERSE_D(139, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_140(o, s, l) BOOST_PP_LIST_FOLD_LEFT_140(o, s, BOOST_PP_LIST_REVERSE_D(140, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_141(o, s, l) BOOST_PP_LIST_FOLD_LEFT_141(o, s, BOOST_PP_LIST_REVERSE_D(141, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_142(o, s, l) BOOST_PP_LIST_FOLD_LEFT_142(o, s, BOOST_PP_LIST_REVERSE_D(142, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_143(o, s, l) BOOST_PP_LIST_FOLD_LEFT_143(o, s, BOOST_PP_LIST_REVERSE_D(143, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_144(o, s, l) BOOST_PP_LIST_FOLD_LEFT_144(o, s, BOOST_PP_LIST_REVERSE_D(144, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_145(o, s, l) BOOST_PP_LIST_FOLD_LEFT_145(o, s, BOOST_PP_LIST_REVERSE_D(145, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_146(o, s, l) BOOST_PP_LIST_FOLD_LEFT_146(o, s, BOOST_PP_LIST_REVERSE_D(146, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_147(o, s, l) BOOST_PP_LIST_FOLD_LEFT_147(o, s, BOOST_PP_LIST_REVERSE_D(147, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_148(o, s, l) BOOST_PP_LIST_FOLD_LEFT_148(o, s, BOOST_PP_LIST_REVERSE_D(148, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_149(o, s, l) BOOST_PP_LIST_FOLD_LEFT_149(o, s, BOOST_PP_LIST_REVERSE_D(149, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_150(o, s, l) BOOST_PP_LIST_FOLD_LEFT_150(o, s, BOOST_PP_LIST_REVERSE_D(150, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_151(o, s, l) BOOST_PP_LIST_FOLD_LEFT_151(o, s, BOOST_PP_LIST_REVERSE_D(151, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_152(o, s, l) BOOST_PP_LIST_FOLD_LEFT_152(o, s, BOOST_PP_LIST_REVERSE_D(152, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_153(o, s, l) BOOST_PP_LIST_FOLD_LEFT_153(o, s, BOOST_PP_LIST_REVERSE_D(153, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_154(o, s, l) BOOST_PP_LIST_FOLD_LEFT_154(o, s, BOOST_PP_LIST_REVERSE_D(154, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_155(o, s, l) BOOST_PP_LIST_FOLD_LEFT_155(o, s, BOOST_PP_LIST_REVERSE_D(155, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_156(o, s, l) BOOST_PP_LIST_FOLD_LEFT_156(o, s, BOOST_PP_LIST_REVERSE_D(156, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_157(o, s, l) BOOST_PP_LIST_FOLD_LEFT_157(o, s, BOOST_PP_LIST_REVERSE_D(157, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_158(o, s, l) BOOST_PP_LIST_FOLD_LEFT_158(o, s, BOOST_PP_LIST_REVERSE_D(158, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_159(o, s, l) BOOST_PP_LIST_FOLD_LEFT_159(o, s, BOOST_PP_LIST_REVERSE_D(159, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_160(o, s, l) BOOST_PP_LIST_FOLD_LEFT_160(o, s, BOOST_PP_LIST_REVERSE_D(160, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_161(o, s, l) BOOST_PP_LIST_FOLD_LEFT_161(o, s, BOOST_PP_LIST_REVERSE_D(161, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_162(o, s, l) BOOST_PP_LIST_FOLD_LEFT_162(o, s, BOOST_PP_LIST_REVERSE_D(162, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_163(o, s, l) BOOST_PP_LIST_FOLD_LEFT_163(o, s, BOOST_PP_LIST_REVERSE_D(163, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_164(o, s, l) BOOST_PP_LIST_FOLD_LEFT_164(o, s, BOOST_PP_LIST_REVERSE_D(164, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_165(o, s, l) BOOST_PP_LIST_FOLD_LEFT_165(o, s, BOOST_PP_LIST_REVERSE_D(165, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_166(o, s, l) BOOST_PP_LIST_FOLD_LEFT_166(o, s, BOOST_PP_LIST_REVERSE_D(166, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_167(o, s, l) BOOST_PP_LIST_FOLD_LEFT_167(o, s, BOOST_PP_LIST_REVERSE_D(167, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_168(o, s, l) BOOST_PP_LIST_FOLD_LEFT_168(o, s, BOOST_PP_LIST_REVERSE_D(168, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_169(o, s, l) BOOST_PP_LIST_FOLD_LEFT_169(o, s, BOOST_PP_LIST_REVERSE_D(169, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_170(o, s, l) BOOST_PP_LIST_FOLD_LEFT_170(o, s, BOOST_PP_LIST_REVERSE_D(170, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_171(o, s, l) BOOST_PP_LIST_FOLD_LEFT_171(o, s, BOOST_PP_LIST_REVERSE_D(171, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_172(o, s, l) BOOST_PP_LIST_FOLD_LEFT_172(o, s, BOOST_PP_LIST_REVERSE_D(172, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_173(o, s, l) BOOST_PP_LIST_FOLD_LEFT_173(o, s, BOOST_PP_LIST_REVERSE_D(173, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_174(o, s, l) BOOST_PP_LIST_FOLD_LEFT_174(o, s, BOOST_PP_LIST_REVERSE_D(174, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_175(o, s, l) BOOST_PP_LIST_FOLD_LEFT_175(o, s, BOOST_PP_LIST_REVERSE_D(175, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_176(o, s, l) BOOST_PP_LIST_FOLD_LEFT_176(o, s, BOOST_PP_LIST_REVERSE_D(176, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_177(o, s, l) BOOST_PP_LIST_FOLD_LEFT_177(o, s, BOOST_PP_LIST_REVERSE_D(177, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_178(o, s, l) BOOST_PP_LIST_FOLD_LEFT_178(o, s, BOOST_PP_LIST_REVERSE_D(178, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_179(o, s, l) BOOST_PP_LIST_FOLD_LEFT_179(o, s, BOOST_PP_LIST_REVERSE_D(179, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_180(o, s, l) BOOST_PP_LIST_FOLD_LEFT_180(o, s, BOOST_PP_LIST_REVERSE_D(180, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_181(o, s, l) BOOST_PP_LIST_FOLD_LEFT_181(o, s, BOOST_PP_LIST_REVERSE_D(181, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_182(o, s, l) BOOST_PP_LIST_FOLD_LEFT_182(o, s, BOOST_PP_LIST_REVERSE_D(182, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_183(o, s, l) BOOST_PP_LIST_FOLD_LEFT_183(o, s, BOOST_PP_LIST_REVERSE_D(183, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_184(o, s, l) BOOST_PP_LIST_FOLD_LEFT_184(o, s, BOOST_PP_LIST_REVERSE_D(184, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_185(o, s, l) BOOST_PP_LIST_FOLD_LEFT_185(o, s, BOOST_PP_LIST_REVERSE_D(185, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_186(o, s, l) BOOST_PP_LIST_FOLD_LEFT_186(o, s, BOOST_PP_LIST_REVERSE_D(186, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_187(o, s, l) BOOST_PP_LIST_FOLD_LEFT_187(o, s, BOOST_PP_LIST_REVERSE_D(187, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_188(o, s, l) BOOST_PP_LIST_FOLD_LEFT_188(o, s, BOOST_PP_LIST_REVERSE_D(188, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_189(o, s, l) BOOST_PP_LIST_FOLD_LEFT_189(o, s, BOOST_PP_LIST_REVERSE_D(189, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_190(o, s, l) BOOST_PP_LIST_FOLD_LEFT_190(o, s, BOOST_PP_LIST_REVERSE_D(190, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_191(o, s, l) BOOST_PP_LIST_FOLD_LEFT_191(o, s, BOOST_PP_LIST_REVERSE_D(191, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_192(o, s, l) BOOST_PP_LIST_FOLD_LEFT_192(o, s, BOOST_PP_LIST_REVERSE_D(192, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_193(o, s, l) BOOST_PP_LIST_FOLD_LEFT_193(o, s, BOOST_PP_LIST_REVERSE_D(193, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_194(o, s, l) BOOST_PP_LIST_FOLD_LEFT_194(o, s, BOOST_PP_LIST_REVERSE_D(194, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_195(o, s, l) BOOST_PP_LIST_FOLD_LEFT_195(o, s, BOOST_PP_LIST_REVERSE_D(195, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_196(o, s, l) BOOST_PP_LIST_FOLD_LEFT_196(o, s, BOOST_PP_LIST_REVERSE_D(196, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_197(o, s, l) BOOST_PP_LIST_FOLD_LEFT_197(o, s, BOOST_PP_LIST_REVERSE_D(197, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_198(o, s, l) BOOST_PP_LIST_FOLD_LEFT_198(o, s, BOOST_PP_LIST_REVERSE_D(198, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_199(o, s, l) BOOST_PP_LIST_FOLD_LEFT_199(o, s, BOOST_PP_LIST_REVERSE_D(199, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_200(o, s, l) BOOST_PP_LIST_FOLD_LEFT_200(o, s, BOOST_PP_LIST_REVERSE_D(200, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_201(o, s, l) BOOST_PP_LIST_FOLD_LEFT_201(o, s, BOOST_PP_LIST_REVERSE_D(201, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_202(o, s, l) BOOST_PP_LIST_FOLD_LEFT_202(o, s, BOOST_PP_LIST_REVERSE_D(202, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_203(o, s, l) BOOST_PP_LIST_FOLD_LEFT_203(o, s, BOOST_PP_LIST_REVERSE_D(203, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_204(o, s, l) BOOST_PP_LIST_FOLD_LEFT_204(o, s, BOOST_PP_LIST_REVERSE_D(204, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_205(o, s, l) BOOST_PP_LIST_FOLD_LEFT_205(o, s, BOOST_PP_LIST_REVERSE_D(205, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_206(o, s, l) BOOST_PP_LIST_FOLD_LEFT_206(o, s, BOOST_PP_LIST_REVERSE_D(206, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_207(o, s, l) BOOST_PP_LIST_FOLD_LEFT_207(o, s, BOOST_PP_LIST_REVERSE_D(207, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_208(o, s, l) BOOST_PP_LIST_FOLD_LEFT_208(o, s, BOOST_PP_LIST_REVERSE_D(208, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_209(o, s, l) BOOST_PP_LIST_FOLD_LEFT_209(o, s, BOOST_PP_LIST_REVERSE_D(209, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_210(o, s, l) BOOST_PP_LIST_FOLD_LEFT_210(o, s, BOOST_PP_LIST_REVERSE_D(210, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_211(o, s, l) BOOST_PP_LIST_FOLD_LEFT_211(o, s, BOOST_PP_LIST_REVERSE_D(211, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_212(o, s, l) BOOST_PP_LIST_FOLD_LEFT_212(o, s, BOOST_PP_LIST_REVERSE_D(212, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_213(o, s, l) BOOST_PP_LIST_FOLD_LEFT_213(o, s, BOOST_PP_LIST_REVERSE_D(213, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_214(o, s, l) BOOST_PP_LIST_FOLD_LEFT_214(o, s, BOOST_PP_LIST_REVERSE_D(214, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_215(o, s, l) BOOST_PP_LIST_FOLD_LEFT_215(o, s, BOOST_PP_LIST_REVERSE_D(215, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_216(o, s, l) BOOST_PP_LIST_FOLD_LEFT_216(o, s, BOOST_PP_LIST_REVERSE_D(216, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_217(o, s, l) BOOST_PP_LIST_FOLD_LEFT_217(o, s, BOOST_PP_LIST_REVERSE_D(217, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_218(o, s, l) BOOST_PP_LIST_FOLD_LEFT_218(o, s, BOOST_PP_LIST_REVERSE_D(218, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_219(o, s, l) BOOST_PP_LIST_FOLD_LEFT_219(o, s, BOOST_PP_LIST_REVERSE_D(219, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_220(o, s, l) BOOST_PP_LIST_FOLD_LEFT_220(o, s, BOOST_PP_LIST_REVERSE_D(220, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_221(o, s, l) BOOST_PP_LIST_FOLD_LEFT_221(o, s, BOOST_PP_LIST_REVERSE_D(221, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_222(o, s, l) BOOST_PP_LIST_FOLD_LEFT_222(o, s, BOOST_PP_LIST_REVERSE_D(222, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_223(o, s, l) BOOST_PP_LIST_FOLD_LEFT_223(o, s, BOOST_PP_LIST_REVERSE_D(223, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_224(o, s, l) BOOST_PP_LIST_FOLD_LEFT_224(o, s, BOOST_PP_LIST_REVERSE_D(224, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_225(o, s, l) BOOST_PP_LIST_FOLD_LEFT_225(o, s, BOOST_PP_LIST_REVERSE_D(225, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_226(o, s, l) BOOST_PP_LIST_FOLD_LEFT_226(o, s, BOOST_PP_LIST_REVERSE_D(226, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_227(o, s, l) BOOST_PP_LIST_FOLD_LEFT_227(o, s, BOOST_PP_LIST_REVERSE_D(227, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_228(o, s, l) BOOST_PP_LIST_FOLD_LEFT_228(o, s, BOOST_PP_LIST_REVERSE_D(228, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_229(o, s, l) BOOST_PP_LIST_FOLD_LEFT_229(o, s, BOOST_PP_LIST_REVERSE_D(229, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_230(o, s, l) BOOST_PP_LIST_FOLD_LEFT_230(o, s, BOOST_PP_LIST_REVERSE_D(230, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_231(o, s, l) BOOST_PP_LIST_FOLD_LEFT_231(o, s, BOOST_PP_LIST_REVERSE_D(231, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_232(o, s, l) BOOST_PP_LIST_FOLD_LEFT_232(o, s, BOOST_PP_LIST_REVERSE_D(232, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_233(o, s, l) BOOST_PP_LIST_FOLD_LEFT_233(o, s, BOOST_PP_LIST_REVERSE_D(233, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_234(o, s, l) BOOST_PP_LIST_FOLD_LEFT_234(o, s, BOOST_PP_LIST_REVERSE_D(234, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_235(o, s, l) BOOST_PP_LIST_FOLD_LEFT_235(o, s, BOOST_PP_LIST_REVERSE_D(235, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_236(o, s, l) BOOST_PP_LIST_FOLD_LEFT_236(o, s, BOOST_PP_LIST_REVERSE_D(236, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_237(o, s, l) BOOST_PP_LIST_FOLD_LEFT_237(o, s, BOOST_PP_LIST_REVERSE_D(237, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_238(o, s, l) BOOST_PP_LIST_FOLD_LEFT_238(o, s, BOOST_PP_LIST_REVERSE_D(238, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_239(o, s, l) BOOST_PP_LIST_FOLD_LEFT_239(o, s, BOOST_PP_LIST_REVERSE_D(239, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_240(o, s, l) BOOST_PP_LIST_FOLD_LEFT_240(o, s, BOOST_PP_LIST_REVERSE_D(240, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_241(o, s, l) BOOST_PP_LIST_FOLD_LEFT_241(o, s, BOOST_PP_LIST_REVERSE_D(241, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_242(o, s, l) BOOST_PP_LIST_FOLD_LEFT_242(o, s, BOOST_PP_LIST_REVERSE_D(242, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_243(o, s, l) BOOST_PP_LIST_FOLD_LEFT_243(o, s, BOOST_PP_LIST_REVERSE_D(243, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_244(o, s, l) BOOST_PP_LIST_FOLD_LEFT_244(o, s, BOOST_PP_LIST_REVERSE_D(244, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_245(o, s, l) BOOST_PP_LIST_FOLD_LEFT_245(o, s, BOOST_PP_LIST_REVERSE_D(245, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_246(o, s, l) BOOST_PP_LIST_FOLD_LEFT_246(o, s, BOOST_PP_LIST_REVERSE_D(246, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_247(o, s, l) BOOST_PP_LIST_FOLD_LEFT_247(o, s, BOOST_PP_LIST_REVERSE_D(247, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_248(o, s, l) BOOST_PP_LIST_FOLD_LEFT_248(o, s, BOOST_PP_LIST_REVERSE_D(248, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_249(o, s, l) BOOST_PP_LIST_FOLD_LEFT_249(o, s, BOOST_PP_LIST_REVERSE_D(249, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_250(o, s, l) BOOST_PP_LIST_FOLD_LEFT_250(o, s, BOOST_PP_LIST_REVERSE_D(250, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_251(o, s, l) BOOST_PP_LIST_FOLD_LEFT_251(o, s, BOOST_PP_LIST_REVERSE_D(251, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_252(o, s, l) BOOST_PP_LIST_FOLD_LEFT_252(o, s, BOOST_PP_LIST_REVERSE_D(252, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_253(o, s, l) BOOST_PP_LIST_FOLD_LEFT_253(o, s, BOOST_PP_LIST_REVERSE_D(253, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_254(o, s, l) BOOST_PP_LIST_FOLD_LEFT_254(o, s, BOOST_PP_LIST_REVERSE_D(254, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_255(o, s, l) BOOST_PP_LIST_FOLD_LEFT_255(o, s, BOOST_PP_LIST_REVERSE_D(255, l))
+# define BOOST_PP_LIST_FOLD_RIGHT_256(o, s, l) BOOST_PP_LIST_FOLD_LEFT_256(o, s, BOOST_PP_LIST_REVERSE_D(256, l))
+#
+# endif
// boost progress.hpp header file ------------------------------------------//
-// (C) Copyright Beman Dawes 1994-99. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Copyright Beman Dawes 1994-99.
+// See accompanying license for terms and conditions of use.
// See http://www.boost.org/libs/timer for documentation.
};
template <typename K, typename V>
const typename readable_property_map_archetype<K,V>::reference&
- get(const readable_property_map_archetype<K,V>&, const K&) {
+ get(const readable_property_map_archetype<K,V>&,
+ const typename readable_property_map_archetype<K,V>::key_type&)
+ {
typedef typename readable_property_map_archetype<K,V>::reference R;
return static_object<R>::get();
}
typedef writable_property_map_tag category;
};
template <typename K, typename V>
- void put(const writable_property_map_archetype<K,V>&, const K&, const V&) { }
+ void put(const writable_property_map_archetype<K,V>&,
+ const typename writable_property_map_archetype<K,V>::key_type&,
+ const typename writable_property_map_archetype<K,V>::value_type&) { }
template <class PMap, class Key>
#define BOOST_PROPERTY_MAP_ITERATOR_HPP
#include <boost/property_map.hpp>
-#include <boost/iterator_adaptors.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_same.hpp>
namespace boost {
namespace detail {
- template <class LvaluePropertyMap>
- struct lvalue_pmap_iter_policies : public default_iterator_policies
+ template <class Iterator, class LvaluePropertyMap>
+ class lvalue_pmap_iter
+ : public iterator_adaptor< lvalue_pmap_iter< Iterator, LvaluePropertyMap >,
+ Iterator,
+ typename property_traits<LvaluePropertyMap>::value_type,
+ use_default,
+ typename property_traits<LvaluePropertyMap>::reference>
{
- lvalue_pmap_iter_policies() { }
- lvalue_pmap_iter_policies(LvaluePropertyMap m) : m_map(m) {}
+ friend class boost::iterator_core_access;
- template <class Iter>
- typename Iter::reference
- dereference(const Iter& i) const
+ typedef iterator_adaptor< lvalue_pmap_iter< Iterator, LvaluePropertyMap >,
+ Iterator,
+ typename property_traits<LvaluePropertyMap>::value_type,
+ use_default,
+ typename property_traits<LvaluePropertyMap>::reference> super_t;
+
+ public:
+ lvalue_pmap_iter() { }
+ lvalue_pmap_iter(Iterator const& it,
+ LvaluePropertyMap m)
+ : super_t(it),
+ m_map(m) {}
+
+ private:
+ typename lvalue_pmap_iter::reference
+ dereference() const
{
- return m_map[*i.base()];
+ return m_map[*(this->base_reference())];
}
- private:
+
LvaluePropertyMap m_map;
};
- template <class ReadablePropertyMap>
- struct readable_pmap_iter_policies : public default_iterator_policies
+ template <class Iterator, class ReadablePropertyMap>
+ class readable_pmap_iter :
+ public iterator_adaptor< readable_pmap_iter< Iterator, ReadablePropertyMap >,
+ Iterator,
+ typename property_traits<ReadablePropertyMap>::value_type,
+ use_default,
+ typename property_traits<ReadablePropertyMap>::value_type>
+
+
{
- readable_pmap_iter_policies() { }
- readable_pmap_iter_policies(ReadablePropertyMap m) : m_map(m) {}
+ friend class iterator_core_access;
- template <class Iter>
- typename Iter::reference
- dereference(const Iter& i) const
+ typedef iterator_adaptor< readable_pmap_iter< Iterator, ReadablePropertyMap >,
+ Iterator,
+ typename property_traits<ReadablePropertyMap>::value_type,
+ use_default,
+ typename property_traits<ReadablePropertyMap>::value_type> super_t;
+
+ public:
+ readable_pmap_iter() { }
+ readable_pmap_iter(Iterator const& it,
+ ReadablePropertyMap m)
+ : super_t(it),
+ m_map(m) {}
+
+ private:
+ typename readable_pmap_iter::reference
+ dereference() const
{
- return get(m_map, *i.base());
+ return get(m_map, *(this->base_reference()));
}
- private:
+
ReadablePropertyMap m_map;
};
- template <class PMapCategory>
- struct choose_pmap_iter {
- template <class PMap, class Iter>
- struct bind_ {
- typedef typename property_traits<PMap>::value_type value;
- typedef iterator_adaptor<Iter,
- readable_pmap_iter_policies<PMap>, value, value,
- value*, std::input_iterator_tag> type;
- };
- };
- template <>
- struct choose_pmap_iter<lvalue_property_map_tag> {
- template <class PMap, class Iter>
- struct bind_ {
- typedef typename property_traits<PMap>::value_type value;
- typedef typename property_traits<PMap>::reference ref;
- typedef iterator_adaptor<Iter,
- lvalue_pmap_iter_policies<PMap>,
- value, ref> type;
- };
- };
-
} // namespace detail
template <class PropertyMap, class Iterator>
- class property_map_iterator_generator {
- public:
- typedef typename property_traits<PropertyMap>::category Cat;
- typedef typename detail::choose_pmap_iter<Cat>::
- template bind_<PropertyMap, Iterator>::type type;
- };
+ struct property_map_iterator_generator :
+ mpl::if_< is_same< typename property_traits<PropertyMap>::category, lvalue_property_map_tag>,
+ detail::lvalue_pmap_iter<Iterator, PropertyMap>,
+ detail::readable_pmap_iter<Iterator, PropertyMap> >
+ {};
template <class PropertyMap, class Iterator>
typename property_map_iterator_generator<PropertyMap, Iterator>::type
--- /dev/null
+// Copyright David Abrahams 2002. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef INDIRECT_TRAITS_DWA2002131_HPP
+# define INDIRECT_TRAITS_DWA2002131_HPP
+# include <boost/type_traits/is_function.hpp>
+# include <boost/type_traits/is_reference.hpp>
+# include <boost/type_traits/is_pointer.hpp>
+# include <boost/type_traits/is_class.hpp>
+# include <boost/type_traits/is_const.hpp>
+# include <boost/type_traits/is_volatile.hpp>
+# include <boost/type_traits/is_member_function_pointer.hpp>
+# include <boost/type_traits/remove_cv.hpp>
+# include <boost/type_traits/remove_reference.hpp>
+# include <boost/type_traits/remove_pointer.hpp>
+
+# include <boost/type_traits/detail/ice_and.hpp>
+
+# include <boost/detail/workaround.hpp>
+# if 0 && BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
+# include <boost/type_traits/is_enum.hpp>
+# endif
+
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/mpl/and.hpp>
+# include <boost/mpl/not.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# include <boost/python/detail/is_function_ref_tester.hpp>
+# endif
+
+namespace boost { namespace python { namespace detail {
+
+# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <class T>
+struct is_reference_to_const : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_const<T const&> : mpl::true_
+{
+};
+
+# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
+template<class T>
+struct is_reference_to_const<T const volatile&> : mpl::true_
+{
+};
+# endif
+
+template <class T>
+struct is_reference_to_function : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_function<T&> : is_function<T>
+{
+};
+
+template <class T>
+struct is_pointer_to_function : mpl::false_
+{
+};
+
+// There's no such thing as a pointer-to-cv-function, so we don't need
+// specializations for those
+template <class T>
+struct is_pointer_to_function<T*> : is_function<T>
+{
+};
+
+template <class T>
+struct is_reference_to_member_function_pointer_impl : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_member_function_pointer_impl<T&>
+ : is_member_function_pointer<typename remove_cv<T>::type>
+{
+};
+
+
+template <class T>
+struct is_reference_to_member_function_pointer
+ : is_reference_to_member_function_pointer_impl<T>
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
+};
+
+template <class T>
+struct is_reference_to_function_pointer_aux
+ : mpl::and_<
+ is_reference<T>
+ , is_pointer_to_function<
+ typename remove_cv<
+ typename remove_reference<T>::type
+ >::type
+ >
+ >
+{
+ // There's no such thing as a pointer-to-cv-function, so we don't need specializations for those
+};
+
+template <class T>
+struct is_reference_to_function_pointer
+ : mpl::if_<
+ is_reference_to_function<T>
+ , mpl::false_
+ , is_reference_to_function_pointer_aux<T>
+ >::type
+{
+};
+
+template <class T>
+struct is_reference_to_non_const
+ : mpl::and_<
+ is_reference<T>
+ , mpl::not_<
+ is_reference_to_const<T>
+ >
+ >
+{
+};
+
+template <class T>
+struct is_reference_to_volatile : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_volatile<T volatile&> : mpl::true_
+{
+};
+
+# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
+template <class T>
+struct is_reference_to_volatile<T const volatile&> : mpl::true_
+{
+};
+# endif
+
+
+template <class T>
+struct is_reference_to_pointer : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T*&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T* const&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T* volatile&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T* const volatile&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_class
+ : mpl::and_<
+ is_reference<T>
+ , is_class<
+ typename remove_cv<
+ typename remove_reference<T>::type
+ >::type
+ >
+ >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
+};
+
+template <class T>
+struct is_pointer_to_class
+ : mpl::and_<
+ is_pointer<T>
+ , is_class<
+ typename remove_cv<
+ typename remove_pointer<T>::type
+ >::type
+ >
+ >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
+};
+
+# else
+
+typedef char (&inner_yes_type)[3];
+typedef char (&inner_no_type)[2];
+typedef char (&outer_no_type)[1];
+
+template <typename V>
+struct is_const_help
+{
+ typedef typename mpl::if_<
+ is_const<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <typename V>
+struct is_volatile_help
+{
+ typedef typename mpl::if_<
+ is_volatile<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <typename V>
+struct is_pointer_help
+{
+ typedef typename mpl::if_<
+ is_pointer<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <typename V>
+struct is_class_help
+{
+ typedef typename mpl::if_<
+ is_class<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <class T>
+struct is_reference_to_function_aux
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::boost::type_traits::yes_type));
+ };
+
+template <class T>
+struct is_reference_to_function
+ : mpl::if_<is_reference<T>, is_reference_to_function_aux<T>, mpl::bool_<false> >::type
+{
+};
+
+template <class T>
+struct is_pointer_to_function_aux
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(::boost::type_traits::is_function_ptr_tester(t)) == sizeof(::boost::type_traits::yes_type));
+ typedef mpl::bool_<value> type;
+};
+
+template <class T>
+struct is_pointer_to_function
+ : mpl::if_<is_pointer<T>, is_pointer_to_function_aux<T>, mpl::bool_<false> >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T))
+};
+
+struct false_helper1
+{
+ template <class T>
+ struct apply : mpl::false_
+ {
+ };
+};
+
+template <typename V>
+typename is_const_help<V>::type reference_to_const_helper(V&);
+outer_no_type
+reference_to_const_helper(...);
+
+struct true_helper1
+{
+ template <class T>
+ struct apply
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(reference_to_const_helper(t)) == sizeof(inner_yes_type));
+ typedef mpl::bool_<value> type;
+ };
+};
+
+template <bool ref = true>
+struct is_reference_to_const_helper1 : true_helper1
+{
+};
+
+template <>
+struct is_reference_to_const_helper1<false> : false_helper1
+{
+};
+
+
+template <class T>
+struct is_reference_to_const
+ : is_reference_to_const_helper1<is_reference<T>::value>::template apply<T>
+{
+};
+
+
+template <bool ref = true>
+struct is_reference_to_non_const_helper1
+{
+ template <class T>
+ struct apply
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
+ };
+};
+
+template <>
+struct is_reference_to_non_const_helper1<false> : false_helper1
+{
+};
+
+
+template <class T>
+struct is_reference_to_non_const
+ : is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
+{
+};
+
+
+template <typename V>
+typename is_volatile_help<V>::type reference_to_volatile_helper(V&);
+outer_no_type
+reference_to_volatile_helper(...);
+
+template <bool ref = true>
+struct is_reference_to_volatile_helper1
+{
+ template <class T>
+ struct apply
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
+ };
+};
+
+template <>
+struct is_reference_to_volatile_helper1<false> : false_helper1
+{
+};
+
+
+template <class T>
+struct is_reference_to_volatile
+ : is_reference_to_volatile_helper1<is_reference<T>::value>::template apply<T>
+{
+};
+
+template <typename V>
+typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
+outer_no_type reference_to_pointer_helper(...);
+
+template <class T>
+struct is_reference_to_pointer
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = (is_reference<T>::value
+ && sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
+ );
+};
+
+template <class T>
+struct is_reference_to_function_pointer
+ : mpl::if_<
+ is_reference<T>
+ , is_pointer_to_function_aux<T>
+ , mpl::bool_<false>
+ >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
+};
+
+
+template <class T>
+struct is_member_function_pointer_help
+ : mpl::if_<is_member_function_pointer<T>, inner_yes_type, inner_no_type>
+{};
+
+template <typename V>
+typename is_member_function_pointer_help<V>::type member_function_pointer_helper(V&);
+outer_no_type member_function_pointer_helper(...);
+
+template <class T>
+struct is_pointer_to_member_function_aux
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof((member_function_pointer_helper)(t)) == sizeof(inner_yes_type));
+ typedef mpl::bool_<value> type;
+};
+
+template <class T>
+struct is_reference_to_member_function_pointer
+ : mpl::if_<
+ is_reference<T>
+ , is_pointer_to_member_function_aux<T>
+ , mpl::bool_<false>
+ >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
+};
+
+template <typename V>
+typename is_class_help<V>::type reference_to_class_helper(V const volatile&);
+outer_no_type reference_to_class_helper(...);
+
+template <class T>
+struct is_reference_to_class
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = (is_reference<T>::value
+ & (sizeof(reference_to_class_helper(t)) == sizeof(inner_yes_type)))
+ );
+ typedef mpl::bool_<value> type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
+};
+
+template <typename V>
+typename is_class_help<V>::type pointer_to_class_helper(V const volatile*);
+outer_no_type pointer_to_class_helper(...);
+
+template <class T>
+struct is_pointer_to_class
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = (is_pointer<T>::value
+ && sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
+ );
+};
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+}}} // namespace boost::python::detail
+
+#endif // INDIRECT_TRAITS_DWA2002131_HPP
--- /dev/null
+// Copyright David Abrahams 2003. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef IS_XXX_DWA2003224_HPP
+# define IS_XXX_DWA2003224_HPP
+
+# include <boost/config.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/preprocessor/enum_params.hpp>
+
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# include <boost/type_traits/is_reference.hpp>
+# include <boost/type_traits/add_reference.hpp>
+
+# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
+template <class X_> \
+struct is_##name \
+{ \
+ typedef char yes; \
+ typedef char (&no)[2]; \
+ \
+ static typename add_reference<X_>::type dummy; \
+ \
+ struct helpers \
+ { \
+ template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
+ static yes test( \
+ qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
+ ); \
+ \
+ template <class U> \
+ static no test(U&, ...); \
+ }; \
+ \
+ BOOST_STATIC_CONSTANT( \
+ bool, value \
+ = !is_reference<X_>::value \
+ & (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
+ \
+ typedef mpl::bool_<value> type; \
+};
+
+# else
+
+# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
+template <class T> \
+struct is_##name : mpl::false_ \
+{ \
+}; \
+ \
+template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
+struct is_##name< \
+ qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
+> \
+ : mpl::true_ \
+{ \
+};
+
+# endif
+
+#endif // IS_XXX_DWA2003224_HPP
#ifndef BOOST_REF_HPP_INCLUDED
-# define BOOST_REF_HPP_INCLUDED
+#define BOOST_REF_HPP_INCLUDED
-# if _MSC_VER+0 >= 1020
-# pragma once
-# endif
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
-# include <boost/config.hpp>
-# include <boost/utility/addressof.hpp>
-# include <boost/mpl/bool.hpp>
+#include <boost/config.hpp>
+#include <boost/utility/addressof.hpp>
+#include <boost/mpl/bool.hpp>
//
// ref.hpp - ref/cref, useful helper functions
#else
- explicit reference_wrapper(T& t): t_(addressof(t)) {}
+ explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
#endif
* Copyright (c) 1998-2000
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#endif // BOOST_RE_REGEX_H
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BOOST_RE_REGEX_HPP
#define BOOST_RE_REGEX_HPP
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex.hpp>
+#else
+#include <boost/regex/v4/regex.hpp>
+#endif
#endif // include
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
-
+
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE config.hpp
// this has to go *before* we include any std lib headers:
//
#if defined(__BORLANDC__)
-# if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)
- // problems with std::basic_string and dll RTL:
-# if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE)
-# ifdef BOOST_REGEX_BUILD_DLL
-# error _RWSTD_COMPILE_INSTANTIATE must not be defined when building regex++ as a DLL
-# else
-# pragma message("Defining _RWSTD_COMPILE_INSTANTIATE when linking to the DLL version of the RTL may produce memory corruption problems in std::basic_string, as a result of separate versions of basic_string's static data in the RTL and you're exe/dll: be warned!!")
-# endif
-# endif
-# ifndef _RTLDLL
- // this is harmless for a staic link:
-# define _RWSTD_COMPILE_INSTANTIATE
-# endif
-# endif
-# if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL)
- // C++ Builder 4 and earlier, we can't tell whether we should be using
- // the VCL runtime or not, do a static link instead:
-# define BOOST_REGEX_STATIC_LINK
-# endif
- //
- // VCL support:
- // if we're building a console app then there can't be any VCL (can there?)
-# if !defined(__CONSOLE__) && !defined(_NO_VCL)
-# define BOOST_REGEX_USE_VCL
-# endif
- //
- // if this isn't Win32 then don't automatically select link
- // libraries:
- //
-# ifndef _Windows
-# ifndef BOOST_REGEX_NO_LIB
-# define BOOST_REGEX_NO_LIB
-# endif
-# ifndef BOOST_REGEX_STATIC_LINK
-# define BOOST_REGEX_STATIC_LINK
-# endif
-# endif
-
+# include <boost/regex/config/borland.hpp>
#endif
/*****************************************************************************
# include <cstdlib>
# include <cstddef>
-# include <cstring>
-# include <cctype>
# include <cstdio>
# include <clocale>
# include <cassert>
# include <string>
# include <stdexcept>
# include <iterator>
+# include <iosfwd>
+# include <vector>
# include <boost/config.hpp>
# include <boost/cstdint.hpp>
# include <boost/detail/allocator.hpp>
+# include <boost/regex/config/cstring.hpp>
+# include <boost/throw_exception.hpp>
+# include <boost/scoped_ptr.hpp>
+# ifndef BOOST_NO_STD_LOCALE
+# include <locale>
+# endif
#else
//
// C build,
# define BOOST_NO_WREGEX
# endif
#else
-# if defined(__sgi) && defined(__SGI_STL_PORT)
+# if defined(__sgi) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
// STLPort on IRIX is misconfigured: <cwctype> does not compile
// as a temporary fix include <wctype.h> instead and prevent inclusion
// of STLPort version of <cwctype>
# endif
#ifdef __cplusplus
-# include <cwchar>
-# include <cwctype>
+# include <boost/regex/config/cwchar.hpp>
#endif
#endif
// If Win32 support has been disabled for boost in general, then
// it is for regex in particular:
//
-#ifdef BOOST_DISABLE_WIN32
+#if defined(BOOST_DISABLE_WIN32) && !defined(BOOST_REGEX_NO_W32)
# define BOOST_REGEX_NO_W32
#endif
// We don't make our templates external if the compiler
// can't handle it:
-#if (defined(BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS) || defined(__HP_aCC) || defined(__MWERKS__) || defined(__COMO__) || defined(__ICL) || defined(__ICC))\
+#if (defined(BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS) || defined(__HP_aCC) || defined(__MWERKS__) || defined(__COMO__) || defined(BOOST_INTEL))\
&& !defined(BOOST_MSVC) && !defined(__BORLANDC__)
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
#endif
# define BOOST_REGEX_USE_C_LOCALE
# define BOOST_REGEX_NO_W32
#endif
-
+#if defined(__COMO__) && !defined(BOOST_REGEX_NO_W32) && !defined(_MSC_EXTENSIONS)
+# define BOOST_REGEX_NO_W32
+#endif
/*****************************************************************************
*
- * Set up dll import/export options:
+ * Wide character workarounds:
*
****************************************************************************/
-// backwards compatibility:
-#ifdef BOOST_RE_STATIC_LIB
-# define BOOST_REGEX_STATIC_LINK
+#ifdef __cplusplus
+#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1300) && !defined(BOOST_REGEX_V3) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+# define BOOST_REGEX_HAS_SHORT_WCHAR_T
+namespace boost{ typedef __wchar_t regex_wchar_type; }
+#else
+namespace boost{ typedef wchar_t regex_wchar_type; }
#endif
-
-#if defined(BOOST_MSVC) && defined(_DLL)
-# define BOOST_REGEX_HAS_DLL_RUNTIME
#endif
-#if defined(__BORLANDC__) && defined(_RTLDLL)
-# define BOOST_REGEX_HAS_DLL_RUNTIME
-#endif
-#if defined(__ICL) && defined(_DLL)
-# define BOOST_REGEX_HAS_DLL_RUNTIME
-#endif
+/*****************************************************************************
+ *
+ * Set up dll import/export options:
+ *
+ ****************************************************************************/
-#if defined(BOOST_REGEX_HAS_DLL_RUNTIME) && !defined(BOOST_REGEX_STATIC_LINK)
+#if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
# if defined(BOOST_REGEX_SOURCE)
# define BOOST_REGEX_DECL __declspec(dllexport)
# define BOOST_REGEX_BUILD_DLL
#ifndef BOOST_REGEX_DECL
# define BOOST_REGEX_DECL
#endif
-
-#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE)
-# include <boost/regex/v3/regex_library_include.hpp>
+
+#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
+# define BOOST_LIB_NAME boost_regex
+# if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
+# define BOOST_DYN_LINK
+# endif
+#ifdef BOOST_REGEX_DIAG
+# define BOOST_LIB_DIAGNOSTIC
+#endif
+# include <boost/config/auto_link.hpp>
#endif
/*****************************************************************************
*
****************************************************************************/
-#if defined(BOOST_MSVC) || defined(__ICL)
-# if defined(_DEBUG)
-# define BOOST_REGEX_CALL __cdecl
-# else
-# define BOOST_REGEX_CALL __fastcall
-# endif
-# define BOOST_REGEX_CCALL __stdcall
+#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1200) && defined(_MSC_EXTENSIONS)
+#if defined(_DEBUG) || defined(__MSVC_RUNTIME_CHECKS)
+# define BOOST_REGEX_CALL __cdecl
+#else
+# define BOOST_REGEX_CALL __fastcall
+#endif
+# define BOOST_REGEX_CCALL __cdecl
#endif
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)
# define BOOST_REGEX_CALL __fastcall
# define BOOST_REGEX_CCALL __stdcall
#endif
# define BOOST_REGEX_MAX_PATH 200
#endif
+#ifndef BOOST_REGEX_MAX_STATE_COUNT
+# define BOOST_REGEX_MAX_STATE_COUNT 100000000
+#endif
/*****************************************************************************
// If there are no exceptions then we must report critical-errors
// the only way we know how; by terminating.
//
-#ifdef __BORLANDC__
-// <cstdio> seems not to make stderr usable with Borland:
-#include <stdio.h>
-#endif
# define BOOST_REGEX_NOEH_ASSERT(x)\
if(0 == (x))\
{\
- std::fprintf(stderr, "Error: critical regex++ failure in \"%s\"", #x);\
- std::abort();\
+ std::string s("Error: critical regex++ failure in: ");\
+ s.append(#x);\
+ std::runtime_error e(s);\
+ boost::throw_exception(e);\
}
#else
//
/*****************************************************************************
*
- * Fix broken compilers that wrongly #define some symbols:
+ * Stack protection under MS Windows:
*
****************************************************************************/
-#ifdef __cplusplus
+#if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3)
+# if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
+ && !defined(__GNUC__) \
+ && !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \
+ && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003))
+# define BOOST_REGEX_HAS_MS_STACK_GUARD
+# endif
+#elif defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
+# undef BOOST_REGEX_HAS_MS_STACK_GUARD
+#endif
-#ifdef BOOST_NO_CTYPE_FUNCTIONS
+#if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
+
+namespace boost{
+namespace re_detail{
-// Make functions out of the macros.
-// Use parentheses so the macros don't screw us up.
-inline int (isalpha)(int c) { return isalpha(c); }
-inline int (iscntrl)(int c) { return iscntrl(c); }
-inline int (isdigit)(int c) { return isdigit(c); }
-inline int (islower)(int c) { return islower(c); }
-inline int (ispunct)(int c) { return ispunct(c); }
-inline int (isspace)(int c) { return isspace(c); }
-inline int (isupper)(int c) { return isupper(c); }
-inline int (isxdigit)(int c) { return isxdigit(c); }
+BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
+
+}
+}
#endif
-// the following may be defined as macros; this is
-// incompatable with std::something syntax, we have
-// no choice but to undef them?
-#ifdef memcpy
-#undef memcpy
+/*****************************************************************************
+ *
+ * Error handling:
+ *
+ ****************************************************************************/
+
+#if defined(__cplusplus)
+
+namespace boost{
+namespace re_detail{
+
+BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_regex_exception(const std::string& s);
+
+template <class traits>
+void raise_error(const traits& t, unsigned code)
+{
+ (void)t; // warning suppression
+ raise_regex_exception(t.error_string(code));
+}
+
+}
+}
+
#endif
-#ifdef memmove
-#undef memmove
+
+/*****************************************************************************
+ *
+ * Algorithm selection and configuration:
+ *
+ ****************************************************************************/
+
+#if !defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_NON_RECURSIVE)
+# if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && !defined(_STLP_DEBUG) && !defined(__STL_DEBUG)
+# define BOOST_REGEX_RECURSIVE
+# else
+# define BOOST_REGEX_NON_RECURSIVE
+# endif
#endif
-#ifdef memset
-#undef memset
+
+#ifdef BOOST_REGEX_NON_RECURSIVE
+# ifdef BOOST_REGEX_RECURSIVE
+# error "Can't set both BOOST_REGEX_RECURSIVE and BOOST_REGEX_NON_RECURSIVE"
+# endif
+# ifndef BOOST_REGEX_BLOCKSIZE
+# define BOOST_REGEX_BLOCKSIZE 4096
+# endif
+# if BOOST_REGEX_BLOCKSIZE < 512
+# error "BOOST_REGEX_BLOCKSIZE must be at least 512"
+# endif
+# ifndef BOOST_REGEX_MAX_BLOCKS
+# define BOOST_REGEX_MAX_BLOCKS 1024
+# endif
+# ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
+# undef BOOST_REGEX_HAS_MS_STACK_GUARD
+# endif
+# ifndef BOOST_REGEX_MAX_CACHE_BLOCKS
+# define BOOST_REGEX_MAX_CACHE_BLOCKS 16
+# endif
#endif
+
+
+/*****************************************************************************
+ *
+ * Fix broken compilers that wrongly #define some symbols:
+ *
+ ****************************************************************************/
+
+#ifdef __cplusplus
+
+// the following may be defined as macros; this is
+// incompatable with std::something syntax, we have
+// no choice but to undef them?
+
#ifdef sprintf
#undef sprintf
#endif
-#ifdef strcat
-#undef strcat
-#endif
-#ifdef strcmp
-#undef strcmp
-#endif
-#ifdef strcpy
-#undef strcpy
-#endif
-#ifdef strlen
-#undef strlen
-#endif
#ifdef swprintf
#undef swprintf
#endif
-#ifdef wcslen
-#undef wcslen
-#endif
-#ifdef wcscpy
-#undef wcscpy
-#endif
-#ifdef wcscmp
-#undef wcscmp
-#endif
-#ifdef isalpha
-#undef isalpha
-#endif
-#ifdef iscntrl
-#undef iscntrl
-#endif
-#ifdef isdigit
-#undef isdigit
-#endif
-#ifdef islower
-#undef islower
-#endif
-#ifdef isupper
-#undef isupper
-#endif
-#ifdef ispunct
-#undef ispunct
-#endif
-#ifdef isspace
-#undef isspace
-#endif
-#ifdef isxdigit
-#undef isxdigit
-#endif
-
-#ifdef tolower
-#undef tolower
-#endif
-#ifdef iswalpha
-#undef iswalpha
-#endif
-#ifdef iswcntrl
-#undef iswcntrl
-#endif
-#ifdef iswdigit
-#undef iswdigit
-#endif
-#ifdef iswlower
-#undef iswlower
-#endif
-#ifdef iswpunct
-#undef iswpunct
-#endif
-#ifdef iswspace
-#undef iswspace
-#endif
-#ifdef iswupper
-#undef iswupper
-#endif
-#ifdef iswxdigit
-#undef iswxdigit
-#endif
-#ifdef towlower
-#undef towlower
-#endif
-#ifdef wcsxfrm
-#undef wcsxfrm
-#endif
-
#endif
/*****************************************************************************
namespace std{
using ::ptrdiff_t;
using ::size_t;
- using ::memcpy;
- using ::memmove;
- using ::memset;
- using ::memcmp;
using ::sprintf;
- using ::strcat;
- using ::strcmp;
- using ::strcpy;
- using ::strlen;
- using ::strxfrm;
- using ::isalpha;
- using ::iscntrl;
- using ::isdigit;
- using ::islower;
- using ::isupper;
- using ::ispunct;
- using ::isspace;
- using ::isxdigit;
- using ::tolower;
using ::abs;
using ::setlocale;
# ifndef BOOST_NO_WREGEX
# ifndef BOOST_NO_SWPRINTF
using ::swprintf;
# endif
- using ::wcslen;
- using ::wcscpy;
- using ::wcscmp;
- using ::iswalpha;
- using ::iswcntrl;
- using ::iswdigit;
- using ::iswlower;
- using ::iswpunct;
- using ::iswspace;
- using ::iswupper;
- using ::iswxdigit;
- using ::towlower;
- using ::wcsxfrm;
using ::wcstombs;
using ::mbstowcs;
# if !defined(BOOST_NO_STD_LOCALE) && !defined (__STL_NO_NATIVE_MBSTATE_T) && !defined(_STLP_NO_NATIVE_MBSTATE_T)
}} // namespaces
#endif
+/*****************************************************************************
+ *
+ * helper memory allocation functions:
+ *
+ ****************************************************************************/
+
+#if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE)
+namespace boost{ namespace re_detail{
+
+BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
+BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
+
+}} // namespaces
#endif
+/*****************************************************************************
+ *
+ * Diagnostics:
+ *
+ ****************************************************************************/
+#ifdef BOOST_REGEX_CONFIG_INFO
+BOOST_REGEX_DECL void BOOST_REGEX_CALL print_regex_library_info();
+#endif
+#if defined(BOOST_REGEX_DIAG)
+# pragma message ("BOOST_REGEX_DECL set as: " BOOST_STRINGIZE(BOOST_REGEX_DECL))
+# pragma message ("BOOST_REGEX_CALL set as: " BOOST_STRINGIZE(BOOST_REGEX_CALL))
+# pragma message ("BOOST_REGEX_CCALL set as: " BOOST_STRINGIZE(BOOST_REGEX_CCALL))
+#ifdef BOOST_REGEX_USE_C_LOCALE
+# pragma message ("Using C locale in regex traits class")
+#elif BOOST_REGEX_USE_CPP_LOCALE
+# pragma message ("Using C++ locale in regex traits class")
+#else
+# pragma message ("Using Win32 locale in regex traits class")
+#endif
+#ifdef BOOST_REGEX_DYN_LINK
+# pragma message ("Dynamic linking enabled")
+#endif
+#ifdef BOOST_REGEX_NO_LIB
+# pragma message ("Auto-linking disabled")
+#endif
+#ifdef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+# pragma message ("Extern templates disabled")
+#endif
+#ifdef BOOST_REGEX_V3
+# pragma message ("Using Version 3 regex code")
+#else
+# pragma message ("Using Version 4 regex code")
+#endif
+#endif
+#endif
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE boost/regex/config/borland.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: regex borland-specific config setup.
+ */
+
+
+#if defined(__BORLANDC__)
+# if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)
+ // problems with std::basic_string and dll RTL:
+# if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE)
+# ifdef BOOST_REGEX_BUILD_DLL
+# error _RWSTD_COMPILE_INSTANTIATE must not be defined when building regex++ as a DLL
+# else
+# pragma message("Defining _RWSTD_COMPILE_INSTANTIATE when linking to the DLL version of the RTL may produce memory corruption problems in std::basic_string, as a result of separate versions of basic_string's static data in the RTL and you're exe/dll: be warned!!")
+# endif
+# endif
+# ifndef _RTLDLL
+ // this is harmless for a staic link:
+# define _RWSTD_COMPILE_INSTANTIATE
+# endif
+ // external templates cause problems for some reason:
+# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+# endif
+# if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL)
+ // C++ Builder 4 and earlier, we can't tell whether we should be using
+ // the VCL runtime or not, do a static link instead:
+# define BOOST_REGEX_STATIC_LINK
+# endif
+ //
+ // VCL support:
+ // if we're building a console app then there can't be any VCL (can there?)
+# if !defined(__CONSOLE__) && !defined(_NO_VCL)
+# define BOOST_REGEX_USE_VCL
+# endif
+ //
+ // if this isn't Win32 then don't automatically select link
+ // libraries:
+ //
+# ifndef _Windows
+# ifndef BOOST_REGEX_NO_LIB
+# define BOOST_REGEX_NO_LIB
+# endif
+# ifndef BOOST_REGEX_STATIC_LINK
+# define BOOST_REGEX_STATIC_LINK
+# endif
+# endif
+
+#endif
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE boost/regex/config/cstring.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: regex narrow character string fixes.
+ */
+
+#ifndef BOOST_REGEX_CONFIG_CSTRING_HPP
+#define BOOST_REGEX_CONFIG_CSTRING_HPP
+
+#include <cstring>
+#include <cctype>
+#ifndef __sgi
+#ifdef __KCC
+#include <ios>
+#endif
+#include <boost/config.hpp>
+
+namespace std{
+
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+
+// Any function that is a macro is converted into an inline function:
+#ifdef memcmp
+inline int boost_memcmp(const void * p1, const void * p2, size_t s)
+{ return memcmp(p1, p2, s); }
+#undef memcmp
+inline int memcmp(const void * p1, const void * p2, size_t s)
+{ return boost_memcmp(p1, p2, s); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::memcmp;
+#endif
+
+#ifdef memcpy
+inline void *boost_memcpy(void * p1, const void *p2, size_t s)
+{ return memcpy(p1, p2, s); }
+#undef memcpy
+inline void *memcpy(void * p1, const void *p2, size_t s)
+{ return boost_memcpy(p1, p2, s); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::memcpy;
+#endif
+
+#ifdef memmove
+inline void *(memmove)(void *, const void *, size_t)
+{ return memmove(p1,p2,s); }
+#undef memmove
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::memmove;
+#endif
+
+#ifdef memset
+inline void *(boost_memset)(void *p, int a, size_t b)
+{ return memset(p,a,b); }
+#undef memset
+inline void *(memset)(void *p, int a, size_t b)
+{ return boost_memset(p,a,b); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::memset;
+#endif
+
+#ifdef strcat
+inline char *(boost_strcat)(char *p1, const char *p2)
+{ return strcat(p1,p2); }
+#undef strcat
+inline char *(strcat)(char *p1, const char *p2)
+{ return boost_strcat(p1,p2); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::strcat;
+#endif
+
+#ifdef strcmp
+inline int (boost_strcmp)(const char *p1, const char *p2)
+{ return strcmp(p1,p2); }
+#undef strcmp
+inline int (strcmp)(const char *p1, const char *p2)
+{ return boost_strcmp(p1,p2); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::strcmp;
+#endif
+
+#ifdef strcoll
+inline int (boost_strcoll) (const char *p1, const char *p2)
+{ return strcoll(p1,p2); }
+#undef strcoll
+inline int (strcoll) (const char *p1, const char *p2)
+{ return boost_strcoll(p1,p2); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::strcoll;
+#endif
+
+#ifdef strcpy
+inline char *(boost_strcpy)(char *p1, const char *p2)
+{ return strcpy(p1,p2); }
+#undef strcpy
+inline char *(strcpy)(char *p1, const char *p2)
+{ return boost_strcpy(p1,p2); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::strcpy;
+#endif
+
+#ifdef strlen
+inline size_t (boost_strlen)(const char *p)
+{ return strlen(p); }
+#undef strlen
+inline size_t (strlen)(const char *p)
+{ return boost_strlen(p); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::strlen;
+#endif
+
+#ifdef strxfrm
+inline size_t (boost_strxfrm)(char *p1, const char *p2, size_t s)
+{ return strxfrm(p1,p2,s); }
+#undef strxfrm
+inline size_t (strxfrm)(char *p1, const char *p2, size_t s)
+{ return boost_strxfrm(p1,p2,s); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::strxfrm;
+#endif
+
+#ifdef isalnum
+inline int (boost_isalnum)(int i)
+{ return isalnum(i); }
+#undef isalnum
+inline int (isalnum)(int i)
+{ return boost_isalnum(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isalnum;
+#endif
+
+#ifdef isalpha
+inline int (boost_isalpha)(int i)
+{ return isalpha(i); }
+#undef isalpha
+inline int (isalpha)(int i)
+{ return boost_isalpha(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isalpha;
+#endif
+
+#ifdef iscntrl
+inline int (boost_iscntrl)(int i)
+{ return iscntrl(i); }
+#undef iscntrl
+inline int (iscntrl)(int i)
+{ return boost_iscntrl(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iscntrl;
+#endif
+
+#ifdef isdigit
+inline int (boost_isdigit)(int i)
+{ return isdigit(i); }
+#undef isdigit
+inline int (isdigit)(int i)
+{ return boost_isdigit(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isdigit;
+#endif
+
+#ifdef isgraph
+inline int (boost_isgraph)(int i)
+{ return isgraph(i); }
+#undef isgraph
+inline int (isgraph)(int i)
+{ return boost_isgraph(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isgraph;
+#endif
+
+#ifdef islower
+inline int (boost_islower)(int i)
+{ return islower(i); }
+#undef islower
+inline int (islower)(int i)
+{ return boost_islower(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::islower;
+#endif
+
+#ifdef isprint
+inline int (boost_isprint)(int i)
+{ return isprint(i); }
+#undef isprint
+inline int (isprint)(int i)
+{ return boost_isprint(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isprint;
+#endif
+
+#ifdef ispunct
+inline int (boost_ispunct)(int i)
+{ return ispunct(i); }
+#undef ispunct
+inline int (ispunct)(int i)
+{ return boost_ispunct(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::ispunct;
+#endif
+
+#ifdef isspace
+inline int (isspace)(int i)
+{ return isspace(i); }
+#undef isspace
+inline int (boost_isspace)(int i)
+{ return boost_isspace(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isspace;
+#endif
+
+#ifdef isupper
+inline int (isupper)(int i)
+{ return isupper(i); }
+#undef isupper
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isupper;
+#endif
+
+#ifdef isxdigit
+inline int (isxdigit)(int i)
+{ return isxdigit(i); }
+#undef isxdigit
+inline int (boost_isxdigit)(int i)
+{ return boost_isxdigit(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::isxdigit;
+#endif
+
+#ifdef tolower
+inline int (boost_tolower)(int i)
+{ return tolower(i); }
+#undef tolower
+inline int (tolower)(int i)
+{ return boost_tolower(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::tolower;
+#endif
+
+#ifdef toupper
+inline int (boost_toupper)(int i)
+{ return toupper(i); }
+#undef toupper
+inline int (toupper)(int i)
+{ return boost_toupper(i); }
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::toupper;
+#endif
+
+#else
+
+#undef memcmp
+#undef memcpy
+#undef memmove
+#undef memset
+#undef strcat
+#undef strcmp
+#undef strcoll
+#undef strcpy
+#undef strlen
+#undef strxfrm
+#undef isalnum
+#undef isalpha
+#undef iscntrl
+#undef isdigit
+#undef isgraph
+#undef islower
+#undef isprint
+#undef ispunct
+#undef isspace
+#undef isupper
+#undef isxdigit
+#undef tolower
+#undef toupper
+
+#endif
+
+
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+
+} // namespace std
+
+#endif // __sgi
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE boost/regex/config/cwchar.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: regex wide character string fixes.
+ */
+
+#ifndef BOOST_REGEX_CONFIG_CWCHAR_HPP
+#define BOOST_REGEX_CONFIG_CWCHAR_HPP
+
+#include <cwchar>
+#include <cwctype>
+#include <boost/config.hpp>
+
+namespace std{
+
+#ifndef BOOST_NO_STDC_NAMESPACE
+extern "C"{
+#endif
+
+#ifdef iswalnum
+inline int (iswalnum)(wint_t i)
+{ return iswalnum(i); }
+#undef iswalnum
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswalnum;
+#endif
+
+#ifdef iswalpha
+inline int (iswalpha)(wint_t i)
+{ return iswalpha(i); }
+#undef iswalpha
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswalpha;
+#endif
+
+#ifdef iswcntrl
+inline int (iswcntrl)(wint_t i)
+{ return iswcntrl(i); }
+#undef iswcntrl
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswcntrl;
+#endif
+
+#ifdef iswdigit
+inline int (iswdigit)(wint_t i)
+{ return iswdigit(i); }
+#undef iswdigit
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswdigit;
+#endif
+
+#ifdef iswgraph
+inline int (iswgraph)(wint_t i)
+{ return iswgraph(i); }
+#undef iswgraph
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswgraph;
+#endif
+
+#ifdef iswlower
+inline int (iswlower)(wint_t i)
+{ return iswlower(i); }
+#undef iswlower
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswlower;
+#endif
+
+#ifdef iswprint
+inline int (iswprint)(wint_t i)
+{ return iswprint(i); }
+#undef iswprint
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswprint;
+#endif
+
+#ifdef iswpunct
+inline int (iswpunct)(wint_t i)
+{ return iswpunct(i); }
+#undef iswpunct
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswpunct;
+#endif
+
+#ifdef iswspace
+inline int (iswspace)(wint_t i)
+{ return iswspace(i); }
+#undef iswspace
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswspace;
+#endif
+
+#ifdef iswupper
+inline int (iswupper)(wint_t i)
+{ return iswupper(i); }
+#undef iswupper
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswupper;
+#endif
+
+#ifdef iswxdigit
+inline int (iswxdigit)(wint_t i)
+{ return iswxdigit(i); }
+#undef iswxdigit
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::iswxdigit;
+#endif
+
+#ifdef towlower
+inline wint_t (towlower)(wint_t i)
+{ return towlower(i); }
+#undef towlower
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::towlower;
+#endif
+
+#ifdef towupper
+inline wint_t (towupper)(wint_t i)
+{ return towupper(i); }
+#undef towupper
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using :: towupper;
+#endif
+
+#ifdef wcscmp
+inline int (wcscmp)(const wchar_t *p1, const wchar_t *p2)
+{ return wcscmp(p1,p2); }
+#undef wcscmp
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::wcscmp;
+#endif
+
+#ifdef wcscoll
+inline int (wcscoll)(const wchar_t *p1, const wchar_t *p2)
+{ return wcscoll(p1,p2); }
+#undef wcscoll
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::wcscoll;
+#endif
+
+#ifdef wcscpy
+inline wchar_t *(wcscpy)(wchar_t *p1, const wchar_t *p2)
+{ return wcscpy(p1,p2); }
+#undef wcscpy
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::wcscpy;
+#endif
+
+#ifdef wcslen
+inline size_t (wcslen)(const wchar_t *p)
+{ return wcslen(p); }
+#undef wcslen
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::wcslen;
+#endif
+
+#ifdef wcsxfrm
+size_t wcsxfrm(wchar_t *p1, const wchar_t *p2, size_t s)
+{ return wcsxfrm(p1,p2,s); }
+#undef wcsxfrm
+#elif defined(BOOST_NO_STDC_NAMESPACE)
+using ::wcsxfrm;
+#endif
+
+
+#ifndef BOOST_NO_STDC_NAMESPACE
+} // extern "C"
+#endif
+
+} // namespace std
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_libary_include.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+/*************************************************************************
+
+Libraries for Borland and Microsoft compilers are automatically
+selected here, the name of the lib is selected according to the following
+formula:
+
+BOOST_LIB_PREFIX
+ + BOOST_LIB_NAME
+ + "_"
+ + BOOST_LIB_TOOLSET
+ + "_"
+ + BOOST_LIB_THREAD_OPT
+ + BOOST_LIB_RT_OPT
+ + BOOST_LIB_DEBUG_OPT
+
+These are defined as:
+
+BOOST_LIB_PREFIX: "lib" for static libraries otherwise "".
+
+BOOST_LIB_NAME: The base name of the lib (boost_regex).
+
+BOOST_LIB_TOOLSET: The compiler toolset name (vc6, vc7, bcb5 etc).
+
+BOOST_LIB_THREAD_OPT: "s" for single thread builds,
+ "m" for multithread builds.
+
+BOOST_LIB_RT_OPT: "s" for static runtime,
+ "d" for dynamic runtime.
+
+BOOST_LIB_DEBUG_OPT: nothing for release builds,
+ "d" for debug builds,
+ "dd" for debug-diagnostic builds (_STLP_DEBUG).
+
+***************************************************************************/
+
+#if !defined(BOOST_REGEX_LIBRARY_INCLUDE_HPP) && !defined(BOOST_REGEX_NO_LIB)
+#define BOOST_REGEX_LIBRARY_INCLUDE_HPP
+
+#define BOOST_LIB_NAME "boost_regex"
+
+//
+// select toolset:
+//
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+
+ // vc6-stlport:
+# define BOOST_LIB_TOOLSET "vc6-stlport"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
+
+ // vc6:
+# define BOOST_LIB_TOOLSET "vc6"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+
+ // vc6-stlport:
+# define BOOST_LIB_TOOLSET "vc7-stlport"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
+
+ // vc7:
+# define BOOST_LIB_TOOLSET "vc7"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+
+ // vc71-stlport:
+# define BOOST_LIB_TOOLSET "vc71-stlport"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310)
+
+ // vc71:
+# define BOOST_LIB_TOOLSET "vc71"
+
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560)
+
+ // CBuilder 6:
+# define BOOST_LIB_TOOLSET "bcb6"
+
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
+
+ // CBuilder 6:
+# define BOOST_LIB_TOOLSET "bcb5"
+
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x540)
+
+ // CBuilder 6:
+# define BOOST_LIB_TOOLSET "bcb4"
+
+#endif
+
+//
+// select thread opt:
+//
+#if defined(_MT) || defined(__MT__)
+# define BOOST_LIB_THREAD_OPT "m"
+#else
+# define BOOST_LIB_THREAD_OPT "s"
+#endif
+
+//
+// select runtime opt:
+//
+#if defined(_DLL) || defined(_RTLDLL)
+# define BOOST_LIB_RT_OPT "d"
+#else
+# define BOOST_LIB_RT_OPT "s"
+#endif
+
+//
+// select linkage opt:
+//
+#if defined(BOOST_REGEX_STATIC_LINK) && defined(BOOST_REGEX_DYN_LINK)
+# undef BOOST_REGEX_STATIC_LINK
+#endif
+#if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_REGEX_DYN_LINK)
+# define BOOST_LIB_PREFIX
+#else
+# define BOOST_LIB_PREFIX "lib"
+#endif
+
+//
+// select debug opt:
+//
+#if defined(BOOST_MSVC) && defined(_DEBUG) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
+# define BOOST_LIB_DEBUG_OPT "dd"
+#elif defined(BOOST_MSVC) && defined(_DEBUG)
+# define BOOST_LIB_DEBUG_OPT "d"
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
+# define BOOST_LIB_DEBUG_OPT "dd"
+#else
+# define BOOST_LIB_DEBUG_OPT
+#endif
+
+//
+// now include the lib:
+//
+#if defined(BOOST_LIB_NAME) \
+ && defined(BOOST_LIB_PREFIX) \
+ && defined(BOOST_LIB_TOOLSET) \
+ && defined(BOOST_LIB_THREAD_OPT) \
+ && defined(BOOST_LIB_RT_OPT) \
+ && defined(BOOST_LIB_DEBUG_OPT)
+
+# pragma comment(lib, BOOST_LIB_PREFIX BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_DEBUG_OPT ".lib")
+#ifdef BOOST_REGEX_DIAG
+# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_DEBUG_OPT ".lib")
+#endif
+
+#endif
+
+//
+// finally undef any macros we may have set:
+//
+#if defined(BOOST_LIB_NAME)
+# undef BOOST_LIB_NAME
+#endif
+#if defined(BOOST_LIB_TOOLSET)
+# undef BOOST_LIB_TOOLSET
+#endif
+#if defined(BOOST_LIB_THREAD_OPT)
+# undef BOOST_LIB_THREAD_OPT
+#endif
+#if defined(BOOST_LIB_RT_OPT)
+# undef BOOST_LIB_RT_OPT
+#endif
+#if defined(BOOST_LIB_LINK_OPT)
+# undef BOOST_LIB_LINK_OPT
+#endif
+#if defined(BOOST_LIB_DEBUG_OPT)
+# undef BOOST_LIB_DEBUG_OPT
+#endif
+
+
+#endif // BOOST_REGEX_LIBRARY_INCLUDE_HPP
+
+
+
+
+
+
+
+
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BOOST_RE_PAT_EXCEPT_HPP
#define BOOST_RE_PAT_EXCEPT_HPP
+#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/config.hpp>
+#endif
namespace boost{
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
#endif
#ifdef BOOST_MSVC
~bad_expression() throw();
};
-
-#ifdef __BORLANDC__
- #pragma option pop
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
#endif
} // namespace boost
#endif
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BOOST_REGEX_TRAITS_HPP
#define BOOST_REGEX_TRAITS_HPP
-#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
-#include <boost/regex/v3/regex_traits.hpp>
+#ifndef BOOST_REGEX_CONFIG_HPP
+# include <boost/regex/config.hpp>
+#endif
+
+#ifdef BOOST_REGEX_V3
+# ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
+# include <boost/regex/v3/regex_traits.hpp>
+# endif
+#else
+# ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
+# include <boost/regex/v4/regex_traits.hpp>
+# endif
#endif
#endif // include
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "libs/regex/src/regex_synch.cpp"
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
// locale:
// #define BOOST_REGEX_USE_CPP_LOCALE
-// define this if you want to statically link to regex,
-// even when the runtime is a dll (Probably Win32 specific):
-// #define BOOST_REGEX_STATIC_LINK
+// define this if the runtime library is a dll, and you
+// want BOOST_REGEX_DYN_LINK to set up dll exports/imports
+// with __declspec(dllexport)/__declspec(dllimport.)
+// #define BOOST_REGEX_HAS_DLL_RUNTIME
+
+// define this if you want to dynamically link to regex,
+// if the runtime library is also a dll (Probably Win32 specific,
+// and has no effect unless BOOST_REGEX_HAS_DLL_RUNTIME is set):
+// #define BOOST_REGEX_DYN_LINK
// define this if you don't want the lib to automatically
// select its link libraries:
// cause more problems than they are worth:
// #define BOOST_REGEX_NO_FWD
+// define this if your compiler can't cope with the new
+// version 4 regex code.
+// #define BOOST_REGEX_V3
+
+// define this if your compiler supports MS Windows structured
+// exception handling.
+// #define BOOST_REGEX_HAS_MS_STACK_GUARD
+
+// define this if you want to use the recursive algorithm
+// even if BOOST_REGEX_HAS_MS_STACK_GUARD is not defined.
+// #define BOOST_REGEX_RECURSIVE
+
+// define this if you want to use the non-recursive
+// algorithm, even if the recursive version would be the default.
+// #define BOOST_REGEX_NON_RECURSIVE
+
+// define this if you want to set the size of the memory blocks
+// used by the non-recursive algorithm.
+// #define BOOST_REGEX_BLOCKSIZE 4096
+
+// define this if you want to set the maximum number of memory blocks
+// used by the non-recursive algorithm.
+// #define BOOST_REGEX_MAX_BLOCKS 1024
+
+// define this if you want to set the maximum number of memory blocks
+// cached by the non-recursive algorithm: Normally this is 16, but can be
+// higher if you have multiple threads all using boost.regex, or lower
+// if you don't want boost.regex to cache memory.
+// #define BOOST_REGEX_MAX_CACHE_BLOCKS 16
+// define this if you want to be able to access extended capture
+// information in your sub_match's (caution this will slow things
+// down quite a bit).
+// #define BOOST_REGEX_MATCH_EXTRA
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
match_max = match_all
};
+typedef unsigned long match_flag_type;
#ifdef __cplusplus
} // extern "C"
//
// now matching operators:
//
- bool Match(const char* p, unsigned int flags = match_default);
- bool Match(const std::string& s, unsigned int flags = match_default) { return Match(s.c_str(), flags); }
- bool Search(const char* p, unsigned int flags = match_default);
- bool Search(const std::string& s, unsigned int flags = match_default) { return Search(s.c_str(), flags); }
- unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default);
- unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default) { return Grep(cb, s.c_str(), flags); }
- unsigned int Grep(std::vector<std::string>& v, const char* p, unsigned int flags = match_default);
- unsigned int Grep(std::vector<std::string>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
- unsigned int Grep(std::vector<std::size_t>& v, const char* p, unsigned int flags = match_default);
- unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
+ bool Match(const char* p, match_flag_type flags = match_default);
+ bool Match(const std::string& s, match_flag_type flags = match_default) { return Match(s.c_str(), flags); }
+ bool Search(const char* p, match_flag_type flags = match_default);
+ bool Search(const std::string& s, match_flag_type flags = match_default) { return Search(s.c_str(), flags); }
+ unsigned int Grep(GrepCallback cb, const char* p, match_flag_type flags = match_default);
+ unsigned int Grep(GrepCallback cb, const std::string& s, match_flag_type flags = match_default) { return Grep(cb, s.c_str(), flags); }
+ unsigned int Grep(std::vector<std::string>& v, const char* p, match_flag_type flags = match_default);
+ unsigned int Grep(std::vector<std::string>& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); }
+ unsigned int Grep(std::vector<std::size_t>& v, const char* p, match_flag_type flags = match_default);
+ unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); }
#ifndef BOOST_REGEX_NO_FILEITER
- unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
- unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
- unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
- unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
+ unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default);
+ unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
+ unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default);
+ unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
#endif
std::string Merge(const std::string& in, const std::string& fmt,
- bool copy = true, unsigned int flags = match_default);
+ bool copy = true, match_flag_type flags = match_default);
std::string Merge(const char* in, const char* fmt,
- bool copy = true, unsigned int flags = match_default);
+ bool copy = true, match_flag_type flags = match_default);
- std::size_t Split(std::vector<std::string>& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0);
+ std::size_t Split(std::vector<std::string>& v, std::string& s, match_flag_type flags = match_default, unsigned max_count = ~0);
//
// now operators for returning what matched in more detail:
//
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
//template class BOOST_REGEX_DECL regex_traits< BOOST_REGEX_CHAR_T >;
template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
-template class BOOST_REGEX_DECL re_detail::match_results_base<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type)>;
-template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type)>;
-template class BOOST_REGEX_DECL match_results<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type)>;
-template class BOOST_REGEX_DECL match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type)>;
+template class BOOST_REGEX_DECL re_detail::match_results_base<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type) >;
+template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type) >;
+template class BOOST_REGEX_DECL match_results<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type) >;
+template class BOOST_REGEX_DECL match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type) >;
#pragma warning(pop)
template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces);
template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::move_offsets(re_detail::re_syntax_base* j, unsigned size);
template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
-template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_aux(re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& singles, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack<boost::uint_fast32_t, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& classes, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& equivalents, bool isnot, const re_detail::_narrow_type&);
-template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_aux(re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& singles, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack<boost::uint_fast32_t, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& classes, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& equivalents, bool isnot, const re_detail::_wide_type&);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_aux(re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >& singles, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack<boost::uint_fast32_t, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >& classes, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >& equivalents, bool isnot, const re_detail::_narrow_type&);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_aux(re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >& singles, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack<boost::uint_fast32_t, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >& classes, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >& equivalents, bool isnot, const re_detail::_wide_type&);
template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot);
template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::parse_inner_set(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size);
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
{
std::size_t cmatches;
unsigned count;
- sub_match<iterator> head, tail, null;
+ sub_match<iterator> head, tail, re_null;
unsigned int lines;
iterator line_pos, base;
c_reference(const Allocator& a)
{
if((n >= 0) && ((unsigned int)n < ref->cmatches))
return *(sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>)*n);
- return (n == -1) ? ref->head : (n == -2) ? ref->tail : ref->null;
+ return (n == -1) ? ref->head : (n == -2) ? ref->tail : ref->re_null;
}
Allocator BOOST_REGEX_CALL allocator()const;
ref->head.first = i;
ref->tail.second = j;
ref->head.matched = ref->tail.matched = true;
- ref->null.first = ref->null.second = j;
- ref->null.matched = false;
+ ref->re_null.first = ref->re_null.second = j;
+ ref->re_null.matched = false;
}
template <class iterator, class Allocator>
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
if((result == traits_type::syntax_colon) && ((first-base) == 5))
{
- return traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
+ unsigned type = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
+ if((type == traits_type::syntax_left_word) || (type == traits_type::syntax_right_word))
+ return type;
}
return ((result == traits_type::syntax_colon) || (result == traits_type::syntax_dot) || (result == traits_type::syntax_equal)) ? result : 0;
}
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
}
void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*)
{
-#ifndef BOOST_NO_STD_DISTANCE
- difference_type dist = std::distance(a,b);
-#else
- difference_type dist = b - a;
-#endif
+ difference_type dist = boost::re_detail::distance(a,b);
states *= states;
difference_type lim = std::numeric_limits<difference_type>::max() - 1000 - states;
if(dist > (difference_type)(lim / states))
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#endif
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
cpp_regex_traits();
~cpp_regex_traits();
+ void swap(cpp_regex_traits&);
+
static std::size_t BOOST_REGEX_CALL length(const char_type* p)
{
return std::strlen(p);
locale_type BOOST_REGEX_CALL imbue(locale_type l);
locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const;
+ void swap(cpp_regex_traits&);
struct sentry
{
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE basic_regex.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares template class basic_regex (note that member function
+ * bodies are in regex_compile.hpp).
+ */
+
+#ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP
+#define BOOST_REGEX_V4_BASIC_REGEX_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+//
+// class reg_expression
+// represents the compiled
+// regular expression:
+//
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable : 4251 4231 4660)
+#endif
+
+#ifdef BOOST_REGEX_NO_FWD
+template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+#else
+template <class charT, class traits, class Allocator >
+#endif
+class reg_expression : public regbase
+{
+public:
+ // typedefs:
+ typedef typename traits::size_type traits_size_type;
+ typedef typename traits::uchar_type traits_uchar_type;
+ typedef typename traits::string_type traits_string_type;
+ typedef charT char_type;
+ typedef traits traits_type;
+
+ typedef charT value_type;
+ typedef charT& reference;
+ typedef const charT& const_reference;
+ typedef const charT* const_iterator;
+ typedef const_iterator iterator;
+ typedef typename Allocator::difference_type difference_type;
+ typedef typename Allocator::size_type size_type;
+ typedef Allocator allocator_type;
+ typedef Allocator alloc_type;
+ typedef regex_constants::syntax_option_type flag_type;
+ // locale_type
+ // placeholder for actual locale type used by the
+ // traits class to localise *this.
+ typedef typename traits::locale_type locale_type;
+
+public:
+ explicit reg_expression(const Allocator& a = Allocator());
+ explicit reg_expression(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+ reg_expression(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator());
+ reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator());
+ reg_expression(const reg_expression&);
+ ~reg_expression();
+ reg_expression& BOOST_REGEX_CALL operator=(const reg_expression&);
+ reg_expression& BOOST_REGEX_CALL operator=(const charT* ptr)
+ {
+ set_expression(ptr, regex_constants::normal | regex_constants::use_except);
+ return *this;
+ }
+
+ //
+ // assign:
+ reg_expression& assign(const reg_expression& that)
+ { return *this = that; }
+ reg_expression& assign(const charT* ptr, flag_type f = regex_constants::normal)
+ {
+ set_expression(ptr, f | regex_constants::use_except);
+ return *this;
+ }
+ reg_expression& assign(const charT* ptr, size_type len, flag_type f)
+ {
+ std::basic_string<charT> s(ptr, len);
+ set_expression(s.c_str(), f | regex_constants::use_except);
+ return *this;
+ }
+
+ reg_expression& assign(const charT* arg_first,
+ const charT* arg_last,
+ flag_type f = regex_constants::normal)
+ {
+ set_expression(arg_first, arg_last, f | regex_constants::use_except);
+ return *this;
+ }
+#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__)
+
+ template <class ST, class SA>
+ unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regex_constants::normal)
+ { return set_expression(p.data(), p.data() + p.size(), f); }
+
+ template <class ST, class SA>
+ explicit reg_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator())
+ : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regex_constants::use_except); }
+
+ template <class InputIterator>
+ reg_expression(InputIterator arg_first, InputIterator arg_last, flag_type f = regex_constants::normal, const Allocator& al = Allocator())
+ : data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+ {
+ std::basic_string<charT> a(arg_first, arg_last);
+ set_expression(a.data(), a.data() + a.size(), f | regex_constants::use_except);
+ }
+
+ template <class ST, class SA>
+ reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string<charT, ST, SA>& p)
+ {
+ set_expression(p.c_str(), p.c_str() + p.size(), regex_constants::normal | regex_constants::use_except);
+ return *this;
+ }
+
+ template <class string_traits, class A>
+ reg_expression& BOOST_REGEX_CALL assign(
+ const std::basic_string<charT, string_traits, A>& s,
+ flag_type f = regex_constants::normal)
+ {
+ set_expression(s.c_str(), s.c_str() + s.size(), f | regex_constants::use_except);
+ return *this;
+ }
+
+ template <class InputIterator>
+ reg_expression& BOOST_REGEX_CALL assign(InputIterator arg_first,
+ InputIterator arg_last,
+ flag_type f = regex_constants::normal)
+ {
+ std::basic_string<charT> a(arg_first, arg_last);
+ set_expression(a.data(), a.data() + a.size(), f | regex_constants::use_except);
+ return *this;
+ }
+#else
+ unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string<charT>& p, flag_type f = regex_constants::normal)
+ { return set_expression(p.data(), p.data() + p.size(), f | regex_constants::use_except); }
+
+ reg_expression(const std::basic_string<charT>& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator())
+ : data(a), pkmp(0) { set_expression(p, f | regex_constants::use_except); }
+
+ reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string<charT>& p)
+ {
+ set_expression(p.c_str(), p.c_str() + p.size(), regex_constants::normal | regex_constants::use_except);
+ return *this;
+ }
+
+ reg_expression& BOOST_REGEX_CALL assign(
+ const std::basic_string<charT>& s,
+ flag_type f = regex_constants::normal)
+ {
+ set_expression(s.c_str(), s.c_str() + s.size(), f | regex_constants::use_except);
+ return *this;
+ }
+
+#endif
+
+
+ //
+ // allocator access:
+ Allocator BOOST_REGEX_CALL get_allocator()const;
+ //
+ // locale:
+ locale_type BOOST_REGEX_CALL imbue(locale_type l){ return traits_inst.imbue(l); }
+ locale_type BOOST_REGEX_CALL getloc()const{ return traits_inst.getloc(); }
+ //
+ // getflags:
+ // retained for backwards compatibility only, the base class has "flags"
+ // member which is now the prefered name:
+ flag_type BOOST_REGEX_CALL getflags()const
+ { return this->flags(); }
+ //
+ // str:
+ std::basic_string<charT> BOOST_REGEX_CALL str()const
+ {
+ std::basic_string<charT> result;
+ if(this->error_code() == 0)
+ result = std::basic_string<charT>(_expression, _expression_len);
+ return result;
+ }
+ //
+ // begin, end:
+ const_iterator BOOST_REGEX_CALL begin()const
+ { return (this->error_code() ? 0 : _expression); }
+ const_iterator BOOST_REGEX_CALL end()const
+ { return (this->error_code() ? 0 : _expression + _expression_len); }
+ //
+ // swap:
+ void BOOST_REGEX_CALL swap(reg_expression&)throw();
+ //
+ // size:
+ size_type BOOST_REGEX_CALL size()const
+ { return (this->error_code() ? 0 : _expression_len); }
+ //
+ // max_size:
+ size_type BOOST_REGEX_CALL max_size()const
+ { return UINT_MAX; }
+ //
+ // empty:
+ bool BOOST_REGEX_CALL empty()const
+ { return 0 != this->error_code(); }
+
+ unsigned BOOST_REGEX_CALL mark_count()const { return (this->error_code() ? 0 : marks); }
+ int BOOST_REGEX_CALL compare(const reg_expression&) const;
+ bool BOOST_REGEX_CALL operator==(const reg_expression& e)const
+ { return compare(e) == 0; }
+ bool operator != (const basic_regex<charT, traits, Allocator>& e)
+ { return compare(e) != 0; }
+ bool BOOST_REGEX_CALL operator<(const reg_expression& e)const
+ { return compare(e) < 0; }
+ bool BOOST_REGEX_CALL operator>(const reg_expression& e)const
+ { return compare(e) > 0; }
+ bool BOOST_REGEX_CALL operator<=(const reg_expression& e)const
+ { return compare(e) <= 0; }
+ bool BOOST_REGEX_CALL operator>=(const reg_expression& e)const
+ { return compare(e) >= 0; }
+
+ //
+ // The following are deprecated as public interfaces
+ // but are available for compatibility with earlier versions.
+ allocator_type BOOST_REGEX_CALL allocator()const;
+ const charT* BOOST_REGEX_CALL expression()const { return (this->error_code() ? 0 : _expression); }
+ unsigned int BOOST_REGEX_CALL set_expression(const charT* p, const charT* end, flag_type f = regex_constants::normal);
+ unsigned int BOOST_REGEX_CALL set_expression(const charT* p, flag_type f = regex_constants::normal) { return set_expression(p, p + traits_type::length(p), f); }
+ //
+ // this should be private but template friends don't work:
+ const traits_type& get_traits()const { return traits_inst; }
+ unsigned int BOOST_REGEX_CALL error_code()const
+ {
+ return error_code_;
+ }
+
+private:
+ traits_type traits_inst; // traits class in use
+ re_detail::raw_storage<Allocator> data; // our state machine
+ unsigned _restart_type; // search method to use
+ unsigned marks; // number of marked sub-expressions
+ int repeats; // number of repeats
+ unsigned char* startmap; // characters that can match the first state(s) in the machine
+ std::size_t _expression_len; // length of the expression
+ std::size_t _leading_len; // length of any leading literal
+ const charT* _leading_string; // leading literal string
+ std::size_t _leading_string_len; // and it's length
+ re_detail::kmp_info<charT>* pkmp; // pointer to Knuth Morris Pratt state machine when available
+ unsigned error_code_; // our current status
+ charT* _expression; // the expression we just compiled if any
+
+ void BOOST_REGEX_CALL compile_maps();
+ void BOOST_REGEX_CALL compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal = 0)const;
+ bool BOOST_REGEX_CALL probe_start(re_detail::re_syntax_base* node, charT c, re_detail::re_syntax_base* terminal)const;
+ bool BOOST_REGEX_CALL probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const;
+ void BOOST_REGEX_CALL fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces);
+ void BOOST_REGEX_CALL move_offsets(re_detail::re_syntax_base* j, unsigned size);
+ re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set(const charT*& first, const charT* last);
+ re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_narrow_type&);
+ re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_wide_type&);
+ re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot = false);
+ unsigned int BOOST_REGEX_CALL parse_inner_set(const charT*& first, const charT* last);
+
+ re_detail::re_syntax_base* BOOST_REGEX_CALL add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size = sizeof(re_detail::re_syntax_base));
+ re_detail::re_syntax_base* BOOST_REGEX_CALL add_literal(re_detail::re_syntax_base* dat, charT c);
+ charT BOOST_REGEX_CALL parse_escape(const charT*& first, const charT* last);
+ void BOOST_REGEX_CALL parse_range(const charT*& first, const charT* last, unsigned& min, unsigned& max);
+ bool BOOST_REGEX_CALL skip_space(const charT*& first, const charT* last);
+ unsigned int BOOST_REGEX_CALL probe_restart(re_detail::re_syntax_base* dat);
+ unsigned int BOOST_REGEX_CALL fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end);
+ void BOOST_REGEX_CALL fail(unsigned int err);
+
+protected:
+ static int BOOST_REGEX_CALL repeat_count(const reg_expression& e)
+ { return e.repeats; }
+ static unsigned int BOOST_REGEX_CALL restart_type(const reg_expression& e)
+ { return e._restart_type; }
+ static const re_detail::re_syntax_base* BOOST_REGEX_CALL first(const reg_expression& e)
+ { return (const re_detail::re_syntax_base*)e.data.data(); }
+ static const unsigned char* BOOST_REGEX_CALL get_map(const reg_expression& e)
+ { return e.startmap; }
+ static std::size_t BOOST_REGEX_CALL leading_length(const reg_expression& e)
+ { return e._leading_len; }
+ static const re_detail::kmp_info<charT>* get_kmp(const reg_expression& e)
+ { return e.pkmp; }
+ static bool BOOST_REGEX_CALL can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&);
+ static bool BOOST_REGEX_CALL can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&);
+};
+
+template <class charT, class traits, class Allocator >
+void swap(reg_expression<charT, traits, Allocator>& a, reg_expression<charT, traits, Allocator>& b)
+{
+ a.swap(b);
+}
+
+#ifndef BOOST_NO_STD_LOCALE
+template <class charT, class traits, class traits2, class Allocator>
+std::basic_ostream<charT, traits>&
+ operator << (std::basic_ostream<charT, traits>& os,
+ const reg_expression<charT, traits2, Allocator>& e)
+{
+ return (os << e.str());
+}
+#else
+template <class traits, class Allocator>
+std::ostream& operator << (std::ostream& os, const reg_expression<char, traits, Allocator>& e)
+{
+ return (os << e.str());
+}
+#endif
+
+//
+// We want to rename reg_expression basic_regex but maintain
+// backwards compatibility, so class basic_regex is just a thin
+// wrapper around reg_expression:
+//
+#ifdef BOOST_REGEX_NO_FWD
+template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+#else
+template <class charT, class traits, class Allocator >
+#endif
+class basic_regex : public reg_expression<charT, traits, Allocator>
+{
+public:
+ typedef typename reg_expression<charT, traits, Allocator>::flag_type flag_type;
+ typedef typename reg_expression<charT, traits, Allocator>::size_type size_type;
+ explicit basic_regex(const Allocator& a = Allocator())
+ : reg_expression<charT, traits, Allocator>(a){}
+ explicit basic_regex(const charT* p, flag_type f = regex_constants::normal, const Allocator& a = Allocator())
+ : reg_expression<charT, traits, Allocator>(p,f,a){}
+ basic_regex(const charT* p1, const charT* p2, flag_type f = regex_constants::normal, const Allocator& a = Allocator())
+ : reg_expression<charT, traits, Allocator>(p1,p2,f,a){}
+ basic_regex(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator())
+ : reg_expression<charT, traits, Allocator>(p,len,f,a){}
+ basic_regex(const basic_regex& that)
+ : reg_expression<charT, traits, Allocator>(that){}
+ ~basic_regex(){}
+ basic_regex& BOOST_REGEX_CALL operator=(const basic_regex& that)
+ {
+ this->assign(that);
+ return *this;
+ }
+ basic_regex& BOOST_REGEX_CALL operator=(const charT* ptr)
+ {
+ this->assign(ptr);
+ return *this;
+ }
+#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !(defined(__IBMCPP__) && (__IBMCPP__ <= 502))
+ template <class ST, class SA>
+ explicit basic_regex(const std::basic_string<charT, ST, SA>& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator())
+ : reg_expression<charT, traits, Allocator>(p,f,a){}
+
+ template <class I>
+ basic_regex(I arg_first, I arg_last, flag_type f = regex_constants::normal, const Allocator& al = Allocator())
+ : reg_expression<charT, traits, Allocator>(arg_first, arg_last, f, al){}
+
+ template <class ST, class SA>
+ basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string<charT, ST, SA>& p)
+ {
+ this->assign(p);
+ return *this;
+ }
+#else
+ basic_regex(const std::basic_string<charT>& p, flag_type f = regex_constants::normal, const Allocator& a = Allocator())
+ : reg_expression<charT, traits, Allocator>(p,f,a){}
+
+ basic_regex& BOOST_REGEX_CALL operator=(const std::basic_string<charT>& p)
+ {
+ this->assign(p);
+ return *this;
+ }
+#endif
+};
+
+#ifdef BOOST_MSVC
+#pragma warning (pop)
+#endif
+
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE char_regex_traits.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares deprecated traits classes char_regex_traits<>.
+ */
+
+
+#ifndef BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP
+#define BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+
+namespace deprecated{
+//
+// class char_regex_traits_i
+// provides case insensitive traits classes (deprecated):
+template <class charT>
+class char_regex_traits_i : public regex_traits<charT> {};
+
+template<>
+class char_regex_traits_i<char> : public regex_traits<char>
+{
+public:
+ typedef char char_type;
+ typedef unsigned char uchar_type;
+ typedef unsigned int size_type;
+ typedef regex_traits<char> base_type;
+
+ char BOOST_REGEX_CALL translate(char c, bool)const
+ {
+ return static_cast<const regex_traits<char>*>(this)->translate(c, true);
+ }
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class char_regex_traits_i<wchar_t> : public regex_traits<wchar_t>
+{
+public:
+ typedef wchar_t char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef regex_traits<wchar_t> base_type;
+
+ wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool)const
+ {
+ return static_cast<const regex_traits<wchar_t>*>(this)->translate(c, true);
+ }
+ boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const
+ {
+ boost::uint_fast32_t result = static_cast<const regex_traits<wchar_t>*>(this)->lookup_classname(first, last);
+ if((result & base_type::char_class_upper) == base_type::char_class_upper)
+ result |= base_type::char_class_alpha;
+ return result;
+ }
+};
+#endif
+} // namespace deprecated
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // include
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE cregex.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares POSIX API functions
+ * + boost::RegEx high level wrapper.
+ */
+
+#ifndef BOOST_RE_CREGEX_HPP_INCLUDED
+#define BOOST_RE_CREGEX_HPP_INCLUDED
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+#include <boost/regex/v4/match_flags.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+/* include these defs only for POSIX compatablity */
+#ifdef __cplusplus
+namespace boost{
+extern "C" {
+#endif
+
+#if defined(__cplusplus) && !defined(BOOST_NO_STDC_NAMESPACE)
+typedef std::ptrdiff_t regoff_t;
+typedef std::size_t regsize_t;
+#else
+typedef ptrdiff_t regoff_t;
+typedef size_t regsize_t;
+#endif
+
+typedef struct
+{
+ unsigned int re_magic;
+ unsigned int re_nsub; /* number of parenthesized subexpressions */
+ const char* re_endp; /* end pointer for REG_PEND */
+ void* guts; /* none of your business :-) */
+ match_flag_type eflags; /* none of your business :-) */
+} regex_tA;
+
+#ifndef BOOST_NO_WREGEX
+typedef struct
+{
+ unsigned int re_magic;
+ unsigned int re_nsub; /* number of parenthesized subexpressions */
+ const wchar_t* re_endp; /* end pointer for REG_PEND */
+ void* guts; /* none of your business :-) */
+ match_flag_type eflags; /* none of your business :-) */
+} regex_tW;
+#endif
+
+typedef struct
+{
+ regoff_t rm_so; /* start of match */
+ regoff_t rm_eo; /* end of match */
+} regmatch_t;
+
+/* regcomp() flags */
+typedef enum{
+ REG_BASIC = 0000,
+ REG_EXTENDED = 0001,
+ REG_ICASE = 0002,
+ REG_NOSUB = 0004,
+ REG_NEWLINE = 0010,
+ REG_NOSPEC = 0020,
+ REG_PEND = 0040,
+ REG_DUMP = 0200,
+ REG_NOCOLLATE = 0400,
+ REG_ESCAPE_IN_LISTS = 01000,
+ REG_NEWLINE_ALT = 02000,
+ REG_PERLEX = 04000,
+
+ REG_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS | REG_PERLEX,
+ REG_AWK = REG_EXTENDED | REG_ESCAPE_IN_LISTS,
+ REG_GREP = REG_BASIC | REG_NEWLINE_ALT,
+ REG_EGREP = REG_EXTENDED | REG_NEWLINE_ALT,
+
+ REG_ASSERT = 15,
+ REG_INVARG = 16,
+ REG_ATOI = 255, /* convert name to number (!) */
+ REG_ITOA = 0400 /* convert number to name (!) */
+} reg_comp_flags;
+
+/* regexec() flags */
+typedef enum{
+ REG_NOTBOL = 00001,
+ REG_NOTEOL = 00002,
+ REG_STARTEND = 00004
+} reg_exec_flags;
+
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA*, const char*, int);
+BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int, const regex_tA*, char*, regsize_t);
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
+BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeA(regex_tA*);
+
+#ifndef BOOST_NO_WREGEX
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW*, const wchar_t*, int);
+BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int, const regex_tW*, wchar_t*, regsize_t);
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW*, const wchar_t*, regsize_t, regmatch_t*, int);
+BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*);
+#endif
+
+#ifdef UNICODE
+#define regcomp regcompW
+#define regerror regerrorW
+#define regexec regexecW
+#define regfree regfreeW
+#define regex_t regex_tW
+#else
+#define regcomp regcompA
+#define regerror regerrorA
+#define regexec regexecA
+#define regfree regfreeA
+#define regex_t regex_tA
+#endif
+
+/* regerror() flags */
+typedef enum
+{
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH = 1, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT = 2, /* Invalid pattern. */
+ REG_ECOLLATE = 3, /* Undefined collating element. */
+ REG_ECTYPE = 4, /* Invalid character class name. */
+ REG_EESCAPE = 5, /* Trailing backslash. */
+ REG_ESUBREG = 6, /* Invalid back reference. */
+ REG_EBRACK = 7, /* Unmatched left bracket. */
+ REG_EPAREN = 8, /* Parenthesis imbalance. */
+ REG_EBRACE = 9, /* Unmatched \{. */
+ REG_BADBR = 10, /* Invalid contents of \{\}. */
+ REG_ERANGE = 11, /* Invalid range end. */
+ REG_ESPACE = 12, /* Ran out of memory. */
+ REG_BADRPT = 13, /* No preceding re for repetition op. */
+ REG_EEND = 14, /* unexpected end of expression */
+ REG_ESIZE = 15, /* expression too big */
+ REG_ERPAREN = 16, /* unmatched right parenthesis */
+ REG_EMPTY = 17, /* empty expression */
+ REG_E_MEMORY = REG_ESIZE, /* out of memory */
+ REG_E_UNKNOWN = 18 /* unknown error */
+} reg_errcode_t;
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+} // namespace
+#endif
+
+//
+// C++ high level wrapper goes here:
+//
+#if defined(__cplusplus)
+#include <string>
+#include <vector>
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+class RegEx;
+
+namespace re_detail{
+
+class RegExData;
+struct pred1;
+struct pred2;
+struct pred3;
+struct pred4;
+
+} // namespace re_detail
+
+#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32)
+typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
+typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression);
+typedef bool (__cdecl *FindFilesCallback)(const char* file);
+#else
+typedef bool (*GrepCallback)(const RegEx& expression);
+typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
+typedef bool (*FindFilesCallback)(const char* file);
+#endif
+
+class BOOST_REGEX_DECL RegEx
+{
+private:
+ re_detail::RegExData* pdata;
+public:
+ RegEx();
+ RegEx(const RegEx& o);
+ ~RegEx();
+ explicit RegEx(const char* c, bool icase = false);
+ explicit RegEx(const std::string& s, bool icase = false);
+ RegEx& operator=(const RegEx& o);
+ RegEx& operator=(const char* p);
+ RegEx& operator=(const std::string& s){ return this->operator=(s.c_str()); }
+ unsigned int SetExpression(const char* p, bool icase = false);
+ unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); }
+ std::string Expression()const;
+ unsigned int error_code()const;
+ //
+ // now matching operators:
+ //
+ bool Match(const char* p, match_flag_type flags = match_default);
+ bool Match(const std::string& s, match_flag_type flags = match_default) { return Match(s.c_str(), flags); }
+ bool Search(const char* p, match_flag_type flags = match_default);
+ bool Search(const std::string& s, match_flag_type flags = match_default) { return Search(s.c_str(), flags); }
+ unsigned int Grep(GrepCallback cb, const char* p, match_flag_type flags = match_default);
+ unsigned int Grep(GrepCallback cb, const std::string& s, match_flag_type flags = match_default) { return Grep(cb, s.c_str(), flags); }
+ unsigned int Grep(std::vector<std::string>& v, const char* p, match_flag_type flags = match_default);
+ unsigned int Grep(std::vector<std::string>& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); }
+ unsigned int Grep(std::vector<std::size_t>& v, const char* p, match_flag_type flags = match_default);
+ unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, match_flag_type flags = match_default) { return Grep(v, s.c_str(), flags); }
+#ifndef BOOST_REGEX_NO_FILEITER
+ unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default);
+ unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
+ unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, match_flag_type flags = match_default);
+ unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, match_flag_type flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
+#endif
+
+ std::string Merge(const std::string& in, const std::string& fmt,
+ bool copy = true, match_flag_type flags = match_default);
+ std::string Merge(const char* in, const char* fmt,
+ bool copy = true, match_flag_type flags = match_default);
+
+ std::size_t Split(std::vector<std::string>& v, std::string& s, match_flag_type flags = match_default, unsigned max_count = ~0);
+ //
+ // now operators for returning what matched in more detail:
+ //
+ std::size_t Position(int i = 0)const;
+ std::size_t Length(int i = 0)const;
+ bool Matched(int i = 0)const;
+ unsigned int Marks()const;
+ std::string What(int i = 0)const;
+ std::string operator[](int i)const { return What(i); }
+
+ static const unsigned int npos;
+
+ friend struct re_detail::pred1;
+ friend struct re_detail::pred2;
+ friend struct re_detail::pred3;
+ friend struct re_detail::pred4;
+};
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif
+
+#endif // include guard
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE fileiter.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares various platform independent file and
+ * directory iterators, plus binary file input in
+ * the form of class map_file.
+ */
+
+#ifndef BOOST_RE_FILEITER_HPP_INCLUDED
+#define BOOST_RE_FILEITER_HPP_INCLUDED
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#ifndef BOOST_REGEX_NO_FILEITER
+
+#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(BOOST_REGEX_NO_W32)
+#error "Sorry, can't mix <windows.h> with STL code and gcc compiler: if you ran configure, try again with configure --disable-ms-windows"
+#define BOOST_REGEX_FI_WIN32_MAP
+#define BOOST_REGEX_FI_POSIX_DIR
+#elif (defined(__WIN32__) || defined(_WIN32) || defined(WIN32)) && !defined(BOOST_REGEX_NO_W32)
+#define BOOST_REGEX_FI_WIN32_MAP
+#define BOOST_REGEX_FI_WIN32_DIR
+#else
+#define BOOST_REGEX_FI_POSIX_MAP
+#define BOOST_REGEX_FI_POSIX_DIR
+#endif
+
+#if defined(BOOST_REGEX_FI_WIN32_MAP)||defined(BOOST_REGEX_FI_WIN32_DIR)
+#include <windows.h>
+#endif
+
+#if defined(BOOST_REGEX_FI_WIN32_DIR)
+
+namespace boost{
+ namespace re_detail{
+
+typedef WIN32_FIND_DATAA _fi_find_data;
+typedef HANDLE _fi_find_handle;
+
+ } // namespace re_detail
+
+} // namespace boost
+
+#define _fi_invalid_handle INVALID_HANDLE_VALUE
+#define _fi_dir FILE_ATTRIBUTE_DIRECTORY
+
+#elif defined(BOOST_REGEX_FI_POSIX_DIR)
+
+#include <cstdio>
+#include <cctype>
+#include <iterator>
+#include <list>
+#include <cassert>
+#include <dirent.h>
+
+#if defined(__SUNPRO_CC)
+using std::list;
+#endif
+
+#ifndef MAX_PATH
+#define MAX_PATH 256
+#endif
+
+namespace boost{
+ namespace re_detail{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+struct _fi_find_data
+{
+ unsigned dwFileAttributes;
+ char cFileName[MAX_PATH];
+};
+
+struct _fi_priv_data;
+
+typedef _fi_priv_data* _fi_find_handle;
+#define _fi_invalid_handle 0
+#define _fi_dir 1
+
+_fi_find_handle _fi_FindFirstFile(const char* lpFileName, _fi_find_data* lpFindFileData);
+bool _fi_FindNextFile(_fi_find_handle hFindFile, _fi_find_data* lpFindFileData);
+bool _fi_FindClose(_fi_find_handle hFindFile);
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+ } // namespace re_detail
+} // namespace boost
+
+#ifdef FindFirstFile
+ #undef FindFirstFile
+#endif
+#ifdef FindNextFile
+ #undef FindNextFile
+#endif
+#ifdef FindClose
+ #undef FindClose
+#endif
+
+#define FindFirstFileA _fi_FindFirstFile
+#define FindNextFileA _fi_FindNextFile
+#define FindClose _fi_FindClose
+
+#endif
+
+namespace boost{
+ namespace re_detail{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+#ifdef BOOST_REGEX_FI_WIN32_MAP // win32 mapfile
+
+class BOOST_REGEX_DECL mapfile
+{
+ HANDLE hfile;
+ HANDLE hmap;
+ const char* _first;
+ const char* _last;
+public:
+
+ typedef const char* iterator;
+
+ mapfile(){ hfile = hmap = 0; _first = _last = 0; }
+ mapfile(const char* file){ hfile = hmap = 0; _first = _last = 0; open(file); }
+ ~mapfile(){ close(); }
+ void open(const char* file);
+ void close();
+ const char* begin(){ return _first; }
+ const char* end(){ return _last; }
+ size_t size(){ return _last - _first; }
+ bool valid(){ return (hfile != 0) && (hfile != INVALID_HANDLE_VALUE); }
+};
+
+
+#else
+
+class BOOST_REGEX_DECL mapfile_iterator;
+
+class BOOST_REGEX_DECL mapfile
+{
+ typedef char* pointer;
+ std::FILE* hfile;
+ long int _size;
+ pointer* _first;
+ pointer* _last;
+ mutable std::list<pointer*> condemed;
+ enum sizes
+ {
+ buf_size = 4096
+ };
+ void lock(pointer* node)const;
+ void unlock(pointer* node)const;
+public:
+
+ typedef mapfile_iterator iterator;
+
+ mapfile(){ hfile = 0; _size = 0; _first = _last = 0; }
+ mapfile(const char* file){ hfile = 0; _size = 0; _first = _last = 0; open(file); }
+ ~mapfile(){ close(); }
+ void open(const char* file);
+ void close();
+ iterator begin()const;
+ iterator end()const;
+ unsigned long size()const{ return _size; }
+ bool valid()const{ return hfile != 0; }
+ friend class mapfile_iterator;
+};
+
+class BOOST_REGEX_DECL mapfile_iterator
+#if !defined(BOOST_NO_STD_ITERATOR) || defined(BOOST_MSVC_STD_ITERATOR)
+: public std::iterator<std::random_access_iterator_tag, char>
+#endif
+{
+ typedef mapfile::pointer internal_pointer;
+ internal_pointer* node;
+ const mapfile* file;
+ unsigned long offset;
+ long position()const
+ {
+ return file ? ((node - file->_first) * mapfile::buf_size + offset) : 0;
+ }
+ void position(long pos)
+ {
+ if(file)
+ {
+ node = file->_first + (pos / mapfile::buf_size);
+ offset = pos % mapfile::buf_size;
+ }
+ }
+public:
+ typedef std::ptrdiff_t difference_type;
+ typedef char value_type;
+ typedef const char* pointer;
+ typedef const char& reference;
+ typedef std::random_access_iterator_tag iterator_category;
+
+ mapfile_iterator() { node = 0; file = 0; offset = 0; }
+ mapfile_iterator(const mapfile* f, long arg_position)
+ {
+ file = f;
+ node = f->_first + arg_position / mapfile::buf_size;
+ offset = arg_position % mapfile::buf_size;
+ if(file)
+ file->lock(node);
+ }
+ mapfile_iterator(const mapfile_iterator& i)
+ {
+ file = i.file;
+ node = i.node;
+ offset = i.offset;
+ if(file)
+ file->lock(node);
+ }
+ ~mapfile_iterator()
+ {
+ if(file && node)
+ file->unlock(node);
+ }
+ mapfile_iterator& operator = (const mapfile_iterator& i);
+ char operator* ()const
+ {
+ assert(node >= file->_first);
+ assert(node < file->_last);
+ return file ? *(*node + sizeof(int) + offset) : char(0);
+ }
+ char operator[] (long off)const
+ {
+ mapfile_iterator tmp(*this);
+ tmp += off;
+ return *tmp;
+ }
+ mapfile_iterator& operator++ ();
+ mapfile_iterator operator++ (int);
+ mapfile_iterator& operator-- ();
+ mapfile_iterator operator-- (int);
+
+ mapfile_iterator& operator += (long off)
+ {
+ position(position() + off);
+ return *this;
+ }
+ mapfile_iterator& operator -= (long off)
+ {
+ position(position() - off);
+ return *this;
+ }
+
+ friend inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset);
+ }
+
+ friend inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return !(i == j);
+ }
+
+ friend inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return i.position() < j.position();
+ }
+ friend inline bool operator>(const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return i.position() > j.position();
+ }
+ friend inline bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return i.position() <= j.position();
+ }
+ friend inline bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return i.position() >= j.position();
+ }
+
+ friend mapfile_iterator operator + (const mapfile_iterator& i, long off);
+ friend mapfile_iterator operator + (long off, const mapfile_iterator& i)
+ {
+ mapfile_iterator tmp(i);
+ return tmp += off;
+ }
+ friend mapfile_iterator operator - (const mapfile_iterator& i, long off);
+ friend inline long operator - (const mapfile_iterator& i, const mapfile_iterator& j)
+ {
+ return i.position() - j.position();
+ }
+};
+
+#endif
+
+// _fi_sep determines the directory separator, either '\\' or '/'
+BOOST_REGEX_DECL extern const char* _fi_sep;
+
+struct file_iterator_ref
+{
+ _fi_find_handle hf;
+ _fi_find_data _data;
+ long count;
+};
+
+
+class BOOST_REGEX_DECL file_iterator
+{
+ char* _root;
+ char* _path;
+ char* ptr;
+ file_iterator_ref* ref;
+
+public:
+ typedef std::ptrdiff_t difference_type;
+ typedef const char* value_type;
+ typedef const char** pointer;
+ typedef const char*& reference;
+ typedef std::input_iterator_tag iterator_category;
+
+ file_iterator();
+ file_iterator(const char* wild);
+ ~file_iterator();
+ file_iterator(const file_iterator&);
+ file_iterator& operator=(const file_iterator&);
+ const char* root()const { return _root; }
+ const char* path()const { return _path; }
+ const char* name()const { return ptr; }
+ _fi_find_data* data() { return &(ref->_data); }
+ void next();
+ file_iterator& operator++() { next(); return *this; }
+ file_iterator operator++(int);
+ const char* operator*() { return path(); }
+
+ friend inline bool operator == (const file_iterator& f1, const file_iterator& f2)
+ {
+ return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
+ }
+
+ friend inline bool operator != (const file_iterator& f1, const file_iterator& f2)
+ {
+ return !(f1 == f2);
+ }
+
+};
+
+// dwa 9/13/00 - suppress unused parameter warning
+inline bool operator < (const file_iterator&, const file_iterator&)
+{
+ return false;
+}
+
+
+class BOOST_REGEX_DECL directory_iterator
+{
+ char* _root;
+ char* _path;
+ char* ptr;
+ file_iterator_ref* ref;
+
+public:
+ typedef std::ptrdiff_t difference_type;
+ typedef const char* value_type;
+ typedef const char** pointer;
+ typedef const char*& reference;
+ typedef std::input_iterator_tag iterator_category;
+
+ directory_iterator();
+ directory_iterator(const char* wild);
+ ~directory_iterator();
+ directory_iterator(const directory_iterator& other);
+ directory_iterator& operator=(const directory_iterator& other);
+
+ const char* root()const { return _root; }
+ const char* path()const { return _path; }
+ const char* name()const { return ptr; }
+ _fi_find_data* data() { return &(ref->_data); }
+ void next();
+ directory_iterator& operator++() { next(); return *this; }
+ directory_iterator operator++(int);
+ const char* operator*() { return path(); }
+
+ static const char* separator() { return _fi_sep; }
+
+ friend inline bool operator == (const directory_iterator& f1, const directory_iterator& f2)
+ {
+ return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
+ }
+
+
+ friend inline bool operator != (const directory_iterator& f1, const directory_iterator& f2)
+ {
+ return !(f1 == f2);
+ }
+
+ };
+
+inline bool operator < (const directory_iterator&, const directory_iterator&)
+{
+ return false;
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+
+} // namespace re_detail
+using boost::re_detail::directory_iterator;
+using boost::re_detail::file_iterator;
+using boost::re_detail::mapfile;
+} // namespace boost
+
+#endif // BOOST_REGEX_NO_FILEITER
+#endif // BOOST_RE_FILEITER_HPP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE instances.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Defines those template instances that are placed in the
+ * library rather than in the users object files.
+ */
+
+//
+// note no include guard, we may include this multiple times:
+//
+#ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+
+namespace boost{
+
+//
+// this header can be included multiple times, each time with
+// a different character type, BOOST_REGEX_CHAR_T must be defined
+// first:
+//
+#ifndef BOOST_REGEX_CHAR_T
+# error "BOOST_REGEX_CHAR_T not defined"
+#endif
+
+//
+// what follows is compiler specific:
+//
+
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+# ifndef BOOST_REGEX_INSTANTIATE
+# pragma option push -Jgx
+# endif
+
+template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
+
+# ifndef BOOST_REGEX_INSTANTIATE
+# pragma option pop
+# endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#elif defined(BOOST_MSVC) || defined(__GNUC__)
+
+# ifndef BOOST_REGEX_INSTANTIATE
+# define template extern template
+# endif
+
+# ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4251 4231 4660)
+# endif
+
+template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
+
+# ifdef BOOST_MSVC
+# pragma warning(pop)
+# endif
+
+# ifdef template
+# undef template
+# endif
+
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_match.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Iterator traits for selecting an iterator type as
+ * an integral constant expression.
+ */
+
+
+#ifndef BOOST_REGEX_ITERATOR_CATEGORY_HPP
+#define BOOST_REGEX_ITERATOR_CATEGORY_HPP
+
+#include <iterator>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+
+namespace boost{
+namespace detail{
+
+template <class I>
+struct is_random_imp
+{
+private:
+ typedef typename std::iterator_traits<I>::iterator_category cat;
+public:
+ BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible<cat*, std::random_access_iterator_tag*>::value));
+};
+
+template <class I>
+struct is_random_pointer_imp
+{
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+template <bool is_pointer_type>
+struct is_random_imp_selector
+{
+ template <class I>
+ struct rebind
+ {
+ typedef is_random_imp<I> type;
+ };
+};
+
+template <>
+struct is_random_imp_selector<true>
+{
+ template <class I>
+ struct rebind
+ {
+ typedef is_random_pointer_imp<I> type;
+ };
+};
+
+}
+
+template <class I>
+struct is_random_access_iterator
+{
+private:
+ typedef detail::is_random_imp_selector< ::boost::is_pointer<I>::value> selector;
+ typedef typename selector::template rebind<I> bound_type;
+ typedef typename bound_type::type answer;
+public:
+ BOOST_STATIC_CONSTANT(bool, value = answer::value);
+};
+
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+template <class I>
+const bool is_random_access_iterator<I>::value;
+#endif
+
+}
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE iterator_traits.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares iterator traits workarounds.
+ */
+
+#ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
+#define BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+namespace re_detail{
+
+#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <class T>
+struct regex_iterator_traits
+{
+ typedef typename T::iterator_category iterator_category;
+ typedef typename T::value_type value_type;
+#if !defined(BOOST_NO_STD_ITERATOR)
+ typedef typename T::difference_type difference_type;
+ typedef typename T::pointer pointer;
+ typedef typename T::reference reference;
+#else
+ typedef std::ptrdiff_t difference_type;
+ typedef value_type* pointer;
+ typedef value_type& reference;
+#endif
+};
+
+template <class T>
+struct pointer_iterator_traits
+{
+ typedef std::ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef std::random_access_iterator_tag iterator_category;
+};
+template <class T>
+struct const_pointer_iterator_traits
+{
+ typedef std::ptrdiff_t difference_type;
+ typedef T value_type;
+ typedef const T* pointer;
+ typedef const T& reference;
+ typedef std::random_access_iterator_tag iterator_category;
+};
+
+template<>
+struct regex_iterator_traits<char*> : pointer_iterator_traits<char>{};
+template<>
+struct regex_iterator_traits<const char*> : const_pointer_iterator_traits<char>{};
+template<>
+struct regex_iterator_traits<wchar_t*> : pointer_iterator_traits<wchar_t>{};
+template<>
+struct regex_iterator_traits<const wchar_t*> : const_pointer_iterator_traits<wchar_t>{};
+
+#if defined(__SGI_STL_PORT) && defined(__STL_DEBUG)
+template<>
+struct regex_iterator_traits<std::string::iterator> : pointer_iterator_traits<char>{};
+template<>
+struct regex_iterator_traits<std::string::const_iterator> : const_pointer_iterator_traits<char>{};
+#ifndef BOOST_NO_STD_WSTRING
+template<>
+struct regex_iterator_traits<std::wstring::iterator> : pointer_iterator_traits<wchar_t>{};
+template<>
+struct regex_iterator_traits<std::wstring::const_iterator> : const_pointer_iterator_traits<wchar_t>{};
+#endif // BOOST_NO_WSTRING
+#endif // stport
+
+#else
+
+template <class T>
+struct regex_iterator_traits : public std::iterator_traits<T> {};
+
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE match_flags.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares match_flags type.
+ */
+
+#ifndef BOOST_REGEX_V4_MATCH_FLAGS
+#define BOOST_REGEX_V4_MATCH_FLAGS
+
+#ifdef __cplusplus
+# include <boost/cstdint.hpp>
+#endif
+
+#include <boost/detail/workaround.hpp>
+
+#ifdef __cplusplus
+namespace boost{
+ namespace regex_constants{
+#endif
+
+typedef enum _match_flags
+{
+ match_default = 0,
+ match_not_bol = 1, // first is not start of line
+ match_not_eol = match_not_bol << 1, // last is not end of line
+ match_not_bob = match_not_eol << 1, // first is not start of buffer
+ match_not_eob = match_not_bob << 1, // last is not end of buffer
+ match_not_bow = match_not_eob << 1, // first is not start of word
+ match_not_eow = match_not_bow << 1, // last is not end of word
+ match_not_dot_newline = match_not_eow << 1, // \n is not matched by '.'
+ match_not_dot_null = match_not_dot_newline << 1, // '\0' is not matched by '.'
+ match_prev_avail = match_not_dot_null << 1, // *--first is a valid expression
+ match_init = match_prev_avail << 1, // internal use
+ match_any = match_init << 1, // don't care what we match
+ match_not_null = match_any << 1, // string can't be null
+ match_continuous = match_not_null << 1, // each grep match must continue from
+ // uninterupted from the previous one
+ match_partial = match_continuous << 1, // find partial matches
+
+ match_stop = match_partial << 1, // stop after first match (grep) V3 only
+ match_not_initial_null = match_stop, // don't match initial null, V4 only
+ match_all = match_stop << 1, // must find the whole of input even if match_any is set
+ match_perl = match_all << 1, // Use perl matching rules
+ match_posix = match_perl << 1, // Use POSIX matching rules
+ match_nosubs = match_posix << 1, // don't trap marked subs
+ match_extra = match_nosubs << 1, // include full capture information for repeated captures
+ match_single_line = match_extra << 1, // treat text as single line and ignor any \n's when matching ^ and $.
+ match_unused1 = match_single_line << 1, // unused
+ match_unused2 = match_unused1 << 1, // unused
+ match_unused3 = match_unused2 << 1, // unused
+ match_max = match_unused3,
+
+ format_perl = 0, // perl style replacement
+ format_default = 0, // ditto.
+ format_sed = match_max << 1, // sed style replacement.
+ format_all = format_sed << 1, // enable all extentions to sytax.
+ format_no_copy = format_all << 1, // don't copy non-matching segments.
+ format_first_only = format_no_copy << 1, // Only replace first occurance.
+ format_is_if = format_first_only << 1 // internal use only.
+
+} match_flags;
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+typedef unsigned long match_flag_type;
+#else
+typedef match_flags match_flag_type;
+
+
+#ifdef __cplusplus
+inline match_flags operator&(match_flags m1, match_flags m2)
+{ return static_cast<match_flags>(static_cast<boost::int32_t>(m1) & static_cast<boost::int32_t>(m2)); }
+inline match_flags operator|(match_flags m1, match_flags m2)
+{ return static_cast<match_flags>(static_cast<boost::int32_t>(m1) | static_cast<boost::int32_t>(m2)); }
+inline match_flags operator^(match_flags m1, match_flags m2)
+{ return static_cast<match_flags>(static_cast<boost::int32_t>(m1) ^ static_cast<boost::int32_t>(m2)); }
+inline match_flags operator~(match_flags m1)
+{ return static_cast<match_flags>(~static_cast<boost::int32_t>(m1)); }
+inline match_flags& operator&=(match_flags& m1, match_flags m2)
+{ m1 = m1&m2; return m1; }
+inline match_flags& operator|=(match_flags& m1, match_flags m2)
+{ m1 = m1|m2; return m1; }
+inline match_flags& operator^=(match_flags& m1, match_flags m2)
+{ m1 = m1^m2; return m1; }
+#endif
+#endif
+
+#ifdef __cplusplus
+} // namespace regex_constants
+//
+// import names into boost for backwards compatiblity:
+//
+using regex_constants::match_flag_type;
+using regex_constants::match_default;
+using regex_constants::match_not_bol;
+using regex_constants::match_not_eol;
+using regex_constants::match_not_bob;
+using regex_constants::match_not_eob;
+using regex_constants::match_not_bow;
+using regex_constants::match_not_eow;
+using regex_constants::match_not_dot_newline;
+using regex_constants::match_not_dot_null;
+using regex_constants::match_prev_avail;
+//using regex_constants::match_init;
+using regex_constants::match_any;
+using regex_constants::match_not_null;
+using regex_constants::match_continuous;
+using regex_constants::match_partial;
+//using regex_constants::match_stop;
+using regex_constants::match_all;
+using regex_constants::match_perl;
+using regex_constants::match_posix;
+using regex_constants::match_nosubs;
+using regex_constants::match_extra;
+using regex_constants::match_single_line;
+//using regex_constants::match_max;
+using regex_constants::format_all;
+using regex_constants::format_sed;
+using regex_constants::format_perl;
+using regex_constants::format_default;
+using regex_constants::format_no_copy;
+using regex_constants::format_first_only;
+//using regex_constants::format_is_if;
+
+} // namespace boost
+#endif // __cplusplus
+#endif // include guard
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE match_results.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares template class match_results.
+ */
+
+#ifndef BOOST_REGEX_V4_MATCH_RESULTS_HPP
+#define BOOST_REGEX_V4_MATCH_RESULTS_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+
+template <class BidiIterator
+ , class Allocator = BOOST_DEFAULT_ALLOCATOR(sub_match<BidiIterator> )
+ >
+class match_results
+{
+private:
+#ifndef BOOST_NO_STD_ALLOCATOR
+ typedef std::vector<sub_match<BidiIterator>, Allocator> vector_type;
+#else
+ typedef std::vector<sub_match<BidiIterator> > vector_type;
+#endif
+public:
+ typedef sub_match<BidiIterator> value_type;
+#if !defined(BOOST_NO_STD_ALLOCATOR) && !(defined(BOOST_MSVC) && defined(_STLPORT_VERSION))
+ typedef typename Allocator::const_reference const_reference;
+#else
+ typedef const value_type& const_reference;
+#endif
+ typedef const_reference reference;
+ typedef typename vector_type::const_iterator const_iterator;
+ typedef const_iterator iterator;
+ typedef typename re_detail::regex_iterator_traits<
+ BidiIterator>::difference_type difference_type;
+ typedef typename Allocator::size_type size_type;
+ typedef Allocator allocator_type;
+ typedef typename re_detail::regex_iterator_traits<
+ BidiIterator>::value_type char_type;
+ typedef std::basic_string<char_type> string_type;
+
+ // construct/copy/destroy:
+ explicit match_results(const Allocator& a = Allocator())
+#ifndef BOOST_NO_STD_ALLOCATOR
+ : m_subs(a), m_base() {}
+#else
+ : m_subs(), m_base() { (void)a; }
+#endif
+ match_results(const match_results& m)
+ : m_subs(m.m_subs), m_base(m.m_base) {}
+ match_results& operator=(const match_results& m)
+ {
+ m_subs = m.m_subs;
+ m_base = m.m_base;
+ return *this;
+ }
+ ~match_results(){}
+
+ // size:
+ size_type size() const
+ { return m_subs.size() - 2; }
+ size_type max_size() const
+ { return m_subs.max_size(); }
+ bool empty() const
+ { return m_subs.size() < 2; }
+ // element access:
+ difference_type length(int sub = 0) const
+ {
+ sub += 2;
+ if((sub < (int)m_subs.size()) && (sub > 0))
+ return m_subs[sub].length();
+ return 0;
+ }
+ difference_type position(unsigned int sub = 0) const
+ {
+ sub += 2;
+ if(sub < m_subs.size())
+ {
+ const sub_match<BidiIterator>& s = m_subs[sub];
+ if(s.matched)
+ {
+ return boost::re_detail::distance((BidiIterator)(m_base), (BidiIterator)(s.first));
+ }
+ }
+ return ~static_cast<difference_type>(0);
+ }
+ string_type str(int sub = 0) const
+ {
+ sub += 2;
+ string_type result;
+ if(sub < (int)m_subs.size() && (sub > 0))
+ {
+ const sub_match<BidiIterator>& s = m_subs[sub];
+ if(s.matched)
+ {
+ result = s;
+ }
+ }
+ return result;
+ }
+ const_reference operator[](int sub) const
+ {
+ sub += 2;
+ if(sub < (int)m_subs.size() && (sub >= 0))
+ {
+ return m_subs[sub];
+ }
+ return m_null;
+ }
+
+ const_reference prefix() const
+ {
+ return (*this)[-1];
+ }
+
+ const_reference suffix() const
+ {
+ return (*this)[-2];
+ }
+ const_iterator begin() const
+ {
+ return (m_subs.size() > 2) ? (m_subs.begin() + 2) : m_subs.end();
+ }
+ const_iterator end() const
+ {
+ return m_subs.end();
+ }
+ // format:
+ template <class OutputIterator>
+ OutputIterator format(OutputIterator out,
+ const string_type& fmt,
+ match_flag_type flags = format_default) const
+ {
+ return regex_format(out, *this, fmt, flags);
+ }
+ string_type format(const string_type& fmt,
+ match_flag_type flags = format_default) const
+ {
+ return regex_format(*this, fmt, flags);
+ }
+
+ allocator_type get_allocator() const
+ {
+#ifndef BOOST_NO_STD_ALLOCATOR
+ return m_subs.get_allocator();
+#else
+ return allocator_type();
+#endif
+ }
+ void swap(match_results& that)
+ {
+ std::swap(m_subs, that.m_subs);
+ std::swap(m_base, that.m_base);
+ }
+ bool operator==(const match_results& that)const
+ {
+ return (m_subs == that.m_subs) && (m_base == that.m_base);
+ }
+ bool operator!=(const match_results& that)const
+ { return !(*this == that); }
+
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ typedef typename sub_match<BidiIterator>::capture_sequence_type capture_sequence_type;
+
+ const capture_sequence_type& captures(int i)const
+ {
+ return (*this)[i].captures();
+ }
+#endif
+
+ //
+ // private access functions:
+ void BOOST_REGEX_CALL set_second(BidiIterator i)
+ {
+ assert(m_subs.size() > 2);
+ m_subs[2].second = i;
+ m_subs[2].matched = true;
+ m_subs[0].first = i;
+ m_subs[0].matched = (m_subs[0].first != m_subs[0].second);
+ m_null.first = i;
+ m_null.second = i;
+ m_null.matched = false;
+ }
+
+ void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true)
+ {
+ pos += 2;
+ assert(m_subs.size() > pos);
+ m_subs[pos].second = i;
+ m_subs[pos].matched = m;
+ if(pos == 2)
+ {
+ m_subs[0].first = i;
+ m_subs[0].matched = (m_subs[0].first != m_subs[0].second);
+ m_null.first = i;
+ m_null.second = i;
+ m_null.matched = false;
+ }
+ }
+ void BOOST_REGEX_CALL set_size(size_type n, BidiIterator i, BidiIterator j)
+ {
+ value_type v(j);
+ size_type len = m_subs.size();
+ if(len > n + 2)
+ {
+ m_subs.erase(m_subs.begin()+n+2);
+ std::fill(m_subs.begin(), m_subs.end(), v);
+ }
+ else
+ {
+ std::fill(m_subs.begin(), m_subs.end(), v);
+ if(n+2 != len)
+ m_subs.insert(m_subs.end(), n+2-len, v);
+ }
+ m_subs[1].first = i;
+ }
+ void BOOST_REGEX_CALL set_base(BidiIterator pos)
+ {
+ m_base = pos;
+ }
+ void BOOST_REGEX_CALL set_first(BidiIterator i)
+ {
+ // set up prefix:
+ m_subs[1].second = i;
+ m_subs[1].matched = (m_subs[1].first != i);
+ // set up $0:
+ m_subs[2].first = i;
+ // zero out everything else:
+ for(size_type n = 3; n < m_subs.size(); ++n)
+ {
+ m_subs[n].first = m_subs[n].second = m_subs[0].second;
+ m_subs[n].matched = false;
+ }
+ }
+ void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos)
+ {
+ assert(pos+2 < m_subs.size());
+ if(pos)
+ m_subs[pos+2].first = i;
+ else
+ set_first(i);
+ }
+ void BOOST_REGEX_CALL maybe_assign(const match_results<BidiIterator, Allocator>& m);
+
+
+private:
+ vector_type m_subs; // subexpressions
+ BidiIterator m_base; // where the search started from
+ sub_match<BidiIterator> m_null; // a null match
+};
+
+template <class BidiIterator, class Allocator>
+void BOOST_REGEX_CALL match_results<BidiIterator, Allocator>::maybe_assign(const match_results<BidiIterator, Allocator>& m)
+{
+ const_iterator p1, p2;
+ p1 = begin();
+ p2 = m.begin();
+ BidiIterator base = (*this)[-1].first;
+ std::size_t len1 = 0;
+ std::size_t len2 = 0;
+ std::size_t base1 = 0;
+ std::size_t base2 = 0;
+ std::size_t i;
+ for(i = 0; i < size(); ++i)
+ {
+ //
+ // leftmost takes priority over longest:
+ base1 = boost::re_detail::distance(base, p1->first);
+ base2 = boost::re_detail::distance(base, p2->first);
+ if(base1 < base2) return;
+ if(base2 < base1) break;
+
+ len1 = boost::re_detail::distance((BidiIterator)p1->first, (BidiIterator)p1->second);
+ len2 = boost::re_detail::distance((BidiIterator)p2->first, (BidiIterator)p2->second);
+ if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
+ break;
+ if((p1->matched == true) && (p2->matched == false))
+ return;
+ ++p1;
+ ++p2;
+ }
+ if(i == size())
+ return;
+ if(base2 < base1)
+ *this = m;
+ else if((len2 > len1) || ((p1->matched == false) && (p2->matched == true)) )
+ *this = m;
+}
+
+template <class BidiIterator, class Allocator>
+void swap(match_results<BidiIterator, Allocator>& a, match_results<BidiIterator, Allocator>& b)
+{
+ a.swap(b);
+}
+
+#ifndef BOOST_NO_STD_LOCALE
+template <class charT, class traits, class BidiIterator, class Allocator>
+std::basic_ostream<charT, traits>&
+ operator << (std::basic_ostream<charT, traits>& os,
+ const match_results<BidiIterator, Allocator>& s)
+{
+ return (os << s.str());
+}
+#else
+template <class BidiIterator, class Allocator>
+std::ostream& operator << (std::ostream& os,
+ const match_results<BidiIterator, Allocator>& s)
+{
+ return (os << s.str());
+}
+#endif
+
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+ /*
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE mem_block_cache.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: memory block cache used by the non-recursive matcher.
+ */
+
+#ifndef BOOST_REGEX_V4_MEM_BLOCK_CACHE_HPP
+#define BOOST_REGEX_V4_MEM_BLOCK_CACHE_HPP
+
+#include <new>
+#include <boost/regex/v4/regex_synch.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+namespace re_detail{
+
+struct mem_block_node
+{
+ mem_block_node* next;
+};
+
+struct mem_block_cache
+{
+ // this member has to be statically initialsed:
+ mem_block_node* next;
+ unsigned cached_blocks;
+
+ ~mem_block_cache()
+ {
+ while(next)
+ {
+ mem_block_node* old = next;
+ next = next->next;
+ ::operator delete(old);
+ }
+ }
+ void* get()
+ {
+#ifdef BOOST_HAS_THREADS
+ re_detail::cs_guard g(*re_detail::p_re_lock);
+#endif
+ if(next)
+ {
+ mem_block_node* result = next;
+ next = next->next;
+ --cached_blocks;
+ return result;
+ }
+ return ::operator new(BOOST_REGEX_BLOCKSIZE);
+ }
+ void put(void* p)
+ {
+#ifdef BOOST_HAS_THREADS
+ re_detail::cs_guard g(*re_detail::p_re_lock);
+#endif
+ if(cached_blocks >= BOOST_REGEX_MAX_CACHE_BLOCKS)
+ {
+ ::operator delete(p);
+ }
+ else
+ {
+ mem_block_node* old = static_cast<mem_block_node*>(p);
+ old->next = next;
+ next = old;
+ ++cached_blocks;
+ }
+ }
+};
+
+extern mem_block_cache block_cache;
+
+}
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+#ifndef BOOST_REGEX_MATCHER_HPP
+#define BOOST_REGEX_MATCHER_HPP
+
+#include <boost/regex/v4/iterator_category.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+namespace re_detail{
+
+//
+// error checking API:
+//
+BOOST_REGEX_DECL void BOOST_REGEX_CALL verify_options(boost::regex::flag_type ef, match_flag_type mf);
+
+
+//
+// Unfortunately Rogue Waves standard library appears to have a bug
+// in std::basic_string::compare that results in eroneous answers
+// in some cases (tested with Borland C++ 5.1, Rogue Wave lib version
+// 0x020101) the test case was:
+// {39135,0} < {0xff,0}
+// which succeeds when it should not.
+//
+#ifndef _RWSTD_VER
+# define STR_COMP(s,p) s.compare(p)
+#else
+template <class C, class T, class A>
+inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
+{ return s.compare(p); }
+inline int string_compare(const std::string& s, const char* p)
+{ return std::strcmp(s.c_str(), p); }
+# ifndef BOOST_NO_WREGEX
+inline int string_compare(const std::wstring& s, const wchar_t* p)
+{ return std::wcscmp(s.c_str(), p); }
+#endif
+# define STR_COMP(s,p) string_compare(s,p)
+#endif
+
+template<class charT>
+inline const charT* re_skip_past_null(const charT* p)
+{
+ while (*p != 0) ++p;
+ return ++p;
+}
+
+template <class iterator, class charT, class traits_type, class Allocator>
+iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
+ iterator last,
+ const re_set_long* set_,
+ const reg_expression<charT, traits_type, Allocator>& e)
+{
+ const charT* p = reinterpret_cast<const charT*>(set_+1);
+ iterator ptr;
+ unsigned int i;
+ bool icase = e.flags() & regex_constants::icase;
+
+ if(next == last) return next;
+
+ typedef typename traits_type::string_type traits_string_type;
+ const traits_type& traits_inst = e.get_traits();
+
+ // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
+ // referenced
+ (void)traits_inst;
+
+ // try and match a single character, could be a multi-character
+ // collating element...
+ for(i = 0; i < set_->csingles; ++i)
+ {
+ ptr = next;
+ if(*p == 0)
+ {
+ // treat null string as special case:
+ if(traits_inst.translate(*ptr, icase) != *p)
+ {
+ while(*p == 0)++p;
+ continue;
+ }
+ return set_->isnot ? next : (ptr == next) ? ++next : ptr;
+ }
+ else
+ {
+ while(*p && (ptr != last))
+ {
+ if(traits_inst.translate(*ptr, icase) != *p)
+ break;
+ ++p;
+ ++ptr;
+ }
+
+ if(*p == 0) // if null we've matched
+ return set_->isnot ? next : (ptr == next) ? ++next : ptr;
+
+ p = re_skip_past_null(p); // skip null
+ }
+ }
+
+ charT col = traits_inst.translate(*next, icase);
+
+
+ if(set_->cranges || set_->cequivalents)
+ {
+ traits_string_type s2(1, col);
+ traits_string_type s1;
+ //
+ // try and match a range, NB only a single character can match
+ if(set_->cranges)
+ {
+ if((e.flags() & regex_constants::collate) == 0)
+ s1 = s2;
+ else
+ traits_inst.transform(s1, s2);
+ for(i = 0; i < set_->cranges; ++i)
+ {
+ if(STR_COMP(s1, p) <= 0)
+ {
+ while(*p)++p;
+ ++p;
+ if(STR_COMP(s1, p) >= 0)
+ return set_->isnot ? next : ++next;
+ }
+ else
+ {
+ // skip first string
+ while(*p)++p;
+ ++p;
+ }
+ // skip second string
+ while(*p)++p;
+ ++p;
+ }
+ }
+ //
+ // try and match an equivalence class, NB only a single character can match
+ if(set_->cequivalents)
+ {
+ traits_inst.transform_primary(s1, s2);
+ for(i = 0; i < set_->cequivalents; ++i)
+ {
+ if(STR_COMP(s1, p) == 0)
+ return set_->isnot ? next : ++next;
+ // skip string
+ while(*p)++p;
+ ++p;
+ }
+ }
+ }
+ if(traits_inst.is_class(col, set_->cclasses) == true)
+ return set_->isnot ? next : ++next;
+ return set_->isnot ? ++next : next;
+}
+
+template <class charT, class traits, class Allocator>
+struct access_t : public reg_expression<charT, traits, Allocator>
+{
+ typedef typename is_byte<charT>::width_type width_type;
+ typedef reg_expression<charT, traits, Allocator> base_type;
+ typedef charT char_type;
+ typedef traits traits_type;
+ typedef Allocator alloc_type;
+
+ static int repeat_count(const base_type& b)
+ { return base_type::repeat_count(b); }
+ static unsigned int restart_type(const base_type& b)
+ { return base_type::restart_type(b); }
+ static const re_syntax_base* first(const base_type& b)
+ { return base_type::first(b); }
+ static const unsigned char* get_map(const base_type& b)
+ { return base_type::get_map(b); }
+ static std::size_t leading_length(const base_type& b)
+ { return base_type::leading_length(b); }
+ static const kmp_info<charT>* get_kmp(const base_type& b)
+ { return base_type::get_kmp(b); }
+ static bool can_start(char_type c, const unsigned char* _map, unsigned char mask)
+ {
+ return reg_expression<char_type, traits_type, alloc_type>::can_start(c, _map, mask, width_type());
+ }
+};
+
+
+template <class BidiIterator>
+class repeater_count
+{
+ repeater_count** stack;
+ repeater_count* next;
+ int id;
+ unsigned count; // the number of iterations so far
+ BidiIterator start_pos; // where the last repeat started
+public:
+ repeater_count(repeater_count** s)
+ {
+ stack = s;
+ next = 0;
+ id = -1;
+ count = 0;
+ }
+ repeater_count(int i, repeater_count** s, BidiIterator start)
+ : start_pos(start)
+ {
+ id = i;
+ stack = s;
+ next = *stack;
+ *stack = this;
+ if(id > next->id)
+ count = 0;
+ else
+ {
+ repeater_count* p = next;
+ while(p->id != id)
+ p = p->next;
+ count = p->count;
+ start_pos = p->start_pos;
+ }
+ }
+ ~repeater_count()
+ {
+ *stack = next;
+ }
+ unsigned get_count() { return count; }
+ int get_id() { return id; }
+ int operator++() { return ++count; }
+ bool check_null_repeat(const BidiIterator& pos, unsigned max)
+ {
+ // this is called when we are about to start a new repeat,
+ // if the last one was NULL move our count to max,
+ // otherwise save the current position.
+ bool result = (count == 0) ? false : (pos == start_pos);
+ if(result)
+ count = max;
+ else
+ start_pos = pos;
+ return result;
+ }
+};
+
+struct saved_state;
+
+enum saved_state_type
+{
+ saved_type_end = 0,
+ saved_type_paren = 1,
+ saved_type_recurse = 2,
+ saved_type_assertion = 3,
+ saved_state_alt = 4,
+ saved_state_repeater_count = 5,
+ saved_state_extra_block = 6,
+ saved_state_greedy_single_repeat = 7,
+ saved_state_rep_slow_dot = 8,
+ saved_state_rep_fast_dot = 9,
+ saved_state_rep_char = 10,
+ saved_state_rep_short_set = 11,
+ saved_state_rep_long_set = 12,
+ saved_state_non_greedy_long_repeat = 13,
+ saved_state_count = 14
+};
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+class perl_matcher
+{
+public:
+ typedef typename traits::char_type char_type;
+ typedef perl_matcher<BidiIterator, Allocator, traits, Allocator2> self_type;
+ typedef bool (self_type::*matcher_proc_type)(void);
+ typedef access_t<char_type, traits, Allocator2> access;
+ typedef typename traits::size_type traits_size_type;
+ typedef typename traits::uchar_type traits_uchar_type;
+ typedef typename is_byte<char_type>::width_type width_type;
+ typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type;
+
+ perl_matcher(BidiIterator first, BidiIterator end,
+ match_results<BidiIterator, Allocator>& what,
+ const reg_expression<char_type, traits, Allocator2>& e,
+ match_flag_type f);
+
+ bool match();
+ bool match_imp();
+ bool find();
+ bool find_imp();
+#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
+ typedef bool (perl_matcher::*protected_proc_type)();
+ bool protected_call(protected_proc_type);
+#endif
+
+ void setf(match_flag_type f)
+ { m_match_flags |= f; }
+ void unsetf(match_flag_type f)
+ { m_match_flags &= ~f; }
+
+private:
+ void estimate_max_state_count(std::random_access_iterator_tag*);
+ void estimate_max_state_count(void*);
+ bool match_prefix();
+ bool match_all_states();
+
+ // match procs, stored in s_match_vtable:
+ bool match_startmark();
+ bool match_endmark();
+ bool match_literal();
+ bool match_start_line();
+ bool match_end_line();
+ bool match_wild();
+ bool match_match();
+ bool match_word_boundary();
+ bool match_within_word();
+ bool match_word_start();
+ bool match_word_end();
+ bool match_buffer_start();
+ bool match_buffer_end();
+ bool match_backref();
+ bool match_long_set();
+ bool match_set();
+ bool match_jump();
+ bool match_alt();
+ bool match_rep();
+ bool match_combining();
+ bool match_soft_buffer_end();
+ bool match_restart_continue();
+ bool match_long_set_repeat();
+ bool match_set_repeat();
+ bool match_char_repeat();
+ bool match_dot_repeat_fast();
+ bool match_dot_repeat_slow();
+ bool backtrack_till_match(unsigned count);
+
+ // find procs stored in s_find_vtable:
+ bool find_restart_any();
+ bool find_restart_word();
+ bool find_restart_line();
+ bool find_restart_buf();
+ bool find_restart_lit();
+
+private:
+ // final result structure to be filled in:
+ match_results<BidiIterator, Allocator>& m_result;
+ // temporary result for POSIX matches:
+ scoped_ptr<match_results<BidiIterator, Allocator> > m_temp_match;
+ // pointer to actual result structure to fill in:
+ match_results<BidiIterator, Allocator>* m_presult;
+ // start of sequence being searched:
+ BidiIterator base;
+ // end of sequence being searched:
+ BidiIterator last;
+ // current character being examined:
+ BidiIterator position;
+ // where to restart next search after failed match attempt:
+ BidiIterator restart;
+ // where the current search started from, acts as base for $` during grep:
+ BidiIterator search_base;
+ // the expression being examined:
+ const reg_expression<char_type, traits, Allocator2>& re;
+ // the expression's traits class:
+ const traits& traits_inst;
+ // the next state in the machine being matched:
+ const re_syntax_base* pstate;
+ // matching flags in use:
+ match_flag_type m_match_flags;
+ // how many states we have examined so far:
+ difference_type state_count;
+ // max number of states to examine before giving up:
+ difference_type max_state_count;
+ // whether we should ignore case or not:
+ bool icase;
+ // set to true when (position == last), indicates that we may have a partial match:
+ bool m_has_partial_match;
+ // set to true whenever we get a match:
+ bool m_has_found_match;
+ // the current repeat being examined:
+ repeater_count<BidiIterator>* next_count;
+ // the first repeat being examined (top of linked list):
+ repeater_count<BidiIterator> rep_obj;
+
+#ifdef BOOST_REGEX_NON_RECURSIVE
+ //
+ // additional members for non-recursive version:
+ //
+ typedef bool (self_type::*unwind_proc_type)(bool);
+
+ void extend_stack();
+ bool unwind(bool);
+ bool unwind_end(bool);
+ bool unwind_paren(bool);
+ bool unwind_recursion_stopper(bool);
+ bool unwind_assertion(bool);
+ bool unwind_alt(bool);
+ bool unwind_repeater_counter(bool);
+ bool unwind_extra_block(bool);
+ bool unwind_greedy_single_repeat(bool);
+ bool unwind_slow_dot_repeat(bool);
+ bool unwind_fast_dot_repeat(bool);
+ bool unwind_char_repeat(bool);
+ bool unwind_short_set_repeat(bool);
+ bool unwind_long_set_repeat(bool);
+ bool unwind_non_greedy_repeat(bool);
+ void destroy_single_repeat();
+ void push_matched_paren(int index, const sub_match<BidiIterator>& sub);
+ void push_recursion_stopper();
+ void push_assertion(const re_syntax_base* ps, bool positive);
+ void push_alt(const re_syntax_base* ps);
+ void push_repeater_count(int i, repeater_count<BidiIterator>** s);
+ void push_single_repeat(unsigned c, const re_repeat* r, BidiIterator last_position, int id);
+ void push_non_greedy_repeat(const re_syntax_base* ps);
+
+
+ // pointer to base of stack:
+ saved_state* m_stack_base;
+ // pointer to current stack position:
+ saved_state* m_backup_state;
+ // determines what value to return when unwinding from recursion,
+ // allows for mixed recursive/non-recursive algorithm:
+ bool m_recursive_result;
+ // how many memory blocks have we used up?:
+ unsigned used_block_count;
+#endif
+
+ // these operations aren't allowed, so are declared private:
+ perl_matcher& operator=(const perl_matcher&);
+ perl_matcher(const perl_matcher&);
+};
+
+} // namespace re_detail
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+//
+// include the implementation of perl_matcher:
+//
+#ifdef BOOST_REGEX_RECURSIVE
+#include <boost/regex/v4/perl_matcher_recursive.hpp>
+#else
+#include <boost/regex/v4/perl_matcher_non_recursive.hpp>
+#endif
+// this one has to be last:
+#include <boost/regex/v4/perl_matcher_common.hpp>
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE perl_matcher_common.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Definitions of perl_matcher member functions that are
+ * common to both the recursive and non-recursive versions.
+ */
+
+#ifndef BOOST_REGEX_V4_PERL_MATCHER_COMMON_HPP
+#define BOOST_REGEX_V4_PERL_MATCHER_COMMON_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+#ifdef __BORLANDC__
+# pragma option push -w-8008 -w-8066
+#endif
+
+namespace boost{
+namespace re_detail{
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+perl_matcher<BidiIterator, Allocator, traits, Allocator2>::perl_matcher(BidiIterator first, BidiIterator end,
+ match_results<BidiIterator, Allocator>& what,
+ const reg_expression<char_type, traits, Allocator2>& e,
+ match_flag_type f)
+ : m_result(what), base(first), last(end),
+ position(first), re(e), traits_inst(e.get_traits()),
+ next_count(&rep_obj), rep_obj(&next_count)
+{
+ typedef typename regex_iterator_traits<BidiIterator>::iterator_category category;
+
+ if(e.empty())
+ {
+ // precondition failure: e is not a valid regex.
+ std::invalid_argument ex("Invalid regular expression object");
+ boost::throw_exception(ex);
+ }
+ pstate = 0;
+ m_match_flags = f;
+ icase = re.flags() & regex_constants::icase;
+ estimate_max_state_count(static_cast<category*>(0));
+ if(!(m_match_flags & (match_perl|match_posix)))
+ {
+ if(re.flags() & regex_constants::perlex)
+ m_match_flags |= match_perl;
+ else
+ m_match_flags |= match_posix;
+ }
+ if(m_match_flags & match_posix)
+ {
+ m_temp_match.reset(new match_results<BidiIterator, Allocator>());
+ m_presult = m_temp_match.get();
+ }
+ else
+ m_presult = &m_result;
+#ifdef BOOST_REGEX_NON_RECURSIVE
+ m_stack_base = 0;
+ m_backup_state = 0;
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::estimate_max_state_count(std::random_access_iterator_tag*)
+{
+ difference_type dist = boost::re_detail::distance(base, last);
+ traits_size_type states = static_cast<traits_size_type>(re.size());
+ states *= states;
+ difference_type lim = std::numeric_limits<difference_type>::max() - 1000 - states;
+ if(dist > (difference_type)(lim / states))
+ max_state_count = lim;
+ else
+ max_state_count = 1000 + states * dist;
+}
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::estimate_max_state_count(void*)
+{
+ // we don't know how long the sequence is:
+ max_state_count = BOOST_REGEX_MAX_STATE_COUNT;
+}
+
+#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::protected_call(
+ protected_proc_type proc)
+{
+ __try{
+ return (this->*proc)();
+ }__except(EXCEPTION_STACK_OVERFLOW == GetExceptionCode())
+ {
+ reset_stack_guard_page();
+ }
+ // we only get here after a stack overflow:
+ raise_error<traits>(traits_inst, REG_E_MEMORY);
+ // and we never really get here at all:
+ return false;
+}
+#endif
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match()
+{
+#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
+ return protected_call(&perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_imp);
+#else
+ return match_imp();
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_imp()
+{
+ // initialise our stack if we are non-recursive:
+#ifdef BOOST_REGEX_NON_RECURSIVE
+ save_state_init init(&m_stack_base, &m_backup_state);
+ used_block_count = BOOST_REGEX_MAX_BLOCKS;
+#if !defined(BOOST_NO_EXCEPTIONS)
+ try{
+#endif
+#endif
+
+ // reset our state machine:
+ position = base;
+ search_base = base;
+ state_count = 0;
+ m_match_flags |= regex_constants::match_all;
+ m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last);
+ m_presult->set_base(base);
+ if(m_match_flags & match_posix)
+ m_result = *m_presult;
+ verify_options(re.flags(), m_match_flags);
+ if(0 == match_prefix())
+ return false;
+ return m_result[0].second == last;
+
+#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_NO_EXCEPTIONS)
+ }
+ catch(...)
+ {
+ // unwind all pushed states, apart from anything else this
+ // ensures that all the states are correctly destructed
+ // not just the memory freed.
+ while(unwind(true)){}
+ throw;
+ }
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find()
+{
+#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
+ return protected_call(&perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_imp);
+#else
+ return find_imp();
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_imp()
+{
+ static matcher_proc_type const s_find_vtable[7] =
+ {
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_any,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_word,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_line,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_buf,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_prefix,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_lit,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_lit,
+ };
+
+ // initialise our stack if we are non-recursive:
+#ifdef BOOST_REGEX_NON_RECURSIVE
+ save_state_init init(&m_stack_base, &m_backup_state);
+ used_block_count = BOOST_REGEX_MAX_BLOCKS;
+#if !defined(BOOST_NO_EXCEPTIONS)
+ try{
+#endif
+#endif
+
+ state_count = 0;
+ if((m_match_flags & regex_constants::match_init) == 0)
+ {
+ // reset our state machine:
+ position = base;
+ search_base = base;
+ pstate = access::first(re);
+ m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last);
+ m_presult->set_base(base);
+ m_match_flags |= regex_constants::match_init;
+ }
+ else
+ {
+ // start again:
+ search_base = position = (*m_presult)[0].second;
+ // If last match was null and match_not_null was not set then increment
+ // our start position, otherwise we go into an infinite loop:
+ if(((m_match_flags & match_not_null) == 0) && (m_presult->length() == 0))
+ {
+ if(position == last)
+ return false;
+ else
+ ++position;
+ }
+ // reset $` start:
+ m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
+ if(base != search_base)
+ m_match_flags |= match_prev_avail;
+ }
+ if(m_match_flags & match_posix)
+ {
+ m_result.set_size(re.mark_count(), base, last);
+ m_result.set_base(base);
+ }
+
+ verify_options(re.flags(), m_match_flags);
+ // find out what kind of expression we have:
+ unsigned type = (m_match_flags & match_continuous) ?
+ static_cast<unsigned int>(regbase::restart_continue)
+ : static_cast<unsigned int>(access::restart_type(re));
+
+ // call the appropriate search routine:
+ matcher_proc_type proc = s_find_vtable[type];
+ return (this->*proc)();
+
+#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_NO_EXCEPTIONS)
+ }
+ catch(...)
+ {
+ // unwind all pushed states, apart from anything else this
+ // ensures that all the states are correctly destructed
+ // not just the memory freed.
+ while(unwind(true)){}
+ throw;
+ }
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_prefix()
+{
+ m_has_partial_match = false;
+ m_has_found_match = false;
+ pstate = access::first(re);
+ m_presult->set_first(position);
+ restart = position;
+ match_all_states();
+ if(!m_has_found_match && m_has_partial_match && (m_match_flags & match_partial))
+ {
+ m_has_found_match = true;
+ m_presult->set_second(last, 0, false);
+ position = last;
+ }
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ if(m_has_found_match && (match_extra & m_match_flags))
+ {
+ //
+ // we have a match, reverse the capture information:
+ //
+ for(unsigned i = 0; i < m_presult->size(); ++i)
+ {
+ typename sub_match<BidiIterator>::capture_sequence_type & seq = ((*m_presult)[i]).get_captures();
+ std::reverse(seq.begin(), seq.end());
+ }
+ }
+#endif
+ if(!m_has_found_match)
+ position = restart; // reset search postion
+ return m_has_found_match;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_endmark()
+{
+ int index = static_cast<const re_brace*>(pstate)->index;
+ if(index > 0)
+ {
+ if((m_match_flags & match_nosubs) == 0)
+ m_presult->set_second(position, index);
+ }
+ else if(index < 0)
+ {
+ // matched forward lookahead:
+ pstate = 0;
+ return true;
+ }
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_literal()
+{
+ unsigned int len = static_cast<const re_literal*>(pstate)->length;
+ const char_type* what = reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1);
+ //
+ // compare string with what we stored in
+ // our records:
+ for(unsigned int i = 0; i < len; ++i, ++position)
+ {
+ if((position == last) || (traits_inst.translate(*position, icase) != what[i]))
+ return false;
+ }
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_start_line()
+{
+ if(position == base)
+ {
+ if((m_match_flags & match_prev_avail) == 0)
+ {
+ if((m_match_flags & match_not_bol) == 0)
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ return false;
+ }
+ }
+ else if(m_match_flags & match_single_line)
+ return false;
+
+ // check the previous value character:
+ BidiIterator t(position);
+ --t;
+ if(position != last)
+ {
+ if(traits_inst.is_separator(*t) && !((*t == '\r') && (*position == '\n')) )
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ }
+ else if(traits_inst.is_separator(*t))
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_end_line()
+{
+ if(position != last)
+ {
+ if(m_match_flags & match_single_line)
+ return false;
+ // we're not yet at the end so *first is always valid:
+ if(traits_inst.is_separator(*position))
+ {
+ if((position != base) || (m_match_flags & match_prev_avail))
+ {
+ // check that we're not in the middle of \r\n sequence
+ BidiIterator t(position);
+ --t;
+ if((*t == '\r') && (*position == '\n'))
+ {
+ return false;
+ }
+ }
+ pstate = pstate->next.p;
+ return true;
+ }
+ }
+ else if((m_match_flags & match_not_eol) == 0)
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_wild()
+{
+ if(position == last)
+ return false;
+ if(traits_inst.is_separator(*position) && (m_match_flags & match_not_dot_newline))
+ return false;
+ if((*position == char_type(0)) && (m_match_flags & match_not_dot_null))
+ return false;
+ pstate = pstate->next.p;
+ ++position;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_match()
+{
+ if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first))
+ return false;
+ if((m_match_flags & match_all) && (position != last))
+ return false;
+ if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base))
+ return false;
+ m_presult->set_second(position);
+ pstate = 0;
+ m_has_found_match = true;
+ if((m_match_flags & (match_posix|match_any)) == match_posix)
+ {
+ m_result.maybe_assign(*m_presult);
+ return false;
+ }
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ if(match_extra & m_match_flags)
+ {
+ for(unsigned i = 0; i < m_presult->size(); ++i)
+ if((*m_presult)[i].matched)
+ ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]);
+ }
+#endif
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_boundary()
+{
+ bool b; // indcates whether next character is a word character
+ if(position != last)
+ {
+ // prev and this character must be opposites:
+ #if defined(BOOST_REGEX_USE_C_LOCALE) && defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
+ b = traits::is_class(*position, traits::char_class_word);
+ #else
+ b = traits_inst.is_class(*position, traits::char_class_word);
+ #endif
+ }
+ else
+ {
+ b = (m_match_flags & match_not_eow) ? true : false;
+ }
+ if((position == base) && ((m_match_flags & match_prev_avail) == 0))
+ {
+ if(m_match_flags & match_not_bow)
+ b ^= true;
+ else
+ b ^= false;
+ }
+ else
+ {
+ --position;
+ b ^= traits_inst.is_class(*position, traits::char_class_word);
+ ++position;
+ }
+ if(b)
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ return false; // no match if we get to here...
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_within_word()
+{
+ if(position == last)
+ return false;
+ // both prev and this character must be traits::char_class_word:
+ if(traits_inst.is_class(*position, traits::char_class_word))
+ {
+ bool b;
+ if((position == base) && ((m_match_flags & match_prev_avail) == 0))
+ return false;
+ else
+ {
+ --position;
+ b = traits_inst.is_class(*position, traits::char_class_word);
+ ++position;
+ }
+ if(b)
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_start()
+{
+ if(position == last)
+ return false; // can't be starting a word if we're already at the end of input
+ if(!traits_inst.is_class(*position, traits::char_class_word))
+ return false; // next character isn't a word character
+ if((position == base) && ((m_match_flags & match_prev_avail) == 0))
+ {
+ if(m_match_flags & match_not_bow)
+ return false; // no previous input
+ }
+ else
+ {
+ // otherwise inside buffer:
+ BidiIterator t(position);
+ --t;
+ if(traits_inst.is_class(*t, traits::char_class_word))
+ return false; // previous character not non-word
+ }
+ // OK we have a match:
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_end()
+{
+ if((position == base) && ((m_match_flags & match_prev_avail) == 0))
+ return false; // start of buffer can't be end of word
+ BidiIterator t(position);
+ --t;
+ if(traits_inst.is_class(*t, traits::char_class_word) == false)
+ return false; // previous character wasn't a word character
+
+ if(position == last)
+ {
+ if(m_match_flags & match_not_eow)
+ return false; // end of buffer but not end of word
+ }
+ else
+ {
+ // otherwise inside buffer:
+ if(traits_inst.is_class(*position, traits::char_class_word))
+ return false; // next character is a word character
+ }
+ pstate = pstate->next.p;
+ return true; // if we fall through to here then we've succeeded
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_buffer_start()
+{
+ if((position != base) || (m_match_flags & match_not_bob))
+ return false;
+ // OK match:
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_buffer_end()
+{
+ if((position != last) || (m_match_flags & match_not_eob))
+ return false;
+ // OK match:
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_backref()
+{
+ // compare with what we previously matched:
+ BidiIterator i = (*m_presult)[static_cast<const re_brace*>(pstate)->index].first;
+ BidiIterator j = (*m_presult)[static_cast<const re_brace*>(pstate)->index].second;
+ while(i != j)
+ {
+ if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase)))
+ return false;
+ ++i;
+ ++position;
+ }
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set()
+{
+ // let the traits class do the work:
+ if(position == last)
+ return false;
+ BidiIterator t = re_is_set_member(position, last, static_cast<const re_set_long*>(pstate), re);
+ if(t != position)
+ {
+ pstate = pstate->next.p;
+ position = t;
+ return true;
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set()
+{
+ if(position == last)
+ return false;
+ if(static_cast<const re_set*>(pstate)->_map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ pstate = pstate->next.p;
+ ++position;
+ return true;
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_jump()
+{
+ pstate = static_cast<const re_jump*>(pstate)->alt.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_combining()
+{
+ if(position == last)
+ return false;
+ if(traits_inst.is_combining(traits_inst.translate(*position, icase)))
+ return false;
+ ++position;
+ while((position != last) && traits_inst.is_combining(traits_inst.translate(*position, icase)))
+ ++position;
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_soft_buffer_end()
+{
+ if(m_match_flags & match_not_eob)
+ return false;
+ BidiIterator p(position);
+ while((p != last) && traits_inst.is_separator(traits_inst.translate(*p, icase)))++p;
+ if(p != last)
+ return false;
+ pstate = pstate->next.p;
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_restart_continue()
+{
+ if(position == search_base)
+ {
+ pstate = pstate->next.p;
+ return true;
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_any()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+ const unsigned char* _map = access::get_map(re);
+ while(true)
+ {
+ // skip everything we can't match:
+ while((position != last) && !access::can_start(*position, _map, (unsigned char)mask_any) )
+ ++position;
+ if(position == last)
+ {
+ // run out of characters, try a null match if possible:
+ if(access::first(re)->can_be_null)
+ return match_prefix();
+ break;
+ }
+ // now try and obtain a match:
+ if(match_prefix())
+ return true;
+ if(position == last)
+ return false;
+ ++position;
+ }
+ return false;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_word()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+ // do search optimised for word starts:
+ const unsigned char* _map = access::get_map(re);
+ if((m_match_flags & match_prev_avail) || (position != base))
+ --position;
+ else if(match_prefix())
+ return true;
+ do
+ {
+ while((position != last) && traits_inst.is_class(*position, traits::char_class_word))
+ ++position;
+ while((position != last) && !traits_inst.is_class(*position, traits::char_class_word))
+ ++position;
+ if(position == last)
+ break;
+
+ if(access::can_start(*position, _map, (unsigned char)mask_any) )
+ {
+ if(match_prefix())
+ return true;
+ }
+ if(position == last)
+ break;
+ } while(true);
+ return false;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_line()
+{
+ // do search optimised for line starts:
+ const unsigned char* _map = access::get_map(re);
+ if(match_prefix())
+ return true;
+ while(position != last)
+ {
+ while((position != last) && (*position != '\n'))
+ ++position;
+ if(position == last)
+ return false;
+ ++position;
+ if(position == last)
+ {
+ if((access::first(re)->can_be_null) && match_prefix())
+ return true;
+ return false;
+ }
+
+ if( access::can_start(*position, _map, (unsigned char)mask_any) )
+ {
+ if(match_prefix())
+ return true;
+ }
+ if(position == last)
+ return false;
+ //++position;
+ }
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_buf()
+{
+ if((position == base) && ((m_match_flags & match_not_bob) == 0))
+ return match_prefix();
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::find_restart_lit()
+{
+ if(position == last)
+ return false; // can't possibly match if we're at the end already
+
+ unsigned type = (m_match_flags & match_continuous) ?
+ static_cast<unsigned int>(regbase::restart_continue)
+ : static_cast<unsigned int>(access::restart_type(re));
+
+ const kmp_info<char_type>* info = access::get_kmp(re);
+ int len = info->len;
+ const char_type* x = info->pstr;
+ int j = 0;
+ while (position != last)
+ {
+ while((j > -1) && (x[j] != traits_inst.translate(*position, icase)))
+ j = info->kmp_next[j];
+ ++position;
+ ++j;
+ if(j >= len)
+ {
+ if(type == regbase::restart_fixed_lit)
+ {
+ std::advance(position, -j);
+ restart = position;
+ std::advance(restart, len);
+ m_result.set_first(position);
+ m_result.set_second(restart);
+ position = restart;
+ return true;
+ }
+ else
+ {
+ restart = position;
+ std::advance(position, -j);
+ if(match_prefix())
+ return true;
+ else
+ {
+ for(int k = 0; (restart != position) && (k < j); ++k, --restart)
+ {} // dwa 10/20/2000 - warning suppression for MWCW
+ if(restart != last)
+ ++restart;
+ position = restart;
+ j = 0; //we could do better than this...
+ }
+ }
+ }
+ }
+ if((m_match_flags & match_partial) && (position == last) && j)
+ {
+ // we need to check for a partial match:
+ restart = position;
+ std::advance(position, -j);
+ return match_prefix();
+ }
+ return false;
+}
+
+} // namespace re_detail
+
+} // namespace boost
+
+#ifdef __BORLANDC__
+# pragma option pop
+#endif
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE perl_matcher_common.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Definitions of perl_matcher member functions that are
+ * specific to the non-recursive implementation.
+ */
+
+#ifndef BOOST_REGEX_V4_PERL_MATCHER_NON_RECURSIVE_HPP
+#define BOOST_REGEX_V4_PERL_MATCHER_NON_RECURSIVE_HPP
+
+#include <new>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+namespace re_detail{
+
+template <class T>
+inline void inplace_destroy(T* p)
+{
+ (void)p; // warning suppression
+ p->~T();
+}
+
+struct saved_state
+{
+ unsigned int id;
+ saved_state(unsigned i) : id(i) {}
+};
+
+template <class BidiIterator>
+struct saved_matched_paren : public saved_state
+{
+ int index;
+ sub_match<BidiIterator> sub;
+ saved_matched_paren(int i, const sub_match<BidiIterator>& s) : saved_state(1), index(i), sub(s){};
+};
+
+template <class BidiIterator>
+struct saved_position : public saved_state
+{
+ const re_syntax_base* pstate;
+ BidiIterator position;
+ saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){};
+};
+
+template <class BidiIterator>
+struct saved_assertion : public saved_position<BidiIterator>
+{
+ bool positive;
+ saved_assertion(bool p, const re_syntax_base* ps, BidiIterator pos)
+ : saved_position<BidiIterator>(ps, pos, saved_type_assertion), positive(p){};
+};
+
+template <class BidiIterator>
+struct saved_repeater : public saved_state
+{
+ repeater_count<BidiIterator> count;
+ saved_repeater(int i, repeater_count<BidiIterator>** s, BidiIterator start)
+ : saved_state(saved_state_repeater_count), count(i,s,start){}
+};
+
+struct saved_extra_block : public saved_state
+{
+ saved_state *base, *end;
+ saved_extra_block(saved_state* b, saved_state* e)
+ : saved_state(saved_state_extra_block), base(b), end(e) {}
+};
+
+struct save_state_init
+{
+ saved_state** stack;
+ save_state_init(saved_state** base, saved_state** end)
+ : stack(base)
+ {
+ *base = static_cast<saved_state*>(get_mem_block());
+ *end = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(*base)+BOOST_REGEX_BLOCKSIZE);
+ --(*end);
+ (void) new (*end)saved_state(0);
+ assert(*end > *base);
+ }
+ ~save_state_init()
+ {
+ put_mem_block(*stack);
+ *stack = 0;
+ }
+};
+
+template <class BidiIterator>
+struct saved_single_repeat : public saved_state
+{
+ unsigned count;
+ const re_repeat* rep;
+ BidiIterator last_position;
+ saved_single_repeat(unsigned c, const re_repeat* r, BidiIterator lp, int arg_id)
+ : saved_state(arg_id), count(c), rep(r), last_position(lp){}
+};
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_all_states()
+{
+ static matcher_proc_type const s_match_vtable[26] =
+ {
+ (&perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_startmark),
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_endmark,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_literal,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_start_line,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_end_line,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_wild,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_match,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_boundary,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_within_word,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_start,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_buffer_start,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_buffer_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_backref,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_jump,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_alt,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_rep,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_combining,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_soft_buffer_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_restart_continue,
+ (::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_slow),
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_repeat,
+ };
+
+ push_recursion_stopper();
+ do{
+ while(pstate)
+ {
+ matcher_proc_type proc = s_match_vtable[pstate->type];
+ ++state_count;
+ if(!(this->*proc)())
+ {
+ if(state_count > max_state_count)
+ raise_error(traits_inst, REG_ESPACE);
+ if((m_match_flags & match_partial) && (position == last))
+ m_has_partial_match = true;
+ if(false == unwind(false))
+ return m_recursive_result;
+ }
+ }
+ }while(unwind(true));
+ return m_recursive_result;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::extend_stack()
+{
+ if(used_block_count)
+ {
+ --used_block_count;
+ saved_state* stack_base;
+ saved_state* backup_state;
+ stack_base = static_cast<saved_state*>(get_mem_block());
+ backup_state = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(stack_base)+BOOST_REGEX_BLOCKSIZE);
+ saved_extra_block* block = static_cast<saved_extra_block*>(backup_state);
+ --block;
+ (void) new (block) saved_extra_block(m_stack_base, m_backup_state);
+ m_stack_base = stack_base;
+ m_backup_state = block;
+ }
+ else
+ raise_error(traits_inst, REG_E_MEMORY);
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_matched_paren(int index, const sub_match<BidiIterator>& sub)
+{
+ assert(index);
+ saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
+ --pmp;
+ }
+ (void) new (pmp)saved_matched_paren<BidiIterator>(index, sub);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_recursion_stopper()
+{
+ saved_state* pmp = m_backup_state;
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = m_backup_state;
+ --pmp;
+ }
+ (void) new (pmp)saved_state(saved_type_recurse);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_assertion(const re_syntax_base* ps, bool positive)
+{
+ saved_assertion<BidiIterator>* pmp = static_cast<saved_assertion<BidiIterator>*>(m_backup_state);
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = static_cast<saved_assertion<BidiIterator>*>(m_backup_state);
+ --pmp;
+ }
+ (void) new (pmp)saved_assertion<BidiIterator>(positive, ps, position);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_alt(const re_syntax_base* ps)
+{
+ saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+ --pmp;
+ }
+ (void) new (pmp)saved_position<BidiIterator>(ps, position, saved_state_alt);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_non_greedy_repeat(const re_syntax_base* ps)
+{
+ saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+ --pmp;
+ }
+ (void) new (pmp)saved_position<BidiIterator>(ps, position, saved_state_non_greedy_long_repeat);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_repeater_count(int i, repeater_count<BidiIterator>** s)
+{
+ saved_repeater<BidiIterator>* pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
+ --pmp;
+ }
+ (void) new (pmp)saved_repeater<BidiIterator>(i, s, position);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::push_single_repeat(unsigned c, const re_repeat* r, BidiIterator last_position, int id)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+ --pmp;
+ if(pmp < m_stack_base)
+ {
+ extend_stack();
+ pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+ --pmp;
+ }
+ (void) new (pmp)saved_single_repeat<BidiIterator>(c, r, last_position, id);
+ m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_startmark()
+{
+ int index = static_cast<const re_brace*>(pstate)->index;
+ switch(index)
+ {
+ case 0:
+ pstate = pstate->next.p;
+ break;
+ case -1:
+ case -2:
+ {
+ // forward lookahead assert:
+ const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
+ pstate = pstate->next.p->next.p;
+ push_assertion(next_pstate, index == -1);
+ break;
+ }
+ case -3:
+ {
+ // independent sub-expression, currently this is always recursive:
+ const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
+ pstate = pstate->next.p->next.p;
+ bool r = match_all_states();
+ pstate = next_pstate;
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ if(r && (m_match_flags & match_extra))
+ {
+ //
+ // our captures have been stored in *m_presult
+ // we need to unpack them, and insert them
+ // back in the right order when we unwind the stack:
+ //
+ match_results<BidiIterator, Allocator> temp_match(*m_presult);
+ unsigned i;
+ for(i = 0; i < temp_match.size(); ++i)
+ (*m_presult)[i].get_captures().clear();
+ // match everything else:
+ r = match_all_states();
+ // now place the stored captures back:
+ for(i = 0; i < temp_match.size(); ++i)
+ {
+ typedef typename sub_match<BidiIterator>::capture_sequence_type seq;
+ seq& s1 = (*m_presult)[i].get_captures();
+ const seq& s2 = temp_match[i].captures();
+ s1.insert(
+ s1.end(),
+ s2.begin(),
+ s2.end());
+ }
+ }
+#endif
+ return r;
+ }
+ default:
+ {
+ assert(index > 0);
+ if((m_match_flags & match_nosubs) == 0)
+ {
+ push_matched_paren(index, (*m_presult)[index]);
+ m_presult->set_first(position, index);
+ }
+ pstate = pstate->next.p;
+ break;
+ }
+ }
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_alt()
+{
+ bool take_first, take_second;
+ const re_jump* jmp = static_cast<const re_jump*>(pstate);
+
+ // find out which of these two alternatives we need to take:
+ if(position == last)
+ {
+ take_first = jmp->can_be_null & mask_take;
+ take_second = jmp->can_be_null & mask_skip;
+ }
+ else
+ {
+ take_first = access::can_start(*position, jmp->_map, (unsigned char)mask_take);
+ take_second = access::can_start(*position, jmp->_map, (unsigned char)mask_skip);
+ }
+
+ if(take_first)
+ {
+ // we can take the first alternative,
+ // see if we need to push next alternative:
+ if(take_second)
+ {
+ push_alt(jmp->alt.p);
+ }
+ pstate = pstate->next.p;
+ return true;
+ }
+ if(take_second)
+ {
+ pstate = jmp->alt.p;
+ return true;
+ }
+ return false; // neither option is possible
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_rep()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127 4244)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+
+ // find out which of these two alternatives we need to take:
+ bool take_first, take_second;
+ if(position == last)
+ {
+ take_first = rep->can_be_null & mask_take;
+ take_second = rep->can_be_null & mask_skip;
+ }
+ else
+ {
+ take_first = access::can_start(*position, rep->_map, (unsigned char)mask_take);
+ take_second = access::can_start(*position, rep->_map, (unsigned char)mask_skip);
+ }
+
+ if(take_first || (next_count->get_id() != rep->id))
+ {
+ // we're moving to a different repeat from the last
+ // one, so set up a counter object:
+ push_repeater_count(rep->id, &next_count);
+ }
+ //
+ // If we've had at least one repeat already, and the last one
+ // matched the NULL string then set the repeat count to
+ // maximum:
+ //
+ next_count->check_null_repeat(position, rep->max);
+
+ if(next_count->get_count() < rep->min)
+ {
+ // we must take the repeat:
+ if(take_first)
+ {
+ // increase the counter:
+ ++(*next_count);
+ pstate = rep->next.p;
+ return true;
+ }
+ return false;
+ }
+
+ if(rep->greedy)
+ {
+ // try and take the repeat if we can:
+ if((next_count->get_count() < rep->max) && take_first)
+ {
+ if(take_second)
+ {
+ // store position in case we fail:
+ push_alt(rep->alt.p);
+ }
+ // increase the counter:
+ ++(*next_count);
+ pstate = rep->next.p;
+ return true;
+ }
+ else if(take_second)
+ {
+ pstate = rep->alt.p;
+ return true;
+ }
+ return false; // can't take anything, fail...
+ }
+ else // non-greedy
+ {
+ // try and skip the repeat if we can:
+ if(take_second)
+ {
+ // store position in case we fail:
+ push_non_greedy_repeat(rep->next.p);
+ pstate = rep->alt.p;
+ return true;
+ }
+ if((next_count->get_count() < rep->max) && take_first)
+ {
+ // increase the counter:
+ ++(*next_count);
+ pstate = rep->next.p;
+ return true;
+ }
+ }
+ return false;
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_slow()
+{
+ unsigned count = 0;
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ re_syntax_base* psingle = rep->next.p;
+ // match compulsary repeats first:
+ while(count < rep->min)
+ {
+ pstate = psingle;
+ if(!match_wild())
+ return false;
+ ++count;
+ }
+ if(rep->greedy)
+ {
+ // repeat for as long as we can:
+ while(count < rep->max)
+ {
+ pstate = psingle;
+ if(!match_wild())
+ break;
+ ++count;
+ }
+ // remember where we got to if this is a leading repeat:
+ if((rep->leading) && (count < rep->max))
+ restart = position;
+ // push backtrack info if available:
+ if(count - rep->min)
+ push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
+ // jump to next state:
+ pstate = rep->alt.p;
+ return true;
+ }
+ else
+ {
+ // non-greedy, push state and return true if we can skip:
+ if(count < rep->max)
+ push_single_repeat(count, rep, position, saved_state_rep_slow_dot);
+ pstate = rep->alt.p;
+ return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
+ }
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_fast()
+{
+ if(m_match_flags & (match_not_dot_newline | match_not_dot_null))
+ return match_dot_repeat_slow();
+
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ unsigned count = std::min(static_cast<unsigned>(re_detail::distance(position, last)), static_cast<unsigned>(rep->greedy ? rep->max : rep->min));
+ if(rep->min > count)
+ return false; // not enough text left to match
+ std::advance(position, count);
+
+ if(rep->greedy)
+ {
+ if((rep->leading) && (count < rep->max))
+ restart = position;
+ // push backtrack info if available:
+ if(count - rep->min)
+ push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
+ // jump to next state:
+ pstate = rep->alt.p;
+ return true;
+ }
+ else
+ {
+ // non-greedy, push state and return true if we can skip:
+ if(count < rep->max)
+ push_single_repeat(count, rep, position, saved_state_rep_fast_dot);
+ pstate = rep->alt.p;
+ return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
+ }
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repeat()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ assert(1 == static_cast<const re_literal*>(rep->next.p)->length);
+ const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(rep->next.p) + 1);
+ unsigned count = 0;
+ //
+ // start by working out how much we can skip:
+ //
+ unsigned desired = rep->greedy ? rep->max : rep->min;
+ if(::boost::is_random_access_iterator<BidiIterator>::value)
+ {
+ BidiIterator end = position;
+ std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ BidiIterator origin(position);
+ while((position != end) && (traits_inst.translate(*position, icase) == what))
+ {
+ ++position;
+ }
+ count = (unsigned)re_detail::distance(origin, position);
+ }
+ else
+ {
+ while((count < desired) && (position != last) && (traits_inst.translate(*position, icase) == what))
+ {
+ ++position;
+ ++count;
+ }
+ }
+
+ if(count < rep->min)
+ return false;
+
+ if(rep->greedy)
+ {
+ if((rep->leading) && (count < rep->max))
+ restart = position;
+ // push backtrack info if available:
+ if(count - rep->min)
+ push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
+ // jump to next state:
+ pstate = rep->alt.p;
+ return true;
+ }
+ else
+ {
+ // non-greedy, push state and return true if we can skip:
+ if(count < rep->max)
+ push_single_repeat(count, rep, position, saved_state_rep_char);
+ pstate = rep->alt.p;
+ return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
+ }
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
+ unsigned count = 0;
+ //
+ // start by working out how much we can skip:
+ //
+ unsigned desired = rep->greedy ? rep->max : rep->min;
+ if(::boost::is_random_access_iterator<BidiIterator>::value)
+ {
+ BidiIterator end = position;
+ std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ BidiIterator origin(position);
+ while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ ++position;
+ }
+ count = (unsigned)re_detail::distance(origin, position);
+ }
+ else
+ {
+ while((count < desired) && (position != last) && map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ ++position;
+ ++count;
+ }
+ }
+
+ if(count < rep->min)
+ return false;
+
+ if(rep->greedy)
+ {
+ if((rep->leading) && (count < rep->max))
+ restart = position;
+ // push backtrack info if available:
+ if(count - rep->min)
+ push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
+ // jump to next state:
+ pstate = rep->alt.p;
+ return true;
+ }
+ else
+ {
+ // non-greedy, push state and return true if we can skip:
+ if(count < rep->max)
+ push_single_repeat(count, rep, position, saved_state_rep_short_set);
+ pstate = rep->alt.p;
+ return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
+ }
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_repeat()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ const re_set_long* set = static_cast<const re_set_long*>(pstate->next.p);
+ unsigned count = 0;
+ //
+ // start by working out how much we can skip:
+ //
+ unsigned desired = rep->greedy ? rep->max : rep->min;
+ if(::boost::is_random_access_iterator<BidiIterator>::value)
+ {
+ BidiIterator end = position;
+ std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ BidiIterator origin(position);
+ while((position != end) && (position != re_is_set_member(position, last, set, re)))
+ {
+ ++position;
+ }
+ count = (unsigned)re_detail::distance(origin, position);
+ }
+ else
+ {
+ while((count < desired) && (position != last) && (position != re_is_set_member(position, last, set, re)))
+ {
+ ++position;
+ ++count;
+ }
+ }
+
+ if(count < rep->min)
+ return false;
+
+ if(rep->greedy)
+ {
+ if((rep->leading) && (count < rep->max))
+ restart = position;
+ // push backtrack info if available:
+ if(count - rep->min)
+ push_single_repeat(count, rep, position, saved_state_greedy_single_repeat);
+ // jump to next state:
+ pstate = rep->alt.p;
+ return true;
+ }
+ else
+ {
+ // non-greedy, push state and return true if we can skip:
+ if(count < rep->max)
+ push_single_repeat(count, rep, position, saved_state_rep_long_set);
+ pstate = rep->alt.p;
+ return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip);
+ }
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+/****************************************************************************
+
+Unwind and associated proceedures follow, these perform what normal stack
+unwinding does in the recursive implementation.
+
+****************************************************************************/
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind(bool have_match)
+{
+ static unwind_proc_type const s_unwind_table[14] =
+ {
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_paren,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_recursion_stopper,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_assertion,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_alt,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_repeater_counter,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_extra_block,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_greedy_single_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_slow_dot_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_fast_dot_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_char_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_short_set_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_long_set_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_non_greedy_repeat,
+ };
+
+ m_recursive_result = have_match;
+ unwind_proc_type unwinder;
+ bool cont;
+ //
+ // keep unwinding our stack until we have something to do:
+ //
+ do
+ {
+ unwinder = s_unwind_table[m_backup_state->id];
+ cont = (this->*unwinder)(m_recursive_result);
+ }while(cont);
+ //
+ // return true if we have more states to try:
+ //
+ return pstate ? true : false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_end(bool)
+{
+ pstate = 0; // nothing left to search
+ return false; // end of stack nothing more to search
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_paren(bool have_match)
+{
+ saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
+ // restore previous values if no match was found:
+ if(have_match == false)
+ {
+ m_presult->set_first(pmp->sub.first, pmp->index);
+ m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched);
+ }
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ //
+ // we have a match, push the capture information onto the stack:
+ //
+ else if(pmp->sub.matched && (match_extra & m_match_flags))
+ ((*m_presult)[pmp->index]).get_captures().push_back(pmp->sub);
+#endif
+ // unwind stack:
+ m_backup_state = pmp+1;
+ boost::re_detail::inplace_destroy(pmp);
+ return true; // keep looking
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_recursion_stopper(bool)
+{
+ boost::re_detail::inplace_destroy(m_backup_state++);
+ pstate = 0; // nothing left to search
+ return false; // end of stack nothing more to search
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_assertion(bool r)
+{
+ saved_assertion<BidiIterator>* pmp = static_cast<saved_assertion<BidiIterator>*>(m_backup_state);
+ pstate = pmp->pstate;
+ position = pmp->position;
+ bool result = (r == pmp->positive);
+ m_recursive_result = pmp->positive ? r : !r;
+ boost::re_detail::inplace_destroy(pmp++);
+ m_backup_state = pmp;
+ return !result; // return false if the assertion was matched to stop search.
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_alt(bool r)
+{
+ saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+ if(!r)
+ {
+ pstate = pmp->pstate;
+ position = pmp->position;
+ }
+ boost::re_detail::inplace_destroy(pmp++);
+ m_backup_state = pmp;
+ return r;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_repeater_counter(bool)
+{
+ saved_repeater<BidiIterator>* pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
+ boost::re_detail::inplace_destroy(pmp++);
+ m_backup_state = pmp;
+ return true; // keep looking
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_extra_block(bool)
+{
+ saved_extra_block* pmp = static_cast<saved_extra_block*>(m_backup_state);
+ void* condemmed = m_stack_base;
+ m_stack_base = pmp->base;
+ m_backup_state = pmp->end;
+ boost::re_detail::inplace_destroy(pmp);
+ put_mem_block(condemmed);
+ return true; // keep looking
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+inline void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::destroy_single_repeat()
+{
+ saved_single_repeat<BidiIterator>* p = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+ boost::re_detail::inplace_destroy(p++);
+ m_backup_state = p;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_greedy_single_repeat(bool r)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+
+ // if we have a match, just discard this state:
+ if(r)
+ {
+ destroy_single_repeat();
+ return true;
+ }
+
+ const re_repeat* rep = pmp->rep;
+ unsigned count = pmp->count;
+ assert(rep->next.p);
+ assert(rep->alt.p);
+
+ count -= rep->min;
+
+ if((m_match_flags & match_partial) && (position == last))
+ m_has_partial_match = true;
+
+ assert(count);
+ position = pmp->last_position;
+
+ // backtrack till we can skip out:
+ do
+ {
+ --position;
+ --count;
+ ++state_count;
+ }while(count && !access::can_start(*position, rep->_map, mask_skip));
+
+ // if we've hit base, destroy this state:
+ if(count == 0)
+ {
+ destroy_single_repeat();
+ if(!access::can_start(*position, rep->_map, mask_skip))
+ return true;
+ }
+ else
+ {
+ pmp->count = count + rep->min;
+ pmp->last_position = position;
+ }
+ pstate = rep->alt.p;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_slow_dot_repeat(bool r)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+
+ // if we have a match, just discard this state:
+ if(r)
+ {
+ destroy_single_repeat();
+ return true;
+ }
+
+ const re_repeat* rep = pmp->rep;
+ unsigned count = pmp->count;
+ assert(rep->type == syntax_element_dot_rep);
+ assert(rep->next.p);
+ assert(rep->alt.p);
+ assert(rep->next.p->type == syntax_element_wild);
+
+ assert(count < rep->max);
+ pstate = rep->next.p;
+ position = pmp->last_position;
+
+ if(position != last)
+ {
+ // wind forward until we can skip out of the repeat:
+ do
+ {
+ if(!match_wild())
+ {
+ // failed repeat match, discard this state and look for another:
+ destroy_single_repeat();
+ return true;
+ }
+ ++count;
+ ++state_count;
+ pstate = rep->next.p;
+ }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip));
+ }
+ if(position == last)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(0 == (rep->can_be_null & mask_skip))
+ return true;
+ }
+ else if(count == rep->max)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(!access::can_start(*position, rep->_map, mask_skip))
+ return true;
+ }
+ else
+ {
+ pmp->count = count;
+ pmp->last_position = position;
+ }
+ pstate = rep->alt.p;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_fast_dot_repeat(bool r)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+
+ // if we have a match, just discard this state:
+ if(r)
+ {
+ destroy_single_repeat();
+ return true;
+ }
+
+ const re_repeat* rep = pmp->rep;
+ unsigned count = pmp->count;
+
+ assert(count < rep->max);
+ position = pmp->last_position;
+ if(position != last)
+ {
+
+ // wind forward until we can skip out of the repeat:
+ do
+ {
+ ++position;
+ ++count;
+ ++state_count;
+ }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip));
+ }
+
+ if(position == last)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(0 == (rep->can_be_null & mask_skip))
+ return true;
+ }
+ else if(count == rep->max)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(!access::can_start(*position, rep->_map, mask_skip))
+ return true;
+ }
+ else
+ {
+ pmp->count = count;
+ pmp->last_position = position;
+ }
+ pstate = rep->alt.p;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_char_repeat(bool r)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+
+ // if we have a match, just discard this state:
+ if(r)
+ {
+ destroy_single_repeat();
+ return true;
+ }
+
+ const re_repeat* rep = pmp->rep;
+ unsigned count = pmp->count;
+ pstate = rep->next.p;
+ const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(pstate) + 1);
+ position = pmp->last_position;
+
+ assert(rep->type == syntax_element_char_rep);
+ assert(rep->next.p);
+ assert(rep->alt.p);
+ assert(rep->next.p->type == syntax_element_literal);
+ assert(count < rep->max);
+
+ if(position != last)
+ {
+ // wind forward until we can skip out of the repeat:
+ do
+ {
+ if(traits_inst.translate(*position, icase) != what)
+ {
+ // failed repeat match, discard this state and look for another:
+ destroy_single_repeat();
+ return true;
+ }
+ ++count;
+ ++ position;
+ ++state_count;
+ pstate = rep->next.p;
+ }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip));
+ }
+ if(position == last)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(0 == (rep->can_be_null & mask_skip))
+ return true;
+ }
+ else if(count == rep->max)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(!access::can_start(*position, rep->_map, mask_skip))
+ return true;
+ }
+ else
+ {
+ pmp->count = count;
+ pmp->last_position = position;
+ }
+ pstate = rep->alt.p;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_short_set_repeat(bool r)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+
+ // if we have a match, just discard this state:
+ if(r)
+ {
+ destroy_single_repeat();
+ return true;
+ }
+
+ const re_repeat* rep = pmp->rep;
+ unsigned count = pmp->count;
+ pstate = rep->next.p;
+ const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
+ position = pmp->last_position;
+
+ assert(rep->type == syntax_element_short_set_rep);
+ assert(rep->next.p);
+ assert(rep->alt.p);
+ assert(rep->next.p->type == syntax_element_set);
+ assert(count < rep->max);
+
+ if(position != last)
+ {
+ // wind forward until we can skip out of the repeat:
+ do
+ {
+ if(!map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ // failed repeat match, discard this state and look for another:
+ destroy_single_repeat();
+ return true;
+ }
+ ++count;
+ ++ position;
+ ++state_count;
+ pstate = rep->next.p;
+ }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip));
+ }
+ if(position == last)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(0 == (rep->can_be_null & mask_skip))
+ return true;
+ }
+ else if(count == rep->max)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(!access::can_start(*position, rep->_map, mask_skip))
+ return true;
+ }
+ else
+ {
+ pmp->count = count;
+ pmp->last_position = position;
+ }
+ pstate = rep->alt.p;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_long_set_repeat(bool r)
+{
+ saved_single_repeat<BidiIterator>* pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
+
+ // if we have a match, just discard this state:
+ if(r)
+ {
+ destroy_single_repeat();
+ return true;
+ }
+
+ const re_repeat* rep = pmp->rep;
+ unsigned count = pmp->count;
+ pstate = rep->next.p;
+ const re_set_long* set = static_cast<const re_set_long*>(pstate);
+ position = pmp->last_position;
+
+ assert(rep->type == syntax_element_long_set_rep);
+ assert(rep->next.p);
+ assert(rep->alt.p);
+ assert(rep->next.p->type == syntax_element_long_set);
+ assert(position != last);
+ assert(count < rep->max);
+
+ if(position != last)
+ {
+ // wind forward until we can skip out of the repeat:
+ do
+ {
+ if(position == re_is_set_member(position, last, set, re))
+ {
+ // failed repeat match, discard this state and look for another:
+ destroy_single_repeat();
+ return true;
+ }
+ ++position;
+ ++count;
+ ++state_count;
+ pstate = rep->next.p;
+ }while((count < rep->max) && (position != last) && !access::can_start(*position, rep->_map, mask_skip));
+ }
+ if(position == last)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(0 == (rep->can_be_null & mask_skip))
+ return true;
+ }
+ else if(count == rep->max)
+ {
+ // can't repeat any more, remove the pushed state:
+ destroy_single_repeat();
+ if(!access::can_start(*position, rep->_map, mask_skip))
+ return true;
+ }
+ else
+ {
+ pmp->count = count;
+ pmp->last_position = position;
+ }
+ pstate = rep->alt.p;
+ return false;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::unwind_non_greedy_repeat(bool r)
+{
+ saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+ if(!r)
+ {
+ position = pmp->position;
+ pstate = pmp->pstate;
+ ++(*next_count);
+ }
+ boost::re_detail::inplace_destroy(pmp++);
+ m_backup_state = pmp;
+ return r;
+}
+
+} // namespace re_detail
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE perl_matcher_common.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Definitions of perl_matcher member functions that are
+ * specific to the recursive implementation.
+ */
+
+#ifndef BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP
+#define BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+namespace re_detail{
+
+template <class BidiIterator>
+class backup_subex
+{
+ int index;
+ sub_match<BidiIterator> sub;
+public:
+ template <class A>
+ backup_subex(const match_results<BidiIterator, A>& w, int i)
+ : index(i), sub(w[i], false) {}
+ template <class A>
+ void restore(match_results<BidiIterator, A>& w)
+ {
+ w.set_first(sub.first, index);
+ w.set_second(sub.second, index, sub.matched);
+ }
+ const sub_match<BidiIterator>& get() { return sub; }
+};
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_all_states()
+{
+ static matcher_proc_type const s_match_vtable[26] =
+ {
+ (&perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_startmark),
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_endmark,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_literal,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_start_line,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_end_line,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_wild,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_match,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_boundary,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_within_word,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_start,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_word_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_buffer_start,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_buffer_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_backref,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_jump,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_alt,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_rep,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_combining,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_soft_buffer_end,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_restart_continue,
+ (::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_slow),
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat,
+ &perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_repeat,
+ };
+
+ if(state_count > max_state_count)
+ raise_error(traits_inst, REG_ESPACE);
+ while(pstate)
+ {
+ matcher_proc_type proc = s_match_vtable[pstate->type];
+ ++state_count;
+ if(!(this->*proc)())
+ {
+ if((m_match_flags & match_partial) && (position == last))
+ m_has_partial_match = true;
+ return 0;
+ }
+ }
+ return true;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_startmark()
+{
+ int index = static_cast<const re_brace*>(pstate)->index;
+ bool r = true;
+ switch(index)
+ {
+ case 0:
+ pstate = pstate->next.p;
+ break;
+ case -1:
+ case -2:
+ {
+ // forward lookahead assert:
+ BidiIterator old_position(position);
+ const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
+ pstate = pstate->next.p->next.p;
+ r = match_all_states();
+ pstate = next_pstate;
+ position = old_position;
+ if((r && (index != -1)) || (!r && (index != -2)))
+ r = false;
+ else
+ r = true;
+ break;
+ }
+ case -3:
+ {
+ // independent sub-expression:
+ const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
+ pstate = pstate->next.p->next.p;
+ r = match_all_states();
+ pstate = next_pstate;
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ if(r && (m_match_flags & match_extra))
+ {
+ //
+ // our captures have been stored in *m_presult
+ // we need to unpack them, and insert them
+ // back in the right order when we unwind the stack:
+ //
+ unsigned i;
+ match_results<BidiIterator, Allocator> tm(*m_presult);
+ for(i = 0; i < tm.size(); ++i)
+ (*m_presult)[i].get_captures().clear();
+ // match everything else:
+ r = match_all_states();
+ // now place the stored captures back:
+ for(i = 0; i < tm.size(); ++i)
+ {
+ typedef typename sub_match<BidiIterator>::capture_sequence_type seq;
+ seq& s1 = (*m_presult)[i].get_captures();
+ const seq& s2 = tm[i].captures();
+ s1.insert(
+ s1.end(),
+ s2.begin(),
+ s2.end());
+ }
+ }
+#endif
+ break;
+ }
+ default:
+ {
+ assert(index > 0);
+ if((m_match_flags & match_nosubs) == 0)
+ {
+ backup_subex<BidiIterator> sub(*m_presult, index);
+ m_presult->set_first(position, index);
+ pstate = pstate->next.p;
+ r = match_all_states();
+ if(r == false)
+ sub.restore(*m_presult);
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ //
+ // we have a match, push the capture information onto the stack:
+ //
+ else if(sub.get().matched && (match_extra & m_match_flags))
+ ((*m_presult)[index]).get_captures().push_back(sub.get());
+#endif
+ }
+ else
+ {
+ pstate = pstate->next.p;
+ }
+ break;
+ }
+ }
+ return r;
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_alt()
+{
+ bool take_first, take_second;
+ const re_jump* jmp = static_cast<const re_jump*>(pstate);
+
+ // find out which of these two alternatives we need to take:
+ if(position == last)
+ {
+ take_first = jmp->can_be_null & mask_take;
+ take_second = jmp->can_be_null & mask_skip;
+ }
+ else
+ {
+ take_first = access::can_start(*position, jmp->_map, (unsigned char)mask_take);
+ take_second = access::can_start(*position, jmp->_map, (unsigned char)mask_skip);
+ }
+
+ if(take_first)
+ {
+ // we can take the first alternative,
+ // see if we need to push next alternative:
+ if(take_second)
+ {
+ BidiIterator oldposition(position);
+ const re_syntax_base* old_pstate = jmp->alt.p;
+ pstate = pstate->next.p;
+ if(!match_all_states())
+ {
+ pstate = old_pstate;
+ position = oldposition;
+ }
+ return true;
+ }
+ pstate = pstate->next.p;
+ return true;
+ }
+ if(take_second)
+ {
+ pstate = jmp->alt.p;
+ return true;
+ }
+ return false; // neither option is possible
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_rep()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127 4244)
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ if(next_count->get_id() != rep->id)
+ {
+ // we're moving to a different repeat from the last
+ // one, so set up a counter object and recurse:
+ repeater_count<BidiIterator> r(rep->id, &next_count, position);
+ return match_rep();
+ }
+ //
+ // If we've had at least one repeat already, and the last one
+ // matched the NULL string then set the repeat count to
+ // maximum:
+ //
+ next_count->check_null_repeat(position, rep->max);
+
+ // find out which of these two alternatives we need to take:
+ bool take_first, take_second;
+ if(position == last)
+ {
+ take_first = rep->can_be_null & mask_take;
+ take_second = rep->can_be_null & mask_skip;
+ }
+ else
+ {
+ take_first = access::can_start(*position, rep->_map, (unsigned char)mask_take);
+ take_second = access::can_start(*position, rep->_map, (unsigned char)mask_skip);
+ }
+
+ if(next_count->get_count() < rep->min)
+ {
+ // we must take the repeat:
+ if(take_first)
+ {
+ // increase the counter:
+ ++(*next_count);
+ pstate = rep->next.p;
+ return match_all_states();
+ }
+ return false;
+ }
+
+ if(rep->greedy)
+ {
+ // try and take the repeat if we can:
+ if((next_count->get_count() < rep->max) && take_first)
+ {
+ // store position in case we fail:
+ BidiIterator pos = position;
+ // increase the counter:
+ ++(*next_count);
+ pstate = rep->next.p;
+ if(match_all_states())
+ return true;
+ // failed repeat, reset posistion and fall through for alternative:
+ position = pos;
+ }
+ if(take_second)
+ {
+ pstate = rep->alt.p;
+ return true;
+ }
+ return false; // can't take anything, fail...
+ }
+ else // non-greedy
+ {
+ // try and skip the repeat if we can:
+ if(take_second)
+ {
+ // store position in case we fail:
+ BidiIterator pos = position;
+ pstate = rep->alt.p;
+ if(match_all_states())
+ return true;
+ // failed alternative, reset posistion and fall through for repeat:
+ position = pos;
+ }
+ if((next_count->get_count() < rep->max) && take_first)
+ {
+ // increase the counter:
+ ++(*next_count);
+ pstate = rep->next.p;
+ return match_all_states();
+ }
+ }
+ return false;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_slow()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+ unsigned count = 0;
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ re_syntax_base* psingle = rep->next.p;
+ // match compulsary repeats first:
+ while(count < rep->min)
+ {
+ pstate = psingle;
+ if(!match_wild())
+ return false;
+ ++count;
+ }
+ if(rep->greedy)
+ {
+ // normal repeat:
+ while(count < rep->max)
+ {
+ pstate = psingle;
+ if(!match_wild())
+ break;
+ ++count;
+ }
+ if((rep->leading) && (count < rep->max))
+ restart = position;
+ pstate = rep;
+ return backtrack_till_match(count - rep->min);
+ }
+ else
+ {
+ // non-greedy, keep trying till we get a match:
+ BidiIterator save_pos;
+ do
+ {
+ if((rep->leading) && (rep->max == UINT_MAX))
+ restart = position;
+ pstate = rep->alt.p;
+ save_pos = position;
+ ++state_count;
+ if(match_all_states())
+ return true;
+ if(count >= rep->max)
+ return false;
+ ++count;
+ pstate = psingle;
+ position = save_pos;
+ if(!match_wild())
+ return false;
+ }while(true);
+ }
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_dot_repeat_fast()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+ if(m_match_flags & (match_not_dot_newline | match_not_dot_null))
+ return match_dot_repeat_slow();
+ //
+ // start by working out how much we can skip:
+ //
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ unsigned count = std::min(static_cast<unsigned>(re_detail::distance(position, last)), (rep->greedy ? rep->max : rep->min));
+ if(rep->min > count)
+ return false; // not enough text left to match
+ std::advance(position, count);
+ if((rep->leading) && (count < rep->max) && (rep->greedy))
+ restart = position;
+ if(rep->greedy)
+ return backtrack_till_match(count - rep->min);
+
+ // non-greedy, keep trying till we get a match:
+ BidiIterator save_pos;
+ do
+ {
+ while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip))
+ {
+ ++position;
+ ++count;
+ }
+ if((rep->leading) && (count == UINT_MAX))
+ restart = position;
+ pstate = rep->alt.p;
+ save_pos = position;
+ ++state_count;
+ if(match_all_states())
+ return true;
+ if(count >= rep->max)
+ return false;
+ if(position == last)
+ return false;
+ position = ++save_pos;
+ ++count;
+ }while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_char_repeat()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ assert(1 == static_cast<const re_literal*>(rep->next.p)->length);
+ const char_type what = *reinterpret_cast<const char_type*>(static_cast<const re_literal*>(rep->next.p) + 1);
+ unsigned count = 0;
+ //
+ // start by working out how much we can skip:
+ //
+ unsigned desired = rep->greedy ? rep->max : rep->min;
+ if(::boost::is_random_access_iterator<BidiIterator>::value)
+ {
+ BidiIterator end = position;
+ std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ BidiIterator origin(position);
+ while((position != end) && (traits_inst.translate(*position, icase) == what))
+ {
+ ++position;
+ }
+ count = (unsigned)re_detail::distance(origin, position);
+ }
+ else
+ {
+ while((count < desired) && (position != last) && (traits_inst.translate(*position, icase) == what))
+ {
+ ++position;
+ ++count;
+ }
+ }
+ if((rep->leading) && (count < rep->max) && (rep->greedy))
+ restart = position;
+ if(count < rep->min)
+ return false;
+
+ if(rep->greedy)
+ return backtrack_till_match(count - rep->min);
+
+ // non-greedy, keep trying till we get a match:
+ BidiIterator save_pos;
+ do
+ {
+ while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip))
+ {
+ if((traits_inst.translate(*position, icase) == what))
+ {
+ ++position;
+ ++count;
+ }
+ else
+ return false; // counldn't repeat even though it was the only option
+ }
+ if((rep->leading) && (rep->max == UINT_MAX))
+ restart = position;
+ pstate = rep->alt.p;
+ save_pos = position;
+ ++state_count;
+ if(match_all_states())
+ return true;
+ if(count >= rep->max)
+ return false;
+ if(position == last)
+ return false;
+ position = ++save_pos;
+ ++count;
+ }while(true);
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_set_repeat()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ const unsigned char* map = static_cast<const re_set*>(rep->next.p)->_map;
+ unsigned count = 0;
+ //
+ // start by working out how much we can skip:
+ //
+ unsigned desired = rep->greedy ? rep->max : rep->min;
+ if(::boost::is_random_access_iterator<BidiIterator>::value)
+ {
+ BidiIterator end = position;
+ std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ BidiIterator origin(position);
+ while((position != end) && map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ ++position;
+ }
+ count = (unsigned)re_detail::distance(origin, position);
+ }
+ else
+ {
+ while((count < desired) && (position != last) && map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ ++position;
+ ++count;
+ }
+ }
+ if((rep->leading) && (count < rep->max) && (rep->greedy))
+ restart = position;
+ if(count < rep->min)
+ return false;
+
+ if(rep->greedy)
+ return backtrack_till_match(count - rep->min);
+
+ // non-greedy, keep trying till we get a match:
+ BidiIterator save_pos;
+ do
+ {
+ while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip))
+ {
+ if(map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ ++position;
+ ++count;
+ }
+ else
+ return false; // counldn't repeat even though it was the only option
+ }
+ if((rep->leading) && (rep->max == UINT_MAX))
+ restart = position;
+ pstate = rep->alt.p;
+ save_pos = position;
+ ++state_count;
+ if(match_all_states())
+ return true;
+ if(count >= rep->max)
+ return false;
+ if(position == last)
+ return false;
+ position = ++save_pos;
+ ++count;
+ }while(true);
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::match_long_set_repeat()
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8008 -w-8066 -w-8004
+#endif
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ const re_set_long* set = static_cast<const re_set_long*>(pstate->next.p);
+ unsigned count = 0;
+ //
+ // start by working out how much we can skip:
+ //
+ unsigned desired = rep->greedy ? rep->max : rep->min;
+ if(::boost::is_random_access_iterator<BidiIterator>::value)
+ {
+ BidiIterator end = position;
+ std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ BidiIterator origin(position);
+ while((position != end) && (position != re_is_set_member(position, last, set, re)))
+ {
+ ++position;
+ }
+ count = (unsigned)re_detail::distance(origin, position);
+ }
+ else
+ {
+ while((count < desired) && (position != last) && (position != re_is_set_member(position, last, set, re)))
+ {
+ ++position;
+ ++count;
+ }
+ }
+ if((rep->leading) && (count < rep->max) && (rep->greedy))
+ restart = position;
+ if(count < rep->min)
+ return false;
+
+ if(rep->greedy)
+ return backtrack_till_match(count - rep->min);
+
+ // non-greedy, keep trying till we get a match:
+ BidiIterator save_pos;
+ do
+ {
+ while((position != last) && (count < rep->max) && !access::can_start(*position, rep->_map, mask_skip))
+ {
+ if(position != re_is_set_member(position, last, set, re))
+ {
+ ++position;
+ ++count;
+ }
+ else
+ return false; // counldn't repeat even though it was the only option
+ }
+ if((rep->leading) && (rep->max == UINT_MAX))
+ restart = position;
+ pstate = rep->alt.p;
+ save_pos = position;
+ ++state_count;
+ if(match_all_states())
+ return true;
+ if(count >= rep->max)
+ return false;
+ if(position == last)
+ return false;
+ position = ++save_pos;
+ ++count;
+ }while(true);
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+template <class BidiIterator, class Allocator, class traits, class Allocator2>
+bool perl_matcher<BidiIterator, Allocator, traits, Allocator2>::backtrack_till_match(unsigned count)
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4127)
+#endif
+ if((m_match_flags & match_partial) && (position == last))
+ m_has_partial_match = true;
+
+ const re_repeat* rep = static_cast<const re_repeat*>(pstate);
+ BidiIterator backtrack = position;
+ if(position == last)
+ {
+ if(rep->can_be_null & mask_skip)
+ {
+ pstate = rep->alt.p;
+ if(match_all_states())
+ return true;
+ }
+ if(count)
+ {
+ position = --backtrack;
+ --count;
+ }
+ else
+ return false;
+ }
+ do
+ {
+ while(count && !access::can_start(*position, rep->_map, mask_skip))
+ {
+ --position;
+ --count;
+ ++state_count;
+ }
+ pstate = rep->alt.p;
+ backtrack = position;
+ if(match_all_states())
+ return true;
+ if(count == 0)
+ return false;
+ position = --backtrack;
+ ++state_count;
+ --count;
+ }while(true);
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+}
+
+} // namespace re_detail
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regbase.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares class regbase.
+ */
+
+#ifndef BOOST_REGEX_V4_REGBASE_HPP
+#define BOOST_REGEX_V4_REGBASE_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+//
+// class regbase
+// handles error codes and flags
+//
+class BOOST_REGEX_DECL regbase
+{
+public:
+ enum flag_type_
+ {
+ escape_in_lists = 1, // '\' special inside [...]
+ char_classes = escape_in_lists << 1, // [[:CLASS:]] allowed
+ intervals = char_classes << 1, // {x,y} allowed
+ limited_ops = intervals << 1, // all of + ? and | are normal characters
+ newline_alt = limited_ops << 1, // \n is the same as |
+ bk_plus_qm = newline_alt << 1, // uses \+ and \?
+ bk_braces = bk_plus_qm << 1, // uses \{ and \}
+ bk_parens = bk_braces << 1, // uses \( and \)
+ bk_refs = bk_parens << 1, // \d allowed
+ bk_vbar = bk_refs << 1, // uses \|
+
+ use_except = bk_vbar << 1, // exception on error
+ failbit = use_except << 1, // error flag
+ literal = failbit << 1, // all characters are literals
+ icase = literal << 1, // characters are matched regardless of case
+ nocollate = 0, // don't use locale specific collation (deprecated)
+ collate = icase << 1, // use locale specific collation
+ perlex = collate << 1, // perl extensions
+ nosubs = perlex << 1, // don't mark sub-expressions
+ optimize = 0, // not really supported
+
+ basic = char_classes | intervals | limited_ops | bk_braces | bk_parens | bk_refs | collate,
+ extended = char_classes | intervals | bk_refs | collate,
+ normal = perlex | escape_in_lists | char_classes | intervals | bk_refs | nocollate,
+ emacs = bk_braces | bk_parens | bk_refs | bk_vbar,
+ awk = extended | escape_in_lists,
+ grep = basic | newline_alt,
+ egrep = extended | newline_alt,
+ sed = basic,
+ perl = normal,
+ ECMAScript = normal,
+ JavaScript = normal,
+ JScript = normal
+ };
+ typedef unsigned int flag_type;
+
+ enum restart_info
+ {
+ restart_any = 0,
+ restart_word = 1,
+ restart_line = 2,
+ restart_buf = 3,
+ restart_continue = 4,
+ restart_lit = 5,
+ restart_fixed_lit = 6,
+ restart_count = 7
+ };
+
+ flag_type BOOST_REGEX_CALL flags()const
+ {
+ return _flags;
+ }
+
+ regbase();
+ regbase(const regbase& b);
+ void swap(regbase& that)
+ { std::swap(_flags, that._flags); }
+protected:
+ flag_type _flags;
+};
+
+//
+// provide std lib proposal compatible constants:
+//
+namespace regex_constants{
+
+ enum flag_type_
+ {
+ escape_in_lists = ::boost::regbase::escape_in_lists,
+ char_classes = ::boost::regbase::char_classes,
+ intervals = ::boost::regbase::intervals,
+ limited_ops = ::boost::regbase::limited_ops,
+ newline_alt = ::boost::regbase::newline_alt,
+ bk_plus_qm = ::boost::regbase::bk_plus_qm,
+ bk_braces = ::boost::regbase::bk_braces,
+ bk_parens = ::boost::regbase::bk_parens,
+ bk_refs = ::boost::regbase::bk_refs,
+ bk_vbar = ::boost::regbase::bk_vbar,
+
+ use_except = ::boost::regbase::use_except,
+ failbit = ::boost::regbase::failbit,
+ literal = ::boost::regbase::literal,
+ icase = ::boost::regbase::icase,
+ nocollate = ::boost::regbase::nocollate,
+ collate = ::boost::regbase::collate,
+ perlex = ::boost::regbase::perlex,
+ nosubs = ::boost::regbase::nosubs,
+ optimize = ::boost::regbase::optimize,
+
+ basic = ::boost::regbase::basic,
+ extended = ::boost::regbase::extended,
+ normal = ::boost::regbase::normal,
+ emacs = ::boost::regbase::emacs,
+ awk = ::boost::regbase::awk,
+ grep = ::boost::regbase::grep,
+ egrep = ::boost::regbase::egrep,
+ sed = basic,
+ perl = normal,
+ ECMAScript = normal,
+ JavaScript = normal,
+ JScript = normal
+ };
+ typedef ::boost::regbase::flag_type syntax_option_type;
+
+} // namespace regex_constants
+
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares boost::reg_expression<> and associated
+ * functions and classes. This header is the main
+ * entry point for the template regex code.
+ */
+
+#ifndef BOOST_RE_REGEX_HPP_INCLUDED
+#define BOOST_RE_REGEX_HPP_INCLUDED
+
+#ifndef BOOST_RE_CREGEX_HPP
+#include <boost/cregex.hpp>
+#endif
+
+#ifdef __cplusplus
+
+// what follows is all C++ don't include in C builds!!
+
+#ifdef BOOST_REGEX_DEBUG
+# include <iosfwd>
+#endif
+
+#include <new>
+#include <cstring>
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+#ifndef BOOST_REGEX_FWD_HPP
+#include <boost/regex_fwd.hpp>
+#endif
+#ifndef BOOST_REGEX_STACK_HPP
+#include <boost/regex/v4/regex_stack.hpp>
+#endif
+#ifndef BOOST_REGEX_RAW_BUFFER_HPP
+#include <boost/regex/v4/regex_raw_buffer.hpp>
+#endif
+#ifndef BOOST_REGEX_KMP_HPP
+#include <boost/regex/v4/regex_kmp.hpp>
+#endif
+#ifndef BOOST_RE_PAT_EXCEPT_HPP
+#include <boost/regex/pattern_except.hpp>
+#endif
+#ifndef BOOST_REGEX_TRAITS_HPP
+#include <boost/regex/regex_traits.hpp>
+#endif
+#include <boost/scoped_array.hpp>
+
+#ifndef BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP
+#include <boost/regex/v4/char_regex_traits.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_STATES_HPP
+#include <boost/regex/v4/states.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_REGBASE_HPP
+#include <boost/regex/v4/regbase.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
+#include <boost/regex/v4/iterator_traits.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
+#include <boost/regex/v4/iterator_traits.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP
+#include <boost/regex/v4/basic_regex.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_SUB_MATCH_HPP
+#include <boost/regex/v4/sub_match.hpp>
+#endif
+#ifndef BOOST_REGEX_FORMAT_HPP
+#include <boost/regex/v4/regex_format.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_MATCH_RESULTS_HPP
+#include <boost/regex/v4/match_results.hpp>
+#endif
+#ifndef BOOST_REGEX_COMPILE_HPP
+#include <boost/regex/v4/regex_compile.hpp>
+#endif
+
+//
+// template instances:
+//
+#define BOOST_REGEX_CHAR_T char
+#ifdef BOOST_REGEX_NARROW_INSTANTIATE
+# define BOOST_REGEX_INSTANTIATE
+#endif
+#include <boost/regex/v4/instances.hpp>
+#undef BOOST_REGEX_CHAR_T
+#ifdef BOOST_REGEX_INSTANTIATE
+# undef BOOST_REGEX_INSTANTIATE
+#endif
+
+#ifndef BOOST_NO_WREGEX
+#define BOOST_REGEX_CHAR_T boost::regex_wchar_type
+#ifdef BOOST_REGEX_WIDE_INSTANTIATE
+# define BOOST_REGEX_INSTANTIATE
+#endif
+#include <boost/regex/v4/instances.hpp>
+#undef BOOST_REGEX_CHAR_T
+#ifdef BOOST_REGEX_INSTANTIATE
+# undef BOOST_REGEX_INSTANTIATE
+#endif
+#endif
+
+
+namespace boost{
+#ifdef BOOST_REGEX_NO_FWD
+typedef reg_expression<char, regex_traits<char>, BOOST_DEFAULT_ALLOCATOR(char)> regex;
+#ifndef BOOST_NO_WREGEX
+typedef reg_expression<wchar_t, regex_traits<wchar_t>, BOOST_DEFAULT_ALLOCATOR(wchar_t)> wregex;
+#endif
+#endif
+
+typedef match_results<const char*> cmatch;
+typedef match_results<std::string::const_iterator> smatch;
+#ifndef BOOST_NO_WREGEX
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<std::wstring::const_iterator> wsmatch;
+#endif
+
+} // namespace boost
+#ifndef BOOST_REGEX_MATCH_HPP
+#include <boost/regex/v4/regex_match.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_REGEX_SEARCH_HPP
+#include <boost/regex/v4/regex_search.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_REGEX_GREP_HPP
+#include <boost/regex/v4/regex_grep.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_REGEX_REPLACE_HPP
+#include <boost/regex/v4/regex_replace.hpp>
+#endif
+#ifndef BOOST_REGEX_V4_REGEX_MERGE_HPP
+#include <boost/regex/v4/regex_merge.hpp>
+#endif
+#ifndef BOOST_REGEX_SPLIT_HPP
+#include <boost/regex/v4/regex_split.hpp>
+#endif
+#ifndef BOOST_REGEX_ITERATOR_HPP
+#include <boost/regex/v4/regex_iterator.hpp>
+#endif
+#ifndef BOOST_REGEX_TOKEN_ITERATOR_HPP
+#include <boost/regex/v4/regex_token_iterator.hpp>
+#endif
+
+#endif // __cplusplus
+
+#endif // include
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_compile.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares reg_expression<> member functions. This is
+ * an internal header file, do not include directly.
+ */
+
+#ifndef BOOST_REGEX_COMPILE_HPP
+#define BOOST_REGEX_COMPILE_HPP
+
+namespace boost{
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+#ifdef __BORLANDC__
+#pragma option push -w-8004
+#endif
+
+namespace re_detail{
+
+
+template <class traits>
+struct kmp_translator
+{
+ typedef typename traits::char_type char_type;
+ bool icase;
+ const traits* pt;
+ kmp_translator(bool c, traits* p) : icase(c), pt(p) {}
+ char_type operator()(char_type c)
+ {
+ return pt->translate(c, icase);
+ }
+};
+
+
+template <class charT, class traits_type, class Allocator>
+bool BOOST_REGEX_CALL re_maybe_set_member(charT c,
+ const re_set_long* set_,
+ const reg_expression<charT, traits_type, Allocator>& e)
+{
+ const charT* p = reinterpret_cast<const charT*>(set_+1);
+ bool icase = e.flags() & regex_constants::icase;
+ charT col = e.get_traits().translate(c, icase);
+ for(unsigned int i = 0; i < set_->csingles; ++i)
+ {
+ if(col == *p)
+ return set_->isnot ? false : true;
+
+ while(*p)++p;
+ ++p; // skip null
+ }
+ return set_->isnot ? true : false;
+}
+
+} // namespace re_detail
+
+template <class traits>
+struct is_big_char
+{
+ typedef typename traits::uchar_type traits_uchar_type;
+ typedef typename traits::size_type traits_size_type;
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+ static bool test(char)
+ { return false; }
+ static bool test(unsigned char)
+ { return false; }
+ static bool test(signed char)
+ { return false; }
+#endif
+ template <class charT> static bool test(charT c)
+ { return (traits_size_type)(traits_uchar_type)c >= 256; }
+};
+
+template <class charT, class traits, class Allocator>
+inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&)
+{
+ if(is_big_char<traits>::test(c))
+ return true;
+ return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
+}
+
+template <class charT, class traits, class Allocator>
+inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&)
+{
+ return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const Allocator& a)
+ : regbase(), data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, flag_type f, const Allocator& a)
+ : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+ set_expression(p, f | regex_constants::use_except);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a)
+ : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+ set_expression(p1, p2, f | regex_constants::use_except);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a)
+ : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+ set_expression(p, p + len, f | regex_constants::use_except);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const reg_expression<charT, traits, Allocator>& e)
+ : regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+ //
+ // we do a deep copy only if e is a valid expression, otherwise fail.
+ //
+ if(e.error_code() == 0)
+ {
+ const charT* pe = e.expression();
+ set_expression(pe, pe + e._expression_len, e.flags() | regex_constants::use_except);
+ }
+ else
+ {
+ _flags = e.flags() & ~(regex_constants::use_except);
+ fail(e.error_code());
+ }
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::~reg_expression()
+{
+ if(pkmp)
+ re_detail::kmp_free(pkmp, data.allocator());
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>& BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator=(const reg_expression<charT, traits, Allocator>& e)
+{
+ //
+ // we do a deep copy only if e is a valid expression, otherwise fail.
+ //
+ if(this == &e) return *this;
+ _flags = use_except;
+ fail(e.error_code());
+ if(error_code() == 0)
+ set_expression(e._expression, e._expression + e._expression_len, e.flags() | regex_constants::use_except);
+ return *this;
+}
+
+template <class charT, class traits, class Allocator>
+int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compare(const reg_expression<charT, traits, Allocator>& e)const
+{
+ if(_flags != e.flags())
+ return _flags - e.flags();
+ return str().compare(e.str());
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::swap(reg_expression& that)throw()
+{
+ traits_inst.swap(that.traits_inst);
+ data.swap(that.data);
+ static_cast<regbase&>(*this).swap(that);
+
+ std::swap(_restart_type, that._restart_type);
+ std::swap(marks, that.marks);
+ std::swap(repeats, that.repeats);
+ std::swap(startmap, that.startmap);
+ std::swap(_expression_len, that._expression_len);
+ std::swap(_leading_len, that._leading_len);
+ std::swap(_leading_string, that._leading_string);
+ std::swap(_leading_string_len, that._leading_string_len);
+ std::swap(pkmp, that.pkmp);
+ std::swap(error_code_, that.error_code_);
+ std::swap(_expression, that._expression);
+}
+
+template <class charT, class traits, class Allocator>
+Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::allocator()const
+{
+ return data.allocator();
+}
+
+template <class charT, class traits, class Allocator>
+Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::get_allocator()const
+{
+ return data.allocator();
+}
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_inner_set(const charT*& arg_first, const charT* arg_last)
+{
+ //
+ // we have an inner [...] construct
+ //
+ jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_open_set);
+ const charT* base = arg_first;
+ while( (arg_first != arg_last)
+ && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) != traits_type::syntax_close_set) )
+ ++arg_first;
+ if(arg_first == arg_last)
+ return 0;
+ ++arg_first;
+ if((arg_first-base) < 5)
+ return 0;
+ if(*(base+1) != *(arg_first-2))
+ return 0;
+ unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
+ if((result == traits_type::syntax_colon) && ((arg_first-base) == 5))
+ {
+ unsigned type = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
+ if((type == traits_type::syntax_left_word) || (type == traits_type::syntax_right_word))
+ return type;
+ }
+ return ((result == traits_type::syntax_colon) || (result == traits_type::syntax_dot) || (result == traits_type::syntax_equal)) ? result : 0;
+}
+
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::skip_space(const charT*& arg_first, const charT* arg_last)
+{
+ //
+ // returns true if we get to arg_last:
+ //
+ while((arg_first != arg_last) && (traits_inst.is_class(*arg_first, traits_type::char_class_space) == true))
+ {
+ ++arg_first;
+ }
+ return arg_first == arg_last;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* arg_end, unsigned& min, unsigned& max)
+{
+ //
+ // we have {x} or {x,} or {x,y} NB no spaces inside braces
+ // anything else is illegal
+ // On input ptr points to "{"
+ //
+ ++ptr;
+ if(skip_space(ptr, arg_end))
+ {
+ fail(REG_EBRACE);
+ return;
+ }
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_digit)
+ {
+ fail(REG_BADBR);
+ return;
+ }
+ min = traits_inst.toi(ptr, arg_end, 10);
+ if(skip_space(ptr, arg_end))
+ {
+ fail(REG_EBRACE);
+ return;
+ }
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_comma)
+ {
+ //we have a second interval:
+ ++ptr;
+ if(skip_space(ptr, arg_end))
+ {
+ fail(REG_EBRACE);
+ return;
+ }
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_digit)
+ max = traits_inst.toi(ptr, arg_end, 10);
+ else
+ max = (unsigned)-1;
+ }
+ else
+ max = min;
+
+ // validate input:
+ if(skip_space(ptr, arg_end))
+ {
+ fail(REG_EBRACE);
+ return;
+ }
+ if(max < min)
+ {
+ fail(REG_ERANGE);
+ return;
+ }
+ if(_flags & bk_braces)
+ {
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_slash)
+ {
+ fail(REG_BADBR);
+ return;
+ }
+ else
+ {
+ // back\ is OK now check the }
+ ++ptr;
+ if((ptr == arg_end) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace))
+ {
+ fail(REG_BADBR);
+ return;
+ }
+ }
+ }
+ else if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace)
+ {
+ fail(REG_BADBR);
+ return;
+ }
+}
+
+template <class charT, class traits, class Allocator>
+charT BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_escape(const charT*& arg_first, const charT* arg_last)
+{
+ charT c(*arg_first);
+ traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*arg_first;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ traits_size_type syntax = traits_inst.syntax_type(c_unsigned);
+ switch(syntax)
+ {
+ case traits_type::syntax_a:
+ c = '\a';
+ ++arg_first;
+ break;
+ case traits_type::syntax_f:
+ c = '\f';
+ ++arg_first;
+ break;
+ case traits_type::syntax_n:
+ c = '\n';
+ ++arg_first;
+ break;
+ case traits_type::syntax_r:
+ c = '\r';
+ ++arg_first;
+ break;
+ case traits_type::syntax_t:
+ c = '\t';
+ ++arg_first;
+ break;
+ case traits_type::syntax_v:
+ c = '\v';
+ ++arg_first;
+ break;
+ case traits_type::syntax_x:
+ ++arg_first;
+ if(arg_first == arg_last)
+ {
+ fail(REG_EESCAPE);
+ break;
+ }
+ // maybe have \x{ddd}
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*arg_first)) == traits_type::syntax_open_brace)
+ {
+ ++arg_first;
+ if(arg_first == arg_last)
+ {
+ fail(REG_EESCAPE);
+ break;
+ }
+ if(traits_inst.is_class(*arg_first, traits_type::char_class_xdigit) == false)
+ {
+ fail(REG_BADBR);
+ break;
+ }
+ c = (charT)traits_inst.toi(arg_first, arg_last, -16);
+ if((arg_first == arg_last) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*arg_first)) != traits_type::syntax_close_brace))
+ {
+ fail(REG_BADBR);
+ }
+ ++arg_first;
+ break;
+ }
+ else
+ {
+ if(traits_inst.is_class(*arg_first, traits_type::char_class_xdigit) == false)
+ {
+ fail(REG_BADBR);
+ break;
+ }
+ c = (charT)traits_inst.toi(arg_first, arg_last, -16);
+ }
+ break;
+ case traits_type::syntax_c:
+ ++arg_first;
+ if(arg_first == arg_last)
+ {
+ fail(REG_EESCAPE);
+ break;
+ }
+ if(((traits_uchar_type)(*arg_first) < (traits_uchar_type)'@')
+ || ((traits_uchar_type)(*arg_first) > (traits_uchar_type)127) )
+ {
+ fail(REG_EESCAPE);
+ return (charT)0;
+ }
+ c = (charT)((traits_uchar_type)(*arg_first) - (traits_uchar_type)'@');
+ ++arg_first;
+ break;
+ case traits_type::syntax_e:
+ c = (charT)27;
+ ++arg_first;
+ break;
+ case traits_type::syntax_digit:
+ c = (charT)traits_inst.toi(arg_first, arg_last, -8);
+ break;
+ default:
+ //c = *arg_first;
+ ++arg_first;
+ }
+ return c;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_maps()
+{
+ re_detail::re_syntax_base* record = static_cast<re_detail::re_syntax_base*>(data.data());
+ // always compile the first _map:
+ std::memset(startmap, 0, 256);
+ record->can_be_null = 0;
+ compile_map(record, startmap, 0, re_detail::mask_all);
+
+ while(record->type != re_detail::syntax_element_match)
+ {
+ if((record->type == re_detail::syntax_element_alt) || (record->type == re_detail::syntax_element_rep))
+ {
+ std::memset(&(static_cast<re_detail::re_jump*>(record)->_map), 0, 256);
+ record->can_be_null = 0;
+ compile_map(record->next.p, static_cast<re_detail::re_jump*>(record)->_map, &(record->can_be_null), re_detail::mask_take, static_cast<re_detail::re_jump*>(record)->alt.p);
+ compile_map(static_cast<re_detail::re_jump*>(record)->alt.p, static_cast<re_detail::re_jump*>(record)->_map, &(record->can_be_null), re_detail::mask_skip);
+ if(record->type == re_detail::syntax_element_rep)
+ {
+ re_detail::re_repeat* rep = static_cast<re_detail::re_repeat*>(record);
+ // set whether this is a singleton repeat or not:
+ if(rep->next.p->next.p->next.p == rep->alt.p)
+ {
+ switch(rep->next.p->type)
+ {
+ case re_detail::syntax_element_wild:
+ rep->type = re_detail::syntax_element_dot_rep;
+ break;
+ case re_detail::syntax_element_literal:
+ rep->type = re_detail::syntax_element_char_rep;
+ break;
+ case re_detail::syntax_element_set:
+ rep->type = re_detail::syntax_element_short_set_rep;
+ break;
+ case re_detail::syntax_element_long_set:
+ if(static_cast<re_detail::re_set_long*>(rep->next.p)->singleton)
+ rep->type = re_detail::syntax_element_long_set_rep;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ record->can_be_null = 0;
+ compile_map(record, 0, &(record->can_be_null), re_detail::mask_all);
+ }
+ record = record->next.p;
+ }
+ record->can_be_null = re_detail::mask_all;
+}
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_start(
+ re_detail::re_syntax_base* node, charT cc, re_detail::re_syntax_base* terminal) const
+{
+ unsigned int c;
+
+ switch(node->type)
+ {
+ case re_detail::syntax_element_startmark:
+ if(static_cast<const re_detail::re_brace*>(node)->index == -1)
+ {
+ return probe_start(node->next.p->next.p, cc, terminal)
+ && probe_start(static_cast<const re_detail::re_jump*>(node->next.p)->alt.p, cc, terminal);
+ }
+ else if(static_cast<const re_detail::re_brace*>(node)->index == -3)
+ {
+ return probe_start(node->next.p->next.p, cc, terminal);
+ }
+ // doesn't tell us anything about the next character, so:
+ return probe_start(node->next.p, cc, terminal);
+ case re_detail::syntax_element_endmark:
+ if(static_cast<const re_detail::re_brace*>(node)->index == -3)
+ {
+ return true;
+ }
+ // fall through:
+ case re_detail::syntax_element_start_line:
+ case re_detail::syntax_element_word_boundary:
+ case re_detail::syntax_element_buffer_start:
+ case re_detail::syntax_element_restart_continue:
+ // doesn't tell us anything about the next character, so:
+ return probe_start(node->next.p, cc, terminal);
+ case re_detail::syntax_element_literal:
+ // only the first character of the literal can match:
+ // note these have already been translated:
+ if(*reinterpret_cast<charT*>(static_cast<re_detail::re_literal*>(node)+1) == traits_inst.translate(cc, (_flags & regex_constants::icase)))
+ return true;
+ return false;
+ case re_detail::syntax_element_end_line:
+ // next character (if there is one!) must be a newline:
+ if(traits_inst.is_separator(traits_inst.translate(cc, (_flags & regex_constants::icase))))
+ return true;
+ return false;
+ case re_detail::syntax_element_wild:
+ return true;
+ case re_detail::syntax_element_match:
+ return true;
+ case re_detail::syntax_element_within_word:
+ case re_detail::syntax_element_word_start:
+ return traits_inst.is_class(traits_inst.translate(cc, (_flags & regex_constants::icase)), traits_type::char_class_word);
+ case re_detail::syntax_element_word_end:
+ // what follows must not be a word character,
+ return traits_inst.is_class(traits_inst.translate(cc, (_flags & regex_constants::icase)), traits_type::char_class_word) ? false : true;
+ case re_detail::syntax_element_buffer_end:
+ // we can be null, nothing must follow,
+ // NB we assume that this is followed by
+ // re_detail::syntax_element_match, if its not then we can
+ // never match anything anyway!!
+ return false;
+ case re_detail::syntax_element_soft_buffer_end:
+ // we can be null, only newlines must follow,
+ // NB we assume that this is followed by
+ // re_detail::syntax_element_match, if its not then we can
+ // never match anything anyway!!
+ return traits_inst.is_separator(traits_inst.translate(cc, (_flags & regex_constants::icase)));
+ case re_detail::syntax_element_backref:
+ // there's no easy way to determine this
+ // which is not to say it can't be done!
+ // for now:
+ return true;
+ case re_detail::syntax_element_long_set:
+ // we can not be null,
+ // we need to add already translated values in the set
+ // to values in the _map
+ return re_detail::re_maybe_set_member(cc, static_cast<const re_detail::re_set_long*>(node), *this) || (re_detail::re_is_set_member(static_cast<const charT*>(&cc), static_cast<const charT*>(&cc+1), static_cast<re_detail::re_set_long*>(node), *this) != &cc);
+ case re_detail::syntax_element_set:
+ // set all the elements that are set in corresponding set:
+ c = (traits_size_type)(traits_uchar_type)traits_inst.translate(cc, (_flags & regex_constants::icase));
+ return static_cast<re_detail::re_set*>(node)->_map[c] != 0;
+ case re_detail::syntax_element_jump:
+ if(static_cast<re_detail::re_jump*>(node)->alt.p < node)
+ {
+ // backwards jump,
+ // caused only by end of repeat section, we'll treat this
+ // the same as a match, because the sub-expression has matched.
+ if(node->next.p == terminal)
+ return true; // null repeat - we can always take this
+ else
+ {
+ //
+ // take the jump, add in fix for the fact that if the
+ // repeat that we're jumping to has non-zero minimum count
+ // then we need to add in the possiblity that we could still
+ // skip that repeat.
+ re_detail::re_syntax_base* next = static_cast<re_detail::re_jump*>(node)->alt.p;
+ bool b = probe_start(next, cc, terminal);
+ if((next->type == re_detail::syntax_element_rep) && (static_cast<re_detail::re_repeat*>(next)->min != 0))
+ {
+ b = b || probe_start(static_cast<re_detail::re_jump*>(next)->alt.p, cc, terminal);
+ }
+ return b;
+ }
+ }
+ else
+ // take the jump and compile:
+ return probe_start(static_cast<re_detail::re_jump*>(node)->alt.p, cc, terminal);
+ case re_detail::syntax_element_alt:
+ // we need to take the OR of the two alternatives:
+ return probe_start(static_cast<re_detail::re_jump*>(node)->alt.p, cc, terminal) || probe_start(node->next.p, cc, terminal);
+ case re_detail::syntax_element_rep:
+ case re_detail::syntax_element_char_rep:
+ case re_detail::syntax_element_dot_rep:
+ case re_detail::syntax_element_long_set_rep:
+ case re_detail::syntax_element_short_set_rep:
+ // we need to take the OR of the two alternatives
+ if(static_cast<re_detail::re_repeat*>(node)->min == 0)
+ return probe_start(node->next.p, cc, static_cast<re_detail::re_jump*>(node)->alt.p) || probe_start(static_cast<re_detail::re_jump*>(node)->alt.p, cc, terminal);
+ else
+ return probe_start(node->next.p, cc, static_cast<re_detail::re_jump*>(node)->alt.p);
+ case re_detail::syntax_element_combining:
+ return !traits_inst.is_combining(traits_inst.translate(cc, (_flags & regex_constants::icase)));
+ }
+ return false;
+}
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const
+{
+ switch(node->type)
+ {
+ case re_detail::syntax_element_endmark:
+ if(static_cast<const re_detail::re_brace*>(node)->index == -3)
+ {
+ return true;
+ }
+ // fall through:
+ case re_detail::syntax_element_startmark:
+ case re_detail::syntax_element_start_line:
+ case re_detail::syntax_element_word_boundary:
+ case re_detail::syntax_element_buffer_start:
+ case re_detail::syntax_element_restart_continue:
+ case re_detail::syntax_element_end_line:
+ case re_detail::syntax_element_word_end:
+ // doesn't tell us anything about the next character, so:
+ return probe_start_null(node->next.p, terminal);
+ case re_detail::syntax_element_match:
+ case re_detail::syntax_element_buffer_end:
+ case re_detail::syntax_element_soft_buffer_end:
+ case re_detail::syntax_element_backref:
+ return true;
+ case re_detail::syntax_element_jump:
+ if(static_cast<re_detail::re_jump*>(node)->alt.p < node)
+ {
+ // backwards jump,
+ // caused only by end of repeat section, we'll treat this
+ // the same as a match, because the sub-expression has matched.
+ // this is only caused by NULL repeats as in "(a*)*" or "(\<)*"
+ // these are really nonsensence and make the matching code much
+ // harder, it would be nice to get rid of them altogether.
+ if(node->next.p == terminal)
+ return true;
+ else
+ return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal);
+ }
+ else
+ // take the jump and compile:
+ return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal);
+ case re_detail::syntax_element_alt:
+ // we need to take the OR of the two alternatives:
+ return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal) || probe_start_null(node->next.p, terminal);
+ case re_detail::syntax_element_rep:
+ // only need to consider skipping the repeat:
+ return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal);
+ default:
+ break;
+ }
+ return false;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_map(
+ re_detail::re_syntax_base* node, unsigned char* _map,
+ unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const
+{
+ if(_map)
+ {
+ for(unsigned int i = 0; i < 256; ++i)
+ {
+ if(probe_start(node, (charT)i, terminal))
+ _map[i] |= mask;
+ }
+ }
+ if(pnull && probe_start_null(node, terminal))
+ *pnull |= mask;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_detail::re_syntax_base* j, unsigned arg_size)
+{
+# ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4127)
+#endif
+ // move all offsets starting with j->link forward by arg_size
+ // called after an insert:
+ j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i);
+ while(true)
+ {
+ switch(j->type)
+ {
+ case re_detail::syntax_element_rep:
+ static_cast<re_detail::re_jump*>(j)->alt.i += arg_size;
+ j->next.i += arg_size;
+ break;
+ case re_detail::syntax_element_jump:
+ case re_detail::syntax_element_alt:
+ static_cast<re_detail::re_jump*>(j)->alt.i += arg_size;
+ j->next.i += arg_size;
+ break;
+ default:
+ j->next.i += arg_size;
+ break;
+ }
+ if(j->next.i == arg_size)
+ break;
+ j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i);
+ }
+# ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot)
+{
+ typedef typename re_detail::is_byte<charT>::width_type width_type;
+ re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
+ re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
+ re_detail::jstack<boost::uint_fast32_t, Allocator> classes(64, data.allocator());
+ re_detail::jstack<traits_string_type, Allocator> equivalents(64, data.allocator());
+ classes.push(cls);
+ if(dat)
+ {
+ data.align();
+ dat->next.i = data.size();
+ }
+ return compile_set_aux(singles, ranges, classes, equivalents, isnot, width_type());
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set(const charT*& arg_first, const charT* arg_last)
+{
+ re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
+ re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
+ re_detail::jstack<boost::uint_fast32_t, Allocator> classes(64, data.allocator());
+ re_detail::jstack<traits_string_type, Allocator> equivalents(64, data.allocator());
+ bool has_digraphs = false;
+ jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_open_set);
+ ++arg_first;
+ bool started = false;
+ bool done = false;
+ bool isnot = false;
+
+ enum last_type
+ {
+ last_single,
+ last_none,
+ last_dash
+ };
+
+ unsigned l = last_none;
+ traits_string_type s;
+
+ while((arg_first != arg_last) && !done)
+ {
+ traits_size_type c = (traits_size_type)(traits_uchar_type)*arg_first;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ traits_size_type syntax = traits_inst.syntax_type(c);
+ switch(syntax)
+ {
+ case traits_type::syntax_caret:
+ if(!started && !isnot)
+ {
+ isnot = true;
+ }
+ else
+ {
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ break;
+ case traits_type::syntax_open_set:
+ {
+ if((_flags & char_classes) == 0)
+ {
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ // check to see if we really have a class:
+ const charT* base = arg_first;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ unsigned int inner_set = parse_inner_set(arg_first, arg_last);
+ switch(inner_set)
+ {
+ case traits_type::syntax_colon:
+ {
+ if(l == last_dash)
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ boost::uint_fast32_t id = traits_inst.lookup_classname(base+2, arg_first-2);
+ if(_flags & regex_constants::icase)
+ {
+ if((id == traits_type::char_class_upper) || (id == traits_type::char_class_lower))
+ {
+ id = traits_type::char_class_alpha;
+ }
+ }
+ if(id == 0)
+ {
+ fail(REG_ECTYPE);
+ return 0;
+ }
+ classes.push(id);
+ started = true;
+ l = last_none;
+ }
+ break;
+ case traits_type::syntax_dot:
+ //
+ // we have a collating element [.collating-name.]
+ //
+ if(traits_inst.lookup_collatename(s, base+2, arg_first-2))
+ {
+ --arg_first;
+ if(s.size() > 1)
+ has_digraphs = true;
+ if(s.size())goto char_set_literal;
+ }
+ fail(REG_ECOLLATE);
+ return 0;
+ case traits_type::syntax_equal:
+ //
+ // we have an equivalence class [=collating-name=]
+ //
+ if(traits_inst.lookup_collatename(s, base+2, arg_first-2))
+ {
+ std::size_t len = s.size();
+ if(len)
+ {
+ unsigned i = 0;
+ while(i < len)
+ {
+ s[i] = traits_inst.translate(s[i], (_flags & regex_constants::icase));
+ ++i;
+ }
+ traits_string_type s2;
+ traits_inst.transform_primary(s2, s);
+ equivalents.push(s2);
+ started = true;
+ l = last_none;
+ break;
+ }
+ }
+ fail(REG_ECOLLATE);
+ return 0;
+ case traits_type::syntax_left_word:
+ if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_close_set))
+ {
+ ++arg_first;
+ return add_simple(0, re_detail::syntax_element_word_start);
+ }
+ fail(REG_EBRACK);
+ return 0;
+ case traits_type::syntax_right_word:
+ if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_close_set))
+ {
+ ++arg_first;
+ return add_simple(0, re_detail::syntax_element_word_end);
+ }
+ fail(REG_EBRACK);
+ return 0;
+ default:
+ if(started == false)
+ {
+ unsigned int t = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
+ if((t != traits_type::syntax_colon) && (t != traits_type::syntax_dot) && (t != traits_type::syntax_equal))
+ {
+ arg_first = base;
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ }
+ fail(REG_EBRACK);
+ return 0;
+ }
+ if(arg_first == arg_last)
+ {
+ fail(REG_EBRACK);
+ return 0;
+ }
+ continue;
+ }
+ case traits_type::syntax_close_set:
+ if(started == false)
+ {
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ done = true;
+ break;
+ case traits_type::syntax_dash:
+ if(!started)
+ {
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ ++arg_first;
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*arg_first) == traits_type::syntax_close_set)
+ {
+ --arg_first;
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ if((singles.empty() == true) || (l != last_single))
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ ranges.push(singles.peek());
+ if(singles.peek().size() <= 1) // leave digraphs and ligatures in place
+ singles.pop();
+ l = last_dash;
+ continue;
+ case traits_type::syntax_slash:
+ if(_flags & regex_constants::escape_in_lists)
+ {
+ ++arg_first;
+ if(arg_first == arg_last)
+ continue;
+ /*traits_size_type*/ c = (traits_size_type)(traits_uchar_type)*arg_first;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ traits_size_type syntax4 = traits_inst.syntax_type(c);
+ switch(syntax4)
+ {
+ case traits_type::syntax_w:
+ if(l == last_dash)
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ classes.push(traits_type::char_class_word);
+ started = true;
+ l = last_none;
+ ++arg_first;
+ continue;
+ case traits_type::syntax_d:
+ if(l == last_dash)
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ classes.push(traits_type::char_class_digit);
+ started = true;
+ l = last_none;
+ ++arg_first;
+ continue;
+ case traits_type::syntax_s:
+ if(l == last_dash)
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ classes.push(traits_type::char_class_space);
+ started = true;
+ l = last_none;
+ ++arg_first;
+ continue;
+ case traits_type::syntax_l:
+ if(l == last_dash)
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ classes.push(traits_type::char_class_lower);
+ started = true;
+ l = last_none;
+ ++arg_first;
+ continue;
+ case traits_type::syntax_u:
+ if(l == last_dash)
+ {
+ fail(REG_ERANGE);
+ return 0;
+ }
+ classes.push(traits_type::char_class_upper);
+ started = true;
+ l = last_none;
+ ++arg_first;
+ continue;
+ case traits_type::syntax_W:
+ case traits_type::syntax_D:
+ case traits_type::syntax_S:
+ case traits_type::syntax_U:
+ case traits_type::syntax_L:
+ fail(REG_EESCAPE);
+ return 0;
+ default:
+ c = parse_escape(arg_first, arg_last);
+ --arg_first;
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ }
+ else
+ {
+ s = (charT)c;
+ goto char_set_literal;
+ }
+ default:
+ s = (charT)c;
+ char_set_literal:
+ unsigned i = 0;
+ // get string length to stop us going past the end of string (DWA)
+ std::size_t len = s.size();
+ while(i < len)
+ {
+ s[i] = traits_inst.translate(s[i], (_flags & regex_constants::icase));
+ ++i;
+ }
+ started = true;
+ if(l == last_dash)
+ {
+ ranges.push(s);
+ l = last_none;
+ if(s.size() > 1) // add ligatures to singles list as well
+ singles.push(s);
+ }
+ else
+ {
+ singles.push(s);
+ l = last_single;
+ }
+ }
+ ++arg_first;
+ }
+ if(!done)
+ return 0;
+
+ typedef typename re_detail::is_byte<charT>::width_type width_type;
+
+ re_detail::re_syntax_base* result;
+ if(has_digraphs)
+ result = compile_set_aux(singles, ranges, classes, equivalents, isnot, re_detail::_wide_type());
+ else
+ result = compile_set_aux(singles, ranges, classes, equivalents, isnot, width_type());
+ #ifdef __BORLANDC__
+ // delayed throw:
+ if((result == 0) && (_flags & regex_constants::use_except))
+ fail(error_code());
+ #endif
+ return result;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_wide_type&)
+{
+ size_type base = data.size();
+ data.extend(sizeof(re_detail::re_set_long));
+ unsigned int csingles = 0;
+ unsigned int cranges = 0;
+ boost::uint_fast32_t cclasses = 0;
+ unsigned int cequivalents = 0;
+ bool nocollate_state = !(flags() & regex_constants::collate);
+ bool singleton = true;
+
+ while(singles.empty() == false)
+ {
+ ++csingles;
+ const traits_string_type& s = singles.peek();
+ std::size_t len = (s.size() + 1) * sizeof(charT);
+ if(len > sizeof(charT))
+ singleton = false;
+ std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
+ singles.pop();
+ }
+ while(ranges.empty() == false)
+ {
+ traits_string_type c1, c2;
+ if(nocollate_state)
+ c1 = ranges.peek();
+ else
+ traits_inst.transform(c1, ranges.peek());
+ ranges.pop();
+ if(nocollate_state)
+ c2 = ranges.peek();
+ else
+ traits_inst.transform(c2, ranges.peek());
+ ranges.pop();
+ if(c1 < c2)
+ {
+ // for some reason bc5 crashes when throwing exceptions
+ // from here - probably an EH-compiler bug, but hard to
+ // be sure...
+ // delay throw to later:
+ #ifdef __BORLANDC__
+ boost::uint_fast32_t f = _flags;
+ _flags &= ~regex_constants::use_except;
+ #endif
+ fail(REG_ERANGE);
+ #ifdef __BORLANDC__
+ _flags = f;
+ #endif
+ return 0;
+ }
+ ++cranges;
+ std::size_t len = (re_detail::re_strlen(c1.c_str()) + 1) * sizeof(charT);
+ std::memcpy(data.extend(len), c1.c_str(), len);
+ len = (re_detail::re_strlen(c2.c_str()) + 1) * sizeof(charT);
+ std::memcpy(data.extend(len), c2.c_str(), len);
+ }
+ while(classes.empty() == false)
+ {
+ cclasses |= classes.peek();
+ classes.pop();
+ }
+ while(equivalents.empty() == false)
+ {
+ ++cequivalents;
+ const traits_string_type& s = equivalents.peek();
+ std::size_t len = (re_detail::re_strlen(s.c_str()) + 1) * sizeof(charT);
+ std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
+ equivalents.pop();
+ }
+
+ re_detail::re_set_long* dat = reinterpret_cast<re_detail::re_set_long*>(reinterpret_cast<unsigned char*>(data.data()) + base);
+ dat->type = re_detail::syntax_element_long_set;
+ dat->csingles = csingles;
+ dat->cranges = cranges;
+ dat->cclasses = cclasses;
+ dat->cequivalents = cequivalents;
+ dat->isnot = isnot;
+ dat->next.i = 0;
+ dat->singleton = isnot ? true : singleton;
+ return dat;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_narrow_type&)
+{
+ re_detail::re_set* dat = reinterpret_cast<re_detail::re_set*>(data.extend(sizeof(re_detail::re_set)));
+ std::memset(dat, 0, sizeof(re_detail::re_set));
+
+ while(singles.empty() == false)
+ {
+ dat->_map[(traits_size_type)(traits_uchar_type)*(singles.peek().c_str())] = re_detail::mask_all;
+ singles.pop();
+ }
+ while(ranges.empty() == false)
+ {
+ traits_string_type c1, c2, c3, c4;
+
+ if((flags() & regex_constants::collate) == 0)
+ c1 = ranges.peek();
+ else
+ traits_inst.transform(c1, ranges.peek());
+ ranges.pop();
+ if((flags() & regex_constants::collate) == 0)
+ c2 = ranges.peek();
+ else
+ traits_inst.transform(c2, ranges.peek());
+ ranges.pop();
+
+ if(c1 < c2)
+ {
+ // for some reason bc5 crashes when throwing exceptions
+ // from here - probably an EH-compiler bug, but hard to
+ // be sure...
+ // delay throw to later:
+ #ifdef __BORLANDC__
+ boost::uint_fast32_t f = _flags;
+ _flags &= ~regex_constants::use_except;
+ #endif
+ fail(REG_ERANGE);
+ #ifdef __BORLANDC__
+ _flags = f;
+ #endif
+ return 0;
+ }
+ for(unsigned int i = 0; i < 256; ++i)
+ {
+ c4 = (charT)i;
+ if((flags() & regex_constants::collate) == 0)
+ c3 = c4;
+ else
+ traits_inst.transform(c3, c4);
+ if((c3 <= c1) && (c3 >= c2))
+ dat->_map[i] = re_detail::mask_all;
+ }
+ }
+ while(equivalents.empty() == false)
+ {
+ traits_string_type c1, c2;
+ for(unsigned int i = 0; i < 256; ++i)
+ {
+ c2 = (charT)i;
+ traits_inst.transform_primary(c1, c2);
+ if(c1 == equivalents.peek())
+ dat->_map[i] = re_detail::mask_all;
+ }
+ equivalents.pop();
+ }
+
+ boost::uint_fast32_t l_flags = 0;
+ while(classes.empty() == false)
+ {
+ l_flags |= classes.peek();
+ classes.pop();
+ }
+ if(l_flags)
+ {
+ for(unsigned int i = 0; i < 256; ++i)
+ {
+ if(traits_inst.is_class(charT(i), l_flags))
+ dat->_map[(traits_uchar_type)traits_inst.translate((charT)i, (_flags & regex_constants::icase))] = re_detail::mask_all;
+ }
+ }
+
+ if(isnot)
+ {
+ for(unsigned int i = 0; i < 256; ++i)
+ {
+ dat->_map[i] = !dat->_map[i];
+ }
+ }
+
+ dat->type = re_detail::syntax_element_set;
+ dat->next.i = 0;
+ return dat;
+}
+
+#ifndef __CODEGUARD__
+// this must not be inline when Borland's codeguard support is turned
+// on, otherwise we _will_ get surious codeguard errors...
+inline
+#endif
+ re_detail::re_syntax_base* add_offset(void* base, std::ptrdiff_t off)
+{
+ return reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(base) + off);
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces)
+{
+ typedef typename boost::detail::rebind_allocator<bool, Allocator>::type b_alloc;
+
+ register unsigned char* base = reinterpret_cast<unsigned char*>(b);
+ register re_detail::re_syntax_base* ptr = b;
+ bool* pb = 0;
+ b_alloc a(data.allocator());
+#ifndef BOOST_NO_EXCEPTIONS
+ try
+ {
+#endif
+ pb = a.allocate(cbraces);
+ BOOST_REGEX_NOEH_ASSERT(pb)
+ for(unsigned i = 0; i < cbraces; ++i)
+ pb[i] = false;
+
+ repeats = 0;
+
+ while(ptr->next.i)
+ {
+ switch(ptr->type)
+ {
+ case re_detail::syntax_element_rep:
+ jm_assert(data.size() > static_cast<re_detail::re_jump*>(ptr)->alt.i);
+ static_cast<re_detail::re_jump*>(ptr)->alt.p = add_offset(base, static_cast<re_detail::re_jump*>(ptr)->alt.i);
+#ifdef BOOST_REGEX_DEBUG
+ if((re_detail::padding_mask & reinterpret_cast<int>(static_cast<re_detail::re_jump*>(ptr)->alt.p)) && (static_cast<re_detail::re_jump*>(ptr)->alt.p != b))
+ {
+ jm_trace("padding mis-aligment in repeat jump to object type: " << static_cast<re_detail::re_jump*>(ptr)->alt.p->type)
+ //jm_assert(0 == (padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p));
+ }
+#endif
+ static_cast<re_detail::re_repeat*>(ptr)->id = repeats;
+ ++repeats;
+ goto rebase;
+ case re_detail::syntax_element_jump:
+ case re_detail::syntax_element_alt:
+ jm_assert(data.size() > static_cast<re_detail::re_jump*>(ptr)->alt.i);
+ static_cast<re_detail::re_jump*>(ptr)->alt.p = add_offset(base, static_cast<re_detail::re_jump*>(ptr)->alt.i);
+#ifdef BOOST_REGEX_DEBUG
+ if((re_detail::padding_mask & reinterpret_cast<int>(static_cast<re_detail::re_jump*>(ptr)->alt.p) && (static_cast<re_detail::re_jump*>(ptr)->alt.p != b)))
+ {
+ jm_trace("padding mis-aligment in alternation jump to object type: " << static_cast<re_detail::re_jump*>(ptr)->alt.p->type)
+ //jm_assert(0 == (padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p));
+ }
+#endif
+ goto rebase;
+ case re_detail::syntax_element_backref:
+ if((static_cast<re_detail::re_brace*>(ptr)->index >= (int)cbraces) || (pb[static_cast<re_detail::re_brace*>(ptr)->index] == false) )
+ {
+ fail(REG_ESUBREG);
+ a.deallocate(pb, cbraces);
+ return;
+ }
+ goto rebase;
+ case re_detail::syntax_element_endmark:
+ if(static_cast<re_detail::re_brace*>(ptr)->index > 0)
+ pb[static_cast<re_detail::re_brace*>(ptr)->index] = true;
+ goto rebase;
+ default:
+ rebase:
+ jm_assert(data.size() > ptr->next.i);
+ ptr->next.p = add_offset(base, ptr->next.i);
+#ifdef BOOST_REGEX_DEBUG
+ if((re_detail::padding_mask & (int)(ptr->next.p)) && (static_cast<re_detail::re_jump*>(ptr)->alt.p != b))
+ {
+ jm_trace("padding mis-alignment in next record of type " << ptr->next.p->type)
+ jm_assert(0 == (re_detail::padding_mask & (int)(ptr->next.p)));
+ }
+#endif
+ ptr = ptr->next.p;
+ }
+ }
+ a.deallocate(pb, cbraces);
+ pb = 0;
+#ifndef BOOST_NO_EXCEPTIONS
+ }
+ catch(...)
+ {
+ if(pb)
+ a.deallocate(pb, cbraces);
+ throw;
+ }
+#endif
+}
+
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expression(const charT* arg_first, const charT* arg_last, flag_type f)
+{
+# ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4127)
+#endif
+#ifdef __OpenBSD__
+ // strxfrm not working on OpenBSD??
+ f &= ~regex_constants::collate;
+#endif
+
+ if(arg_first == expression())
+ {
+ traits_string_type s(arg_first, arg_last);
+ return set_expression(s.c_str(), s.c_str() + s.size(), f);
+ }
+ typedef typename traits_type::sentry sentry_t;
+ sentry_t sent(traits_inst);
+ if(sent){
+
+ const charT* base = arg_first;
+ data.clear();
+ _flags = f;
+ fail(REG_NOERROR); // clear any error
+
+ if(arg_first >= arg_last)
+ {
+ fail(REG_EMPTY);
+ return error_code();
+ }
+
+ const charT* ptr = arg_first;
+ marks = 0;
+ re_detail::jstack<std::size_t, Allocator> mark(64, data.allocator());
+ re_detail::jstack<int, Allocator> markid(64, data.allocator());
+ std::size_t last_mark_popped = 0;
+ register traits_size_type c;
+ register re_detail::re_syntax_base* dat;
+
+ unsigned rep_min = 0;
+ unsigned rep_max = 0;
+
+ //
+ // set up header:
+ //
+ ++marks;
+ dat = 0;
+
+ if(_flags & regex_constants::literal)
+ {
+ while(ptr != arg_last)
+ {
+ dat = add_literal(dat, traits_inst.translate(*ptr, (_flags & regex_constants::icase)));
+ ++ptr;
+ }
+ }
+
+ while (ptr < arg_last)
+ {
+ c = (traits_size_type)(traits_uchar_type)*ptr;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ traits_size_type syntax = traits_inst.syntax_type(c);
+ switch(syntax)
+ {
+ case traits_type::syntax_open_bracket:
+ if(_flags & bk_parens)
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+ open_bracked_jump:
+ // extend:
+ dat = add_simple(dat, re_detail::syntax_element_startmark, sizeof(re_detail::re_brace));
+ if(_flags & nosubs)
+ {
+ markid.push(0);
+ static_cast<re_detail::re_brace*>(dat)->index = 0;
+ }
+ else
+ {
+ markid.push(marks);
+ static_cast<re_detail::re_brace*>(dat)->index = marks++;
+ }
+ mark.push(data.index(dat));
+ ++ptr;
+ //
+ // check for perl like (?...) extention syntax
+ c = (traits_size_type)(traits_uchar_type)*ptr;
+ if(((_flags & (bk_parens|perlex)) == perlex) && (traits_type::syntax_question == traits_inst.syntax_type(c)))
+ {
+ ++ptr;
+ c = (traits_size_type)(traits_uchar_type)*ptr;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ traits_size_type syntax2 = traits_inst.syntax_type(c);
+ switch(syntax2)
+ {
+ case traits_type::syntax_colon:
+ static_cast<re_detail::re_brace*>(dat)->index = 0;
+ --marks;
+ markid.pop();
+ markid.push(0);
+ ++ptr;
+ continue;
+ case traits_type::syntax_equal:
+ static_cast<re_detail::re_brace*>(dat)->index = -1;
+ markid.pop();
+ markid.push(-1);
+ common_forward_assert:
+ --marks;
+ ++ptr;
+ // extend:
+ dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
+ data.align();
+ //
+ // we don't know what value to put here yet,
+ // use an arbitrarily large value for now
+ // and check it later:
+ static_cast<re_detail::re_jump*>(dat)->alt.i = INT_MAX/2;
+ mark.push(data.size() - re_detail::re_jump_size);
+ continue;
+ case traits_type::syntax_right_word:
+ static_cast<re_detail::re_brace*>(dat)->index = -3;
+ markid.pop();
+ markid.push(-3);
+ goto common_forward_assert;
+ case traits_type::syntax_not:
+ static_cast<re_detail::re_brace*>(dat)->index = -2;
+ markid.pop();
+ markid.push(-2);
+ goto common_forward_assert;
+ case traits_type::syntax_hash:
+ // comment just skip it:
+ static_cast<re_detail::re_brace*>(dat)->index = 0;
+ --marks;
+ markid.pop();
+ mark.pop();
+ do{
+ ++ptr;
+ c = (traits_size_type)(traits_uchar_type)*ptr;
+ }while(traits_type::syntax_close_bracket != traits_inst.syntax_type(c));
+ ++ptr;
+ continue;
+ default:
+ //
+ // error, return to standard parsing and let that handle the error:
+ --ptr;
+ continue;
+ }
+ }
+ break;
+ case traits_type::syntax_close_bracket:
+ if(_flags & bk_parens)
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+
+ close_bracked_jump:
+ if(dat)
+ {
+ data.align();
+ dat->next.i = data.size();
+ }
+
+ if(mark.empty())
+ {
+ fail(REG_EPAREN);
+ return error_code();
+ }
+ // see if we have an empty alternative:
+ if(mark.peek() == data.index(dat) )
+ {
+ re_detail::re_syntax_base* para = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + mark.peek());
+ if(para->type == re_detail::syntax_element_jump)
+ {
+ fail(REG_EMPTY);
+ return error_code();
+ }
+ }
+
+ // pop any pushed alternatives and set the target arg_last destination:
+ dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+ while(dat->type == re_detail::syntax_element_jump)
+ {
+ static_cast<re_detail::re_jump*>(dat)->alt.i = data.size();
+ mark.pop();
+ if(mark.empty())
+ {
+ fail(REG_EPAREN);
+ return error_code();
+ }
+ dat = reinterpret_cast<re_detail::re_jump*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+ }
+
+ dat = add_simple(0, re_detail::syntax_element_endmark, sizeof(re_detail::re_brace));
+ static_cast<re_detail::re_brace*>(dat)->index = markid.peek();
+ markid.pop();
+ last_mark_popped = mark.peek();
+ mark.pop();
+ ++ptr;
+ break;
+ case traits_type::syntax_char:
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ break;
+ case traits_type::syntax_slash:
+ {
+ if(++ptr == arg_last)
+ {
+ fail(REG_EESCAPE);
+ return error_code();
+ }
+ c = (traits_size_type)(traits_uchar_type)*ptr;
+ // this is only used for the switch(), but cannot be folded in
+ // due to a bug in Comeau 4.2.44beta3
+ traits_size_type syntax3 = traits_inst.syntax_type(c);
+ switch(syntax3)
+ {
+ case traits_type::syntax_open_bracket:
+ if(_flags & bk_parens)
+ goto open_bracked_jump;
+ break;
+ case traits_type::syntax_close_bracket:
+ if(_flags & bk_parens)
+ goto close_bracked_jump;
+ break;
+ case traits_type::syntax_plus:
+ if((_flags & bk_plus_qm) && ((_flags & limited_ops) == 0))
+ {
+ rep_min = 1;
+ rep_max = (unsigned)-1;
+ goto repeat_jump;
+ }
+ break;
+ case traits_type::syntax_question:
+ if((_flags & bk_plus_qm) && ((_flags & limited_ops) == 0))
+ {
+ rep_min = 0;
+ rep_max = 1;
+ goto repeat_jump;
+ }
+ break;
+ case traits_type::syntax_or:
+ if(((_flags & bk_vbar) == 0) || (_flags & limited_ops))
+ break;
+ goto alt_string_jump;
+ case traits_type::syntax_open_brace:
+ if( ((_flags & bk_braces) == 0) || ((_flags & intervals) == 0))
+ break;
+
+ // we have {x} or {x,} or {x,y}:
+ parse_range(ptr, arg_last, rep_min, rep_max);
+ goto repeat_jump;
+
+ case traits_type::syntax_digit:
+ if(_flags & bk_refs)
+ {
+ // update previous:
+ int i = traits_inst.toi((charT)c);
+ if(i == 0)
+ {
+ // we can have \025 which means take char whose
+ // code is 25 (octal), so parse string:
+ c = traits_inst.toi(ptr, arg_last, -8);
+ --ptr;
+ break;
+ }
+ dat = add_simple(dat, re_detail::syntax_element_backref, sizeof(re_detail::re_brace));
+ static_cast<re_detail::re_brace*>(dat)->index = i;
+ ++ptr;
+ continue;
+ }
+ break;
+ case traits_type::syntax_b: // re_detail::syntax_element_word_boundary
+ dat = add_simple(dat, re_detail::syntax_element_word_boundary);
+ ++ptr;
+ continue;
+ case traits_type::syntax_B:
+ dat = add_simple(dat, re_detail::syntax_element_within_word);
+ ++ptr;
+ continue;
+ case traits_type::syntax_left_word:
+ dat = add_simple(dat, re_detail::syntax_element_word_start);
+ ++ptr;
+ continue;
+ case traits_type::syntax_right_word:
+ dat = add_simple(dat, re_detail::syntax_element_word_end);
+ ++ptr;
+ continue;
+ case traits_type::syntax_w: //re_detail::syntax_element_word_char
+ dat = compile_set_simple(dat, traits_type::char_class_word);
+ ++ptr;
+ continue;
+ case traits_type::syntax_W:
+ dat = compile_set_simple(dat, traits_type::char_class_word, true);
+ ++ptr;
+ continue;
+ case traits_type::syntax_d: //re_detail::syntax_element_word_char
+ dat = compile_set_simple(dat, traits_type::char_class_digit);
+ ++ptr;
+ continue;
+ case traits_type::syntax_D:
+ dat = compile_set_simple(dat, traits_type::char_class_digit, true);
+ ++ptr;
+ continue;
+ case traits_type::syntax_s: //re_detail::syntax_element_word_char
+ dat = compile_set_simple(dat, traits_type::char_class_space);
+ ++ptr;
+ continue;
+ case traits_type::syntax_S:
+ dat = compile_set_simple(dat, traits_type::char_class_space, true);
+ ++ptr;
+ continue;
+ case traits_type::syntax_l: //re_detail::syntax_element_word_char
+ dat = compile_set_simple(dat, traits_type::char_class_lower);
+ ++ptr;
+ continue;
+ case traits_type::syntax_L:
+ dat = compile_set_simple(dat, traits_type::char_class_lower, true);
+ ++ptr;
+ continue;
+ case traits_type::syntax_u: //re_detail::syntax_element_word_char
+ dat = compile_set_simple(dat, traits_type::char_class_upper);
+ ++ptr;
+ continue;
+ case traits_type::syntax_U:
+ dat = compile_set_simple(dat, traits_type::char_class_upper, true);
+ ++ptr;
+ continue;
+ case traits_type::syntax_Q:
+ ++ptr;
+ while(true)
+ {
+ if(ptr == arg_last)
+ {
+ fail(REG_EESCAPE);
+ return error_code();
+ }
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_slash)
+ {
+ ++ptr;
+ if((ptr != arg_last) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_E))
+ break;
+ else
+ {
+ dat = add_literal(dat, *(ptr-1));
+ continue;
+ }
+ }
+ dat = add_literal(dat, *ptr);
+ ++ptr;
+ }
+ ++ptr;
+ continue;
+ case traits_type::syntax_C:
+ dat = add_simple(dat, re_detail::syntax_element_wild);
+ ++ptr;
+ continue;
+ case traits_type::syntax_X:
+ dat = add_simple(dat, re_detail::syntax_element_combining);
+ ++ptr;
+ continue;
+ case traits_type::syntax_Z:
+ dat = add_simple(dat, re_detail::syntax_element_soft_buffer_end);
+ ++ptr;
+ continue;
+ case traits_type::syntax_G:
+ dat = add_simple(dat, re_detail::syntax_element_restart_continue);
+ ++ptr;
+ continue;
+ case traits_type::syntax_start_buffer:
+ dat = add_simple(dat, re_detail::syntax_element_buffer_start);
+ ++ptr;
+ continue;
+ case traits_type::syntax_end_buffer:
+ dat = add_simple(dat, re_detail::syntax_element_buffer_end);
+ ++ptr;
+ continue;
+ default:
+ c = (traits_size_type)(traits_uchar_type)parse_escape(ptr, arg_last);
+ dat = add_literal(dat, (charT)c);
+ continue;
+ }
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ break;
+ }
+ case traits_type::syntax_dollar:
+ dat = add_simple(dat, re_detail::syntax_element_end_line, sizeof(re_detail::re_syntax_base));
+ ++ptr;
+ continue;
+ case traits_type::syntax_caret:
+ dat = add_simple(dat, re_detail::syntax_element_start_line, sizeof(re_detail::re_syntax_base));
+ ++ptr;
+ continue;
+ case traits_type::syntax_dot:
+ dat = add_simple(dat, re_detail::syntax_element_wild, sizeof(re_detail::re_syntax_base));
+ ++ptr;
+ continue;
+ case traits_type::syntax_star:
+ rep_min = 0;
+ rep_max = (unsigned)-1;
+
+ repeat_jump:
+ {
+ std::ptrdiff_t offset;
+ if(dat == 0)
+ {
+ fail(REG_BADRPT);
+ return error_code();
+ }
+ switch(dat->type)
+ {
+ case re_detail::syntax_element_endmark:
+ offset = last_mark_popped;
+ break;
+ case re_detail::syntax_element_literal:
+ if(static_cast<re_detail::re_literal*>(dat)->length > 1)
+ {
+ // update previous:
+ charT lit = *reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal) + ((static_cast<re_detail::re_literal*>(dat)->length-1)*sizeof(charT)));
+ --static_cast<re_detail::re_literal*>(dat)->length;
+ dat = add_simple(dat, re_detail::syntax_element_literal, sizeof(re_detail::re_literal) + sizeof(charT));
+ static_cast<re_detail::re_literal*>(dat)->length = 1;
+ *reinterpret_cast<charT*>(static_cast<re_detail::re_literal*>(dat)+1) = lit;
+ }
+ offset = reinterpret_cast<char*>(dat) - reinterpret_cast<char*>(data.data());
+ break;
+ case re_detail::syntax_element_backref:
+ case re_detail::syntax_element_long_set:
+ case re_detail::syntax_element_set:
+ case re_detail::syntax_element_wild:
+ case re_detail::syntax_element_combining:
+ // we're repeating a single item:
+ offset = reinterpret_cast<char*>(dat) - reinterpret_cast<char*>(data.data());
+ break;
+ default:
+ fail(REG_BADRPT);
+ return error_code();
+ }
+ data.align();
+ dat->next.i = data.size();
+ //unsigned pos = (char*)dat - (char*)data.data();
+
+ // add the trailing jump:
+ dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
+ static_cast<re_detail::re_jump*>(dat)->alt.i = 0;
+
+ // now insert the leading repeater:
+ dat = static_cast<re_detail::re_syntax_base*>(data.insert(offset, re_detail::re_repeater_size));
+ dat->next.i = (reinterpret_cast<char*>(dat) - reinterpret_cast<char*>(data.data())) + re_detail::re_repeater_size;
+ dat->type = re_detail::syntax_element_rep;
+ static_cast<re_detail::re_repeat*>(dat)->alt.i = data.size();
+ static_cast<re_detail::re_repeat*>(dat)->min = rep_min;
+ static_cast<re_detail::re_repeat*>(dat)->max = rep_max;
+ static_cast<re_detail::re_repeat*>(dat)->leading = false;
+ static_cast<re_detail::re_repeat*>(dat)->greedy = true;
+ move_offsets(dat, re_detail::re_repeater_size);
+ ++ptr;
+ //
+ // now check to see if we have a non-greedy repeat:
+ if((ptr != arg_last) && (_flags & (perlex | limited_ops | bk_plus_qm | bk_braces)) == perlex)
+ {
+ c = (traits_size_type)(traits_uchar_type)*ptr;
+ if(traits_type::syntax_question == traits_inst.syntax_type(c))
+ {
+ // OK repeat is non-greedy:
+ static_cast<re_detail::re_repeat*>(dat)->greedy = false;
+ ++ptr;
+ }
+ }
+ dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + data.size() - re_detail::re_jump_size);
+ static_cast<re_detail::re_repeat*>(dat)->alt.i = offset;
+ continue;
+ }
+ case traits_type::syntax_plus:
+ if(_flags & (bk_plus_qm | limited_ops))
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+ rep_min = 1;
+ rep_max = (unsigned)-1;
+ goto repeat_jump;
+ case traits_type::syntax_question:
+ if(_flags & (bk_plus_qm | limited_ops))
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+ rep_min = 0;
+ rep_max = 1;
+ goto repeat_jump;
+ case traits_type::syntax_open_set:
+ // update previous:
+ if(dat)
+ {
+ data.align();
+ dat->next.i = data.size();
+ }
+ // extend:
+ dat = compile_set(ptr, arg_last);
+ if(dat == 0)
+ {
+ if((_flags & regex_constants::failbit) == 0)
+ fail(REG_EBRACK);
+ return error_code();
+ }
+ break;
+ case traits_type::syntax_or:
+ {
+ if(_flags & (bk_vbar | limited_ops))
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+
+ alt_string_jump:
+
+ // update previous:
+ if(dat == 0)
+ {
+ // start of pattern can't have empty "|"
+ fail(REG_EMPTY);
+ return error_code();
+ }
+ // see if we have an empty alternative:
+ if(mark.empty() == false)
+ if(mark.peek() == data.index(dat))
+ {
+ fail(REG_EMPTY);
+ return error_code();
+ }
+ // extend:
+ dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
+ data.align();
+ //
+ // we don't know what value to put here yet,
+ // use an arbitrarily large value for now
+ // and check it later (TODO!)
+ static_cast<re_detail::re_jump*>(dat)->alt.i = INT_MAX/2;
+
+ // now work out where to insert:
+ std::size_t offset = 0;
+ if(mark.empty() == false)
+ {
+ // we have a '(' or '|' to go back to:
+ offset = mark.peek();
+ re_detail::re_syntax_base* base2 = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + offset);
+ offset = base2->next.i;
+ }
+ re_detail::re_jump* j = static_cast<re_detail::re_jump*>(data.insert(offset, re_detail::re_jump_size));
+ j->type = re_detail::syntax_element_alt;
+ j->next.i = offset + re_detail::re_jump_size;
+ j->alt.i = data.size();
+ move_offsets(j, re_detail::re_jump_size);
+ dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + data.size() - re_detail::re_jump_size);
+ mark.push(data.size() - re_detail::re_jump_size);
+ ++ptr;
+ break;
+ }
+ case traits_type::syntax_open_brace:
+ if((_flags & bk_braces) || ((_flags & intervals) == 0))
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+ // we have {x} or {x,} or {x,y}:
+ parse_range(ptr, arg_last, rep_min, rep_max);
+ goto repeat_jump;
+ case traits_type::syntax_newline:
+ if(_flags & newline_alt)
+ goto alt_string_jump;
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ case traits_type::syntax_close_brace:
+ if(_flags & bk_braces)
+ {
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ continue;
+ }
+ fail(REG_BADPAT);
+ return error_code();
+ default:
+ dat = add_literal(dat, (charT)c);
+ ++ptr;
+ break;
+ } // switch
+ } // while
+
+ //
+ // update previous:
+ if(dat)
+ {
+ data.align();
+ dat->next.i = data.size();
+ }
+
+ // see if we have an empty alternative:
+ if(mark.empty() == false)
+ if(mark.peek() == data.index(dat) )
+ {
+ re_detail::re_syntax_base* para = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + mark.peek());
+ if(para->type == re_detail::syntax_element_jump)
+ {
+ fail(REG_EMPTY);
+ return error_code();
+ }
+ }
+ //
+ // set up tail:
+ //
+ if(mark.empty() == false)
+ {
+ // pop any pushed alternatives and set the target arg_last destination:
+ dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+ while(dat->type == re_detail::syntax_element_jump)
+ {
+ static_cast<re_detail::re_jump*>(dat)->alt.i = data.size();
+ mark.pop();
+ if(mark.empty() == true)
+ break;
+ dat = reinterpret_cast<re_detail::re_jump*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+ }
+ }
+
+ dat = static_cast<re_detail::re_brace*>(data.extend(sizeof(re_detail::re_syntax_base)));
+ dat->type = re_detail::syntax_element_match;
+ dat->next.i = 0;
+
+ if(mark.empty() == false)
+ {
+ fail(REG_EPAREN);
+ return error_code();
+ }
+
+ //
+ // allocate space for start _map:
+ startmap = reinterpret_cast<unsigned char*>(data.extend(256 + ((arg_last - base + 1) * sizeof(charT))));
+ //
+ // and copy the expression we just compiled:
+ _expression = reinterpret_cast<charT*>(reinterpret_cast<char*>(startmap) + 256);
+ _expression_len = arg_last - base;
+ std::memcpy(_expression, base, _expression_len * sizeof(charT));
+ *(_expression + _expression_len) = charT(0);
+
+ //
+ // now we need to apply fixups to the array
+ // so that we can use pointers and not indexes
+ fixup_apply(static_cast<re_detail::re_syntax_base*>(data.data()), marks);
+
+ // check for error during fixup:
+ if(_flags & regex_constants::failbit)
+ return error_code();
+
+ //
+ // finally compile the maps so that we can make intelligent choices
+ // whenever we encounter an alternative:
+ compile_maps();
+ if(pkmp)
+ {
+ re_detail::kmp_free(pkmp, data.allocator());
+ pkmp = 0;
+ }
+ re_detail::re_syntax_base* sbase = static_cast<re_detail::re_syntax_base*>(data.data());
+ _restart_type = probe_restart(sbase);
+ _leading_len = fixup_leading_rep(sbase, 0);
+ if((sbase->type == re_detail::syntax_element_literal) && (sbase->next.p->type == re_detail::syntax_element_match))
+ {
+ _restart_type = restart_fixed_lit;
+ if(0 == pkmp)
+ {
+ charT* p1 = reinterpret_cast<charT*>(reinterpret_cast<char*>(sbase) + sizeof(re_detail::re_literal));
+ charT* p2 = p1 + static_cast<re_detail::re_literal*>(sbase)->length;
+ pkmp = re_detail::kmp_compile(p1, p2, charT(), re_detail::kmp_translator<traits>(_flags®ex_constants::icase, &traits_inst), data.allocator());
+ }
+ }
+ return error_code();
+
+ } // sentry
+ return REG_EMPTY;
+
+# ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int arg_size)
+{
+ if(dat)
+ {
+ data.align();
+ dat->next.i = data.size();
+ }
+ if(arg_size < sizeof(re_detail::re_syntax_base))
+ arg_size = sizeof(re_detail::re_syntax_base);
+ dat = static_cast<re_detail::re_syntax_base*>(data.extend(arg_size));
+ dat->type = type;
+ dat->next.i = 0;
+ return dat;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_literal(re_detail::re_syntax_base* dat, charT c)
+{
+ if(dat && (dat->type == re_detail::syntax_element_literal))
+ {
+ // add another charT to the list:
+ std::ptrdiff_t pos = reinterpret_cast<unsigned char*>(dat) - reinterpret_cast<unsigned char*>(data.data());
+ *reinterpret_cast<charT*>(data.extend(sizeof(charT))) = traits_inst.translate(c, (_flags & regex_constants::icase));
+ dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + pos);
+ ++(static_cast<re_detail::re_literal*>(dat)->length);
+ }
+ else
+ {
+ // extend:
+ dat = add_simple(dat, re_detail::syntax_element_literal, sizeof(re_detail::re_literal) + sizeof(charT));
+ static_cast<re_detail::re_literal*>(dat)->length = 1;
+ *reinterpret_cast<charT*>(reinterpret_cast<re_detail::re_literal*>(dat)+1) = traits_inst.translate(c, (_flags & regex_constants::icase));
+ }
+ return dat;
+}
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_restart(re_detail::re_syntax_base* dat)
+{
+ switch(dat->type)
+ {
+ case re_detail::syntax_element_startmark:
+ case re_detail::syntax_element_endmark:
+ if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
+ return regbase::restart_any;
+ return probe_restart(dat->next.p);
+ case re_detail::syntax_element_start_line:
+ return regbase::restart_line;
+ case re_detail::syntax_element_word_start:
+ return regbase::restart_word;
+ case re_detail::syntax_element_buffer_start:
+ return regbase::restart_buf;
+ case re_detail::syntax_element_restart_continue:
+ return regbase::restart_continue;
+ default:
+ return regbase::restart_any;
+ }
+}
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* arg_end)
+{
+ unsigned int len = 0;
+ bool leading_lit = arg_end ? false : true;
+ while(dat != arg_end)
+ {
+ switch(dat->type)
+ {
+ case re_detail::syntax_element_literal:
+ len += static_cast<re_detail::re_literal*>(dat)->length;
+ if((leading_lit) && (static_cast<re_detail::re_literal*>(dat)->length > 2))
+ {
+ // we can do a literal search for the leading literal string
+ // using Knuth-Morris-Pratt (or whatever), and only then check for
+ // matches. We need a decent length string though to make it
+ // worth while.
+ _leading_string = reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal));
+ _leading_string_len = static_cast<re_detail::re_literal*>(dat)->length;
+ _restart_type = restart_lit;
+ leading_lit = false;
+ const charT* p1 = _leading_string;
+ const charT* p2 = _leading_string + _leading_string_len;
+ pkmp = re_detail::kmp_compile(p1, p2, charT(), re_detail::kmp_translator<traits>(_flags®ex_constants::icase, &traits_inst), data.allocator());
+ }
+ leading_lit = false;
+ break;
+ case re_detail::syntax_element_wild:
+ ++len;
+ leading_lit = false;
+ break;
+ case re_detail::syntax_element_match:
+ return len;
+ case re_detail::syntax_element_backref:
+ //case re_detail::syntax_element_jump:
+ case re_detail::syntax_element_alt:
+ case re_detail::syntax_element_combining:
+ return 0;
+ case re_detail::syntax_element_long_set:
+ {
+ // we need to verify that there are no multi-character
+ // collating elements inside the repeat:
+ if(!static_cast<re_detail::re_set_long*>(dat)->singleton)
+ return 0;
+ ++len;
+ leading_lit = false;
+ break;
+ }
+ case re_detail::syntax_element_set:
+ ++len;
+ leading_lit = false;
+ break;
+ case re_detail::syntax_element_rep:
+ case re_detail::syntax_element_dot_rep:
+ case re_detail::syntax_element_char_rep:
+ case re_detail::syntax_element_short_set_rep:
+ case re_detail::syntax_element_long_set_rep:
+ if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast<re_detail::re_repeat*>(dat)->alt.p) ))
+ {
+ static_cast<re_detail::re_repeat*>(dat)->leading = leading_lit;
+ return len;
+ }
+ return len;
+ case re_detail::syntax_element_startmark:
+ if(static_cast<const re_detail::re_brace*>(dat)->index == -2)
+ return 0;
+ // fall through:
+ default:
+ break;
+ }
+ dat = dat->next.p;
+ }
+ return len;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fail(unsigned int err)
+{
+ error_code_ = err;
+ if(err)
+ {
+ _flags |= regex_constants::failbit;
+#ifndef BOOST_NO_EXCEPTIONS
+ if(_flags & regex_constants::use_except)
+ {
+ re_detail::raise_error(traits_inst, err);
+ }
+#endif
+ }
+ else
+ _flags &= ~regex_constants::failbit;
+}
+
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+
+#endif // BOOST_REGEX_COMPILE_HPP
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_cstring.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: This is an internal header file, do not include directly.
+ * String support and helper functions, for regular
+ * expression library.
+ */
+
+#ifndef BOOST_REGEX_CSTRING_HPP
+#define BOOST_REGEX_CSTRING_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#include <cstring>
+
+namespace boost{
+ namespace re_detail{
+
+//
+// start by defining some template function aliases for C API functions:
+//
+
+template <class charT>
+std::size_t BOOST_REGEX_CALL re_strlen(const charT *s)
+{
+ std::size_t len = 0;
+ while(*s)
+ {
+ ++s;
+ ++len;
+ }
+ return len;
+}
+
+inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s)
+{
+ return std::strlen(s);
+}
+
+#ifndef BOOST_NO_WREGEX
+
+inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s)
+{
+ return std::wcslen(s);
+}
+
+#endif
+
+#ifndef BOOST_NO_WREGEX
+BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
+#endif
+BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in);
+
+template <class charT>
+void BOOST_REGEX_CALL re_trunc_primary(std::basic_string<charT>& s)
+{
+ for(unsigned int i = 0; i < s.size(); ++i)
+ {
+ if(s[i] <= 1)
+ {
+ s.erase(i);
+ break;
+ }
+ }
+}
+
+inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2)
+{
+ #if defined(__BORLANDC__) && defined(strcpy)
+ return ::strcpy(s1, s2);
+ #else
+ return std::strcpy(s1, s2);
+ #endif
+}
+
+#ifndef BOOST_NO_WREGEX
+
+inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2)
+{
+ return std::wcscpy(s1, s2);
+}
+
+#endif
+
+
+template <class charT>
+charT* BOOST_REGEX_CALL re_strdup(const charT* p)
+{
+ charT* buf = new charT[re_strlen(p) + 1];
+ re_strcpy(buf, p);
+ return buf;
+}
+
+template <class charT>
+inline void BOOST_REGEX_CALL re_strfree(charT* p)
+{
+ delete[] p;
+}
+
+} // namespace re_detail
+} // namespace boost
+
+#endif // BOOST_REGEX_CSTRING_HPP
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_format.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides formatting output routines for search and replace
+ * operations. Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_FORMAT_HPP
+#define BOOST_REGEX_FORMAT_HPP
+
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+//
+// Forward declaration:
+//
+template <class RandomAccessIterator, class Allocator>
+class match_results;
+
+namespace re_detail{
+
+template <class O, class I>
+O BOOST_REGEX_CALL re_copy_out(O out, I first, I last)
+{
+ while(first != last)
+ {
+ *out = *first;
+ ++out;
+ ++first;
+ }
+ return out;
+}
+
+template <class charT, class traits_type>
+void BOOST_REGEX_CALL re_skip_format(const charT*& fmt, const traits_type& traits_inst)
+{
+ // dwa 9/13/00 - suppress incorrect unused parameter warning for MSVC
+ (void)traits_inst;
+
+ typedef typename traits_type::size_type traits_size_type;
+ typedef typename traits_type::uchar_type traits_uchar_type;
+ typedef typename traits_type::string_type traits_string_type;
+
+ unsigned int parens = 0;
+ unsigned int c;
+ while(*fmt)
+ {
+ c = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt));
+ if((c == traits_type::syntax_colon) && (parens == 0))
+ {
+ ++fmt;
+ return;
+ }
+ else if(c == traits_type::syntax_close_bracket)
+ {
+ if(parens == 0)
+ {
+ ++fmt;
+ return;
+ }
+ --parens;
+ }
+ else if(c == traits_type::syntax_open_bracket)
+ ++parens;
+ else if(c == traits_type::syntax_slash)
+ {
+ ++fmt;
+ if(*fmt == 0)
+ return;
+ }
+ ++fmt;
+ }
+}
+
+#ifdef BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
+
+//
+// ugly hack for buggy output iterators
+
+template <class T>
+inline void oi_assign(T* p, T v)
+{
+ ::boost::re_detail::pointer_destroy(p);
+ pointer_construct(p, v);
+}
+
+#else
+
+template <class T>
+inline void oi_assign(T* p, T v)
+{
+ //
+ // if you get a compile time error in here then you either
+ // need to rewrite your output iterator to make it assignable
+ // (as is required by the standard), or define
+ // BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN to use the ugly hack above
+ *p = v;
+}
+
+#endif
+
+
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+//
+// Ugly ugly hack,
+// template don't merge if they contain switch statements so declare these
+// templates in unnamed namespace (ie with internal linkage), each translation
+// unit then gets its own local copy, it works seemlessly but bloats the app.
+namespace{
+#endif
+
+//
+// algorithm reg_format:
+// takes the result of a match and a format string
+// and merges them to produce a new string which
+// is sent to an OutputIterator,
+// _reg_format_aux does the actual work:
+//
+template <class OutputIterator, class Iterator, class Allocator, class charT, class traits_type>
+OutputIterator BOOST_REGEX_CALL _reg_format_aux(OutputIterator out,
+ const match_results<Iterator, Allocator>& m,
+ const charT*& fmt,
+ match_flag_type flags, const traits_type& traits_inst)
+{
+#ifdef __BORLANDC__
+#pragma option push -w-8037
+#endif
+ const charT* fmt_end = fmt;
+ while(*fmt_end) ++ fmt_end;
+
+ typedef typename traits_type::size_type traits_size_type;
+ typedef typename traits_type::uchar_type traits_uchar_type;
+ typedef typename traits_type::string_type traits_string_type;
+
+ while(*fmt)
+ {
+ switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)))
+ {
+ case traits_type::syntax_dollar:
+ if(flags & format_sed)
+ {
+ // no perl style replacement,
+ // $ is an ordinary character:
+ goto default_opt;
+ }
+ ++fmt;
+ if(*fmt == 0) // oops trailing $
+ {
+ --fmt;
+ *out = *fmt;
+ ++out;
+ return out;
+ }
+ switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)))
+ {
+ case traits_type::syntax_start_buffer:
+ oi_assign(&out, re_copy_out(out, Iterator(m[-1].first), Iterator(m[-1].second)));
+ ++fmt;
+ continue;
+ case traits_type::syntax_end_buffer:
+ oi_assign(&out, re_copy_out(out, Iterator(m[-2].first), Iterator(m[-2].second)));
+ ++fmt;
+ continue;
+ case traits_type::syntax_digit:
+ {
+expand_sub:
+ unsigned int index = traits_inst.toi(fmt, fmt_end, 10);
+ if(index < m.size())
+ oi_assign(&out, re_copy_out(out, Iterator(m[index].first), Iterator(m[index].second)));
+ continue;
+ }
+ }
+ // anything else:
+ if(*fmt == '&')
+ {
+ oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second)));
+ ++fmt;
+ }
+ else
+ {
+ // probably an error, treat as a literal '$'
+ --fmt;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ }
+ continue;
+ case traits_type::syntax_slash:
+ {
+ // escape sequence:
+ ++fmt;
+ charT c(*fmt);
+ if(*fmt == 0)
+ {
+ --fmt;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ return out;
+ }
+ switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)))
+ {
+ case traits_type::syntax_a:
+ c = '\a';
+ ++fmt;
+ break;
+ case traits_type::syntax_f:
+ c = '\f';
+ ++fmt;
+ break;
+ case traits_type::syntax_n:
+ c = '\n';
+ ++fmt;
+ break;
+ case traits_type::syntax_r:
+ c = '\r';
+ ++fmt;
+ break;
+ case traits_type::syntax_t:
+ c = '\t';
+ ++fmt;
+ break;
+ case traits_type::syntax_v:
+ c = '\v';
+ ++fmt;
+ break;
+ case traits_type::syntax_x:
+ ++fmt;
+ if(fmt == fmt_end)
+ {
+ *out = *--fmt;
+ ++out;
+ return out;
+ }
+ // maybe have \x{ddd}
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) == traits_type::syntax_open_brace)
+ {
+ ++fmt;
+ if(fmt == fmt_end)
+ {
+ fmt -= 2;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ if(traits_inst.is_class(*fmt, traits_type::char_class_xdigit) == false)
+ {
+ fmt -= 2;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ c = (charT)traits_inst.toi(fmt, fmt_end, -16);
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) != traits_type::syntax_close_brace)
+ {
+ while(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) != traits_type::syntax_slash)
+ --fmt;
+ ++fmt;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ ++fmt;
+ break;
+ }
+ else
+ {
+ if(traits_inst.is_class(*fmt, traits_type::char_class_xdigit) == false)
+ {
+ --fmt;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ c = (charT)traits_inst.toi(fmt, fmt_end, -16);
+ }
+ break;
+ case traits_type::syntax_c:
+ ++fmt;
+ if(fmt == fmt_end)
+ {
+ --fmt;
+ *out = *fmt;
+ ++out;
+ return out;
+ }
+ if(((typename traits_type::uchar_type)(*fmt) < (typename traits_type::uchar_type)'@')
+ || ((typename traits_type::uchar_type)(*fmt) > (typename traits_type::uchar_type)127) )
+ {
+ --fmt;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ break;
+ }
+ c = (charT)((typename traits_type::uchar_type)(*fmt) - (typename traits_type::uchar_type)'@');
+ ++fmt;
+ break;
+ case traits_type::syntax_e:
+ c = (charT)27;
+ ++fmt;
+ break;
+ case traits_type::syntax_digit:
+ if(flags & format_sed)
+ goto expand_sub;
+ else
+ c = (charT)traits_inst.toi(fmt, fmt_end, -8);
+ break;
+ default:
+ //c = *fmt;
+ ++fmt;
+ }
+ *out = c;
+ ++out;
+ continue;
+ }
+ case traits_type::syntax_open_bracket:
+ if(0 == (flags & format_all))
+ {
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ else
+ {
+ ++fmt; // recurse
+ oi_assign(&out, _reg_format_aux(out, m, fmt, flags, traits_inst));
+ continue;
+ }
+ case traits_type::syntax_close_bracket:
+ if(0 == (flags & format_all))
+ {
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ else
+ {
+ ++fmt; // return from recursion
+ return out;
+ }
+ case traits_type::syntax_colon:
+ if(flags & regex_constants::format_is_if)
+ {
+ ++fmt;
+ return out;
+ }
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ case traits_type::syntax_question:
+ {
+ if(0 == (flags & format_all))
+ {
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ continue;
+ }
+ else
+ {
+ ++fmt;
+ if(*fmt == 0)
+ {
+ --fmt;
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ return out;
+ }
+ unsigned int id = traits_inst.toi(fmt, fmt_end, 10);
+ if(m[id].matched)
+ {
+ oi_assign(&out, _reg_format_aux(out, m, fmt, flags | regex_constants::format_is_if, traits_inst));
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon)
+ re_skip_format(fmt, traits_inst);
+ }
+ else
+ {
+ re_skip_format(fmt, traits_inst);
+ if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon)
+ oi_assign(&out, _reg_format_aux(out, m, fmt, flags | regex_constants::format_is_if, traits_inst));
+ }
+ return out;
+ }
+ }
+ default:
+default_opt:
+ if((flags & format_sed) && (*fmt == '&'))
+ {
+ oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second)));
+ ++fmt;
+ continue;
+ }
+ *out = *fmt;
+ ++out;
+ ++fmt;
+ }
+ }
+
+ return out;
+#ifdef __BORLANDC__
+#pragma option pop
+#endif
+}
+
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+} // namespace
+#endif
+
+template <class S>
+class string_out_iterator
+{
+ S* out;
+public:
+ string_out_iterator(S& s) : out(&s) {}
+ string_out_iterator& operator++() { return *this; }
+ string_out_iterator& operator++(int) { return *this; }
+ string_out_iterator& operator*() { return *this; }
+ string_out_iterator& operator=(typename S::value_type v)
+ {
+ out->append(1, v);
+ return *this;
+ }
+};
+
+template <class OutputIterator, class Iterator, class charT, class Allocator, class traits_type>
+class merge_out_predicate
+{
+ OutputIterator* out;
+ Iterator* last;
+ const charT* fmt;
+ match_flag_type flags;
+ const traits_type* pt;
+ // rebind allocator to correct type:
+ typedef typename detail::rebind_allocator<sub_match<Iterator>, Allocator>::type alloc_type;
+
+public:
+ merge_out_predicate(OutputIterator& o, Iterator& pi, const charT* f, match_flag_type format_flags, const traits_type& p)
+ : out(&o), last(&pi), fmt(f), flags(format_flags), pt(&p){}
+
+ ~merge_out_predicate() {}
+ bool BOOST_REGEX_CALL operator()(const boost::match_results<Iterator, alloc_type>& m)
+ {
+ const charT* f = fmt;
+ if(0 == (flags & format_no_copy))
+ oi_assign(out, re_copy_out(*out, Iterator(m[-1].first), Iterator(m[-1].second)));
+ oi_assign(out, _reg_format_aux(*out, m, f, flags, *pt));
+ *last = m[-2].first;
+ return flags & format_first_only ? false : true;
+ }
+};
+
+} // namespace re_detail
+
+template <class OutputIterator, class Iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+ const match_results<Iterator, Allocator>& m,
+ const charT* fmt,
+ match_flag_type flags = format_all
+ )
+{
+ regex_traits<charT> t;
+ return re_detail::_reg_format_aux(out, m, fmt, flags, t);
+}
+
+template <class OutputIterator, class Iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+ const match_results<Iterator, Allocator>& m,
+ const std::basic_string<charT>& fmt,
+ match_flag_type flags = format_all
+ )
+{
+ regex_traits<charT> t;
+ const charT* start = fmt.c_str();
+ return re_detail::_reg_format_aux(out, m, start, flags, t);
+}
+
+template <class Iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format(const match_results<Iterator, Allocator>& m,
+ const charT* fmt,
+ match_flag_type flags = format_all)
+{
+ std::basic_string<charT> result;
+ re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ regex_format(i, m, fmt, flags);
+ return result;
+}
+
+template <class Iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format(const match_results<Iterator, Allocator>& m,
+ const std::basic_string<charT>& fmt,
+ match_flag_type flags = format_all)
+{
+ std::basic_string<charT> result;
+ re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ regex_format(i, m, fmt.c_str(), flags);
+ return result;
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_FORMAT_HPP
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_fwd.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Forward declares boost::reg_expression<> and
+ * associated typedefs.
+ */
+
+#ifndef BOOST_REGEX_FWD_HPP_INCLUDED
+#define BOOST_REGEX_FWD_HPP_INCLUDED
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+#include <boost/detail/allocator.hpp>
+
+//
+// define BOOST_REGEX_NO_FWD if this
+// header doesn't work!
+//
+#ifdef BOOST_REGEX_NO_FWD
+# ifndef BOOST_RE_REGEX_HPP
+# include <boost/regex.hpp>
+# endif
+#else
+
+//
+// If there isn't good enough wide character support then there will
+// be no wide character regular expressions:
+//
+#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX)
+# define BOOST_NO_WREGEX
+#endif
+
+namespace boost{
+
+template <class charT>
+class regex_traits;
+
+template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+class reg_expression;
+template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+class basic_regex;
+
+typedef basic_regex<char, regex_traits<char>, BOOST_DEFAULT_ALLOCATOR(char) > regex;
+#ifndef BOOST_NO_WREGEX
+typedef basic_regex<wchar_t, regex_traits<wchar_t>, BOOST_DEFAULT_ALLOCATOR(wchar_t) > wregex;
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_NO_FWD
+
+#endif
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_grep.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides regex_grep implementation.
+ */
+
+#ifndef BOOST_REGEX_V4_REGEX_GREP_HPP
+#define BOOST_REGEX_V4_REGEX_GREP_HPP
+
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+//
+// regex_grep:
+// find all non-overlapping matches within the sequence first last:
+//
+template <class Predicate, class BidiIterator, class charT, class traits, class Allocator>
+inline unsigned int regex_grep(Predicate foo,
+ BidiIterator first,
+ BidiIterator last,
+ const reg_expression<charT, traits, Allocator>& e,
+ match_flag_type flags = match_default)
+{
+ if(e.flags() & regex_constants::failbit)
+ return false;
+ typedef detail::rebind_allocator<sub_match<BidiIterator>, Allocator> binder;
+ typedef typename binder::type match_allocator_type;
+ //typedef Allocator match_allocator_type;
+
+ match_results<BidiIterator, match_allocator_type> m;
+ re_detail::perl_matcher<BidiIterator, match_allocator_type, traits, Allocator> matcher(first, last, m, e, flags);
+ unsigned int count = 0;
+ while(matcher.find())
+ {
+ ++count;
+ if(0 == foo(m))
+ return count; // caller doesn't want to go on
+ if(m[0].second == last)
+ return count; // we've reached the end, don't try and find an extra null match.
+ if(m.length() == 0)
+ {
+ // we found a NULL-match, now try to find
+ // a non-NULL one at the same position:
+ BidiIterator last_end(m[0].second);
+ if(last_end == last)
+ return count;
+ matcher.setf(match_not_null | match_continuous);
+ if(matcher.find())
+ {
+ ++count;
+ last_end = m[0].second;
+ if(0 == foo(m))
+ return count;
+ }
+ else
+ {
+ // reset match back to where it was:
+ m.set_second(last_end);
+ }
+ matcher.unsetf((match_not_null | match_continuous) & ~flags);
+ }
+ }
+ return count;
+}
+
+//
+// regex_grep convenience interfaces:
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// this isn't really a partial specialisation, but template function
+// overloading - if the compiler doesn't support partial specialisation
+// then it really won't support this either:
+template <class Predicate, class charT, class Allocator, class traits>
+inline unsigned int regex_grep(Predicate foo, const charT* str,
+ const reg_expression<charT, traits, Allocator>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_grep(foo, str, str + traits::length(str), e, flags);
+}
+
+template <class Predicate, class ST, class SA, class Allocator, class charT, class traits>
+inline unsigned int regex_grep(Predicate foo, const std::basic_string<charT, ST, SA>& s,
+ const reg_expression<charT, traits, Allocator>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_grep(foo, s.begin(), s.end(), e, flags);
+}
+#else // partial specialisation
+inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_grep(foo, str, str + wregex::traits_type::length(str), e, flags);
+}
+#endif
+inline unsigned int regex_grep(bool (*foo)(const match_results<std::string::const_iterator>&), const std::string& s,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_grep(foo, s.begin(), s.end(), e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string<wchar_t>::const_iterator>&),
+ const std::basic_string<wchar_t>& s,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_grep(foo, s.begin(), s.end(), e, flags);
+}
+#endif
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_V4_REGEX_GREP_HPP
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2003
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_iterator.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides regex_iterator implementation.
+ */
+
+#ifndef BOOST_REGEX_V4_REGEX_ITERATOR_HPP
+#define BOOST_REGEX_V4_REGEX_ITERATOR_HPP
+
+#include <boost/shared_ptr.hpp>
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+template <class BidirectionalIterator,
+ class charT,
+ class traits,
+ class Allocator>
+class regex_iterator_implementation
+{
+ typedef basic_regex<charT, traits, Allocator> regex_type;
+
+ match_results<BidirectionalIterator> what; // current match
+ BidirectionalIterator base; // start of sequence
+ BidirectionalIterator end; // end of sequence
+ const regex_type* pre; // the expression
+ match_flag_type flags; // flags for matching
+
+public:
+ regex_iterator_implementation(const regex_type* p, BidirectionalIterator last, match_flag_type f)
+ : base(), end(last), pre(p), flags(f){}
+ bool init(BidirectionalIterator first)
+ {
+ base = first;
+ return regex_search(first, end, what, *pre, flags);
+ }
+ bool compare(const regex_iterator_implementation& that)
+ {
+ if(this == &that) return true;
+ return (pre == that.pre) && (end == that.end) && (flags == that.flags) && (what[0].first == that.what[0].first) && (what[0].second == that.what[0].second);
+ }
+ const match_results<BidirectionalIterator>& get()
+ { return what; }
+ bool next()
+ {
+ if(what.prefix().first != what[0].second)
+ flags |= match_prev_avail;
+ BidirectionalIterator next_start = what[0].second;
+ match_flag_type f(flags);
+ if(!what.length())
+ f |= regex_constants::match_not_initial_null;
+ bool result = regex_search(next_start, end, what, *pre, f);
+ if(result)
+ what.set_base(base);
+ return result;
+ }
+};
+
+template <class BidirectionalIterator,
+ class charT = BOOST_DEDUCED_TYPENAME re_detail::regex_iterator_traits<BidirectionalIterator>::value_type,
+ class traits = regex_traits<charT>,
+ class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+class regex_iterator
+{
+private:
+ typedef regex_iterator_implementation<BidirectionalIterator, charT, traits, Allocator> impl;
+ typedef shared_ptr<impl> pimpl;
+public:
+ typedef basic_regex<charT, traits, Allocator> regex_type;
+ typedef match_results<BidirectionalIterator> value_type;
+ typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
+ difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+ regex_iterator(){}
+ regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
+ const regex_type& re,
+ match_flag_type m = match_default)
+ : pdata(new impl(&re, b, m))
+ {
+ if(!pdata->init(a))
+ {
+ pdata.reset();
+ }
+ }
+ regex_iterator(const regex_iterator& that)
+ : pdata(that.pdata) {}
+ regex_iterator& operator=(const regex_iterator& that)
+ {
+ pdata = that.pdata;
+ return *this;
+ }
+ bool operator==(const regex_iterator& that)const
+ {
+ if((pdata.get() == 0) || (that.pdata.get() == 0))
+ return pdata.get() == that.pdata.get();
+ return pdata->compare(*(that.pdata.get()));
+ }
+ bool operator!=(const regex_iterator& that)const
+ { return !(*this == that); }
+ const value_type& operator*()const
+ { return pdata->get(); }
+ const value_type* operator->()const
+ { return &(pdata->get()); }
+ regex_iterator& operator++()
+ {
+ cow();
+ if(0 == pdata->next())
+ {
+ pdata.reset();
+ }
+ return *this;
+ }
+ regex_iterator operator++(int)
+ {
+ regex_iterator result(*this);
+ ++(*this);
+ return result;
+ }
+private:
+
+ pimpl pdata;
+
+ void cow()
+ {
+ // copy-on-write
+ if(pdata.get() && !pdata.unique())
+ {
+ pdata.reset(new impl(*(pdata.get())));
+ }
+ }
+};
+
+typedef regex_iterator<const char*> cregex_iterator;
+typedef regex_iterator<std::string::const_iterator> sregex_iterator;
+#ifndef BOOST_NO_WREGEX
+typedef regex_iterator<const wchar_t*> wcregex_iterator;
+typedef regex_iterator<std::wstring::const_iterator> wsregex_iterator;
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_V4_REGEX_ITERATOR_HPP
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_kmp.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides Knuth Morris Pratt search operations.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_KMP_HPP
+#define BOOST_REGEX_KMP_HPP
+
+#ifdef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+
+namespace boost{
+ namespace re_detail{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+template <class charT>
+struct kmp_info
+{
+ unsigned int size;
+ unsigned int len;
+ const charT* pstr;
+ int kmp_next[1];
+};
+
+template <class charT, class Allocator>
+void kmp_free(kmp_info<charT>* pinfo, const Allocator& a)
+{
+ typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
+ atype(a).deallocate(reinterpret_cast<char*>(pinfo), pinfo->size);
+}
+
+template <class iterator, class charT, class Trans, class Allocator>
+kmp_info<charT>* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a)
+{
+ typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
+ int i, j, m;
+ i = 0;
+ m = static_cast<int>(boost::re_detail::distance(first, last));
+ ++m;
+ unsigned int size = sizeof(kmp_info<charT>) + sizeof(int)*m + sizeof(charT)*m;
+ --m;
+ //
+ // allocate struct and fill it in:
+ //
+ kmp_info<charT>* pinfo = reinterpret_cast<kmp_info<charT>*>(atype(a).allocate(size));
+ BOOST_REGEX_NOEH_ASSERT(pinfo)
+ pinfo->size = size;
+ pinfo->len = m;
+ charT* p = reinterpret_cast<charT*>(reinterpret_cast<char*>(pinfo) + sizeof(kmp_info<charT>) + sizeof(int)*(m+1));
+ pinfo->pstr = p;
+ while(first != last)
+ {
+ *p = translate(*first);
+ ++first;
+ ++p;
+ }
+ *p = 0;
+ //
+ // finally do regular kmp compile:
+ //
+ j = pinfo->kmp_next[0] = -1;
+ while (i < m)
+ {
+ while ((j > -1) && (pinfo->pstr[i] != pinfo->pstr[j]))
+ j = pinfo->kmp_next[j];
+ ++i;
+ ++j;
+ if (pinfo->pstr[i] == pinfo->pstr[j])
+ pinfo->kmp_next[i] = pinfo->kmp_next[j];
+ else
+ pinfo->kmp_next[i] = j;
+ }
+
+ return pinfo;
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+ } // namepsace re_detail
+} // namespace boost
+
+#endif // BOOST_REGEX_KMP_HPP
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_match.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Regular expression matching algorithms.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+
+#ifndef BOOST_REGEX_MATCH_HPP
+#define BOOST_REGEX_MATCH_HPP
+
+#ifndef BOOST_REGEX_MAX_STATE_COUNT
+# define BOOST_REGEX_MAX_STATE_COUNT 100000000
+#endif
+
+#include <boost/limits.hpp>
+#include <boost/regex/v4/perl_matcher.hpp>
+
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+//
+// proc regex_match
+// returns true if the specified regular expression matches
+// the whole of the input. Fills in what matched in m.
+//
+template <class BidiIterator, class Allocator, class charT, class traits, class Allocator2>
+bool regex_match(BidiIterator first, BidiIterator last,
+ match_results<BidiIterator, Allocator>& m,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ re_detail::perl_matcher<BidiIterator, Allocator, traits, Allocator2> matcher(first, last, m, e, flags);
+ return matcher.match();
+}
+template <class iterator, class charT, class traits, class Allocator2>
+bool regex_match(iterator first, iterator last,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ match_results<iterator> m;
+ return regex_match(first, last, m, e, flags);
+}
+//
+// query_match convenience interfaces:
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// this isn't really a partial specialisation, but template function
+// overloading - if the compiler doesn't support partial specialisation
+// then it really won't support this either:
+template <class charT, class Allocator, class traits, class Allocator2>
+inline bool regex_match(const charT* str,
+ match_results<const charT*, Allocator>& m,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_match(str, str + traits::length(str), m, e, flags);
+}
+
+template <class ST, class SA, class Allocator, class charT, class traits, class Allocator2>
+inline bool regex_match(const std::basic_string<charT, ST, SA>& s,
+ match_results<typename std::basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_match(s.begin(), s.end(), m, e, flags);
+}
+template <class charT, class traits, class Allocator2>
+inline bool regex_match(const charT* str,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ match_results<const charT*> m;
+ return regex_match(str, str + traits::length(str), m, e, flags);
+}
+
+template <class ST, class SA, class charT, class traits, class Allocator2>
+inline bool regex_match(const std::basic_string<charT, ST, SA>& s,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ typedef typename std::basic_string<charT, ST, SA>::const_iterator iterator;
+ match_results<iterator> m;
+ return regex_match(s.begin(), s.end(), m, e, flags);
+}
+#else // partial ordering
+inline bool regex_match(const char* str,
+ cmatch& m,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
+}
+inline bool regex_match(const char* str,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ match_results<const char*> m;
+ return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline bool regex_match(const wchar_t* str,
+ wcmatch& m,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+inline bool regex_match(const wchar_t* str,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ match_results<const wchar_t*> m;
+ return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+#endif
+inline bool regex_match(const std::string& s,
+ smatch& m,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_match(s.begin(), s.end(), m, e, flags);
+}
+inline bool regex_match(const std::string& s,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ match_results<std::string::const_iterator, regex::allocator_type> m;
+ return regex_match(s.begin(), s.end(), m, e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline bool regex_match(const std::basic_string<wchar_t>& s,
+ match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>& m,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_match(s.begin(), s.end(), m, e, flags);
+}
+inline bool regex_match(const std::basic_string<wchar_t>& s,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type> m;
+ return regex_match(s.begin(), s.end(), m, e, flags);
+}
+#endif
+
+#endif
+
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_MATCH_HPP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_format.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides formatting output routines for search and replace
+ * operations. Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_V4_REGEX_MERGE_HPP
+#define BOOST_REGEX_V4_REGEX_MERGE_HPP
+
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+template <class OutputIterator, class Iterator, class traits, class Allocator, class charT>
+inline OutputIterator regex_merge(OutputIterator out,
+ Iterator first,
+ Iterator last,
+ const reg_expression<charT, traits, Allocator>& e,
+ const charT* fmt,
+ match_flag_type flags = match_default)
+{
+ return regex_replace(out, first, last, e, fmt, flags);
+}
+
+template <class OutputIterator, class Iterator, class traits, class Allocator, class charT>
+inline OutputIterator regex_merge(OutputIterator out,
+ Iterator first,
+ Iterator last,
+ const reg_expression<charT, traits, Allocator>& e,
+ const std::basic_string<charT>& fmt,
+ match_flag_type flags = match_default)
+{
+ return regex_merge(out, first, last, e, fmt.c_str(), flags);
+}
+
+template <class traits, class Allocator, class charT>
+inline std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
+ const reg_expression<charT, traits, Allocator>& e,
+ const charT* fmt,
+ match_flag_type flags = match_default)
+{
+ return regex_replace(s, e, fmt, flags);
+}
+
+template <class traits, class Allocator, class charT>
+inline std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
+ const reg_expression<charT, traits, Allocator>& e,
+ const std::basic_string<charT>& fmt,
+ match_flag_type flags = match_default)
+{
+ return regex_replace(s, e, fmt, flags);
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_V4_REGEX_MERGE_HPP
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_raw_buffer.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Raw character buffer for regex code.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_RAW_BUFFER_HPP
+#define BOOST_REGEX_RAW_BUFFER_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+namespace boost{
+ namespace re_detail{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+struct empty_padding{};
+
+union padding
+{
+ void* p;
+ unsigned int i;
+};
+
+template <int N>
+struct padding3
+{
+ enum{
+ padding_size = 8,
+ padding_mask = 7
+ };
+};
+
+template<>
+struct padding3<2>
+{
+ enum{
+ padding_size = 2,
+ padding_mask = 1
+ };
+};
+
+template<>
+struct padding3<4>
+{
+ enum{
+ padding_size = 4,
+ padding_mask = 3
+ };
+};
+
+template<>
+struct padding3<8>
+{
+ enum{
+ padding_size = 8,
+ padding_mask = 7
+ };
+};
+
+template<>
+struct padding3<16>
+{
+ enum{
+ padding_size = 16,
+ padding_mask = 15
+ };
+};
+
+enum{
+ padding_size = padding3<sizeof(padding)>::padding_size,
+ padding_mask = padding3<sizeof(padding)>::padding_mask
+};
+
+//
+// class raw_storage
+// basically this is a simplified vector<unsigned char>
+// this is used by reg_expression for expression storage
+//
+
+template <class Allocator>
+class raw_storage
+{
+public:
+ typedef Allocator allocator_type;
+ typedef typename boost::detail::rebind_allocator<unsigned char, allocator_type>::type alloc_inst_type;
+ typedef typename alloc_inst_type::size_type size_type;
+ typedef typename alloc_inst_type::pointer pointer;
+private:
+ //
+ // empty member optimisation:
+ struct alloc_data : public alloc_inst_type
+ {
+ typename alloc_inst_type::pointer last;
+ alloc_data(const Allocator& a) : alloc_inst_type(a){}
+ } alloc_inst;
+ pointer start, end;
+public:
+
+ raw_storage(const Allocator& a = Allocator());
+ raw_storage(size_type n, const Allocator& a = Allocator());
+
+ ~raw_storage()
+ {
+ alloc_inst.deallocate(start, (alloc_inst.last - start));
+ }
+
+ void BOOST_REGEX_CALL resize(size_type n);
+
+ void* BOOST_REGEX_CALL extend(size_type n)
+ {
+ if(size_type(alloc_inst.last - end) < n)
+ resize(n + (end - start));
+ register void* result = end;
+ end += n;
+ return result;
+ }
+
+ void* BOOST_REGEX_CALL insert(size_type pos, size_type n);
+
+ size_type BOOST_REGEX_CALL size()
+ {
+ return end - start;
+ }
+
+ size_type BOOST_REGEX_CALL capacity()
+ {
+ return alloc_inst.last - start;
+ }
+
+ void* BOOST_REGEX_CALL data()const
+ {
+ return start;
+ }
+
+ size_type BOOST_REGEX_CALL index(void* ptr)
+ {
+ return reinterpret_cast<unsigned char*>(ptr) - reinterpret_cast<unsigned char*>(data());
+ }
+
+ void BOOST_REGEX_CALL clear()
+ {
+ end = start;
+ }
+
+ void BOOST_REGEX_CALL align()
+ {
+ // move end up to a boundary:
+ end = reinterpret_cast<unsigned char*>(start) + (((reinterpret_cast<unsigned char*>(end) - reinterpret_cast<unsigned char*>(start)) + padding_mask) & ~padding_mask);
+ }
+
+ Allocator BOOST_REGEX_CALL allocator()const;
+ void swap(raw_storage& that)
+ {
+ std::swap(start, that.start);
+ std::swap(end, that.end);
+ std::swap(alloc_inst.last, that.alloc_inst.last);
+ std::swap(static_cast<alloc_inst_type&>(alloc_inst), static_cast<alloc_inst_type&>(that.alloc_inst));
+ }
+};
+
+template <class Allocator>
+raw_storage<Allocator>::raw_storage(const Allocator& a)
+ : alloc_inst(a)
+{
+ start = end = alloc_inst.allocate(1024);
+ BOOST_REGEX_NOEH_ASSERT(start)
+ alloc_inst.last = start + 1024;
+}
+
+template <class Allocator>
+raw_storage<Allocator>::raw_storage(size_type n, const Allocator& a)
+ : alloc_inst(a)
+{
+ start = end = alloc_inst.allocate(n);
+ BOOST_REGEX_NOEH_ASSERT(start)
+ alloc_inst.last = start + n;
+}
+
+template <class Allocator>
+Allocator BOOST_REGEX_CALL raw_storage<Allocator>::allocator()const
+{
+ return alloc_inst;
+}
+
+template <class Allocator>
+void BOOST_REGEX_CALL raw_storage<Allocator>::resize(size_type n)
+{
+ register size_type newsize = (alloc_inst.last - start) * 2;
+ register size_type datasize = end - start;
+ if(newsize < n)
+ newsize = n;
+ // extend newsize to WORD/DWORD boundary:
+ newsize = (newsize + padding_mask) & ~(padding_mask);
+
+ // allocate and copy data:
+ register unsigned char* ptr = alloc_inst.allocate(newsize);
+ BOOST_REGEX_NOEH_ASSERT(ptr)
+ std::memcpy(ptr, start, datasize);
+
+ // get rid of old buffer:
+ alloc_inst.deallocate(start, (alloc_inst.last - start));
+
+ // and set up pointers:
+ start = ptr;
+ end = ptr + datasize;
+ alloc_inst.last = ptr + newsize;
+}
+
+template <class Allocator>
+void* BOOST_REGEX_CALL raw_storage<Allocator>::insert(size_type pos, size_type n)
+{
+ jm_assert(pos <= size_type(end - start));
+ if(size_type(alloc_inst.last - end) < n)
+ resize(n + (end - start));
+ register void* result = start + pos;
+ std::memmove(start + pos + n, start + pos, (end - start) - pos);
+ end += n;
+ return result;
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_format.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides formatting output routines for search and replace
+ * operations. Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_V4_REGEX_REPLACE_HPP
+#define BOOST_REGEX_V4_REGEX_REPLACE_HPP
+
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+template <class OutputIterator, class Iterator, class traits, class Allocator, class charT>
+OutputIterator regex_replace(OutputIterator out,
+ Iterator first,
+ Iterator last,
+ const reg_expression<charT, traits, Allocator>& e,
+ const charT* fmt,
+ match_flag_type flags = match_default)
+{
+ Iterator l = first;
+ re_detail::merge_out_predicate<OutputIterator, Iterator, charT, Allocator, traits> oi(out, l, fmt, flags, e.get_traits());
+ regex_grep(oi, first, last, e, flags);
+ return (flags & format_no_copy) ? out : re_detail::re_copy_out(out, l, last);
+}
+
+template <class OutputIterator, class Iterator, class traits, class Allocator, class charT>
+inline OutputIterator regex_replace(OutputIterator out,
+ Iterator first,
+ Iterator last,
+ const reg_expression<charT, traits, Allocator>& e,
+ const std::basic_string<charT>& fmt,
+ match_flag_type flags = match_default)
+{
+ return regex_replace(out, first, last, e, fmt.c_str(), flags);
+}
+
+template <class traits, class Allocator, class charT>
+std::basic_string<charT> regex_replace(const std::basic_string<charT>& s,
+ const reg_expression<charT, traits, Allocator>& e,
+ const charT* fmt,
+ match_flag_type flags = match_default)
+{
+ std::basic_string<charT> result;
+ re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ regex_replace(i, s.begin(), s.end(), e, fmt, flags);
+ return result;
+}
+
+template <class traits, class Allocator, class charT>
+std::basic_string<charT> regex_replace(const std::basic_string<charT>& s,
+ const reg_expression<charT, traits, Allocator>& e,
+ const std::basic_string<charT>& fmt,
+ match_flag_type flags = match_default)
+{
+ std::basic_string<charT> result;
+ re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+ regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags);
+ return result;
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_V4_REGEX_REPLACE_HPP
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_search.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides regex_search implementation.
+ */
+
+#ifndef BOOST_REGEX_V4_REGEX_SEARCH_HPP
+#define BOOST_REGEX_V4_REGEX_SEARCH_HPP
+
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+template <class BidiIterator, class Allocator, class charT, class traits, class Allocator2>
+bool regex_search(BidiIterator first, BidiIterator last,
+ match_results<BidiIterator, Allocator>& m,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ if(e.flags() & regex_constants::failbit)
+ return false;
+
+ re_detail::perl_matcher<BidiIterator, Allocator, traits, Allocator2> matcher(first, last, m, e, flags);
+ return matcher.find();
+}
+
+//
+// regex_search convenience interfaces:
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// this isn't really a partial specialisation, but template function
+// overloading - if the compiler doesn't support partial specialisation
+// then it really won't support this either:
+template <class charT, class Allocator, class traits, class Allocator2>
+inline bool regex_search(const charT* str,
+ match_results<const charT*, Allocator>& m,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(str, str + traits::length(str), m, e, flags);
+}
+
+template <class ST, class SA, class Allocator, class charT, class traits, class Allocator2>
+inline bool regex_search(const std::basic_string<charT, ST, SA>& s,
+ match_results<typename std::basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#else // partial specialisation
+inline bool regex_search(const char* str,
+ cmatch& m,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(str, str + regex::traits_type::length(str), m, e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline bool regex_search(const wchar_t* str,
+ wcmatch& m,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+#endif
+inline bool regex_search(const std::string& s,
+ smatch& m,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline bool regex_search(const std::basic_string<wchar_t>& s,
+ wsmatch& m,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#endif
+
+#endif
+
+template <class BidiIterator, class charT, class traits, class Allocator2>
+bool regex_search(BidiIterator first, BidiIterator last,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ if(e.flags() & regex_constants::failbit)
+ return false;
+
+ match_results<BidiIterator> m;
+ typedef typename match_results<BidiIterator>::allocator_type match_alloc_type;
+ re_detail::perl_matcher<BidiIterator, match_alloc_type, traits, Allocator2> matcher(first, last, m, e, flags);
+ return matcher.find();
+}
+
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template <class charT, class traits, class Allocator2>
+inline bool regex_search(const charT* str,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(str, str + traits::length(str), e, flags);
+}
+
+template <class ST, class SA, class charT, class traits, class Allocator2>
+inline bool regex_search(const std::basic_string<charT, ST, SA>& s,
+ const reg_expression<charT, traits, Allocator2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_search(s.begin(), s.end(), e, flags);
+}
+#else // non-template function overloads
+inline bool regex_search(const char* first, const char* last,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ cmatch m;
+ return regex_search(first, last, m, e, flags);
+}
+
+#ifndef BOOST_NO_WREGEX
+inline bool regex_search(const wchar_t* first, const wchar_t* last,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ wcmatch m;
+ return regex_search(first, last, m, e, flags);
+}
+#endif
+inline bool regex_search(const char* str,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ cmatch m;
+ return regex_search(str, str + regex::traits_type::length(str), m, e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline bool regex_search(const wchar_t* str,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ wcmatch m;
+ return regex_search(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+#endif
+inline bool regex_search(const std::string& s,
+ const regex& e,
+ match_flag_type flags = match_default)
+{
+ smatch m;
+ return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline bool regex_search(const std::basic_string<wchar_t>& s,
+ const wregex& e,
+ match_flag_type flags = match_default)
+{
+ wsmatch m;
+ return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#endif
+
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_V4_REGEX_SEARCH_HPP
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_split.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Implements regex_split and associated functions.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_SPLIT_HPP
+#define BOOST_REGEX_SPLIT_HPP
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace re_detail{
+
+template <class charT>
+const reg_expression<charT>& get_default_expression(charT)
+{
+ static const charT expression_text[4] = { '\\', 's', '+', '\00', };
+ static const reg_expression<charT> e(expression_text);
+ return e;
+}
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Alloc2>
+class split_pred
+{
+ typedef std::basic_string<charT, Traits1, Alloc1> string_type;
+ typedef typename string_type::const_iterator iterator_type;
+ iterator_type* p_last;
+ OutputIterator* p_out;
+ std::size_t* p_max;
+ std::size_t initial_max;
+public:
+ split_pred(iterator_type* a, OutputIterator* b, std::size_t* c)
+ : p_last(a), p_out(b), p_max(c), initial_max(*c) {}
+
+ bool operator()(const match_results<iterator_type, Alloc2>& what);
+};
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Alloc2>
+bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
+ (const match_results<iterator_type, Alloc2>& what)
+{
+ *p_last = what[0].second;
+ if(what.size() > 1)
+ {
+ // output sub-expressions only:
+ for(unsigned i = 1; i < what.size(); ++i)
+ {
+ *(*p_out) = static_cast<string_type>(what[i]);
+ ++(*p_out);
+ if(0 == --*p_max) return false;
+ }
+ return *p_max != 0;
+ }
+ else
+ {
+ // output $` only if it's not-null or not at the start of the input:
+ const sub_match<iterator_type>& sub = what[-1];
+ if((sub.first != sub.second) || (*p_max != initial_max))
+ {
+ *(*p_out) = static_cast<string_type>(sub);
+ ++(*p_out);
+ return --*p_max;
+ }
+ }
+ //
+ // initial null, do nothing:
+ return true;
+}
+
+} // namespace re_detail
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+std::size_t regex_split(OutputIterator out,
+ std::basic_string<charT, Traits1, Alloc1>& s,
+ const reg_expression<charT, Traits2, Alloc2>& e,
+ match_flag_type flags,
+ std::size_t max_split)
+{
+ typedef typename std::basic_string<charT, Traits1, Alloc1>::const_iterator ci_t;
+ typedef typename detail::rebind_allocator<sub_match<ci_t>, Alloc2>::type match_allocator;
+ ci_t last = s.begin();
+ std::size_t init_size = max_split;
+ re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1, match_allocator> pred(&last, &out, &max_split);
+ ci_t i, j;
+ i = s.begin();
+ j = s.end();
+ regex_grep(pred, i, j, e, flags);
+ //
+ // if there is still input left, do a final push as long as max_split
+ // is not exhausted, and we're not splitting sub-expressions rather
+ // than whitespace:
+ if(max_split && (last != s.end()) && (e.mark_count() == 1))
+ {
+ *out = std::basic_string<charT, Traits1, Alloc1>((ci_t)last, (ci_t)s.end());
+ ++out;
+ last = s.end();
+ --max_split;
+ }
+ //
+ // delete from the string everything that has been processed so far:
+ s.erase(0, last - s.begin());
+ //
+ // return the number of new records pushed:
+ return init_size - max_split;
+}
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+inline std::size_t regex_split(OutputIterator out,
+ std::basic_string<charT, Traits1, Alloc1>& s,
+ const reg_expression<charT, Traits2, Alloc2>& e,
+ match_flag_type flags = match_default)
+{
+ return regex_split(out, s, e, flags, UINT_MAX);
+}
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1>
+inline std::size_t regex_split(OutputIterator out,
+ std::basic_string<charT, Traits1, Alloc1>& s)
+{
+ return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX);
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_stack.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Implements customised internal regex stacks.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_STACK_HPP
+#define BOOST_REGEX_STACK_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+#ifndef BOOST_REGEX_RAW_BUFFER_HPP
+#include <boost/regex/v4/regex_raw_buffer.hpp>
+#endif
+
+namespace boost{
+ namespace re_detail{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+//
+// class jstack
+// simplified stack optimised for push/peek/pop
+// operations, we could use std::stack<std::vector<T>> instead...
+//
+template <class T, class Allocator = BOOST_DEFAULT_ALLOCATOR(T) >
+class jstack
+{
+public:
+ typedef typename boost::detail::rebind_allocator<unsigned char, Allocator>::type allocator_type;
+private:
+ typedef typename boost::detail::rebind_allocator<T, Allocator>::type T_alloc_type;
+ typedef typename T_alloc_type::size_type size_type;
+ typedef T value_type;
+ struct node
+ {
+ node* next;
+ T* start; // first item
+ T* end; // last item
+ T* last; // end of storage
+ };
+
+ //
+ // empty base member optimisation:
+ struct data : public allocator_type
+ {
+ padding buf[(sizeof(T) * 16 + sizeof(padding) - 1) / sizeof(padding)];
+ data(const Allocator& a) : allocator_type(a){}
+ };
+
+ data alloc_inst;
+ mutable node* m_stack;
+ mutable node* unused;
+ node base;
+ size_type block_size;
+
+ void BOOST_REGEX_CALL pop_aux()const;
+ void BOOST_REGEX_CALL push_aux();
+
+public:
+ jstack(size_type n = 64, const Allocator& a = Allocator());
+
+ ~jstack();
+
+ node* BOOST_REGEX_CALL get_node()
+ {
+ node* new_stack = reinterpret_cast<node*>(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size));
+ BOOST_REGEX_NOEH_ASSERT(new_stack)
+ new_stack->last = reinterpret_cast<T*>(new_stack+1);
+ new_stack->start = new_stack->end = new_stack->last + block_size;
+ new_stack->next = 0;
+ return new_stack;
+ }
+
+ bool BOOST_REGEX_CALL empty()
+ {
+ return (m_stack->start == m_stack->end) && (m_stack->next == 0);
+ }
+
+ bool BOOST_REGEX_CALL good()
+ {
+ return (m_stack->start != m_stack->end) || (m_stack->next != 0);
+ }
+
+ T& BOOST_REGEX_CALL peek()
+ {
+ if(m_stack->start == m_stack->end)
+ pop_aux();
+ return *m_stack->end;
+ }
+
+ const T& BOOST_REGEX_CALL peek()const
+ {
+ if(m_stack->start == m_stack->end)
+ pop_aux();
+ return *m_stack->end;
+ }
+
+ void BOOST_REGEX_CALL pop()
+ {
+ if(m_stack->start == m_stack->end)
+ pop_aux();
+ ::boost::re_detail::pointer_destroy(m_stack->end);
+ ++(m_stack->end);
+ }
+
+ void BOOST_REGEX_CALL pop(T& t)
+ {
+ if(m_stack->start == m_stack->end)
+ pop_aux();
+ t = *m_stack->end;
+ ::boost::re_detail::pointer_destroy(m_stack->end);
+ ++(m_stack->end);
+ }
+
+ void BOOST_REGEX_CALL push(const T& t)
+ {
+ if(m_stack->end == m_stack->last)
+ push_aux();
+ --(m_stack->end);
+ pointer_construct(m_stack->end, t);
+ }
+
+};
+
+template <class T, class Allocator>
+jstack<T, Allocator>::jstack(size_type n, const Allocator& a)
+ : alloc_inst(a)
+{
+ unused = 0;
+ block_size = n;
+ m_stack = &base;
+ base.last = reinterpret_cast<T*>(alloc_inst.buf);
+ base.end = base.start = base.last + 16;
+ base.next = 0;
+}
+
+template <class T, class Allocator>
+void BOOST_REGEX_CALL jstack<T, Allocator>::push_aux()
+{
+ // make sure we have spare space on TOS:
+ register node* new_node;
+ if(unused)
+ {
+ new_node = unused;
+ unused = new_node->next;
+ new_node->next = m_stack;
+ m_stack = new_node;
+ }
+ else
+ {
+ new_node = get_node();
+ new_node->next = m_stack;
+ m_stack = new_node;
+ }
+}
+
+template <class T, class Allocator>
+void BOOST_REGEX_CALL jstack<T, Allocator>::pop_aux()const
+{
+ // make sure that we have a valid item
+ // on TOS:
+ jm_assert(m_stack->next);
+ register node* p = m_stack;
+ m_stack = p->next;
+ p->next = unused;
+ unused = p;
+}
+
+template <class T, class Allocator>
+jstack<T, Allocator>::~jstack()
+{
+ node* condemned;
+ while(good())
+ pop();
+ while(unused)
+ {
+ condemned = unused;
+ unused = unused->next;
+ alloc_inst.deallocate(reinterpret_cast<unsigned char*>(condemned), sizeof(node) + sizeof(T) * block_size);
+ }
+ while(m_stack != &base)
+ {
+ condemned = m_stack;
+ m_stack = m_stack->next;
+ alloc_inst.deallocate(reinterpret_cast<unsigned char*>(condemned), sizeof(node) + sizeof(T) * block_size);
+ }
+}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_synch.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Thread synchronisation for regex code.
+ * Note this is an internal header file included
+ * by regex.hpp, do not include on its own.
+ */
+
+#ifndef BOOST_REGEX_SYNCH_HPP
+#define BOOST_REGEX_SYNCH_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_THREADS)
+# if defined(BOOST_HAS_WINTHREADS)
+# include <windows.h>
+# elif defined(BOOST_HAS_BETHREADS)
+# include <OS.h>
+# include <cassert>
+# elif defined(BOOST_HAS_PTHREADS)
+# include <pthread.h>
+# else
+# error "Unknown threading API"
+# endif
+#endif
+
+
+namespace boost{
+ namespace re_detail{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+void BOOST_REGEX_CALL re_init_threads();
+void BOOST_REGEX_CALL re_free_threads();
+
+#ifdef BOOST_HAS_THREADS
+
+# ifdef BOOST_HAS_BETHREADS
+
+typedef sem_id CRITICAL_SECTION;
+
+inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
+{
+ *ps = create_sem(1, "regex++");
+ assert(*ps > 0);
+}
+
+inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
+{
+ int t = delete_sem(*ps);
+ assert(t == B_NO_ERROR);
+}
+
+inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
+{
+ status_t t = acquire_sem(*ps);
+ assert(t == B_NO_ERROR);
+}
+
+inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
+{
+ status_t t = release_sem(*ps);
+ assert(t == B_NO_ERROR);
+}
+
+# elif defined(BOOST_HAS_PTHREADS)
+
+typedef pthread_mutex_t CRITICAL_SECTION;
+
+inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
+{
+ pthread_mutex_init(ps, 0);
+}
+
+inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
+{
+ pthread_mutex_destroy(ps);
+}
+
+inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
+{
+ pthread_mutex_lock(ps);
+}
+
+inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
+{
+ pthread_mutex_unlock(ps);
+}
+
+# elif !defined(BOOST_HAS_WINTHREADS)
+# error "Unknown threading API"
+# endif
+
+template <class Lock>
+class lock_guard
+{
+ typedef Lock lock_type;
+public:
+ lock_guard(lock_type& m, bool aq = true)
+ : mut(m), owned(false){ acquire(aq); }
+
+ ~lock_guard()
+ { acquire(false); }
+
+ void BOOST_REGEX_CALL acquire(bool aq = true)
+ {
+ if(aq && !owned)
+ {
+ mut.acquire(true);
+ owned = true;
+ }
+ else if(!aq && owned)
+ {
+ mut.acquire(false);
+ owned = false;
+ }
+ }
+private:
+ lock_type& mut;
+ bool owned;
+ // VC6 warning suppression:
+ lock_guard& operator=(const lock_guard&);
+};
+
+
+class critical_section
+{
+public:
+ critical_section()
+ { InitializeCriticalSection(&hmutex);}
+
+ critical_section(const critical_section&)
+ { InitializeCriticalSection(&hmutex);}
+
+ const critical_section& BOOST_REGEX_CALL operator=(const critical_section&)
+ {return *this;}
+
+ ~critical_section()
+ {DeleteCriticalSection(&hmutex);}
+
+private:
+
+ void BOOST_REGEX_CALL acquire(bool aq)
+ { if(aq) EnterCriticalSection(&hmutex);
+ else LeaveCriticalSection(&hmutex);
+ }
+
+ CRITICAL_SECTION hmutex;
+
+public:
+ typedef lock_guard<critical_section> ro_guard;
+ typedef lock_guard<critical_section> rw_guard;
+
+ friend class lock_guard<critical_section>;
+};
+
+inline bool BOOST_REGEX_CALL operator==(const critical_section&, const critical_section&)
+{
+ return false;
+}
+
+inline bool BOOST_REGEX_CALL operator<(const critical_section&, const critical_section&)
+{
+ return true;
+}
+
+typedef lock_guard<critical_section> cs_guard;
+
+BOOST_REGEX_DECL extern critical_section* p_re_lock;
+BOOST_REGEX_DECL extern unsigned int re_lock_count;
+
+#define BOOST_REGEX_GUARD(inst) boost::re_detail::critical_section::rw_guard g(inst);
+
+#else // BOOST_HAS_THREADS
+
+#define BOOST_REGEX_GUARD(inst)
+
+#endif // BOOST_HAS_THREADS
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif // sentry
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 2003
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_token_iterator.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Provides regex_token_iterator implementation.
+ */
+
+#ifndef BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP
+#define BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP
+
+#include <boost/shared_ptr.hpp>
+#include <boost/detail/workaround.hpp>
+#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
+ || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+//
+// Borland C++ Builder 6, and Visual C++ 6,
+// can't cope with the array template constructor
+// so we have a template member that will accept any type as
+// argument, and then assert that is really is an array:
+//
+#include <boost/static_assert.hpp>
+#include <boost/type_traits/is_array.hpp>
+#endif
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
+# pragma warning(push)
+# pragma warning(disable:4700)
+#endif
+
+template <class BidirectionalIterator,
+ class charT,
+ class traits,
+ class Allocator>
+class regex_token_iterator_implementation
+{
+ typedef basic_regex<charT, traits, Allocator> regex_type;
+#if 1
+ typedef sub_match<BidirectionalIterator> value_type;
+#else
+ typedef std::basic_string<charT> value_type;
+#endif
+
+ match_results<BidirectionalIterator> what; // current match
+ BidirectionalIterator end; // end of search area
+ const regex_type* pre; // the expression
+ match_flag_type flags; // match flags
+ value_type result; // the current string result
+ int N; // the current sub-expression being enumerated
+ std::vector<int> subs; // the sub-expressions to enumerate
+
+public:
+ regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, int sub, match_flag_type f)
+ : end(last), pre(p), flags(f){ subs.push_back(sub); }
+ regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector<int>& v, match_flag_type f)
+ : end(last), pre(p), subs(v), flags(f){}
+#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
+ || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ template <class T>
+ regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const T& submatches, match_flag_type f)
+ : end(last), pre(p), flags(f)
+ {
+ // assert that T really is an array:
+ BOOST_STATIC_ASSERT(::boost::is_array<T>::value);
+ const std::size_t array_size = sizeof(T) / sizeof(submatches[0]);
+ for(std::size_t i = 0; i < array_size; ++i)
+ {
+ subs.push_back(submatches[i]);
+ }
+ }
+#else
+ template <std::size_t CN>
+ regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[CN], match_flag_type f)
+ : end(last), pre(p), flags(f)
+ {
+ for(std::size_t i = 0; i < CN; ++i)
+ {
+ subs.push_back(submatches[i]);
+ }
+ }
+#endif
+
+ bool init(BidirectionalIterator first)
+ {
+ N = 0;
+ if(regex_search(first, end, what, *pre, flags) == true)
+ {
+ N = 0;
+ result = ((subs[N] == -1) ? what.prefix() : what[(int)subs[N]]);
+ return true;
+ }
+ else if((subs[N] == -1) && (first != end))
+ {
+ result.first = first;
+ result.second = end;
+ result.matched = (first != end);
+ return true;
+ }
+ return false;
+ }
+ bool compare(const regex_token_iterator_implementation& that)
+ {
+ if(this == &that) return true;
+ return (pre == that.pre)
+ && (end == that.end)
+ && (flags == that.flags)
+ && (N == that.N)
+ && (what[0].first == that.what[0].first)
+ && (what[0].second == that.what[0].second);
+ }
+ const value_type& get()
+ { return result; }
+ bool next()
+ {
+ if(N == -1)
+ return false;
+ if(N+1 < (int)subs.size())
+ {
+ ++N;
+ result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
+ return true;
+ }
+ if(what.prefix().first != what[0].second)
+ flags |= match_prev_avail;
+ BidirectionalIterator last_end(what[0].second);
+ if(regex_search(last_end, end, what, *pre, ((what[0].first == what[0].second) ? flags | regex_constants::match_not_initial_null : flags)))
+ {
+ N =0;
+ result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
+ return true;
+ }
+ else if((last_end != end) && (subs[0] == -1))
+ {
+ N =-1;
+ result.first = last_end;
+ result.second = end;
+ result.matched = (last_end != end);
+ return true;
+ }
+ return false;
+ }
+};
+
+template <class BidirectionalIterator,
+ class charT = BOOST_DEDUCED_TYPENAME re_detail::regex_iterator_traits<BidirectionalIterator>::value_type,
+ class traits = regex_traits<charT>,
+ class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+class regex_token_iterator
+{
+private:
+ typedef regex_token_iterator_implementation<BidirectionalIterator, charT, traits, Allocator> impl;
+ typedef shared_ptr<impl> pimpl;
+public:
+ typedef basic_regex<charT, traits, Allocator> regex_type;
+ typedef sub_match<BidirectionalIterator> value_type;
+ typedef typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type
+ difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+ regex_token_iterator(){}
+ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
+ int submatch = 0, match_flag_type m = match_default)
+ : pdata(new impl(&re, b, submatch, m))
+ {
+ if(!pdata->init(a))
+ pdata.reset();
+ }
+ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
+ const std::vector<int>& submatches, match_flag_type m = match_default)
+ : pdata(new impl(&re, b, submatches, m))
+ {
+ if(!pdata->init(a))
+ pdata.reset();
+ }
+#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
+ || BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ template <class T>
+ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
+ const T& submatches, match_flag_type m = match_default)
+ : pdata(new impl(&re, b, submatches, m))
+ {
+ if(!pdata->init(a))
+ pdata.reset();
+ }
+#else
+ template <std::size_t N>
+ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
+ const int (&submatches)[N], match_flag_type m = match_default)
+ : pdata(new impl(&re, b, submatches, m))
+ {
+ if(!pdata->init(a))
+ pdata.reset();
+ }
+#endif
+ regex_token_iterator(const regex_token_iterator& that)
+ : pdata(that.pdata) {}
+ regex_token_iterator& operator=(const regex_token_iterator& that)
+ {
+ pdata = that.pdata;
+ return *this;
+ }
+ bool operator==(const regex_token_iterator& that)const
+ {
+ if((pdata.get() == 0) || (that.pdata.get() == 0))
+ return pdata.get() == that.pdata.get();
+ return pdata->compare(*(that.pdata.get()));
+ }
+ bool operator!=(const regex_token_iterator& that)const
+ { return !(*this == that); }
+ const value_type& operator*()const
+ { return pdata->get(); }
+ const value_type* operator->()const
+ { return &(pdata->get()); }
+ regex_token_iterator& operator++()
+ {
+ cow();
+ if(0 == pdata->next())
+ {
+ pdata.reset();
+ }
+ return *this;
+ }
+ regex_token_iterator operator++(int)
+ {
+ regex_token_iterator result(*this);
+ ++(*this);
+ return result;
+ }
+private:
+
+ pimpl pdata;
+
+ void cow()
+ {
+ // copy-on-write
+ if(pdata.get() && !pdata.unique())
+ {
+ pdata.reset(new impl(*(pdata.get())));
+ }
+ }
+};
+
+typedef regex_token_iterator<const char*> cregex_token_iterator;
+typedef regex_token_iterator<std::string::const_iterator> sregex_token_iterator;
+#ifndef BOOST_NO_WREGEX
+typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
+typedef regex_token_iterator<std::wstring::const_iterator> wsregex_token_iterator;
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+# pragma warning(pop)
+#endif
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_V4_REGEX_TOKEN_ITERATOR_HPP
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE regex_traits.hpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares regular expression traits classes.
+ */
+
+#ifndef BOOST_REGEX_TRAITS_HPP_INCLUDED
+#define BOOST_REGEX_TRAITS_HPP_INCLUDED
+
+#ifndef BOOST_RE_CREGEX_HPP
+#include <boost/cregex.hpp>
+#endif
+#ifndef BOOST_REGEX_CSTRING_HPP
+#include <boost/regex/v4/regex_cstring.hpp>
+#endif
+
+namespace boost{
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+template <class charT>
+class c_regex_traits;
+
+namespace re_detail{
+
+struct mss
+{
+ unsigned int id;
+ const char* what;
+};
+
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
+BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id);
+extern BOOST_REGEX_DECL const char *re_default_error_messages[];
+
+#ifndef BOOST_NO_WREGEX
+extern BOOST_REGEX_DECL regex_wchar_type wide_lower_case_map[];
+extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[];
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(regex_wchar_type c);
+#endif
+
+
+struct BOOST_REGEX_DECL regex_traits_base
+{
+ enum char_syntax_type
+ {
+ syntax_char = 0,
+ syntax_open_bracket = 1, // (
+ syntax_close_bracket = 2, // )
+ syntax_dollar = 3, // $
+ syntax_caret = 4, // ^
+ syntax_dot = 5, // .
+ syntax_star = 6, // *
+ syntax_plus = 7, // +
+ syntax_question = 8, // ?
+ syntax_open_set = 9, // [
+ syntax_close_set = 10, // ]
+ syntax_or = 11, // |
+ syntax_slash = 12, //
+ syntax_hash = 13, // #
+ syntax_dash = 14, // -
+ syntax_open_brace = 15, // {
+ syntax_close_brace = 16, // }
+ syntax_digit = 17, // 0-9
+ syntax_b = 18, // for \b
+ syntax_B = 19, // for \B
+ syntax_left_word = 20, // for \<
+ syntax_right_word = 21, // for \>
+ syntax_w = 22, // for \w
+ syntax_W = 23, // for \W
+ syntax_start_buffer = 24, // for \`
+ syntax_end_buffer = 25, // for \'
+ syntax_newline = 26, // for newline alt
+ syntax_comma = 27, // for {x,y}
+
+ syntax_a = 28, // for \a
+ syntax_f = 29, // for \f
+ syntax_n = 30, // for \n
+ syntax_r = 31, // for \r
+ syntax_t = 32, // for \t
+ syntax_v = 33, // for \v
+ syntax_x = 34, // for \xdd
+ syntax_c = 35, // for \cx
+ syntax_colon = 36, // for [:...:]
+ syntax_equal = 37, // for [=...=]
+
+ // perl ops:
+ syntax_e = 38, // for \e
+ syntax_l = 39, // for \l
+ syntax_L = 40, // for \L
+ syntax_u = 41, // for \u
+ syntax_U = 42, // for \U
+ syntax_s = 43, // for \s
+ syntax_S = 44, // for \S
+ syntax_d = 45, // for \d
+ syntax_D = 46, // for \D
+ syntax_E = 47, // for \Q\E
+ syntax_Q = 48, // for \Q\E
+ syntax_X = 49, // for \X
+ syntax_C = 50, // for \C
+ syntax_Z = 51, // for \Z
+ syntax_G = 52, // for \G
+
+ // new extentions:
+ syntax_not = 53, // for (?!...)
+
+ syntax_max = 54
+ };
+#ifdef __BORLANDC__
+private:
+ char dummy_member;
+#endif
+};
+
+struct BOOST_REGEX_DECL c_traits_base : public regex_traits_base
+{
+public:
+ enum{
+ char_class_none = 0,
+ char_class_alpha = 0x0001,
+ char_class_cntrl = 0x0002,
+ char_class_digit = 0x0004,
+ char_class_lower = 0x0008,
+ char_class_punct = 0x0010,
+ char_class_space = 0x0020,
+ char_class_upper = 0x0040,
+ char_class_xdigit = 0x0080,
+ char_class_blank = 0x0100,
+ char_class_underscore = 0x4000,
+ char_class_unicode = 0x8000,
+
+ char_class_alnum = char_class_alpha | char_class_digit,
+ char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore,
+ char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank,
+ char_class_word = char_class_alpha | char_class_digit | char_class_underscore
+ };
+ static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
+protected:
+#if defined(__MWERKS__) && __MWERKS__ <= 0x6000
+ friend class c_regex_traits<char>;
+ friend class c_regex_traits<regex_wchar_type>;
+#endif
+
+ static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
+ enum syntax_map_size
+ {
+ map_size = UCHAR_MAX + 1
+ };
+
+ static unsigned char syntax_map[map_size];
+ static unsigned short class_map[map_size];
+ static char lower_case_map[map_size];
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
+ static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
+ static void BOOST_REGEX_CALL do_update_ctype();
+ static void BOOST_REGEX_CALL do_update_collate();
+public:
+ static std::string BOOST_REGEX_CALL error_string(unsigned id);
+ static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
+};
+
+} // namespace re_detail
+
+
+template<>
+class BOOST_REGEX_DECL c_regex_traits<char> : public re_detail::c_traits_base
+{
+ typedef re_detail::c_traits_base base_type;
+public:
+ typedef char char_type;
+ typedef unsigned char uchar_type;
+ typedef unsigned int size_type;
+ typedef std::string string_type;
+ typedef int locale_type;
+
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::strlen(p);
+ }
+ static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
+ {
+ return syntax_map[c];
+ }
+ static char BOOST_REGEX_CALL translate(char c, bool icase)
+ {
+ return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
+ }
+ static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
+
+ static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
+
+ static bool BOOST_REGEX_CALL is_separator(char c)
+ {
+ return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(char)
+ {
+ return false;
+ }
+
+ static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
+ {
+ return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
+ }
+
+ static int BOOST_REGEX_CALL toi(char c);
+ static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
+ {
+ std::string s(first, last);
+ return do_lookup_class(s.c_str());
+ }
+
+ static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
+ {
+ std::string s(first, last);
+ return do_lookup_collate(buf, s.c_str());
+ }
+
+ static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+ void swap(c_regex_traits&){}
+
+ c_regex_traits()
+ {
+ init();
+ }
+ ~c_regex_traits()
+ {
+ m_free();
+ }
+ struct sentry
+ {
+ sentry(const c_regex_traits<char>&)
+ { c_regex_traits<char>::update(); }
+ operator void*() { return this; }
+ };
+ static void BOOST_REGEX_CALL update();
+private:
+ static void BOOST_REGEX_CALL init();
+ static void BOOST_REGEX_CALL m_free();
+ static c_regex_traits<char> i;
+
+ static unsigned sort_type;
+ static char sort_delim;
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class BOOST_REGEX_DECL c_regex_traits<regex_wchar_type> : public re_detail::c_traits_base
+{
+ typedef re_detail::c_traits_base base_type;
+public:
+ typedef regex_wchar_type char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef std::basic_string<regex_wchar_type> string_type;
+ typedef int locale_type;
+#ifndef BOOST_REGEX_HAS_SHORT_WCHAR_T
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::wcslen(p);
+ }
+#else
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::wcslen(reinterpret_cast<const wchar_t*>(p));
+ }
+#endif
+ static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
+ static regex_wchar_type BOOST_REGEX_CALL translate(regex_wchar_type c, bool icase)
+ {
+ return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c;
+ }
+
+ static void BOOST_REGEX_CALL transform(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in);
+
+ static void BOOST_REGEX_CALL transform_primary(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in);
+
+ static bool BOOST_REGEX_CALL is_separator(regex_wchar_type c)
+ {
+ return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (regex_wchar_type)0x2028) || (c == (regex_wchar_type)0x2029));
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(regex_wchar_type c)
+ { return re_detail::is_combining(c); }
+
+ static bool BOOST_REGEX_CALL is_class(regex_wchar_type c, boost::uint_fast32_t f)
+ {
+ return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
+ }
+
+ static int BOOST_REGEX_CALL toi(regex_wchar_type c);
+ static int BOOST_REGEX_CALL toi(const regex_wchar_type*& first, const regex_wchar_type* last, int radix);
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const regex_wchar_type* first, const regex_wchar_type* last);
+
+ static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<regex_wchar_type>& s, const regex_wchar_type* first, const regex_wchar_type* last);
+
+ static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+ void swap(c_regex_traits&){}
+ c_regex_traits<regex_wchar_type>()
+ { init(); }
+ ~c_regex_traits<regex_wchar_type>()
+ { m_free(); }
+ struct sentry
+ {
+ sentry(const c_regex_traits<regex_wchar_type>&)
+ { c_regex_traits<regex_wchar_type>::update(); }
+ operator void*() { return this; }
+ };
+ static void BOOST_REGEX_CALL update();
+ static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const regex_wchar_type *s2);
+ static std::size_t BOOST_REGEX_CALL strwiden(regex_wchar_type *s1, std::size_t len, const char *s2);
+private:
+ static bool BOOST_REGEX_CALL do_iswclass(regex_wchar_type c, boost::uint_fast32_t f);
+ static void BOOST_REGEX_CALL m_free();
+ static void BOOST_REGEX_CALL init();
+ static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<regex_wchar_type>& out, const regex_wchar_type* first, const regex_wchar_type* last);
+ static c_regex_traits<regex_wchar_type> init_;
+
+ static unsigned sort_type;
+ static regex_wchar_type sort_delim;
+};
+
+#ifdef BOOST_REGEX_HAS_SHORT_WCHAR_T
+//
+// What follows here is Visual Studio specific - it is a thin wrapper
+// that redirects calls to c_regex_traits<unsigned short> to
+// c_regex_traits<__wchar_t>. This allows the library to be built
+// so that it supports programs built both with and without /Zc:wchar_t.
+//
+template<>
+class c_regex_traits<unsigned short> : public re_detail::c_traits_base
+{
+ typedef re_detail::c_traits_base base_type;
+public:
+ typedef unsigned short char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef std::basic_string<unsigned short> string_type;
+ typedef int locale_type;
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return c_regex_traits<regex_wchar_type>::length(
+ reinterpret_cast<const regex_wchar_type*>(p));
+ }
+ static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
+ {
+ return c_regex_traits<regex_wchar_type>::syntax_type(c);
+ }
+ static unsigned short BOOST_REGEX_CALL translate(unsigned short c, bool icase)
+ {
+ return c_regex_traits<regex_wchar_type>::translate(c, icase);
+ }
+
+ static void BOOST_REGEX_CALL transform(std::basic_string<unsigned short>& out, const std::basic_string<unsigned short>& in)
+ {
+ c_regex_traits<regex_wchar_type>::transform(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(out),
+ reinterpret_cast<const std::basic_string<regex_wchar_type>&>(in));
+ }
+
+ static void BOOST_REGEX_CALL transform_primary(std::basic_string<unsigned short>& out, const std::basic_string<unsigned short>& in)
+ {
+ c_regex_traits<regex_wchar_type>::transform_primary(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(out),
+ reinterpret_cast<const std::basic_string<regex_wchar_type>&>(in)); }
+
+ static bool BOOST_REGEX_CALL is_separator(unsigned short c)
+ {
+ return c_regex_traits<regex_wchar_type>::is_separator(c);
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(unsigned short c)
+ {
+ return c_regex_traits<regex_wchar_type>::is_combining(c);
+ }
+
+ static bool BOOST_REGEX_CALL is_class(unsigned short c, boost::uint_fast32_t f)
+ {
+ return c_regex_traits<regex_wchar_type>::is_class(c, f);
+ }
+
+ static int BOOST_REGEX_CALL toi(unsigned short c)
+ {
+ return c_regex_traits<regex_wchar_type>::toi(c);
+ }
+ static int BOOST_REGEX_CALL toi(const unsigned short*& first, const unsigned short* last, int radix)
+ {
+ return c_regex_traits<regex_wchar_type>::toi(
+ reinterpret_cast<const regex_wchar_type*&>(first),
+ reinterpret_cast<const regex_wchar_type*>(last),
+ radix);
+ }
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const unsigned short* first, const unsigned short* last)
+ {
+ return c_regex_traits<regex_wchar_type>::lookup_classname(
+ reinterpret_cast<const regex_wchar_type*>(first),
+ reinterpret_cast<const regex_wchar_type*>(last));
+ }
+
+ static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<unsigned short>& s, const unsigned short* first, const unsigned short* last)
+ {
+ return c_regex_traits<regex_wchar_type>::lookup_collatename(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(s),
+ reinterpret_cast<const regex_wchar_type*>(first),
+ reinterpret_cast<const regex_wchar_type*>(last));
+ }
+
+ static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+ struct sentry
+ {
+ sentry(const c_regex_traits<unsigned short>&)
+ { c_regex_traits<unsigned short>::update(); }
+ ~sentry(){}
+ operator void*() { return this; }
+ };
+ static void BOOST_REGEX_CALL update()
+ {
+ c_regex_traits<regex_wchar_type>::update();
+ }
+ void swap(c_regex_traits&){}
+ c_regex_traits(){};
+ ~c_regex_traits(){};
+ static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const unsigned short *s2)
+ {
+ return c_regex_traits<regex_wchar_type>::strnarrow(
+ s1,
+ len,
+ reinterpret_cast<const regex_wchar_type *>(s2));
+ }
+ static std::size_t BOOST_REGEX_CALL strwiden(unsigned short *s1, std::size_t len, const char *s2)
+ {
+ return c_regex_traits<regex_wchar_type>::strwiden(
+ reinterpret_cast<regex_wchar_type *>(s1), len, s2);
+ }
+
+private:
+ c_regex_traits<regex_wchar_type> m_init;
+
+};
+
+#endif // BOOST_REGEX_HAS_SHORT_WCHAR_T
+
+#endif // wide characters
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+
+namespace re_detail{
+
+struct BOOST_REGEX_DECL w32_traits_base : public regex_traits_base
+{
+ enum{
+ char_class_none = 0,
+ char_class_alnum = C1_ALPHA | C1_DIGIT,
+ char_class_alpha = C1_ALPHA,
+ char_class_cntrl = C1_CNTRL,
+ char_class_digit = C1_DIGIT,
+ char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA,
+ char_class_lower = C1_LOWER,
+ char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA,
+ char_class_punct = C1_PUNCT,
+ char_class_space = C1_SPACE,
+ char_class_upper = C1_UPPER,
+ char_class_xdigit = C1_XDIGIT,
+ char_class_blank = C1_BLANK,
+ char_class_underscore = 0x4000,
+ char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
+ char_class_unicode = 0x8000,
+ char_class_win = 0x01FF
+ };
+
+
+public:
+ static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
+protected:
+ static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
+ enum syntax_map_size
+ {
+ map_size = UCHAR_MAX + 1
+ };
+
+ static unsigned char syntax_map[map_size];
+ static unsigned short class_map[map_size];
+ static char lower_case_map[map_size];
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
+ static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
+ static void BOOST_REGEX_CALL do_free();
+ static void BOOST_REGEX_CALL do_init();
+public:
+ static std::string BOOST_REGEX_CALL error_string(unsigned id);
+ static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
+};
+
+
+} // namespace re_detail
+
+template<class charT>
+class w32_regex_traits;
+
+template<>
+class BOOST_REGEX_DECL w32_regex_traits<char> : public re_detail::w32_traits_base
+{
+ typedef re_detail::w32_traits_base base_type;
+public:
+ typedef char char_type;
+ typedef unsigned char uchar_type;
+ typedef unsigned int size_type;
+ typedef std::string string_type;
+ typedef int locale_type;
+
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::strlen(p);
+ }
+ static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
+ {
+ return syntax_map[c];
+ }
+ static char BOOST_REGEX_CALL translate(char c, bool icase)
+ {
+ return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
+ }
+ static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
+
+ static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
+
+ static bool BOOST_REGEX_CALL is_separator(char c)
+ {
+ return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(char)
+ {
+ return false;
+ }
+
+ static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
+ {
+ return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
+ }
+
+ static int BOOST_REGEX_CALL toi(char c);
+ static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
+ {
+ std::string s(first, last);
+ return do_lookup_class(s.c_str());
+ }
+
+ static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
+ {
+ std::string s(first, last);
+ return do_lookup_collate(buf, s.c_str());
+ }
+
+ static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+ struct sentry
+ {
+ sentry(const w32_regex_traits<char>&)
+ { w32_regex_traits<char>::update(); }
+ ~sentry(){}
+ operator void*() { return this; }
+ };
+ static void BOOST_REGEX_CALL update();
+ void swap(w32_regex_traits&){}
+ w32_regex_traits();
+ ~w32_regex_traits();
+private:
+ static w32_regex_traits<char> i;
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class BOOST_REGEX_DECL w32_regex_traits<regex_wchar_type> : public re_detail::w32_traits_base
+{
+ typedef re_detail::w32_traits_base base_type;
+public:
+ typedef regex_wchar_type char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef std::basic_string<regex_wchar_type> string_type;
+ typedef int locale_type;
+#ifndef BOOST_REGEX_HAS_SHORT_WCHAR_T
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::wcslen(p);
+ }
+#else
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::wcslen(reinterpret_cast<const wchar_t*>(p));
+ }
+#endif
+ static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
+ static regex_wchar_type BOOST_REGEX_CALL translate(regex_wchar_type c, bool icase)
+ {
+ return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c;
+ }
+
+ static void BOOST_REGEX_CALL transform(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in);
+
+ static void BOOST_REGEX_CALL transform_primary(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in);
+
+ static bool BOOST_REGEX_CALL is_separator(regex_wchar_type c)
+ {
+ return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (regex_wchar_type)0x2028) || (c == (regex_wchar_type)0x2029));
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(regex_wchar_type c)
+ { return re_detail::is_combining(c); }
+
+ static bool BOOST_REGEX_CALL is_class(regex_wchar_type c, boost::uint_fast32_t f)
+ {
+ return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
+ }
+
+ static int BOOST_REGEX_CALL toi(regex_wchar_type c);
+ static int BOOST_REGEX_CALL toi(const regex_wchar_type*& first, const regex_wchar_type* last, int radix);
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const regex_wchar_type* first, const regex_wchar_type* last);
+
+ static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<regex_wchar_type>& s, const regex_wchar_type* first, const regex_wchar_type* last);
+
+ static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+ struct sentry
+ {
+ sentry(const w32_regex_traits<regex_wchar_type>&)
+ { w32_regex_traits<regex_wchar_type>::update(); }
+ ~sentry(){}
+ operator void*() { return this; }
+ };
+ static void BOOST_REGEX_CALL update();
+ void swap(w32_regex_traits&){}
+ w32_regex_traits();
+ ~w32_regex_traits();
+ static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const regex_wchar_type *s2);
+ static std::size_t BOOST_REGEX_CALL strwiden(regex_wchar_type *s1, std::size_t len, const char *s2);
+
+private:
+ static bool BOOST_REGEX_CALL do_iswclass(regex_wchar_type c, boost::uint_fast32_t f);
+ static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<regex_wchar_type>& out, const regex_wchar_type* first, const regex_wchar_type* last);
+ static w32_regex_traits<regex_wchar_type> init_;
+ static regex_wchar_type BOOST_REGEX_CALL wtolower(regex_wchar_type c);
+ static unsigned short wide_unicode_classes[];
+};
+
+#ifdef BOOST_REGEX_HAS_SHORT_WCHAR_T
+//
+// What follows here is Visual Studio specific - it is a thin wrapper
+// that redirects calls to w32_regex_traits<unsigned short> to
+// w32_regex_traits<__wchar_t>. This allows the library to be built
+// so that it supports programs built both with and without /Zc:wchar_t.
+//
+template<>
+class w32_regex_traits<unsigned short> : public re_detail::w32_traits_base
+{
+ typedef re_detail::w32_traits_base base_type;
+public:
+ typedef unsigned short char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef std::basic_string<unsigned short> string_type;
+ typedef int locale_type;
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return w32_regex_traits<regex_wchar_type>::length(
+ reinterpret_cast<const regex_wchar_type*>(p));
+ }
+ static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
+ {
+ return w32_regex_traits<regex_wchar_type>::syntax_type(c);
+ }
+ static unsigned short BOOST_REGEX_CALL translate(unsigned short c, bool icase)
+ {
+ return w32_regex_traits<regex_wchar_type>::translate(c, icase);
+ }
+
+ static void BOOST_REGEX_CALL transform(std::basic_string<unsigned short>& out, const std::basic_string<unsigned short>& in)
+ {
+ w32_regex_traits<regex_wchar_type>::transform(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(out),
+ reinterpret_cast<const std::basic_string<regex_wchar_type>&>(in));
+ }
+
+ static void BOOST_REGEX_CALL transform_primary(std::basic_string<unsigned short>& out, const std::basic_string<unsigned short>& in)
+ {
+ w32_regex_traits<regex_wchar_type>::transform_primary(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(out),
+ reinterpret_cast<const std::basic_string<regex_wchar_type>&>(in)); }
+
+ static bool BOOST_REGEX_CALL is_separator(unsigned short c)
+ {
+ return w32_regex_traits<regex_wchar_type>::is_separator(c);
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(unsigned short c)
+ {
+ return w32_regex_traits<regex_wchar_type>::is_combining(c);
+ }
+
+ static bool BOOST_REGEX_CALL is_class(unsigned short c, boost::uint_fast32_t f)
+ {
+ return w32_regex_traits<regex_wchar_type>::is_class(c, f);
+ }
+
+ static int BOOST_REGEX_CALL toi(unsigned short c)
+ {
+ return w32_regex_traits<regex_wchar_type>::toi(c);
+ }
+ static int BOOST_REGEX_CALL toi(const unsigned short*& first, const unsigned short* last, int radix)
+ {
+ return w32_regex_traits<regex_wchar_type>::toi(
+ reinterpret_cast<const regex_wchar_type*&>(first),
+ reinterpret_cast<const regex_wchar_type*>(last),
+ radix);
+ }
+
+ static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const unsigned short* first, const unsigned short* last)
+ {
+ return w32_regex_traits<regex_wchar_type>::lookup_classname(
+ reinterpret_cast<const regex_wchar_type*>(first),
+ reinterpret_cast<const regex_wchar_type*>(last));
+ }
+
+ static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<unsigned short>& s, const unsigned short* first, const unsigned short* last)
+ {
+ return w32_regex_traits<regex_wchar_type>::lookup_collatename(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(s),
+ reinterpret_cast<const regex_wchar_type*>(first),
+ reinterpret_cast<const regex_wchar_type*>(last));
+ }
+
+ static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+ struct sentry
+ {
+ sentry(const w32_regex_traits<unsigned short>&)
+ { w32_regex_traits<unsigned short>::update(); }
+ ~sentry(){}
+ operator void*() { return this; }
+ };
+ static void BOOST_REGEX_CALL update()
+ {
+ w32_regex_traits<regex_wchar_type>::update();
+ }
+ void swap(w32_regex_traits&){}
+ w32_regex_traits(){};
+ ~w32_regex_traits(){};
+ static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const unsigned short *s2)
+ {
+ return w32_regex_traits<regex_wchar_type>::strnarrow(
+ s1,
+ len,
+ reinterpret_cast<const regex_wchar_type *>(s2));
+ }
+ static std::size_t BOOST_REGEX_CALL strwiden(unsigned short *s1, std::size_t len, const char *s2)
+ {
+ return w32_regex_traits<regex_wchar_type>::strwiden(
+ reinterpret_cast<regex_wchar_type *>(s1), len, s2);
+ }
+
+private:
+ w32_regex_traits<regex_wchar_type> m_init;
+
+};
+
+#endif // BOOST_REGEX_HAS_SHORT_WCHAR_T
+
+#endif // Wide strings
+#endif // Win32
+
+#if !defined(BOOST_NO_STD_LOCALE)
+
+namespace re_detail
+{
+
+template <class charT>
+struct message_data;
+
+template <>
+struct message_data<char>;
+
+template <>
+struct message_data<regex_wchar_type>;
+
+struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base
+{
+ enum char_class_type
+ {
+ char_class_none = 0,
+ char_class_alnum = std::ctype_base::alnum,
+ char_class_alpha = std::ctype_base::alpha,
+ char_class_cntrl = std::ctype_base::cntrl,
+ char_class_digit = std::ctype_base::digit,
+ char_class_graph = std::ctype_base::graph,
+ char_class_lower = std::ctype_base::lower,
+ char_class_print = std::ctype_base::print,
+ char_class_punct = std::ctype_base::punct,
+ char_class_space = std::ctype_base::space,
+ char_class_upper = std::ctype_base::upper,
+ char_class_xdigit = std::ctype_base::xdigit,
+ char_class_blank = 1<<12,
+ char_class_underscore = 1<<13,
+ char_class_word = std::ctype_base::alnum | char_class_underscore,
+ char_class_unicode = 1<<14,
+ char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl
+ | char_class_digit | char_class_graph | char_class_lower
+ | char_class_print | char_class_punct | char_class_space
+ | char_class_upper | char_class_xdigit
+ };
+
+ static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
+protected:
+ static char regex_message_cat[BOOST_REGEX_MAX_PATH];
+};
+
+} // namespace re_detail
+
+template <class charT>
+class cpp_regex_traits;
+
+template<>
+class BOOST_REGEX_DECL cpp_regex_traits<char> : public re_detail::cpp_regex_traits_base
+{
+ typedef re_detail::cpp_regex_traits_base base_type;
+private:
+ re_detail::message_data<char>* pmd;
+ const unsigned char* psyntax;
+ char* lower_map;
+ const std::ctype<char>* pctype;
+ const std::collate<char>* pcollate;
+ std::locale locale_inst;
+ unsigned sort_type;
+ char sort_delim;
+
+ cpp_regex_traits(const cpp_regex_traits&);
+ cpp_regex_traits& operator=(const cpp_regex_traits&);
+
+public:
+ typedef char char_type;
+ typedef unsigned char uchar_type;
+ typedef unsigned int size_type;
+ typedef std::string string_type;
+ typedef std::locale locale_type;
+
+ cpp_regex_traits();
+ ~cpp_regex_traits();
+
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::strlen(p);
+ }
+ unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
+ {
+ return psyntax[c];
+ }
+ char BOOST_REGEX_CALL translate(char c, bool icase)const
+ {
+ return icase ? lower_map[(size_type)(uchar_type)c] : c;
+ }
+ void BOOST_REGEX_CALL transform(std::string& out, const std::string& in)const
+ {
+ out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str();
+ }
+
+ void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in)const;
+
+ static bool BOOST_REGEX_CALL is_separator(char c)
+ {
+ return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(char)
+ {
+ return false;
+ }
+
+ bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)const
+ {
+ if(pctype->is((std::ctype<char>::mask)(f & char_class_all_base), c))
+ return true;
+ if((f & char_class_underscore) && (c == '_'))
+ return true;
+ if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
+ return true;
+ return false;
+ }
+
+ int BOOST_REGEX_CALL toi(char c)const;
+ int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix)const;
+
+ boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)const;
+ bool BOOST_REGEX_CALL lookup_collatename(std::string& s, const char* first, const char* last)const;
+
+ std::string BOOST_REGEX_CALL error_string(unsigned id)const;
+ locale_type BOOST_REGEX_CALL imbue(locale_type l);
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
+ void swap(cpp_regex_traits&);
+
+ struct sentry
+ {
+ sentry(const cpp_regex_traits<char>&){}
+ operator void*() { return this; }
+ };
+};
+
+#if !defined(BOOST_NO_WREGEX) && !defined(BOOST_NO_STD_WSTREAMBUF)
+template<>
+class BOOST_REGEX_DECL cpp_regex_traits<regex_wchar_type> : public re_detail::cpp_regex_traits_base
+{
+ typedef re_detail::cpp_regex_traits_base base_type;
+public:
+ typedef regex_wchar_type char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef std::basic_string<regex_wchar_type> string_type;
+ typedef std::locale locale_type;
+
+private:
+ re_detail::message_data<regex_wchar_type>* pmd;
+ const unsigned char* psyntax;
+ regex_wchar_type* lower_map;
+ const std::ctype<regex_wchar_type>* pctype;
+ const std::collate<regex_wchar_type>* pcollate;
+ const std::codecvt<regex_wchar_type, char, std::mbstate_t>* pcdv;
+ std::locale locale_inst;
+ unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const;
+ unsigned sort_type;
+ regex_wchar_type sort_delim;
+
+ cpp_regex_traits(const cpp_regex_traits&);
+ cpp_regex_traits& operator=(const cpp_regex_traits&);
+
+public:
+#ifndef BOOST_REGEX_HAS_SHORT_WCHAR_T
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::wcslen(p);
+ }
+#else
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return std::wcslen(reinterpret_cast<const wchar_t*>(p));
+ }
+#endif
+ unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
+ {
+ return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
+ }
+ regex_wchar_type BOOST_REGEX_CALL translate(regex_wchar_type c, bool icase)const
+ {
+ return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c;
+ }
+ void BOOST_REGEX_CALL transform(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in)const
+ {
+ out = pcollate->transform(in.c_str(), in.c_str() + in.size());
+ }
+
+ void BOOST_REGEX_CALL transform_primary(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in)const;
+
+ static bool BOOST_REGEX_CALL is_separator(regex_wchar_type c)
+ {
+ return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (regex_wchar_type)0x2028) || (c == (regex_wchar_type)0x2029));
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(regex_wchar_type c)
+ { return re_detail::is_combining(c); }
+
+ bool BOOST_REGEX_CALL is_class(regex_wchar_type c, boost::uint_fast32_t f)const
+ {
+ if(pctype->is((std::ctype<regex_wchar_type>::mask)(f & char_class_all_base), c))
+ return true;
+ if((f & char_class_underscore) && (c == '_'))
+ return true;
+ if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
+ return true;
+ if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255))
+ return true;
+ return false;
+ }
+
+ int BOOST_REGEX_CALL toi(regex_wchar_type c)const;
+ int BOOST_REGEX_CALL toi(const regex_wchar_type*& first, const regex_wchar_type* last, int radix)const;
+
+ boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const regex_wchar_type* first, const regex_wchar_type* last)const;
+ bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<regex_wchar_type>& s, const regex_wchar_type* first, const regex_wchar_type* last)const;
+
+ std::string BOOST_REGEX_CALL error_string(unsigned id)const;
+ void swap(cpp_regex_traits&);
+ cpp_regex_traits();
+ ~cpp_regex_traits();
+ locale_type BOOST_REGEX_CALL imbue(locale_type l);
+ locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
+ std::size_t BOOST_REGEX_CALL strwiden(regex_wchar_type *s1, std::size_t len, const char *s2)const;
+
+ struct sentry
+ {
+ sentry(const cpp_regex_traits<regex_wchar_type>&){}
+ operator void*() { return this; }
+ };
+};
+
+#ifdef BOOST_REGEX_HAS_SHORT_WCHAR_T
+//
+// What follows here is Visual Studio specific - it is a thin wrapper
+// that redirects calls to cpp_regex_traits<unsigned short> to
+// cpp_regex_traits<__wchar_t>. This allows the library to be built
+// so that it supports programs built both with and without /Zc:wchar_t.
+//
+template<>
+class cpp_regex_traits<unsigned short> : public re_detail::cpp_regex_traits_base
+{
+ typedef re_detail::cpp_regex_traits_base base_type;
+public:
+ typedef unsigned short char_type;
+ typedef unsigned short uchar_type;
+ typedef unsigned int size_type;
+ typedef std::basic_string<unsigned short> string_type;
+ typedef std::locale locale_type;
+ static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+ {
+ return cpp_regex_traits<regex_wchar_type>::length(
+ reinterpret_cast<const regex_wchar_type*>(p));
+ }
+ unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
+ {
+ return m_imp.syntax_type(c);
+ }
+ unsigned short BOOST_REGEX_CALL translate(unsigned short c, bool icase)const
+ {
+ return m_imp.translate(c, icase);
+ }
+
+ void BOOST_REGEX_CALL transform(std::basic_string<unsigned short>& out, const std::basic_string<unsigned short>& in)const
+ {
+ m_imp.transform(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(out),
+ reinterpret_cast<const std::basic_string<regex_wchar_type>&>(in));
+ }
+
+ void BOOST_REGEX_CALL transform_primary(std::basic_string<unsigned short>& out, const std::basic_string<unsigned short>& in)const
+ {
+ m_imp.transform_primary(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(out),
+ reinterpret_cast<const std::basic_string<regex_wchar_type>&>(in)); }
+
+ static bool BOOST_REGEX_CALL is_separator(unsigned short c)
+ {
+ return cpp_regex_traits<regex_wchar_type>::is_separator(c);
+ }
+
+ static bool BOOST_REGEX_CALL is_combining(unsigned short c)
+ {
+ return cpp_regex_traits<regex_wchar_type>::is_combining(c);
+ }
+
+ bool BOOST_REGEX_CALL is_class(unsigned short c, boost::uint_fast32_t f)const
+ {
+ return m_imp.is_class(c, f);
+ }
+
+ int BOOST_REGEX_CALL toi(unsigned short c)const
+ {
+ return m_imp.toi(c);
+ }
+ int BOOST_REGEX_CALL toi(const unsigned short*& first, const unsigned short* last, int radix)const
+ {
+ return m_imp.toi(
+ reinterpret_cast<const regex_wchar_type*&>(first),
+ reinterpret_cast<const regex_wchar_type*>(last),
+ radix);
+ }
+
+ boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const unsigned short* first, const unsigned short* last)const
+ {
+ return m_imp.lookup_classname(
+ reinterpret_cast<const regex_wchar_type*>(first),
+ reinterpret_cast<const regex_wchar_type*>(last));
+ }
+
+ bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<unsigned short>& s, const unsigned short* first, const unsigned short* last)const
+ {
+ return m_imp.lookup_collatename(
+ reinterpret_cast<std::basic_string<regex_wchar_type>&>(s),
+ reinterpret_cast<const regex_wchar_type*>(first),
+ reinterpret_cast<const regex_wchar_type*>(last));
+ }
+
+ locale_type BOOST_REGEX_CALL imbue(locale_type l)
+ {
+ return m_imp.imbue(l);
+ }
+ locale_type BOOST_REGEX_CALL getloc()const
+ {
+ return m_imp.getloc();
+ }
+
+ struct sentry
+ {
+ sentry(const cpp_regex_traits<unsigned short>&){}
+ operator void*() { return this; }
+ };
+ void swap(cpp_regex_traits& that)
+ {
+ m_imp.swap(that.m_imp);
+ }
+ cpp_regex_traits(){};
+ ~cpp_regex_traits(){};
+ std::size_t BOOST_REGEX_CALL strwiden(unsigned short *s1, std::size_t len, const char *s2)const
+ {
+ return m_imp.strwiden(
+ reinterpret_cast<regex_wchar_type *>(s1), len, s2);
+ }
+ std::string BOOST_REGEX_CALL error_string(unsigned id)const
+ {
+ return m_imp.error_string(id);
+ }
+
+private:
+ cpp_regex_traits<regex_wchar_type> m_imp;
+
+};
+
+#endif // BOOST_REGEX_HAS_SHORT_WCHAR_T
+#endif // BOOST_NO_WREGEX
+
+#endif // BOOST_NO_STD_LOCALE
+
+#ifdef BOOST_REGEX_USE_WIN32_LOCALE
+
+template <class charT>
+class regex_traits : public w32_regex_traits<charT>
+{
+};
+
+#elif defined(BOOST_REGEX_USE_C_LOCALE)
+
+template <class charT>
+class regex_traits : public c_regex_traits<charT>
+{
+};
+
+#elif defined(BOOST_REGEX_USE_CPP_LOCALE)
+
+template <class charT>
+class regex_traits : public cpp_regex_traits<charT>
+{
+};
+
+#else
+#error No default localisation model defined
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+} // namespace boost
+
+#endif // include
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE states.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares internal state machine structures.
+ */
+
+#ifndef BOOST_REGEX_V4_STATES_HPP
+#define BOOST_REGEX_V4_STATES_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+namespace re_detail{
+
+/*** mask_type *******************************************************
+Whenever we have a choice of two alternatives, we use an array of bytes
+to indicate which of the two alternatives it is possible to take for any
+given input character. If mask_take is set, then we can take the next
+state, and if mask_skip is set then we can take the alternative.
+***********************************************************************/
+enum mask_type
+{
+ mask_take = 1,
+ mask_skip = 2,
+ mask_any = mask_skip | mask_take,
+ mask_all = mask_any
+};
+
+/*** helpers **********************************************************
+These helpers let us use function overload resolution to detect whether
+we have narrow or wide character strings:
+***********************************************************************/
+struct _narrow_type{};
+struct _wide_type{};
+template <class charT> struct is_byte;
+template<> struct is_byte<char> { typedef _narrow_type width_type; };
+template<> struct is_byte<unsigned char>{ typedef _narrow_type width_type; };
+template<> struct is_byte<signed char> { typedef _narrow_type width_type; };
+template <class charT> struct is_byte { typedef _wide_type width_type; };
+
+/*** enum syntax_element_type ******************************************
+Every record in the state machine falls into one of the following types:
+***********************************************************************/
+enum syntax_element_type
+{
+ // start of a marked sub-expression, or perl-style (?...) extension
+ syntax_element_startmark = 0,
+ // end of a marked sub-expression, or perl-style (?...) extension
+ syntax_element_endmark = syntax_element_startmark + 1,
+ // any sequence of literal characters
+ syntax_element_literal = syntax_element_endmark + 1,
+ // start of line assertion: ^
+ syntax_element_start_line = syntax_element_literal + 1,
+ // end of line assertion $
+ syntax_element_end_line = syntax_element_start_line + 1,
+ // match any character: .
+ syntax_element_wild = syntax_element_end_line + 1,
+ // end of expression: we have a match when we get here
+ syntax_element_match = syntax_element_wild + 1,
+ // perl style word boundary: \b
+ syntax_element_word_boundary = syntax_element_match + 1,
+ // perl style within word boundary: \B
+ syntax_element_within_word = syntax_element_word_boundary + 1,
+ // start of word assertion: \<
+ syntax_element_word_start = syntax_element_within_word + 1,
+ // end of word assertion: \>
+ syntax_element_word_end = syntax_element_word_start + 1,
+ // start of buffer assertion: \`
+ syntax_element_buffer_start = syntax_element_word_end + 1,
+ // end of buffer assertion: \'
+ syntax_element_buffer_end = syntax_element_buffer_start + 1,
+ // backreference to previously matched sub-expression
+ syntax_element_backref = syntax_element_buffer_end + 1,
+ // either a wide character set [..] or one with multicharacter collating elements:
+ syntax_element_long_set = syntax_element_backref + 1,
+ // narrow character set: [...]
+ syntax_element_set = syntax_element_long_set + 1,
+ // jump to a new state in the machine:
+ syntax_element_jump = syntax_element_set + 1,
+ // choose between two production states:
+ syntax_element_alt = syntax_element_jump + 1,
+ // a repeat
+ syntax_element_rep = syntax_element_alt + 1,
+ // match a combining character sequence
+ syntax_element_combining = syntax_element_rep + 1,
+ // perl style soft buffer end: \z
+ syntax_element_soft_buffer_end = syntax_element_combining + 1,
+ // perl style continuation: \G
+ syntax_element_restart_continue = syntax_element_soft_buffer_end + 1,
+ // single character repeats:
+ syntax_element_dot_rep = syntax_element_restart_continue + 1,
+ syntax_element_char_rep = syntax_element_dot_rep + 1,
+ syntax_element_short_set_rep = syntax_element_char_rep + 1,
+ syntax_element_long_set_rep = syntax_element_short_set_rep + 1
+};
+
+#ifdef BOOST_REGEX_DEBUG
+// dwa 09/26/00 - This is needed to suppress warnings about an ambiguous conversion
+std::ostream& operator<<(std::ostream&, syntax_element_type);
+#endif
+
+struct re_syntax_base;
+
+/*** union offset_type ************************************************
+Points to another state in the machine. During machine construction
+we use integral offsets, but these are converted to pointers before
+execution of the machine.
+***********************************************************************/
+union offset_type
+{
+ re_syntax_base* p;
+ std::size_t i;
+};
+
+/*** struct re_syntax_base ********************************************
+Base class for all states in the machine.
+***********************************************************************/
+struct re_syntax_base
+{
+ syntax_element_type type; // what kind of state this is
+ offset_type next; // next state in the machine
+ unsigned int can_be_null; // true if we match a NULL string
+};
+
+/*** struct re_brace **************************************************
+Base class for all states in the machine.
+***********************************************************************/
+struct re_brace : public re_syntax_base
+{
+ // The index to match, can be zero (don't mark the sub-expression)
+ // or negative (for perl style (?...) extentions):
+ int index;
+};
+
+/*** struct re_literal ************************************************
+A string of literals, following this structure will be an
+array of characters: charT[length]
+***********************************************************************/
+struct re_literal : public re_syntax_base
+{
+ unsigned int length;
+};
+
+/*** struct re_set_long ***********************************************
+A wide character set of characters, following this structure will be
+an array of type charT:
+First csingles null-terminated strings
+Then 2 * cranges NULL terminated strings
+Then cequivalents NULL terminated strings
+***********************************************************************/
+struct re_set_long : public re_syntax_base
+{
+ unsigned int csingles, cranges, cequivalents;
+ boost::uint_fast32_t cclasses;
+ bool isnot;
+ bool singleton;
+};
+
+/*** struct re_set ****************************************************
+A set of narrow-characters, matches any of _map which is none-zero
+***********************************************************************/
+struct re_set : public re_syntax_base
+{
+ unsigned char _map[256];
+};
+
+/*** struct re_jump ***************************************************
+Jump to a new location in the machine (not next).
+***********************************************************************/
+struct re_jump : public re_syntax_base
+{
+ offset_type alt; // location to jump to
+ unsigned char _map[256]; // which characters can take the jump
+};
+
+/*** struct re_repeat *************************************************
+Repeat a section of the machine
+***********************************************************************/
+struct re_repeat : public re_jump
+{
+ unsigned min, max; // min and max allowable repeats
+ int id; // Unique identifier for this repeat
+ bool leading; // True if this repeat is at the start of the machine (lets us optimize some searches)
+ bool greedy; // True if this is a greedy repeat
+};
+
+/*** enum re_jump_size_type *******************************************
+Provides compiled size of re_jump structure (allowing for trailing alignment).
+We provide this so we know how manybytes to insert when constructing the machine
+(The value of padding_mask is defined in regex_raw_buffer.hpp).
+***********************************************************************/
+enum re_jump_size_type
+{
+ re_jump_size = (sizeof(re_jump) + padding_mask) & ~(padding_mask),
+ re_repeater_size = (sizeof(re_repeat) + padding_mask) & ~(padding_mask)
+};
+
+/*** proc re_is_set_member *********************************************
+Forward declaration: we'll need this one later...
+***********************************************************************/
+template <class iterator, class charT, class traits_type, class Allocator>
+iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
+ iterator last,
+ const re_set_long* set_,
+ const reg_expression<charT, traits_type, Allocator>& e);
+
+} // namespace re_detail
+
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
+
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE sub_match.cpp
+ * VERSION see <boost/version.hpp>
+ * DESCRIPTION: Declares template class sub_match.
+ */
+
+#ifndef BOOST_REGEX_V4_SUB_MATCH_HPP
+#define BOOST_REGEX_V4_SUB_MATCH_HPP
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost{
+
+template <class BidiIterator>
+struct sub_match : public std::pair<BidiIterator, BidiIterator>
+{
+ typedef typename re_detail::regex_iterator_traits<BidiIterator>::value_type value_type;
+#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ typedef std::ptrdiff_t difference_type;
+#else
+ typedef typename re_detail::regex_iterator_traits<BidiIterator>::difference_type difference_type;
+#endif
+ typedef BidiIterator iterator_type;
+
+ bool matched;
+
+ sub_match() : std::pair<BidiIterator, BidiIterator>(), matched(false) {}
+ sub_match(BidiIterator i) : std::pair<BidiIterator, BidiIterator>(i, i), matched(false) {}
+
+ operator std::basic_string<value_type> ()const
+ {
+ return str();
+ }
+ difference_type BOOST_REGEX_CALL length()const
+ {
+ difference_type n = boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
+ return n;
+ }
+ std::basic_string<value_type> str()const
+ {
+ std::basic_string<value_type> result;
+ std::size_t len = boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
+ result.reserve(len);
+ BidiIterator i = this->first;
+ while(i != this->second)
+ {
+ result.append(1, *i);
+ ++i;
+ }
+ return result;
+ }
+ int compare(const sub_match& s)const
+ {
+ if(matched != s.matched)
+ return static_cast<int>(matched) - static_cast<int>(s.matched);
+ return str().compare(s.str());
+ }
+
+ bool operator==(const sub_match& that)const
+ { return compare(that) == 0; }
+ bool BOOST_REGEX_CALL operator !=(const sub_match& that)const
+ { return compare(that) != 0; }
+ bool operator<(const sub_match& that)const
+ { return compare(that) < 0; }
+ bool operator>(const sub_match& that)const
+ { return compare(that) > 0; }
+ bool operator<=(const sub_match& that)const
+ { return compare(that) <= 0; }
+ bool operator>=(const sub_match& that)const
+ { return compare(that) >= 0; }
+
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ typedef std::vector<sub_match<BidiIterator> > capture_sequence_type;
+
+ const capture_sequence_type& captures()const
+ {
+ if(!m_captures)
+ m_captures.reset(new capture_sequence_type());
+ return *m_captures;
+ }
+ //
+ // Private implementation API: DO NOT USE!
+ //
+ capture_sequence_type& get_captures()const
+ {
+ if(!m_captures)
+ m_captures.reset(new capture_sequence_type());
+ return *m_captures;
+ }
+
+private:
+ mutable boost::scoped_ptr<capture_sequence_type> m_captures;
+public:
+
+#endif
+ sub_match(const sub_match& that, bool
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ deep_copy
+#endif
+ = true
+ )
+ : std::pair<BidiIterator, BidiIterator>(that),
+ matched(that.matched)
+ {
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ if(that.m_captures)
+ if(deep_copy)
+ m_captures.reset(new capture_sequence_type(*(that.m_captures)));
+#endif
+ }
+ sub_match& operator=(const sub_match& that)
+ {
+ this->first = that.first;
+ this->second = that.second;
+ matched = that.matched;
+#ifdef BOOST_REGEX_MATCH_EXTRA
+ if(that.m_captures)
+ get_captures() = *(that.m_captures);
+#endif
+ return *this;
+ }
+
+
+#ifdef BOOST_OLD_REGEX_H
+ //
+ // the following are deprecated, do not use!!
+ //
+ operator int()const;
+ operator unsigned int()const;
+ operator short()const
+ {
+ return (short)(int)(*this);
+ }
+ operator unsigned short()const
+ {
+ return (unsigned short)(unsigned int)(*this);
+ }
+#endif
+};
+
+// comparison to std::basic_string<> part 1:
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator == (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return s.compare(m.str()) == 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator != (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return s.compare(m.str()) != 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator < (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return s.compare(m.str()) < 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator <= (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return s.compare(m.str()) <= 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator >= (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return s.compare(m.str()) >= 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator > (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return s.compare(m.str()) > 0; }
+// comparison to std::basic_string<> part 2:
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator == (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{ return m.str().compare(s) == 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator != (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{ return m.str().compare(s) != 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator < (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{ return m.str().compare(s) < 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator > (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{ return m.str().compare(s) > 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator <= (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{ return m.str().compare(s) <= 0; }
+template <class RandomAccessIterator, class traits, class Allocator>
+inline bool operator >= (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{ return m.str().compare(s) >= 0; }
+// comparison to const charT* part 1:
+template <class RandomAccessIterator>
+inline bool operator == (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+{ return m.str().compare(s) == 0; }
+template <class RandomAccessIterator>
+inline bool operator != (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+{ return m.str().compare(s) != 0; }
+template <class RandomAccessIterator>
+inline bool operator > (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+{ return m.str().compare(s) > 0; }
+template <class RandomAccessIterator>
+inline bool operator < (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+{ return m.str().compare(s) < 0; }
+template <class RandomAccessIterator>
+inline bool operator >= (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+{ return m.str().compare(s) >= 0; }
+template <class RandomAccessIterator>
+inline bool operator <= (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s)
+{ return m.str().compare(s) <= 0; }
+// comparison to const charT* part 2:
+template <class RandomAccessIterator>
+inline bool operator == (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(s) == 0; }
+template <class RandomAccessIterator>
+inline bool operator != (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(s) != 0; }
+template <class RandomAccessIterator>
+inline bool operator < (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(s) > 0; }
+template <class RandomAccessIterator>
+inline bool operator > (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(s) < 0; }
+template <class RandomAccessIterator>
+inline bool operator <= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(s) >= 0; }
+template <class RandomAccessIterator>
+inline bool operator >= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(s) <= 0; }
+
+// comparison to const charT& part 1:
+template <class RandomAccessIterator>
+inline bool operator == (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{ return m.str().compare(0, m.length(), &s, 1) == 0; }
+template <class RandomAccessIterator>
+inline bool operator != (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{ return m.str().compare(0, m.length(), &s, 1) != 0; }
+template <class RandomAccessIterator>
+inline bool operator > (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{ return m.str().compare(0, m.length(), &s, 1) > 0; }
+template <class RandomAccessIterator>
+inline bool operator < (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{ return m.str().compare(0, m.length(), &s, 1) < 0; }
+template <class RandomAccessIterator>
+inline bool operator >= (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
+template <class RandomAccessIterator>
+inline bool operator <= (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
+// comparison to const charT* part 2:
+template <class RandomAccessIterator>
+inline bool operator == (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(0, m.length(), &s, 1) == 0; }
+template <class RandomAccessIterator>
+inline bool operator != (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(0, m.length(), &s, 1) != 0; }
+template <class RandomAccessIterator>
+inline bool operator < (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(0, m.length(), &s, 1) > 0; }
+template <class RandomAccessIterator>
+inline bool operator > (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(0, m.length(), &s, 1) < 0; }
+template <class RandomAccessIterator>
+inline bool operator <= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(0, m.length(), &s, 1) >= 0; }
+template <class RandomAccessIterator>
+inline bool operator >= (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{ return m.str().compare(0, m.length(), &s, 1) <= 0; }
+
+// addition operators:
+template <class RandomAccessIterator, class traits, class Allocator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
+operator + (const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
+ const sub_match<RandomAccessIterator>& m)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
+ result.reserve(s.size() + m.length() + 1);
+ return result.append(s).append(m.first, m.second);
+}
+template <class RandomAccessIterator, class traits, class Allocator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
+operator + (const sub_match<RandomAccessIterator>& m,
+ const std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type, traits, Allocator> result;
+ result.reserve(s.size() + m.length() + 1);
+ return result.append(m.first, m.second).append(s);
+}
+#if !(defined(__GNUC__) && defined(BOOST_NO_STD_LOCALE))
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
+ return result.append(s).append(m.first, m.second);
+}
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(std::char_traits<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>::length(s) + m.length() + 1);
+ return result.append(m.first, m.second).append(s);
+}
+#else
+// worwaround versions:
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const* s,
+ const sub_match<RandomAccessIterator>& m)
+{
+ return s + m.str();
+}
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const * s)
+{
+ return m.str() + s;
+}
+#endif
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s,
+ const sub_match<RandomAccessIterator>& m)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(m.length() + 2);
+ return result.append(1, s).append(m.first, m.second);
+}
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (const sub_match<RandomAccessIterator>& m,
+ typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type const& s)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(m.length() + 2);
+ return result.append(m.first, m.second).append(1, s);
+}
+template <class RandomAccessIterator>
+inline std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type>
+operator + (const sub_match<RandomAccessIterator>& m1,
+ const sub_match<RandomAccessIterator>& m2)
+{
+ std::basic_string<typename re_detail::regex_iterator_traits<RandomAccessIterator>::value_type> result;
+ result.reserve(m1.length() + m2.length() + 1);
+ return result.append(m1.first, m1.second).append(m2.first, m2.second);
+}
+#ifndef BOOST_NO_STD_LOCALE
+template <class charT, class traits, class RandomAccessIterator>
+std::basic_ostream<charT, traits>&
+ operator << (std::basic_ostream<charT, traits>& os,
+ const sub_match<RandomAccessIterator>& s)
+{
+ return (os << s.str());
+}
+#else
+template <class RandomAccessIterator>
+std::ostream& operator << (std::ostream& os,
+ const sub_match<RandomAccessIterator>& s)
+{
+ return (os << s.str());
+}
+#endif
+
+#ifdef BOOST_OLD_REGEX_H
+namespace re_detail{
+template <class BidiIterator, class charT>
+int do_toi(BidiIterator i, BidiIterator j, char c, int radix)
+{
+ std::string s(i, j);
+ char* p;
+ int result = std::strtol(s.c_str(), &p, radix);
+ if(*p)raise_regex_exception("Bad sub-expression");
+ return result;
+}
+
+//
+// helper:
+template <class I, class charT>
+int do_toi(I& i, I j, charT c)
+{
+ int result = 0;
+ while((i != j) && (isdigit(*i)))
+ {
+ result = result*10 + (*i - '0');
+ ++i;
+ }
+ return result;
+}
+}
+
+
+template <class BidiIterator>
+sub_match<BidiIterator>::operator int()const
+{
+ BidiIterator i = first;
+ BidiIterator j = second;
+ if(i == j)raise_regex_exception("Bad sub-expression");
+ int neg = 1;
+ if((i != j) && (*i == '-'))
+ {
+ neg = -1;
+ ++i;
+ }
+ neg *= re_detail::do_toi(i, j, *i);
+ if(i != j)raise_regex_exception("Bad sub-expression");
+ return neg;
+}
+template <class BidiIterator>
+sub_match<BidiIterator>::operator unsigned int()const
+{
+ BidiIterator i = first;
+ BidiIterator j = second;
+ if(i == j)
+ raise_regex_exception("Bad sub-expression");
+ return re_detail::do_toi(i, j, *first);
+}
+#endif
+
+} // namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BOOST_REGEX_FWD_HPP
#define BOOST_REGEX_FWD_HPP
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex_fwd.hpp>
+#else
+#include <boost/regex/v4/regex_fwd.hpp>
+#endif
#endif
+
return ptr != 0;
}
-#else
-
+#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
typedef T * (this_type::*unspecified_bool_type)() const;
-
+
operator unspecified_bool_type() const // never throws
{
return ptr == 0? 0: &this_type::get;
}
+#else
+
+ typedef T * this_type::*unspecified_bool_type;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return ptr == 0? 0: &this_type::ptr;
+ }
+
#endif
bool operator! () const // never throws
return ptr != 0;
}
-#else
-
+#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
typedef T * (this_type::*unspecified_bool_type)() const;
-
+
operator unspecified_bool_type() const // never throws
{
return ptr == 0? 0: &this_type::get;
}
+#else
+ typedef T * this_type::*unspecified_bool_type;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return ptr == 0? 0: &this_type::ptr;
+ }
+
#endif
bool operator! () const // never throws
return px != 0;
}
-#else
-
+#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
typedef T * (this_type::*unspecified_bool_type)() const;
-
+
operator unspecified_bool_type() const // never throws
{
return px == 0? 0: &this_type::get;
}
+#else
+
+ typedef T * this_type::*unspecified_bool_type;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return px == 0? 0: &this_type::px;
+ }
+
#endif
bool operator! () const // never throws
{
struct static_cast_tag {};
+struct const_cast_tag {};
struct dynamic_cast_tag {};
struct polymorphic_cast_tag {};
typedef void reference;
};
+template<> struct shared_ptr_traits<void volatile>
+{
+ typedef void reference;
+};
+
+template<> struct shared_ptr_traits<void const volatile>
+{
+ typedef void reference;
+};
+
#endif
// enable_shared_from_this support
if(pe != 0) pe->_internal_weak_this._internal_assign(px, pn);
}
-inline void sp_enable_shared_from_this(void const *, void const *, shared_count const &)
+inline void sp_enable_shared_from_this(void const volatile *, void const volatile *, shared_count const &)
{
}
{
}
+ template<class Y>
+ shared_ptr(shared_ptr<Y> const & r, detail::const_cast_tag): px(const_cast<element_type *>(r.px)), pn(r.pn)
+ {
+ }
+
template<class Y>
shared_ptr(shared_ptr<Y> const & r, detail::dynamic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
{
BOOST_ASSERT(px != 0);
return px;
}
-
+
T * get() const // never throws
{
return px;
return px != 0;
}
-#else
-
+#elif defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
typedef T * (this_type::*unspecified_bool_type)() const;
-
+
operator unspecified_bool_type() const // never throws
{
return px == 0? 0: &this_type::get;
}
+#else
+
+ typedef T * this_type::*unspecified_bool_type;
+
+ operator unspecified_bool_type() const // never throws
+ {
+ return px == 0? 0: &this_type::px;
+ }
+
#endif
// operator! is redundant, but some compilers need it
return shared_ptr<T>(r, detail::static_cast_tag());
}
+template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r)
+{
+ return shared_ptr<T>(r, detail::const_cast_tag());
+}
+
template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r)
{
return shared_ptr<T>(r, detail::dynamic_cast_tag());
template<class E, class T, class Y> basic_ostream<E, T> & operator<< (basic_ostream<E, T> & os, shared_ptr<Y> const & p)
# else
template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::basic_ostream<E, T> & os, shared_ptr<Y> const & p)
-# endif
+# endif
{
os << p.get();
return os;
// get_deleter (experimental)
-#if defined(__GNUC__) && (__GNUC__ < 3)
+#if (defined(__GNUC__) && (__GNUC__ < 3)) || (defined(__EDG_VERSION__) && (__EDG_VERSION__ <= 238))
// g++ 2.9x doesn't allow static_cast<X const *>(void *)
+// apparently EDG 2.38 also doesn't accept it
template<class D, class T> D * get_deleter(shared_ptr<T> const & p)
{
#ifdef BOOST_MSVC
# pragma warning(pop)
-#endif
+#endif
#endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
// Boost.Signals library
-//
-// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org/libs/signals
#ifndef BOOST_SIGNAL_HPP
#include <boost/signals/signal10.hpp>
#include <boost/function.hpp>
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
namespace boost {
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#ifndef BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
- template<int Arity,
- typename Signature,
+ template<int Arity,
+ typename Signature,
typename Combiner,
typename Group,
typename GroupCompare,
typename SlotFunction>
- struct real_get_signal_impl;
+ class real_get_signal_impl;
template<typename Signature,
typename Combiner,
typename Group,
typename GroupCompare,
typename SlotFunction>
- struct get_signal_impl :
+ struct get_signal_impl :
public real_get_signal_impl<(function_traits<Signature>::arity),
Signature,
Combiner,
{
}
};
-#endif // ndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#endif // ndef BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
} // end namespace boost
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
#endif // BOOST_SIGNAL_HPP
// Boost.Signals library
-//
-// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_CONNECTION_HPP
#include <cassert>
#include <utility>
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
class trackable;
bool operator==(const bound_object& other) const
{ return obj == other.obj && data == other.data; }
- bool operator<(const bound_object& other) const
+ bool operator<(const bound_object& other) const
{ return obj < other.obj; }
};
-
+
// Describes the connection between a signal and the objects that are
// bound for a specific slot. Enables notification of the signal and the
// slots when a disconnect is requested.
void* signal;
void* signal_data;
void (*signal_disconnect)(void*, void*);
-
+
std::list<bound_object> bound_objects;
};
} // end namespace detail
// The user may freely pass around the "connection" object and terminate
// the connection at any time using disconnect().
- class BOOST_SIGNALS_DECL connection :
+ class BOOST_SIGNALS_DECL connection :
private less_than_comparable1<connection>,
private equality_comparable1<connection>
{
public:
- connection();
+ connection() : con(), controlling_connection(false) {}
connection(const connection&);
~connection();
bool released;
};
- inline connection::connection() :
- con(), controlling_connection(false)
- {
- }
-
inline connection::connection(const connection& other) :
- con(other.con), controlling_connection(other.controlling_connection)
+ con(other.con), controlling_connection(other.controlling_connection)
{
}
}
}
- inline void
+ inline void
connection::reset(BOOST_SIGNALS_NAMESPACE::detail::basic_connection* new_con)
{
con.reset(new_con);
}
- inline void
- connection::add_bound_object(const BOOST_SIGNALS_NAMESPACE::detail::bound_object& b)
- {
- assert(con.get() != 0);
- con->bound_objects.push_back(b);
- }
-
inline bool connection::operator==(const connection& other) const
{
return con.get() == other.con.get();
}
inline connection& connection::operator=(const connection& other)
- {
+ {
connection(other).swap(*this);
return *this;
}
{
}
- inline
+ inline
scoped_connection::scoped_connection(const scoped_connection& other) :
connection(other),
released(other.released)
c1.swap(c2);
}
- inline scoped_connection&
+ inline scoped_connection&
scoped_connection::operator=(const connection& other)
{
scoped_connection(other).swap(*this);
return *this;
}
- inline scoped_connection&
+ inline scoped_connection&
scoped_connection::operator=(const scoped_connection& other)
{
scoped_connection(other).swap(*this);
connection_slot_pair() {}
- connection_slot_pair(const connection& c, const any& a)
- : first(c), second(a)
+ connection_slot_pair(const connection& c, const any& a)
+ : first(c), second(a)
{
}
// Dummys to allow explicit instantiation to work
bool operator==(const connection_slot_pair&) const { return false; }
- bool operator<(const connection_slot_pair&) const { return false;}
+ bool operator<(const connection_slot_pair&) const { return false;}
};
-
+
// Determines if the underlying connection is disconnected
struct is_disconnected {
typedef std::pair<const any, connection_slot_pair> argument_type;
// release method is invoked.
class auto_disconnect_bound_object {
public:
- auto_disconnect_bound_object(const bound_object& b) :
+ auto_disconnect_bound_object(const bound_object& b) :
binding(b), auto_disconnect(true)
{
}
} // end namespace BOOST_SIGNALS_NAMESPACE
} // end namespace boost
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
#endif // BOOST_SIGNALS_CONNECTION_HPP
--- /dev/null
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Copyright (c) 2003
+ * Doug Gregor
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+#ifndef BOOST_SIGNALS_CONFIG_HPP
+#define BOOST_SIGNALS_CONFIG_HPP
+
+#ifdef BOOST_HAS_DECLSPEC
+# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
+# ifdef BOOST_SIGNALS_SOURCE
+# define BOOST_SIGNALS_DECL __declspec(dllexport)
+# else
+# define BOOST_SIGNALS_DECL __declspec(dllimport)
+# endif // BOOST_SIGNALS_SOURCE
+# endif // DYN_LINK
+#endif // BOOST_HAS_DECLSPEC
+
+#ifndef BOOST_SIGNALS_DECL
+# define BOOST_SIGNALS_DECL
+#endif
+
+// Setup autolinking
+#if !defined(BOOST_SIGNALS_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_SIGNALS_NO_LIB)
+# define BOOST_LIB_NAME boost_signals
+
+# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
+# define BOOST_DYN_LINK
+# endif
+
+# include <boost/config/auto_link.hpp>
+#endif // autolinking on
+
+#endif // BOOST_SIGNALS_CONFIG_HPP
+
+
+
+
+
+
+
+
+
#!/usr/bin/perl -w
#
# Boost.Signals library
-#
-# Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-#
-# Permission to copy, use, sell and distribute this software is granted
-# provided this copyright notice appears in all copies.
-# Permission to modify the code and to distribute modified code is granted
-# provided this copyright notice appears in all copies, and a notice
-# that the code was modified is included with the copyright notice.
-#
-# This software is provided "as is" without express or implied warranty,
-# and with no claim as to its suitability for any purpose.
-#
+
+# Copyright Doug Gregor 2001-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)
+
# For more information, see http://www.boost.org
use English;
// Boost.Signals library
-//
-// Copyright (C) 2001, 2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL_BASE_HEADER
#define BOOST_SIGNALS_SIGNAL_BASE_HEADER
-#ifdef BOOST_SIGNALS_IN_LIBRARY_SOURCE
-# define BOOST_FUNCTION_SILENT_DEPRECATED
-#endif
-
+#include <boost/signals/detail/config.hpp>
#include <boost/signals/detail/signals_common.hpp>
#include <boost/signals/connection.hpp>
#include <boost/signals/trackable.hpp>
#include <utility>
#include <vector>
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
public:
call_notification(const shared_ptr<signal_base_impl>&);
~call_notification();
-
+
shared_ptr<signal_base_impl> impl;
};
-
- // Implementation of base class for all signals. It handles the
+
+ // Implementation of base class for all signals. It handles the
// management of the underlying slot lists.
class BOOST_SIGNALS_DECL signal_base_impl {
public:
// Are there any connected slots?
bool empty() const;
+ // The number of connected slots
+ std::size_t num_slots() const;
+
// Disconnect all slots in the given group
void disconnect(const any&);
public:
// Our call depth when invoking slots (> 1 when we have a loop)
mutable int call_depth;
-
+
struct {
// True if some slots have disconnected, but we were not able to
- // remove them from the list of slots because there are valid
+ // remove them from the list of slots because there are valid
// iterators into the slot list
mutable bool delayed_disconnect:1;
-
+
// True if we are disconnecting all disconnected slots
bool clearing:1;
} flags;
-
+
// Slots
typedef std::multimap<any, connection_slot_pair, compare_type>
slot_container_type;
friend class call_notification;
- signal_base(const compare_type& comp) : impl()
- {
- impl.reset(new signal_base_impl(comp));
- }
-
+ signal_base(const compare_type& comp);
~signal_base();
public:
// Are there any connected slots?
bool empty() const { return impl->empty(); }
-
+
+ // How many slots are connected?
+ std::size_t num_slots() const { return impl->num_slots(); }
+
protected:
connection connect_slot(const any& slot,
const any& name,
} // end namespace BOOST_SIGNALS_NAMESPACE
} // end namespace boost
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
#endif // BOOST_SIGNALS_SIGNAL_BASE_HEADER
// Boost.Signals library
-//
-// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_COMMON_HEADER
# define BOOST_SIGNALS_NAMESPACE signals
#endif
-/*****************************************************************************
- *
- * Set up dll import/export options:
- *
- ****************************************************************************/
-#if defined(_MSC_VER) && defined(_DLL)
-# define BOOST_SIGNALS_HAS_DLL_RUNTIME
-#endif
-
-#if defined(BOOST_SIGNALS_HAS_DLL_RUNTIME) && !defined(BOOST_SIGNALS_STATIC_LINK)
-# if defined(BOOST_SIGNALS_IN_LIBRARY_SOURCE)
-# define BOOST_SIGNALS_DECL __declspec(dllexport)
-# define BOOST_SIGNALS_BUILD_DLL
-# else
-# define BOOST_SIGNALS_DECL __declspec(dllimport)
-# endif
-#endif
-
-#ifndef BOOST_SIGNALS_DECL
-# define BOOST_SIGNALS_DECL
-#endif
-
-/*****************************************************************************
- ****************************************************************************/
-
#include <boost/type_traits/conversion_traits.hpp>
#include <boost/ref.hpp>
+#include <boost/signals/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
// The unusable class is a placeholder for unused function arguments
// It is also completely unusable except that it constructable from
// anything. This helps compilers without partial specialization
- // handle slots returning void.
+ // handle slots returning void.
struct unusable {
unusable() {}
};
template<typename T>
struct is_signal {
- BOOST_STATIC_CONSTANT(bool,
+ BOOST_STATIC_CONSTANT(bool,
value = (is_convertible<T*, signal_base*>::value));
};
/*
* The IF implementation is temporary code. When a Boost metaprogramming
- * library is introduced, Boost.Signals will use it instead.
+ * library is introduced, Boost.Signals will use it instead.
*/
namespace intimate {
- struct SelectThen
- {
+ struct SelectThen
+ {
template<typename Then, typename Else>
struct Result
- {
+ {
typedef Then type;
};
};
-
+
struct SelectElse
{
template<typename Then, typename Else>
struct Result
- {
+ {
typedef Else type;
};
};
-
+
template<bool Condition>
struct Selector
{
typedef SelectThen type;
};
-
+
template<>
struct Selector<false>
{
typedef SelectElse type;
};
- } // end namespace intimate
-
+ } // end namespace intimate
+
template<bool Condition, typename Then, typename Else>
struct IF
{
template<typename T>
struct is_ref
{
- BOOST_STATIC_CONSTANT(bool, value = false);
+ BOOST_STATIC_CONSTANT(bool, value = false);
};
template<typename T>
#else // no partial specialization
typedef char yes_type;
typedef double no_type;
-
+
no_type is_ref_tester(...);
template<typename T>
struct is_ref
{
static T* t;
- BOOST_STATIC_CONSTANT(bool,
+ BOOST_STATIC_CONSTANT(bool,
value = (sizeof(is_ref_tester(t)) == sizeof(yes_type)));
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- // A slot can be a signal, a reference to a function object, or a
+ // A slot can be a signal, a reference to a function object, or a
// function object.
struct signal_tag {};
struct reference_tag {};
struct value_tag {};
- // Classify the given slot as a signal, a reference-to-slot, or a
+ // Classify the given slot as a signal, a reference-to-slot, or a
// standard slot
template<typename S>
class get_slot_tag {
signal_tag,
value_tag>::type signal_or_value;
- public:
+ public:
typedef typename IF<(is_ref<S>::value),
reference_tag,
signal_or_value>::type type;
} // end namespace BOOST_SIGNALS_NAMESPACE
} // end namespace boost
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
#endif // BOOST_SIGNALS_COMMON_HEADER
// Boost.Signals library
-//
-// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SLOT_CALL_ITERATOR
#define BOOST_SIGNALS_SLOT_CALL_ITERATOR
#include <functional>
-#include <boost/iterator_adaptors.hpp>
+#include <boost/iterator/iterator_facade.hpp>
#include <boost/smart_ptr.hpp>
+#include <boost/signals/detail/config.hpp>
#include <boost/signals/connection.hpp>
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
template<typename T>
struct cached_return_value {
cached_return_value(const T& t) : value(t) {}
-
+
T value;
};
// - calls the connected slots when dereferenced
// - caches the result of calling the slots
template<typename Function, typename Iterator>
- class slot_call_policies : public default_iterator_policies {
- public:
+ class slot_call_iterator
+ : public iterator_facade<slot_call_iterator<Function, Iterator>,
+ typename Function::result_type,
+ single_pass_traversal_tag,
+ typename Function::result_type const&>
+ {
+ typedef iterator_facade<slot_call_iterator<Function, Iterator>,
+ typename Function::result_type,
+ single_pass_traversal_tag,
+ typename Function::result_type const&>
+ inherited;
+
typedef typename Function::result_type result_type;
- slot_call_policies() {}
+ friend class iterator_core_access;
- slot_call_policies(const Iterator& x, Function fi) :
- end(x), f(fi), cache()
+ public:
+ slot_call_iterator() {}
+
+ slot_call_iterator(Iterator iter_in, Iterator end_in, Function f)
+ : iter(iter_in), end(end_in), f(f), cache()
{
+ iter = std::find_if(iter, end, std::not1(is_disconnected()));
}
-
- void initialize(Iterator& x)
- {
- x = std::find_if(x, end, std::not1(is_disconnected()));
- cache.reset();
- }
-
- template <class IteratorAdaptor>
- typename IteratorAdaptor::reference
- dereference(const IteratorAdaptor& x) const
+
+ typename inherited::reference
+ dereference() const
{
if (!cache.get()) {
- cache.reset(new cached_return_value<result_type>(f(*x.base())));
+ cache.reset(new cached_return_value<result_type>(f(*iter)));
}
-
+
return cache->value;
}
- template<typename IteratorAdaptor>
- void increment(IteratorAdaptor& x)
+ void increment()
{
- ++x.base();
- x.base() = std::find_if(x.base(), x.policies().end,
- std::not1(is_disconnected()));
+ iter = std::find_if(++iter, end, std::not1(is_disconnected()));
cache.reset();
}
-
- template<typename IteratorAdaptor1, typename IteratorAdaptor2>
- bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+
+ bool equal(const slot_call_iterator& other) const
{
- Iterator xb = std::find_if(x.base(), x.policies().end,
- std::not1(is_disconnected()));
- Iterator yb = std::find_if(y.base(), y.policies().end,
- std::not1(is_disconnected()));
- const_cast<IteratorAdaptor1&>(x).base() = xb;
- const_cast<IteratorAdaptor1&>(y).base() = yb;
- return xb == yb;
+ iter = std::find_if(iter, end, std::not1(is_disconnected()));
+ other.iter = std::find_if(other.iter, other.end,
+ std::not1(is_disconnected()));
+ return iter == other.iter;
}
-
+
private:
+ mutable Iterator iter;
Iterator end;
Function f;
mutable shared_ptr< cached_return_value<result_type> > cache;
};
-
- template<typename Function, typename Iterator>
- class slot_call_iterator_generator {
- private:
- typedef typename Function::result_type value_type;
- public:
- typedef slot_call_policies<Function, Iterator> policy_type;
- typedef iterator_adaptor<Iterator, policy_type, value_type,
- value_type&, value_type*,
- std::input_iterator_tag> type;
- };
-
- template<typename Function, typename Iterator>
- inline typename slot_call_iterator_generator<Function, Iterator>::type
- make_slot_call_iterator(Iterator first, Iterator last, Function f)
- {
- typedef slot_call_iterator_generator<Function, Iterator> gen;
- typedef typename gen::type sc_iterator;
- typedef typename gen::policy_type sc_policy;
-
- return sc_iterator(first, sc_policy(last, f));
- }
} // end namespace detail
} // end namespace BOOST_SIGNALS_NAMESPACE
} // end namespace boost
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
#endif // BOOST_SIGNALS_SLOT_CALL_ITERATOR
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL0_HEADER
#define BOOST_SIGNALS_SIGNAL0_HEADER
#define BOOST_SIGNALS_NUM_ARGS 0
-#define BOOST_SIGNALS_TEMPLATE_PARMS
-#define BOOST_SIGNALS_TEMPLATE_ARGS
-#define BOOST_SIGNALS_PARMS
-#define BOOST_SIGNALS_ARGS
-#define BOOST_SIGNALS_BOUND_ARGS
-#define BOOST_SIGNALS_ARGS_AS_MEMBERS
-#define BOOST_SIGNALS_COPY_PARMS
-#define BOOST_SIGNALS_INIT_ARGS
-#define BOOST_SIGNALS_ARG_TYPES
+#define BOOST_SIGNALS_TEMPLATE_PARMS
+#define BOOST_SIGNALS_TEMPLATE_ARGS
+#define BOOST_SIGNALS_PARMS
+#define BOOST_SIGNALS_ARGS
+#define BOOST_SIGNALS_BOUND_ARGS
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS
+#define BOOST_SIGNALS_COPY_PARMS
+#define BOOST_SIGNALS_INIT_ARGS
+#define BOOST_SIGNALS_ARG_TYPES
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL1_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL10_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;T10 a10;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9, T10 ia10
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9), a10(ia10)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; typedef T10 arg11_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; typedef T10 arg11_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL2_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL3_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL4_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL5_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL6_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL7_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL8_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
#ifndef BOOST_SIGNALS_SIGNAL9_HEADER
#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;
#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9
#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type;
#include <boost/signals/signal_template.hpp>
// Boost.Signals library
-//
-// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
// This file intentionally does not have include guards, because it is meant
-// to be included multiple times (one for each signalN class). The
+// to be included multiple times (one for each signalN class). The
// BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED macro merely serves to
// suppress reinclusion of the files that this header depends on.
# include <string>
#endif // !BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
// Include the appropriate functionN header
#define BOOST_SIGNAL_FUNCTION_N_HEADER BOOST_JOIN(<boost/function/function,BOOST_SIGNALS_NUM_ARGS.hpp>)
#include BOOST_SIGNAL_FUNCTION_N_HEADER
// The actual signalN class
template<
typename R,
- BOOST_SIGNALS_TEMPLATE_PARMS
+ BOOST_SIGNALS_TEMPLATE_PARMS
BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
typename Combiner = last_value<R>,
typename Group = int,
typename GroupCompare = std::less<Group>,
typename SlotFunction = BOOST_SIGNALS_FUNCTION<
R BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
- BOOST_SIGNALS_TEMPLATE_ARGS>
+ BOOST_SIGNALS_TEMPLATE_ARGS>
>
- class BOOST_SIGNALS_SIGNAL :
+ class BOOST_SIGNALS_SIGNAL :
public BOOST_SIGNALS_NAMESPACE::detail::signal_base, // management of slot list
public BOOST_SIGNALS_NAMESPACE::trackable // signals are trackable
{
// The function object passed to the slot call iterator that will call
// the underlying slot function with its arguments bound
- typedef BOOST_SIGNALS_NAMESPACE::detail::BOOST_SIGNALS_CALL_BOUND<R>
+ typedef BOOST_SIGNALS_NAMESPACE::detail::BOOST_SIGNALS_CALL_BOUND<R>
outer_bound_slot_caller;
typedef typename outer_bound_slot_caller::template
caller<BOOST_SIGNALS_TEMPLATE_ARGS
public:
// Combiner's result type
- typedef typename Combiner::result_type result_type;
+ typedef typename Combiner::result_type result_type;
// Combiner type
typedef Combiner combiner_type;
typedef Group group_type;
typedef GroupCompare group_compare_type;
- typedef typename BOOST_SIGNALS_NAMESPACE::detail::slot_call_iterator_generator<
- call_bound_slot,
- slot_iterator>::type slot_call_iterator;
+ typedef BOOST_SIGNALS_NAMESPACE::detail::slot_call_iterator<
+ call_bound_slot, slot_iterator> slot_call_iterator;
- explicit
+ explicit
BOOST_SIGNALS_SIGNAL(const Combiner& c = Combiner(),
- const GroupCompare& comp = GroupCompare()) :
+ const GroupCompare& comp = GroupCompare()) :
BOOST_SIGNALS_NAMESPACE::detail::signal_base(real_group_compare_type(comp)),
combiner(c)
{
typename GroupCompare,
typename SlotFunction
>
- BOOST_SIGNALS_NAMESPACE::connection
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+ BOOST_SIGNALS_NAMESPACE::connection
+ BOOST_SIGNALS_SIGNAL<
+ R, BOOST_SIGNALS_TEMPLATE_ARGS
+ BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction
>::connect(const slot_type& in_slot)
{
- // If the slot has been disconnected, just return a disconnected
+ // If the slot has been disconnected, just return a disconnected
// connection
if (!in_slot.is_active()) {
return BOOST_SIGNALS_NAMESPACE::connection();
typename GroupCompare,
typename SlotFunction
>
- BOOST_SIGNALS_NAMESPACE::connection
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+ BOOST_SIGNALS_NAMESPACE::connection
+ BOOST_SIGNALS_SIGNAL<
+ R, BOOST_SIGNALS_TEMPLATE_ARGS
+ BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction
- >::connect(const group_type& group,
+ >::connect(const group_type& group,
const slot_type& in_slot)
{
return impl->connect_slot(in_slot.get_slot_function(),
typename Group,
typename GroupCompare,
typename SlotFunction
- >
- typename BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+ >
+ typename BOOST_SIGNALS_SIGNAL<
+ R, BOOST_SIGNALS_TEMPLATE_ARGS
+ BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction>::result_type
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+ BOOST_SIGNALS_SIGNAL<
+ R, BOOST_SIGNALS_TEMPLATE_ARGS
+ BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction
>::operator()(BOOST_SIGNALS_PARMS)
{
BOOST_SIGNALS_NAMESPACE::detail::call_notification notification(this->impl);
// Construct a function object that will call the underlying slots
- // with the given arguments.
+ // with the given arguments.
#if BOOST_SIGNALS_NUM_ARGS == 0
BOOST_SIGNALS_ARGS_STRUCT_INST args;
#else
call_bound_slot f(&args);
// Let the combiner call the slots via a pair of input iterators
- return combiner(BOOST_SIGNALS_NAMESPACE::detail::make_slot_call_iterator(
- notification.impl->slots_.begin(), impl->slots_.end(), f),
- BOOST_SIGNALS_NAMESPACE::detail::make_slot_call_iterator(
- notification.impl->slots_.end(), impl->slots_.end(), f));
+ return combiner(slot_call_iterator(notification.impl->slots_.begin(),
+ impl->slots_.end(), f),
+ slot_call_iterator(notification.impl->slots_.end(),
+ impl->slots_.end(), f));
}
template<
typename Group,
typename GroupCompare,
typename SlotFunction
- >
- typename BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+ >
+ typename BOOST_SIGNALS_SIGNAL<
+ R, BOOST_SIGNALS_TEMPLATE_ARGS
+ BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction>::result_type
- BOOST_SIGNALS_SIGNAL<
- R, BOOST_SIGNALS_TEMPLATE_ARGS
- BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+ BOOST_SIGNALS_SIGNAL<
+ R, BOOST_SIGNALS_TEMPLATE_ARGS
+ BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction
>::operator()(BOOST_SIGNALS_PARMS) const
{
BOOST_SIGNALS_NAMESPACE::detail::call_notification notification(this->impl);
// Construct a function object that will call the underlying slots
- // with the given arguments.
+ // with the given arguments.
#if BOOST_SIGNALS_NUM_ARGS == 0
BOOST_SIGNALS_ARGS_STRUCT_INST args;
#else
call_bound_slot f(&args);
// Let the combiner call the slots via a pair of input iterators
- return combiner(BOOST_SIGNALS_NAMESPACE::detail::make_slot_call_iterator(
- notification.impl->slots_.begin(), impl->slots_.end(), f),
- BOOST_SIGNALS_NAMESPACE::detail::make_slot_call_iterator(
- notification.impl->slots_.end(), impl->slots_.end(), f));
+ return combiner(slot_call_iterator(notification.impl->slots_.begin(),
+ impl->slots_.end(), f),
+ slot_call_iterator(notification.impl->slots_.end(),
+ impl->slots_.end(), f));
}
} // namespace boost
#undef BOOST_SIGNALS_FUNCTION
#undef BOOST_SIGNALS_SIGNAL
#undef BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
// Boost.Signals library
-//
-// Copyright (C) 2001-2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+
+// Copyright Doug Gregor 2001-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)
// For more information, see http://www.boost.org
#include <boost/visit_each.hpp>
#include <cassert>
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
typename BOOST_SIGNALS_NAMESPACE::detail::get_slot_tag<F>::type
tag_type(const F&)
{
- typename BOOST_SIGNALS_NAMESPACE::detail::get_slot_tag<F>::type tag;
+ typedef typename BOOST_SIGNALS_NAMESPACE::detail::get_slot_tag<F>::type
+ the_tag_type;
+ the_tag_type tag = the_tag_type();
return tag;
}
};
} // end namespace boost
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
#endif // BOOST_SIGNALS_SLOT_HEADER
// Boost.Signals library
-//
-// Copyright (C) 2001-2003 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+
+// Copyright Doug Gregor 2001-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)
// For more information, see http://www.boost.org
#include <list>
#include <vector>
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
} // end namespace boost
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
#endif // BOOST_SIGNALS_TRACKABLE_HPP
//
// smart_ptr.hpp
//
-// For compatibility, this header includes the headers for the four "classic"
-// smart pointer class templates.
+// For convenience, this header includes the rest of the smart
+// pointer library headers.
//
// Copyright (c) 1998-2002 boost.org
+// Copyright (c) 2003 Peter Dimov
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// http://www.boost.org/libs/smart_ptr/smart_ptr.htm
//
-#include <boost/scoped_ptr.hpp>
+#include <boost/config.hpp>
+
+#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/shared_array.hpp>
+
+#if !defined(BOOST_NO_MEMBER_TEMPLATES) || defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+# include <boost/weak_ptr.hpp>
+# include <boost/intrusive_ptr.hpp>
+# include <boost/enable_shared_from_this.hpp>
+#endif
// (C) Copyright John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/static_assert for documentation.
#define BOOST_STATIC_ASSERT_HPP
#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
#ifdef __BORLANDC__
//
// style casts: too many compilers currently have problems with static_cast
// when used inside integral constant expressions.
//
-#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) && !defined(__MWERKS__)
+#if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS) && \
+ !BOOST_WORKAROUND(__MWERKS__, < 0x3003)
-#if defined(BOOST_MSVC)
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
// __LINE__ macro broken when -ZI is used see Q199057
// fortunately MSVC ignores duplicate typedef's.
#define BOOST_STATIC_ASSERT( B ) \
typedef ::boost::static_assert_test<\
sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\
> boost_static_assert_typedef_
+#elif defined(BOOST_MSVC)
+#define BOOST_STATIC_ASSERT( B ) \
+ typedef ::boost::static_assert_test<\
+ sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
+ BOOST_JOIN(boost_static_assert_typedef_, __COUNTER__)
#elif defined(BOOST_INTEL_CXX_VERSION)
// agurt 15/sep/02: a special care is needed to force Intel C++ issue an error
// instead of warning in case of failure
# define BOOST_STATIC_ASSERT( B ) \
typedef char BOOST_JOIN(boost_static_assert_typedef_, __LINE__) \
[ ::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >::value ]
+#elif defined(__sgi)
+// special version for SGI MIPSpro compiler
+#define BOOST_STATIC_ASSERT( B ) \
+ BOOST_STATIC_CONSTANT(bool, \
+ BOOST_JOIN(boost_static_assert_test_, __LINE__) = ( B )); \
+ typedef ::boost::static_assert_test<\
+ sizeof(::boost::STATIC_ASSERTION_FAILURE< \
+ BOOST_JOIN(boost_static_assert_test_, __LINE__) >)>\
+ BOOST_JOIN(boost_static_assert_typedef_, __LINE__)
#else
// generic version
#define BOOST_STATIC_ASSERT( B ) \
#endif // BOOST_STATIC_ASSERT_HPP
+
+
-// (C) Copyright Gennadiy Rozental 2002.
-// (C) Copyright Daryle Walker 2000-2001.
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// (C) Copyright Gennadiy Rozental 2002-2003.
+// (C) Copyright Daryle Walker 2000-2001.
+// Use, modification, and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile: nullstream.hpp,v $
//
-// Version : $Id: nullstream.hpp,v 1.1 2003/09/26 14:27:18 larsbj Exp $
+// Version : $Revision: 1.7 $
//
// Description : simulate /dev/null stream
// ***************************************************************************
} // namespace boost
+// ***************************************************************************
+// Revision History :
+//
+// $Log: nullstream.hpp,v $
+// Revision 1.7 2003/12/01 00:41:56 rogeeff
+// prerelease cleaning
+//
+
+// ***************************************************************************
#endif // BOOST_NULLSTREAM_HPP
#ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED
#define BOOST_THROW_EXCEPTION_HPP_INCLUDED
-#if _MSC_VER >= 1020
-#pragma once
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
#endif
//
// boost timer.hpp header file ---------------------------------------------//
-// (C) Copyright Beman Dawes 1994-99. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Copyright Beman Dawes 1994-99.
+// See accompanying license for terms and conditions of use.
// See http://www.boost.org/libs/timer for documentation.
#include <cassert>
#include <string>
#include <cctype>
+#include <algorithm> // for find_if
//
// the following must not be macros if we are to prefix them
// See http://www.boost.org/libs/tokenizer for documentation.
-#ifndef BOOST_TOKENIZER_POLICY_JRB051801_HPP_
-#define BOOST_TOKENIZER_POLICY_JRB051801_HPP_
+// Revision History:
+// 16 Jul 2003 John Bandela
+// Allowed conversions from convertible base iterators
+// 03 Jul 2003 John Bandela
+// Converted to new iterator adapter
-#include<boost/iterator_adaptors.hpp>
+
+
+#ifndef BOOST_TOKENIZER_POLICY_JRB070303_HPP_
+#define BOOST_TOKENIZER_POLICY_JRB070303_HPP_
+
+#include<boost/iterator/iterator_adaptor.hpp>
+#include<boost/iterator/detail/minimum_category.hpp>
#include<boost/token_functions.hpp>
#include<utility>
#include<cassert>
-namespace boost {
- namespace detail{
- // The base "iterator" for iterator adapter
- template<class It>
- class token_iterator_base
- {
- public:
- std::pair<It,It> p_;
- bool valid_;
- token_iterator_base():p_(It(),It()),valid_(false){}
- token_iterator_base(const It& b , const It& e )
- :p_(b,e),valid_(false){}
- operator It(){return p_.first;}
-
- template<class T>
- token_iterator_base(const token_iterator_base<T>& other)
- :p_(other.p_),valid_(other.valid_){}
- };
-
-
- template<class Type, class TokenizerFunc>
- class tokenizer_policy{
- private:
- TokenizerFunc func_;
- Type tok_;
- public:
- tokenizer_policy(){}
- tokenizer_policy(const TokenizerFunc& f):func_(f){};
-
- template<class Base>
- void initialize(Base& b){
- if(b.valid_) return;
- func_.reset();
- b.valid_ = (b.p_.first != b.p_.second)?
- func_(b.p_.first,b.p_.second,tok_):false;
- }
-
- template<class Iterator1, class Iterator2>
- bool equal(const Iterator1& a, const Iterator2& b) const{
- return (a.base().valid_ && b.base().valid_)
- ?(a.base().p_==b.base().p_)
- :(a.base().valid_==b.base().valid_);
-
- }
-
- template<class Iterator>
- typename Iterator::reference
- dereference(const Iterator& a) const{
- using namespace std;
- assert(a.base().valid_);
- return tok_;
- }
- template <class Iterator>
- void increment(Iterator& b){
- using namespace std;
- assert(b.base().valid_);
- b.base().valid_ = func_(b.base().p_.first,b.base().p_.second,tok_);
- }
-
- };
-
- } // namespace detail
+namespace boost
+{
+ template <class TokenizerFunc, class Iterator, class Type>
+ class token_iterator
+ : public iterator_facade<
+ token_iterator<TokenizerFunc, Iterator, Type>
+ , Type
+ , typename detail::minimum_category<
+ forward_traversal_tag
+ , typename iterator_traversal<Iterator>::type
+ >::type
+ , const Type&
+ >
+ {
+
+ friend class iterator_core_access;
+
+ TokenizerFunc f_;
+ Iterator begin_;
+ Iterator end_;
+ bool valid_;
+ Type tok_;
+
+ void increment(){
+ assert(valid_);
+ valid_ = f_(begin_,end_,tok_);
+ }
+
+ const Type& dereference() const {
+ assert(valid_);
+ return tok_;
+ }
+ template<class Other>
+ bool equal(const Other& a) const{
+ return (a.valid_ && valid_)
+ ?( (a.begin_==begin_) && (a.end_ == end_) )
+ :(a.valid_==valid_);
+
+ }
+
+ void initialize(){
+ if(valid_) return;
+ f_.reset();
+ valid_ = (begin_ != end_)?
+ f_(begin_,end_,tok_):false;
+ }
+ public:
+ token_iterator():begin_(),end_(),valid_(false),tok_() { }
+
+ token_iterator(TokenizerFunc f, Iterator begin, Iterator e = Iterator())
+ : f_(f),begin_(begin),end_(e),valid_(false),tok_(){ initialize(); }
+
+ token_iterator(Iterator begin, Iterator e = Iterator())
+ : f_(),begin_(begin),end_(e),valid_(false),tok_() {initialize();}
+
+ template<class OtherIter>
+ token_iterator(
+ token_iterator<TokenizerFunc, OtherIter,Type> const& t
+ , typename enable_if_convertible<OtherIter, Iterator>::type* = 0)
+ : f_(t.tokenizer_function()),begin_(t.base())
+ ,end_(t.end()),valid_(t.at_end()),tok_(t.current_token()) {}
+
+ Iterator base()const{return begin_;}
+
+ Iterator end()const{return end_;};
+
+ TokenizerFunc tokenizer_function()const{return f_;}
+
+ Type current_token()const{return tok_;}
+
+ bool at_end()const{return valid_;}
+
+
+
+
+ };
template <
class TokenizerFunc = char_delimiters_separator<char>,
class Iterator = std::string::const_iterator,
class token_iterator_generator {
private:
- typedef Type value_type;
- typedef detail::tokenizer_policy<Type, TokenizerFunc> policies;
- typedef detail::token_iterator_base<Iterator> base;
- typedef typename boost::detail::non_bidirectional_category<
- Iterator>::type category;
public:
- typedef boost::iterator_adaptor<base,policies,value_type,
- const value_type&,const value_type*,category,std::ptrdiff_t> type;
+ typedef token_iterator<TokenizerFunc,Iterator,Type> type;
};
make_token_iterator(Iterator begin, Iterator end,const TokenizerFunc& fun){
typedef typename
token_iterator_generator<TokenizerFunc,Iterator,Type>::type ret_type;
- detail::token_iterator_base<Iterator> b(begin,end);
- detail::tokenizer_policy<Type,TokenizerFunc> f(fun);
- return ret_type(b,f);
+ return ret_type(fun,begin,end);
}
} // namespace boost
// See http://www.boost.org/libs/tokenizer for documenation
// Revision History:
-
+// 03 Jul 2003 John Bandela
+// Converted to new iterator adapter
// 02 Feb 2002 Jeremy Siek
// Removed tabs and a little cleanup.
-#ifndef BOOST_TOKENIZER_JRB051801_HPP_
-#define BOOST_TOKENIZER_JRB051801_HPP_
+#ifndef BOOST_TOKENIZER_JRB070303_HPP_
+#define BOOST_TOKENIZER_JRB070303_HPP_
#include <boost/token_iterator.hpp>
#include <cassert>
>
class tokenizer {
private:
- typedef detail::tokenizer_policy<Type, TokenizerFunc> Pol;
- typedef detail::token_iterator_base<Iterator> TBase;
typedef token_iterator_generator<TokenizerFunc,Iterator,Type> TGen;
// It seems that MSVC does not like the unqualified use of iterator,
assign(c.begin(),c.end(),f);
}
- iter begin() const { return iter(TBase(first_,last_),Pol(f_)); }
- iter end() const { return iter(TBase(last_,last_),Pol(f_)); }
+ iter begin() const { return iter(f_,first_,last_); }
+ iter end() const { return iter(f_,last_,last_); }
private:
Iterator first_;
namespace detail {
-#ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
-
- template<int N> struct workaround_holder {};
-
-# define BOOST_TUPLE_DUMMY_PARM , detail::workaround_holder<N>* = 0
-# define BOOST_TUPLE_SINGLE_DUMMY_PARM detail::workaround_holder<N>* = 0
-#else
-# define BOOST_TUPLE_DUMMY_PARM
-# define BOOST_TUPLE_SINGLE_DUMMY_PARM
-#endif
-
// -- generate error template, referencing to non-existing members of this
// template is used to produce compilation errors intentionally
template<class T>
inline typename access_traits<
typename element<N, cons<HT, TT> >::type
>::non_const_type
-get(cons<HT, TT>& c BOOST_TUPLE_DUMMY_PARM) {
+get(cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
get<
typename access_traits<
inline typename access_traits<
typename element<N, cons<HT, TT> >::type
>::const_type
-get(const cons<HT, TT>& c BOOST_TUPLE_DUMMY_PARM) {
+get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
get<
typename access_traits<
typename access_traits<
typename element<N, self_type>::type
>::non_const_type
- get(BOOST_TUPLE_SINGLE_DUMMY_PARM) {
+ get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
return boost::tuples::get<N>(*this);
}
typename access_traits<
typename element<N, self_type>::type
>::const_type
- get(BOOST_TUPLE_SINGLE_DUMMY_PARM) const {
+ get(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) const {
return boost::tuples::get<N>(*this);
}
struct swallow_assign {
template<typename T>
- swallow_assign& operator=(const T&) {
+ swallow_assign const& operator=(const T&) const {
return *this;
}
};
} // namespace detail
// "ignore" allows tuple positions to be ignored when using "tie".
-namespace {
- detail::swallow_assign ignore;
-}
+detail::swallow_assign const ignore = detail::swallow_assign();
// ---------------------------------------------------------------------------
// The call_traits for make_tuple
} // end of namespace tuples
} // end of namespace boost
-#undef BOOST_TUPLE_DUMMY_PARM
-#undef BOOST_TUPLE_SINGLE_DUMMY_PARM
#endif // BOOST_TUPLE_BASIC_HPP
+
+
// Copyright (C) 2001 Gary Powell (gary.powell@sierra.com)
//
// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
+// provided this copyright notice appears in all copies.
// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
+// provided this copyright notice appears in all copies, and a notice
// that the code was modified is included with the copyright notice.
//
-// This software is provided "as is" without express or implied warranty,
+// This software is provided "as is" without express or implied warranty,
// and with no claim as to its suitability for any purpose.
-// For more information, see http://www.boost.org or http://lambda.cs.utu.fi
+// For more information, see http://www.boost.org or http://lambda.cs.utu.fi
-// Revision History
+// Revision History
// 14 02 01 Remove extra ';'. Also, fixed 10-parameter to make_tuple. (DG)
// 10 02 01 Fixed "null_type" constructors.
// Implemented comparison operators globally.
// Hide element_type_ref and element_type_const_ref.
// (DG).
-// 09 02 01 Extended to tuples of length 10. Changed comparison for
+// 09 02 01 Extended to tuples of length 10. Changed comparison for
// operator<()
// to the same used by std::pair<>, added cnull_type() (GP)
// 03 02 01 Initial Version from original tuple.hpp code by JJ. (DG)
-// -----------------------------------------------------------------
+// -----------------------------------------------------------------
#ifndef BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP
#define BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP
namespace tuples {
// null_type denotes the end of a list built with "cons"
- struct null_type
+ struct null_type
{
null_type() {}
null_type(const null_type&, const null_type&) {}
};
-
+
// a helper function to provide a const null_type type temporary
inline const null_type cnull_type() { return null_type(); }
// forward declaration of tuple
template<
- typename T1 = null_type,
- typename T2 = null_type,
- typename T3 = null_type,
+ typename T1 = null_type,
+ typename T2 = null_type,
+ typename T3 = null_type,
typename T4 = null_type,
typename T5 = null_type,
typename T6 = null_type,
>
class tuple;
+// forward declaration of cons
+ template<typename Head, typename Tail = null_type>
+ struct cons;
+
namespace detail {
// Takes a pointer and routes all assignments to whatever it points to
struct swallow_assign
{
template<typename T>
- swallow_assign& operator=(const T&)
+ swallow_assign const& operator=(const T&) const
{
return *this;
}
};
template <typename T> struct add_const_reference : add_reference<typename add_const<T>::type> {};
+
+ template <class MyTail>
+ struct init_tail
+ {
+ // Each of vc6 and vc7 seem to require a different formulation
+ // of this return type
+ template <class H, class T>
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ static typename add_reference<typename add_const<T>::type>::type
+#else
+ static typename add_const_reference<T>::type
+#endif
+ execute( cons<H,T> const& u, long )
+ {
+ return u.get_tail();
+ }
+ };
+
+ template <>
+ struct init_tail<null_type>
+ {
+ template <class H>
+ static null_type execute( cons<H,null_type> const& u, long )
+ {
+ return null_type();
+ }
+
+ template <class U>
+ static null_type execute(U const&, ...)
+ {
+ return null_type();
+ }
+ private:
+ template <class H, class T>
+ void execute( cons<H,T> const&, int);
+ };
+
+ template <class Other>
+ Other const&
+ init_head( Other const& u, ... )
+ {
+ return u;
+ }
+
+ template <class H, class T>
+ typename add_reference<typename add_const<H>::type>::type
+ init_head( cons<H,T> const& u, int )
+ {
+ return u.get_head();
+ }
+
+ inline char**** init_head(null_type const&, int);
+
} // end of namespace detail
// cons builds a heterogenous list of types
- template<typename Head, typename Tail = null_type>
+ template<typename Head, typename Tail>
struct cons
{
typedef cons self_type;
tail_type tail;
head_ref get_head() { return head; }
- tail_ref get_tail() { return tail; }
+ tail_ref get_tail() { return tail; }
head_cref get_head() const { return head; }
tail_cref get_tail() const { return tail; }
-
+
+ cons() : head(), tail() {}
+
#if defined BOOST_MSVC
template<typename Tail>
- explicit cons(head_cref h /* = head_type() */, // causes MSVC 6.5 to barf.
+ cons(head_cref h /* = head_type() */, // causes MSVC 6.5 to barf.
const Tail& t) : head(h), tail(t.head, t.tail)
{
}
- explicit cons(head_cref h /* = head_type() */, // causes MSVC 6.5 to barf.
+ cons(head_cref h /* = head_type() */, // causes MSVC 6.5 to barf.
const null_type& t) : head(h), tail(t)
{
}
#else
template<typename T>
- explicit cons(head_cref h, const T& t) :
+ explicit cons(head_cref h, const T& t) :
head(h), tail(t.head, t.tail)
{
}
}
#endif
+ template <class U>
+ cons( const U& u )
+ : head(detail::init_head(u, 0))
+ , tail(detail::init_tail<Tail>::execute(u, 0L))
+ {
+ }
template<typename Other>
cons& operator=(const Other& other)
return *this;
}
};
-
+
namespace detail {
// Determines if the parameter is null_type
template<typename T> struct is_null_type { enum { RET = 0 }; };
template<> struct is_null_type<null_type> { enum { RET = 1 }; };
-
+
/* Build a cons structure from the given Head and Tail. If both are null_type,
return null_type. */
template<typename Head, typename Tail>
// Map the N elements of a tuple into a cons list
template<
- typename T1,
- typename T2 = null_type,
- typename T3 = null_type,
- typename T4 = null_type,
- typename T5 = null_type,
- typename T6 = null_type,
- typename T7 = null_type,
- typename T8 = null_type,
- typename T9 = null_type,
+ typename T1,
+ typename T2 = null_type,
+ typename T3 = null_type,
+ typename T4 = null_type,
+ typename T5 = null_type,
+ typename T6 = null_type,
+ typename T7 = null_type,
+ typename T8 = null_type,
+ typename T9 = null_type,
typename T10 = null_type
>
struct map_tuple_to_cons
{
BOOST_STATIC_CONSTANT(int, value = 1 + length<typename Tuple::tail_type>::value);
};
-
+
template<> struct length<tuple<> > {
BOOST_STATIC_CONSTANT(int, value = 0);
};
// tuple class
template<
- typename T1,
- typename T2,
- typename T3,
+ typename T1,
+ typename T2,
+ typename T3,
typename T4,
typename T5,
typename T6,
typename T9,
typename T10
>
- class tuple :
+ class tuple :
public detail::map_tuple_to_cons<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::cons1
{
private:
typedef cons1 inherited;
typedef tuple self_type;
- explicit tuple(t1_cref t1 = T1(),
- t2_cref t2 = T2(),
- t3_cref t3 = T3(),
- t4_cref t4 = T4(),
- t5_cref t5 = T5(),
- t6_cref t6 = T6(),
- t7_cref t7 = T7(),
- t8_cref t8 = T8(),
- t9_cref t9 = T9(),
- t10_cref t10 = T10()
- ) :
+ tuple() : cons1(T1(), cons2(T2(), cons3(T3(), cons4(T4(), cons5(T5(), cons6(T6(),cons7(T7(),cons8(T8(),cons9(T9(),cons10(T10()))))))))))
+ {}
+
+ tuple(
+ t1_cref t1,
+ t2_cref t2,
+ t3_cref t3 = T3(),
+ t4_cref t4 = T4(),
+ t5_cref t5 = T5(),
+ t6_cref t6 = T6(),
+ t7_cref t7 = T7(),
+ t8_cref t8 = T8(),
+ t9_cref t9 = T9(),
+ t10_cref t10 = T10()
+ ) :
cons1(t1, cons2(t2, cons3(t3, cons4(t4, cons5(t5, cons6(t6,cons7(t7,cons8(t8,cons9(t9,cons10(t10))))))))))
{
}
+ explicit tuple(t1_cref t1)
+ : cons1(t1, cons2(T2(), cons3(T3(), cons4(T4(), cons5(T5(), cons6(T6(),cons7(T7(),cons8(T8(),cons9(T9(),cons10(T10()))))))))))
+ {}
+
template<typename Head, typename Tail>
- explicit tuple(const cons<Head, Tail>& other) :
+ tuple(const cons<Head, Tail>& other) :
cons1(other.head, other.tail)
{
}
{
return tuple<T1, T2, T3, T4, T5, T6>(t1, t2, t3, t4, t5, t6);
}
-
+
// Make a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
inline
// Tie variables into a tuple
template<typename T1, typename T2>
inline
- tuple<detail::assign_to_pointee<T1>,
+ tuple<detail::assign_to_pointee<T1>,
detail::assign_to_pointee<T2> >
tie(T1& t1, T2& t2)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
detail::assign_to_pointee<T3> >
tie(T1& t1, T2& t2, T3& t3)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
detail::assign_to_pointee<T4> >
tie(T1& t1, T2& t2, T3& t3, T4& t4)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
- detail::assign_to_pointee<T4>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
+ detail::assign_to_pointee<T4>,
detail::assign_to_pointee<T5> >
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
- detail::assign_to_pointee<T4>,
- detail::assign_to_pointee<T5>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
+ detail::assign_to_pointee<T4>,
+ detail::assign_to_pointee<T5>,
detail::assign_to_pointee<T6> >
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
- detail::assign_to_pointee<T4>,
- detail::assign_to_pointee<T5>,
- detail::assign_to_pointee<T6>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
+ detail::assign_to_pointee<T4>,
+ detail::assign_to_pointee<T5>,
+ detail::assign_to_pointee<T6>,
detail::assign_to_pointee<T7> >
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
- detail::assign_to_pointee<T4>,
- detail::assign_to_pointee<T5>,
- detail::assign_to_pointee<T6>,
- detail::assign_to_pointee<T7>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
+ detail::assign_to_pointee<T4>,
+ detail::assign_to_pointee<T5>,
+ detail::assign_to_pointee<T6>,
+ detail::assign_to_pointee<T7>,
detail::assign_to_pointee<T8> >
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
- detail::assign_to_pointee<T4>,
- detail::assign_to_pointee<T5>,
- detail::assign_to_pointee<T6>,
- detail::assign_to_pointee<T7>,
- detail::assign_to_pointee<T8>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
+ detail::assign_to_pointee<T4>,
+ detail::assign_to_pointee<T5>,
+ detail::assign_to_pointee<T6>,
+ detail::assign_to_pointee<T7>,
+ detail::assign_to_pointee<T8>,
detail::assign_to_pointee<T9> >
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8, T9 &t9)
{
// Tie variables into a tuple
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
inline
- tuple<detail::assign_to_pointee<T1>,
- detail::assign_to_pointee<T2>,
- detail::assign_to_pointee<T3>,
- detail::assign_to_pointee<T4>,
- detail::assign_to_pointee<T5>,
- detail::assign_to_pointee<T6>,
- detail::assign_to_pointee<T7>,
- detail::assign_to_pointee<T8>,
- detail::assign_to_pointee<T9>,
+ tuple<detail::assign_to_pointee<T1>,
+ detail::assign_to_pointee<T2>,
+ detail::assign_to_pointee<T3>,
+ detail::assign_to_pointee<T4>,
+ detail::assign_to_pointee<T5>,
+ detail::assign_to_pointee<T6>,
+ detail::assign_to_pointee<T7>,
+ detail::assign_to_pointee<T8>,
+ detail::assign_to_pointee<T9>,
detail::assign_to_pointee<T10> >
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8, T9 &t9, T10 &t10)
{
detail::assign_to_pointee<T9>(&t9),
detail::assign_to_pointee<T10>(&t10));
}
- // "ignore" allows tuple positions to be ignored when using "tie".
- namespace {
-#if (defined(BOOST_MSVC) && BOOST_MSVC <= 1300) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031)
- static
-#endif
- detail::swallow_assign ignore;
- }
+ // "ignore" allows tuple positions to be ignored when using "tie".
+
+detail::swallow_assign const ignore = detail::swallow_assign();
} // namespace tuples
} // namespace boost
-// (C) Copyright Boost.org 2000. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
-// See http://www.boost.org/libs/type_traits for documentation.
// See boost/type_traits/*.hpp for full copyright notices.
#ifndef BOOST_TYPE_TRAITS_HPP
#include "boost/type_traits/remove_reference.hpp"
#include "boost/type_traits/remove_volatile.hpp"
#include "boost/type_traits/type_with_alignment.hpp"
+#include "boost/type_traits/function_traits.hpp"
#include "boost/type_traits/ice.hpp"
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ADD_CONST_HPP_INCLUDED
#define BOOST_TT_ADD_CONST_HPP_INCLUDED
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_ADD_CV_HPP_INCLUDED
#define BOOST_TT_ADD_CV_HPP_INCLUDED
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ADD_POINTER_HPP_INCLUDED
#define BOOST_TT_ADD_POINTER_HPP_INCLUDED
namespace detail {
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
//
// For some reason this implementation stops Borlands compiler
// from dropping cv-qualifiers, it still fails with references
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
#define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
// agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional
// level of indirection, here
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561))
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
#endif
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
#define BOOST_TT_ADD_VOLATILE_HPP_INCLUDED
-// (C) Copyright John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED
#define BOOST_TT_ALIGNMENT_OF_HPP_INCLUDED
# pragma warning(push)
# pragma warning(disable: 4121) // alignment is sensitive to packing
#endif
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#pragma option push -Vx- -Ve-
#endif
} // namespace boost
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
#pragma option pop
#endif
#ifdef BOOST_MSVC
// (C) Copyright John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED
#define BOOST_TT_ALIGNMENT_TRAITS_HPP_INCLUDED
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// defines traits classes for arithmetic types:
// is_void, is_integral, is_float, is_arithmetic, is_fundamental.
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED
#define BOOST_TT_ARRAY_TRAITS_HPP_INCLUDED
-// Copyright (c) 2001 Aleksey Gurtovoy.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright (c) 2001-2003 Aleksey Gurtovoy.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
#define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
#include "boost/mpl/aux_/lambda_support.hpp"
#include "boost/config.hpp"
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-
-# define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
-
-#else
-
+// these are needed regardless of BOOST_TT_NO_BROKEN_COMPILER_SPEC
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
namespace boost { namespace detail {
template< typename T > struct remove_const_impl { typedef T type; };
template< typename T > struct remove_volatile_impl { typedef T type; };
template< typename T > struct remove_pointer_impl { typedef T type; };
template< typename T > struct remove_reference_impl { typedef T type; };
+typedef int invoke_BOOST_TT_BROKEN_COMPILER_SPEC_outside_all_namespaces;
}}
+#endif
+
+// agurt, 27/jun/03: disable the workaround if user defined
+// BOOST_TT_NO_BROKEN_COMPILER_SPEC
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ || defined(BOOST_TT_NO_BROKEN_COMPILER_SPEC)
+
+# define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
+
+#else
// same as BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1 macro, except that it
// never gets #undef-ined
# define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \
BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*,T) \
+ BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*const,T) \
+ BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*volatile,T) \
+ BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*const volatile,T) \
BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_reference,T&,T) \
/**/
# define BOOST_TT_BROKEN_COMPILER_SPEC(T) \
namespace boost { namespace detail { \
+ typedef invoke_BOOST_TT_BROKEN_COMPILER_SPEC_outside_all_namespaces \
+ please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_outside_all_namespaces; \
BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \
BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \
BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T*) \
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// defines traits classes for composite types:
// is_array, is_pointer, is_reference, is_member_pointer, is_enum, is_union.
//
-// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
-// is_member_pointer based on the Simulated Partial Specialization work
-// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
-// http://groups.yahoo.com/group/boost/message/5441
-// Some workarounds in here use ideas suggested from "Generic<Programming>:
-// Mappings between Types and Values"
-// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
-// Fixes for is_array are based on a newgroup posting by Jonathan Lundquist.
#ifndef BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED
#define BOOST_TT_COMPOSITE_TRAITS_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_CONFIG_HPP_INCLUDED
#define BOOST_TT_CONFIG_HPP_INCLUDED
// it needs to be declared __cdecl to suppress compiler
// warnings from MS and Borland compilers (this *must*
// appear before we include is_same.hpp below):
-#if defined(BOOST_MSVC) || defined(__BORLANDC__)
+#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
# define BOOST_TT_DECL __cdecl
#else
# define BOOST_TT_DECL /**/
#endif
-# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || (defined(BOOST_MSVC) && (BOOST_MSVC > 1301)) || defined(BOOST_NO_COMPILER_CONFIG)
+# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || (defined(BOOST_MSVC) && (BOOST_MSVC > 1301)) || defined(__EDG_VERSION__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(BOOST_NO_COMPILER_CONFIG)
# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
#endif
-// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com)
+// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
// Copyright (C) 2000 Jeremy Siek (jsiek@lsc.nd.edu)
// Copyright (C) 1999, 2000 Jaakko J\84rvi (jaakko.jarvi@cs.utu.fi)
//
-// Permission to copy and use this software is granted,
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted,
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED
#define BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// defines traits classes for cv-qualified types:
// is_const, is_volatile, remove_const, remove_volatile, remove_cv.
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
// no include guards, the header is intended for multiple inclusion!
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,value) \
/**/
#endif
+
+#if 0 // there are true_type and false_type already in boost::
+ // This also induces dependencies which may be undesirable
+ // Let's wait until sometime not just before a release and clean
+ // the whole ct_if mess up.
+# ifndef BOOST_TT_INTEGRAL_CONSTANT
+# define BOOST_TT_INTEGRAL_CONSTANT
+# include <boost/mpl/integral_c.hpp>
+
+//
+// this is not a TR1 conforming integral_constant,
+// but it is a first start:
+//
+
+namespace boost{
+
+template <class T, T val>
+struct integral_constant
+: public mpl::integral_c<T,val> {};
+
+
+template<> struct integral_constant< bool, true > \
+ BOOST_TT_AUX_BOOL_C_BASE(true) \
+{ \
+ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(true) \
+ BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,integral_constant,(bool)) \
+};
+template<> struct integral_constant< bool, false > \
+ BOOST_TT_AUX_BOOL_C_BASE(false) \
+{ \
+ BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(false) \
+ BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,integral_constant,(bool)) \
+};
+
+namespace pending {
+typedef mpl::true_ true_type;
+typedef mpl::false_ false_type;
+}
+
+}
+
+# endif
+#endif
//-----------------------------------------------------------------------------
// boost/type_traits/detail/bool_trait_undef.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
// no include guards, the header is intended for multiple inclusion!
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
#define BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
-// Copyright David Abrahams 2002. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Copyright David Abrahams 2002.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED
#define BOOST_TT_DETAIL_FALSE_RESULT_HPP_INCLUDED
-// (C) Copyright John Maddock and Steve Cleary 2000.
+// (C) Copyright John Maddock and Steve Cleary 2000.
//
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
#define BOOST_TT_DETAIL_ICE_AND_HPP_INCLUDED
-// (C) Copyright John Maddock and Steve Cleary 2000.
+// (C) Copyright John Maddock and Steve Cleary 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
-//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
#define BOOST_TT_DETAIL_ICE_EQ_HPP_INCLUDED
-// (C) Copyright John Maddock and Steve Cleary 2000.
+// (C) Copyright John Maddock and Steve Cleary 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
-//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
#define BOOST_TT_DETAIL_ICE_NOT_HPP_INCLUDED
-// (C) Copyright John Maddock and Steve Cleary 2000.
+// (C) Copyright John Maddock and Steve Cleary 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
-//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
#define BOOST_TT_DETAIL_ICE_OR_HPP_INCLUDED
-// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com)
-// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
+// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
//
-// Permission to copy and use this software is granted,
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted,
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#if !defined(BOOST_PP_IS_ITERATING)
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
-// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#if !defined(BOOST_PP_IS_ITERATING)
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
// no include guards, the header is intended for multiple inclusion!
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
// no include guards, the header is intended for multiple inclusion!
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
// no include guards, the header is intended for multiple inclusion!
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
// no include guards, the header is intended for multiple inclusion!
// Copyright (c) 2002
// Aleksey Gurtovoy
//
-// Permission to use, copy, modify, distribute and sell this software
-// and its documentation for any purpose is hereby granted without fee,
-// provided that the above copyright notice appears in all copies and
-// that both the copyright notice and this permission notice appear in
-// supporting documentation. No representations are made about the
-// suitability of this software for any purpose. It is provided "as is"
-// without express or implied warranty.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
// no include guards, the header is intended for multiple inclusion!
-// Copyright David Abrahams 2002. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright David Abrahams 2002.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_DETAIL_WRAP_HPP_INCLUDED
#define BOOST_TT_DETAIL_WRAP_HPP_INCLUDED
-// (C) Copyright John Maddock and Steve Cleary 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// (C) Copyright John Maddock and Steve Cleary 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
-// macros and helpers for working with integral-constant-expressions.
+// macros and helpers for working with integral-constant-expressions.
#ifndef BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED
#define BOOST_TT_DETAIL_YES_NO_TYPE_HPP_INCLUDED
-// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com)
+// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// Permission to copy and use this software is granted,
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted,
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED
#define BOOST_TT_FUNCTION_TRAITS_HPP_INCLUDED
BOOST_STATIC_CONSTANT(int, arity = 1);
typedef R result_type;
typedef T1 arg1_type;
+ typedef T1 argument_type;
};
template<typename R, typename T1, typename T2>
typedef R result_type;
typedef T1 arg1_type;
typedef T2 arg2_type;
+ typedef T1 first_argument_type;
+ typedef T2 second_argument_type;
};
template<typename R, typename T1, typename T2, typename T3>
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_ASSIGN_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_CONSTRUCTOR_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_COPY_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_ASSIGN_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
#define BOOST_TT_HAS_TRIVIAL_DESTRUCTOR_HPP_INCLUDED
// (C) Copyright John Maddock and Steve Cleary 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
-
-// See http://www.boost.org for most recent version including documentation.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// macros and helpers for working with integral-constant-expressions.
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_INTRINSICS_HPP_INCLUDED
#define BOOST_TT_INTRINSICS_HPP_INCLUDED
# define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_copy_constructor, ::__true_type>::value
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_assignment_operator, ::__true_type>::value
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_destructor, ::__true_type>::value
+
+# ifdef __sgi
+# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
+# endif
#endif
#if defined(__MSL_CPP__) && (__MSL_CPP__ >= 0x8000)
# define BOOST_HAS_TRIVIAL_COPY(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_copy_ctor<T>::value
# define BOOST_HAS_TRIVIAL_ASSIGN(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_assignment<T>::value
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_dtor<T>::value
+# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
#endif
#ifndef BOOST_IS_UNION
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
#define BOOST_TT_IS_ARITHMETIC_HPP_INCLUDED
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+
+// Some fixes for is_array are based on a newgroup posting by Jonathan Lundquist.
+
#ifndef BOOST_TT_IS_ARRAY_HPP_INCLUDED
#define BOOST_TT_IS_ARRAY_HPP_INCLUDED
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_array,T,false)
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T[N],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const[N],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T volatile[N],true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,is_array,T const volatile[N],true)
+#if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x600))
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T[],true)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const[],true)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T volatile[],true)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_array,T const volatile[],true)
+#endif
+#endif
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template< typename T >
struct is_array_impl
-{
- BOOST_STATIC_CONSTANT(bool, value =
+{
+ BOOST_STATIC_CONSTANT(bool, value =
sizeof(::boost::detail::is_array_tester2(
::boost::detail::is_array_tester1(
::boost::type_traits::wrap<T>()
-// (C) Copyright Rani Sharoni 2003.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Rani Sharoni 2003.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
-
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED
#define BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED
namespace detail {
-#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) \
+#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x570) \
&& !BOOST_WORKAROUND(__SUNPRO_CC , BOOST_TESTED_AT(0x540)) \
&& !BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
// The EDG version number is a lower estimate.
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000-2002. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000-2003.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_IS_CLASS_HPP_INCLUDED
#define BOOST_TT_IS_CLASS_HPP_INCLUDED
# include "boost/type_traits/is_function.hpp"
#endif
+#ifdef __EDG_VERSION__
+# include "boost/type_traits/remove_cv.hpp"
+#endif
+
// should be the last #include
#include "boost/type_traits/detail/bool_trait_def.hpp"
// is_class<> metafunction due to Paul Mensonides
// (leavings@attbi.com). For more details:
// http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
+#if defined(__GNUC__) && !defined(__EDG_VERSION__)
+
+template <class U> ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
+template <class U> ::boost::type_traits::no_type is_class_tester(...);
+
+template <typename T>
+struct is_class_impl
+{
+
+ BOOST_STATIC_CONSTANT(bool, value =
+ (::boost::type_traits::ice_and<
+ sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type),
+ ::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value
+ >::value)
+ );
+};
+
+#else
template <typename T>
struct is_class_impl
template <class U> static ::boost::type_traits::yes_type is_class_tester(void(U::*)(void));
template <class U> static ::boost::type_traits::no_type is_class_tester(...);
- BOOST_STATIC_CONSTANT(bool, value =
+ BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
sizeof(is_class_tester<T>(0)) == sizeof(::boost::type_traits::yes_type),
::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value
);
};
+#endif
+
#else
template <typename T>
} // namespace detail
+# ifdef __EDG_VERSION__
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(
+ is_class,T, detail::is_class_impl<typename remove_cv<T>::type>::value)
+# else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_class,T,::boost::detail::is_class_impl<T>::value)
-
+# endif
+
} // namespace boost
#include "boost/type_traits/detail/bool_trait_undef.hpp"
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_COMPOUND_HPP_INCLUDED
#define BOOST_TT_IS_COMPOUND_HPP_INCLUDED
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
#ifndef BOOST_TT_IS_CONST_HPP_INCLUDED
#define BOOST_TT_IS_CONST_HPP_INCLUDED
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::cv_traits_imp<T*>::is_const)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false)
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_const_tester(t))
));
- };
+ };
};
template <>
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_const_tester(&t))
));
- };
+ };
};
template <typename T>
is_reference<T>::value
, is_array<T>::value
>::template result_<T>
-{
+{
};
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_const,void,false)
-// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com)
+// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
// Copyright (C) 2000 Jeremy Siek (jsiek@lsc.nd.edu)
// Copyright (C) 1999, 2000 Jaakko J\84rvi (jaakko.jarvi@cs.utu.fi)
//
-// Permission to copy and use this software is granted,
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted,
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED
#define BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED
};
static From _m_from;
- static bool const value = sizeof( checker<To>::_m_check(_m_from) )
+ static bool const value = sizeof( checker<To>::_m_check(_m_from) )
== sizeof(::boost::type_traits::yes_type);
#pragma option pop
};
-#elif defined(__GNUC__) || defined(__BORLANDC__)
+#elif defined(__GNUC__) || defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
// special version for gcc compiler + recent Borland versions
// note that this does not pass UDT's through (...)
struct any_conversion
{
template <typename T> any_conversion(const volatile T&);
- //template <typename T> any_conversion(T&);
+ template <typename T> any_conversion(T&);
};
template <typename T> struct checker
struct is_convertible_basic_impl
{
static From _m_from;
- static bool const value = sizeof( detail::checker<To>::_m_check(_m_from, 0) )
+ static bool const value = sizeof( detail::checker<To>::_m_check(_m_from, 0) )
== sizeof(::boost::type_traits::yes_type);
};
-#elif (defined(BOOST_MSVC) && (BOOST_MSVC > 1310)) \
- || (defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 245) && !defined(__ICL))
+#elif (defined(__EDG_VERSION__) && (__EDG_VERSION__ >= 245) && !defined(__ICL)) \
+ || defined(__IBMCPP__)
//
// This is *almost* an ideal world implementation as it doesn't rely
// on undefined behaviour by passing UDT's through (...).
// Unfortunately it doesn't quite pass all the tests for most compilers (sigh...)
// Enable this for your compiler if is_convertible_test.cpp will compile it...
//
+// Note we do not enable this for VC7.1, because even though it passes all the
+// type_traits tests it is known to cause problems when instantiation occurs
+// deep within the instantiation tree :-(
+//
struct any_conversion
{
template <typename T> any_conversion(const volatile T&);
{
static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(any_conversion ...);
static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To, int);
- static From _m_from;
+ static From _m_from;
- BOOST_STATIC_CONSTANT(bool, value =
+ BOOST_STATIC_CONSTANT(bool, value =
sizeof( _m_check(_m_from, 0) ) == sizeof(::boost::type_traits::yes_type)
);
};
#else
//
-// This version seems to work pretty well for a wide spectrum of compilers,
+// This version seems to work pretty well for a wide spectrum of compilers,
// however it does rely on undefined behaviour by passing UDT's through (...).
//
template <typename From, typename To>
/**/
# define TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(F) \
+ TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F) \
TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F const) \
TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F volatile) \
TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_SPEC(F const volatile) \
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_EMPTY_HPP_INCLUDED
#define BOOST_TT_IS_EMPTY_HPP_INCLUDED
struct empty_helper_t2 { int i[256]; };
-#ifndef __BORLANDC__
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
template <typename T, bool is_a_class = false>
struct empty_helper
};
};
-template <typename T>
+template <typename T>
struct is_empty_impl
-{
+{
typedef ::boost::detail::empty_helper_chooser<
::boost::type_traits::ice_and<
::boost::type_traits::ice_not< ::boost::is_reference<T>::value >::value,
typedef typename result::type eh_type;
BOOST_STATIC_CONSTANT(bool, value =
- (::boost::type_traits::ice_or<eh_type::value, BOOST_IS_EMPTY(T)>::value));
+ (::boost::type_traits::ice_or<eh_type::value, BOOST_IS_EMPTY(T)>::value));
};
#else
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_IS_ENUM_HPP_INCLUDED
#define BOOST_TT_IS_ENUM_HPP_INCLUDED
#include "boost/type_traits/is_arithmetic.hpp"
#include "boost/type_traits/is_reference.hpp"
#include "boost/type_traits/is_convertible.hpp"
+#ifdef __GNUC__
+#include <boost/type_traits/is_function.hpp>
+#endif
#include "boost/type_traits/config.hpp"
-
-#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
-# include "boost/type_traits/is_class.hpp"
+#if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION)
+# include <boost/type_traits/is_class.hpp>
+# include <boost/type_traits/is_union.hpp>
#endif
+
// should be the last #include
#include "boost/type_traits/detail/bool_trait_def.hpp"
#if !(defined(__BORLANDC__) && (__BORLANDC__ <= 0x551))
namespace detail {
-
+
+#if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION)
+
+template <typename T>
+struct is_class_or_union
+{
+ BOOST_STATIC_CONSTANT(bool, value =
+ (::boost::type_traits::ice_or<
+ ::boost::is_class<T>::value
+ , ::boost::is_union<T>::value
+ >::value));
+};
+
+#else
+
+template <typename T>
+struct is_class_or_union
+{
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) || BOOST_WORKAROUND(__BORLANDC__, <= 0x570)// we simply can't detect it this way.
+ BOOST_STATIC_CONSTANT(bool, value = false);
+# else
+ template <class U> static ::boost::type_traits::yes_type is_class_or_union_tester(void(U::*)(void));
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) \
+ || BOOST_WORKAROUND(__MWERKS__, <= 0x3000) // no SFINAE
+ static ::boost::type_traits::no_type is_class_or_union_tester(...);
+ BOOST_STATIC_CONSTANT(
+ bool, value = sizeof(is_class_or_union_tester(0)) == sizeof(::boost::type_traits::yes_type));
+# else
+ template <class U>
+ static ::boost::type_traits::no_type is_class_or_union_tester(...);
+ BOOST_STATIC_CONSTANT(
+ bool, value = sizeof(is_class_or_union_tester<T>(0)) == sizeof(::boost::type_traits::yes_type));
+# endif
+# endif
+};
+#endif
+
struct int_convertible
{
int_convertible(int);
{
typedef ::boost::add_reference<T> ar_t;
typedef typename ar_t::type r_type;
-
-#if defined(BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION)
+
+#if defined(__GNUC__)
+
+#ifdef BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
BOOST_STATIC_CONSTANT(bool, selector =
(::boost::type_traits::ice_or<
::boost::is_arithmetic<T>::value
, ::boost::is_reference<T>::value
- // We MUST do this on conforming compilers in order to
- // correctly deduce that noncopyable types are not enums (dwa
- // 2002/04/15)...
- , ::boost::is_class<T>::value
+ , ::boost::is_function<T>::value
+ , is_class_or_union<T>::value
>::value));
-#else
+#else
BOOST_STATIC_CONSTANT(bool, selector =
(::boost::type_traits::ice_or<
::boost::is_arithmetic<T>::value
, ::boost::is_reference<T>::value
+ , ::boost::is_function<T>::value
+ >::value));
+#endif // BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
+
+#else
+ BOOST_STATIC_CONSTANT(bool, selector =
+ (::boost::type_traits::ice_or<
+ ::boost::is_arithmetic<T>::value
+ , ::boost::is_reference<T>::value
+ , is_class_or_union<T>::value
// However, not doing this on non-conforming compilers prevents
// a dependency recursion.
>::value));
#endif
-#ifdef __BORLANDC__
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
typedef ::boost::detail::is_enum_helper<
::boost::detail::is_enum_impl<T>::selector
> se_t;
#else
typedef ::boost::detail::is_enum_helper<selector> se_t;
#endif
+
typedef typename se_t::template type<r_type> helper;
BOOST_STATIC_CONSTANT(bool, value = helper::value);
};
-// Specializations suppress some nasty warnings with GCC
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,float,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,double,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,long double,false)
// these help on compilers with no partial specialization support:
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_enum,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
#else // __BORLANDC__
//
-// buggy is_convertible prevents working
+// buggy is_convertible prevents working
// implementation of is_enum:
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_enum,T,false)
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED
#define BOOST_TYPE_TRAITS_IS_FLOAT_HPP_INCLUDED
-// Copyright (C) 2000 John Maddock (john_maddock@compuserve.com)
-// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
+// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
//
-// Permission to copy and use this software is granted,
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted,
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_FUNCTION_HPP_INCLUDED
#define BOOST_TT_IS_FUNCTION_HPP_INCLUDED
template <typename T>
struct is_function_impl
: is_function_chooser< ::boost::is_reference<T>::value >
- ::template result_<T>
+ ::BOOST_NESTED_TEMPLATE result_<T>
{
};
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED
#define BOOST_TT_IS_FUNDAMENTAL_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_INTEGRAL_HPP_INCLUDED
#define BOOST_TT_IS_INTEGRAL_HPP_INCLUDED
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
#endif
-#if (defined(BOOST_MSVC) && (BOOST_MSVC == 1200)) || (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600))
+#if (defined(BOOST_MSVC) && (BOOST_MSVC == 1200)) \
+ || (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \
+ || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER == 1200))
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int8,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int8,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int16,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true)
+#ifdef __BORLANDC__
+BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
+BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
+#endif
#endif
# if defined(BOOST_HAS_LONG_LONG)
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
#include "boost/type_traits/config.hpp"
+#include "boost/detail/workaround.hpp"
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
# include "boost/type_traits/detail/is_mem_fun_pointer_impl.hpp"
#else
# include "boost/type_traits/is_reference.hpp"
namespace boost {
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_member_function_pointer
{
static T& make_t;
typedef result_<T> self_type;
-
+
BOOST_STATIC_CONSTANT(
bool, value = (
1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
#ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
#include "boost/type_traits/config.hpp"
+#include "boost/detail/workaround.hpp"
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
# include "boost/type_traits/is_member_function_pointer.hpp"
#else
# include "boost/type_traits/is_reference.hpp"
namespace boost {
-#if defined(__BORLANDC__)
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
{
static T& make_t();
BOOST_STATIC_CONSTANT(
- bool, value =
+ bool, value =
(::boost::type_traits::ice_or<
(1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(make_t()))),
(1 == sizeof(is_member_pointer_tester(make_t())))
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_OBJECT_HPP_INCLUDED
#define BOOST_TT_IS_OBJECT_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_POD_HPP_INCLUDED
#define BOOST_TT_IS_POD_HPP_INCLUDED
>::value));
};
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
template <typename T, std::size_t sz>
struct is_pod_impl<T[sz]>
: is_pod_impl<T>
{
};
+#endif
#else
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_POD,T,::boost::detail::is_pod_impl<T>::value)
-BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::is_POD<T>::value)
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl<T>::value)
} // namespace boost
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
#ifndef BOOST_TT_IS_POINTER_HPP_INCLUDED
#define BOOST_TT_IS_POINTER_HPP_INCLUDED
template< typename T >
struct is_pointer_impl
{
- BOOST_STATIC_CONSTANT(bool, value =
+ BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::detail::is_pointer_helper<T>::value
, ::boost::type_traits::ice_not<
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl<T>::value)
-#if defined(__BORLANDC__) && !defined(__COMO__)
+#if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T&,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& volatile,false)
-// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_POLYMORPHIC_HPP
#define BOOST_TT_IS_POLYMORPHIC_HPP
{
d2();
virtual ~d2()throw();
-# ifndef BOOST_MSVC
- // for some reason this messes up VC++ when T has virtual bases:
- virtual void foo();
+# if !defined(BOOST_MSVC) && !defined(__ICL)
+ // for some reason this messes up VC++ when T has virtual bases,
+ // probably likewise for compilers that use the same ABI:
+ struct unique{};
+ virtual void foo(unique*);
# endif
char padding[256];
};
-// (C) Copyright David Abrahams Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000-2002. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
#ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_REFERENCE_HPP_INCLUDED
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T&,true)
-#if defined(__BORLANDC__) && !defined(__COMO__)
+#if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
#include "boost/type_traits/detail/bool_trait_undef.hpp"
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
+
-// (C) Copyright Steve Cleary, Beman Dawes, Aleksey Gurtovoy,
-// Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This
-// software is provided "as is" without express or implied warranty, and
-// with no claim as to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
#ifndef BOOST_TT_IS_SAME_HPP_INCLUDED
#define BOOST_TT_IS_SAME_HPP_INCLUDED
BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_same,T,U,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T,T,true)
-#ifdef __BORLANDC__
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
// without this, Borland's compiler gives the wrong answer for
// references to arrays:
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_1(typename T,is_same,T&,T&,true)
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_SCALAR_HPP_INCLUDED
#define BOOST_TT_IS_SCALAR_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_STATELESS_HPP_INCLUDED
#define BOOST_TT_IS_STATELESS_HPP_INCLUDED
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_IS_UNION_HPP_INCLUDED
#define BOOST_TT_IS_UNION_HPP_INCLUDED
namespace boost {
namespace detail {
+#ifndef __GNUC__
template <typename T> struct is_union_impl
{
typedef typename remove_cv<T>::type cvt;
BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
};
+#else
+//
+// using remove_cv here generates a whole load of needless
+// warnings with gcc, since it doesn't do any good with gcc
+// in any case (at least at present), just remove it:
+//
+template <typename T> struct is_union_impl
+{
+ BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T));
+};
+#endif
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl<T>::value)
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_VOID_HPP_INCLUDED
#define BOOST_TT_IS_VOID_HPP_INCLUDED
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
#ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED
#define BOOST_TT_IS_VOLATILE_HPP_INCLUDED
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp<T*>::is_volatile)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false)
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(t))
));
- };
+ };
};
template <>
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(&t))
));
- };
+ };
};
template <typename T>
is_reference<T>::value
, is_array<T>::value
>::template result_<T>
-{
+{
};
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void,false)
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// defines object traits classes:
// is_object, is_scalar, is_class, is_compound, is_pod,
// (C) Copyright David Abrahams Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000-2002. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// Hinnant & John Maddock 2000-2002.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_REFERENCE_TRAITS_HPP_INCLUDED
#define BOOST_TT_REFERENCE_TRAITS_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
#define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_bounds,T,T)
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T[N],T type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const[N],T const type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T volatile[N],T volatile type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_bounds,T const volatile[N],T const volatile type)
+#if !(defined(__BORLANDC__) && (__BORLANDC__ < 0x600))
+BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T[],T)
+BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const[],T const)
+BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T volatile[],T volatile)
+BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_bounds,T const volatile[],T const volatile)
+#endif
#endif
} // namespace boost
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_REMOVE_CONST_HPP_INCLUDED
#define BOOST_TT_REMOVE_CONST_HPP_INCLUDED
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_const,T,typename detail::remove_const_impl<T>::type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_const,T&,T&)
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const[N],T type[N])
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_const,T const volatile[N],T volatile type[N])
+#endif
#else
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_REMOVE_CV_HPP_INCLUDED
#define BOOST_TT_REMOVE_CV_HPP_INCLUDED
// convert a type T to a non-cv-qualified type - remove_cv<T>
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename detail::cv_traits_imp<T*>::unqualified_type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_cv,T&,T&)
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const[N],T type[N])
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T volatile[N],T type[N])
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_cv,T const volatile[N],T type[N])
+#endif
#else
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
#define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
-// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This software
-// is provided "as is" without express or implied warranty, and with no claim
-// as to its suitability for any purpose.
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED
#define BOOST_TT_REMOVE_REFERENCE_HPP_INCLUDED
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_reference,T,T)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_reference,T&,T)
-#if defined(__BORLANDC__)
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
-// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
-// Hinnant & John Maddock 2000. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+// Hinnant & John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
#ifndef BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED
#define BOOST_TT_REMOVE_VOLATILE_HPP_INCLUDED
BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_volatile,T,typename detail::remove_volatile_impl<T>::type)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_volatile,T&,T&)
+#if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T volatile[N],T type[N])
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(typename T,std::size_t N,remove_volatile,T const volatile[N],T const type[N])
+#endif
#else
// (C) Copyright Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// defines is_same:
// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-// Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
//
-// See http://www.boost.org for most recent version including documentation.
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
//
// defines traits classes for transforming one type to another:
// remove_reference, add_reference, remove_bounds, remove_pointer.
-// Copyright (c) 2001 Aleksey Gurtovoy.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright (c) 2001 Aleksey Gurtovoy.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP_INCLUDED
#define BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP_INCLUDED
-// (C) Copyright John Maddock 2000. Permission to copy, use, modify, sell and
-// distribute this software is granted provided this copyright notice appears
-// in all copies. This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
// common test code for type-traits tests
// WARNING: contains code as well as declarations!
-
-// (C) Copyright John Maddock 2000.
-// Permission to copy, use, modify, sell and distribute this software is
-// granted provided this copyright notice appears in all copies. This
-// software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// (C) Copyright John Maddock 2000.
+// Use, modification and distribution are subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED
#define BOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED
#include "boost/preprocessor/list/for_each_i.hpp"
#include "boost/preprocessor/tuple/to_list.hpp"
#include "boost/preprocessor/cat.hpp"
+#include "boost/preprocessor/list/transform.hpp"
+#include "boost/preprocessor/list/append.hpp"
#include "boost/type_traits/alignment_of.hpp"
#include "boost/type_traits/is_pod.hpp"
#include "boost/static_assert.hpp"
typedef int (alignment_dummy::*member_ptr);
typedef int (alignment_dummy::*member_function_ptr)();
-#define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \
+#ifdef BOOST_HAS_LONG_LONG
+#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \
+ 12, ( \
+ char, short, int, long, long long, float, double, long double \
+ , void*, function_ptr, member_ptr, member_function_ptr))
+#else
+#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \
11, ( \
char, short, int, long, float, double, long double \
, void*, function_ptr, member_ptr, member_function_ptr))
+#endif
+
+#define BOOST_TT_HAS_ONE_T(D,Data,T) boost::detail::has_one_T<T>
+
+#define BOOST_TT_ALIGNMENT_STRUCT_TYPES \
+ BOOST_PP_LIST_TRANSFORM(BOOST_TT_HAS_ONE_T, \
+ X, \
+ BOOST_TT_ALIGNMENT_BASE_TYPES)
+
+#define BOOST_TT_ALIGNMENT_TYPES \
+ BOOST_PP_LIST_APPEND(BOOST_TT_ALIGNMENT_BASE_TYPES, \
+ BOOST_TT_ALIGNMENT_STRUCT_TYPES)
+
+//
+// lower_alignment_helper --
+//
+// This template gets instantiated a lot, so use partial
+// specialization when available to reduce the compiler burden.
+//
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <bool found = true>
+struct lower_alignment_helper_impl
+{
+ template <std::size_t, class>
+ struct apply
+ {
+ typedef char type;
+ enum { value = true };
+ };
+};
+
+template <>
+struct lower_alignment_helper_impl<false>
+{
+ template <std::size_t target, class TestType>
+ struct apply
+ : mpl::if_c<(alignment_of<TestType>::value == target), TestType, char>
+ {
+ enum { value = (alignment_of<TestType>::value == target) };
+ };
+};
+
+template <bool found, std::size_t target, class TestType>
+struct lower_alignment_helper
+ : lower_alignment_helper_impl<found>::template apply<target,TestType>
+{
+};
+#else
+template <bool found, std::size_t target, class TestType>
+struct lower_alignment_helper
+{
+ typedef char type;
+ enum { value = true };
+};
+
+template <std::size_t target, class TestType>
+struct lower_alignment_helper<false,target,TestType>
+{
+ enum { value = (alignment_of<TestType>::value == target) };
+ typedef typename mpl::if_c<value, TestType, char>::type type;
+};
+#endif
-#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \
- typename mpl::if_c< \
- alignment_of<T>::value <= target, T, char>::type BOOST_PP_CAT(t,I);
+#define BOOST_TT_CHOOSE_MIN_ALIGNMENT(R,P,I,T) \
+ typename lower_alignment_helper< \
+ BOOST_PP_CAT(found,I),target,T \
+ >::type BOOST_PP_CAT(t,I); \
+ enum { \
+ BOOST_PP_CAT(found,BOOST_PP_INC(I)) \
+ = lower_alignment_helper<BOOST_PP_CAT(found,I),target,T >::value \
+ };
#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I);
-
+
+template <typename T>
+struct has_one_T
+{
+ T data;
+};
+
template <std::size_t target>
union lower_alignment
{
+ enum { found0 = false };
+
BOOST_PP_LIST_FOR_EACH_I(
BOOST_TT_CHOOSE_MIN_ALIGNMENT
, ignored
)
};
+#undef BOOST_TT_ALIGNMENT_BASE_TYPES
+#undef BOOST_TT_HAS_ONE_T
+#undef BOOST_TT_ALIGNMENT_STRUCT_TYPES
#undef BOOST_TT_ALIGNMENT_TYPES
#undef BOOST_TT_CHOOSE_MIN_ALIGNMENT
#undef BOOST_TT_CHOOSE_T
);
};
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::max_align,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<1> ,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<2> ,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<10> ,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<16> ,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::detail::lower_alignment<32> ,true)
+#endif
} // namespace detail
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template<std::size_t Align>
+struct is_pod< ::boost::detail::lower_alignment<Align> >
+{
+ BOOST_STATIC_CONSTANT(std::size_t, value = true);
+};
+#endif
+
// This alignment method originally due to Brian Parker, implemented by David
-// Abrahams, and then ported here by Doug Gregor.
+// Abrahams, and then ported here by Doug Gregor.
template <int Align>
class type_with_alignment
{
BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t>::value);
-#ifndef __BORLANDC__
BOOST_STATIC_ASSERT(found >= Align);
BOOST_STATIC_ASSERT(found % Align == 0);
-#else
- BOOST_STATIC_ASSERT(::boost::type_with_alignment<Align>::found >= Align);
- BOOST_STATIC_ASSERT(::boost::type_with_alignment<Align>::found % Align == 0);
-#endif
public:
typedef align_t type;
};
+#if defined(__GNUC__)
+namespace align {
+struct __attribute__((__aligned__(2))) a2 {};
+struct __attribute__((__aligned__(4))) a4 {};
+struct __attribute__((__aligned__(8))) a8 {};
+struct __attribute__((__aligned__(16))) a16 {};
+struct __attribute__((__aligned__(32))) a32 {};
+}
+
+template<> class type_with_alignment<1> { public: typedef char type; };
+template<> class type_with_alignment<2> { public: typedef align::a2 type; };
+template<> class type_with_alignment<4> { public: typedef align::a4 type; };
+template<> class type_with_alignment<8> { public: typedef align::a8 type; };
+template<> class type_with_alignment<16> { public: typedef align::a16 type; };
+template<> class type_with_alignment<32> { public: typedef align::a32 type; };
+
+namespace detail {
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a2,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a4,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a8,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a16,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a32,true)
+}
+#endif
+
#else
//
}
namespace detail {
+
+typedef ::boost::align::a16 max_align;
+
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a2,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a4,true)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_pod,::boost::align::a8,true)
// Boost utility.hpp header file -------------------------------------------//
-// (C) Copyright Boost.org 1999-2003. Permission to copy, use, modify, sell
-// and distribute this software is granted provided this copyright
-// notice appears in all copies. This software is provided "as is" without
-// express or implied warranty, and with no claim as to its suitability for
-// any purpose.
+// Copyright 1999-2003 Boost.org. Use, modification, and distribution are
+// subject to the Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
-// See http://www.boost.org/libs/utility for documentation.
+// See <http://www.boost.org/libs/utility/> for the library's home page.
#ifndef BOOST_UTILITY_HPP
#define BOOST_UTILITY_HPP
#include <boost/noncopyable.hpp>
#endif // BOOST_UTILITY_HPP
-
// boost utility/base_from_member.hpp header file --------------------------//
-// (C) Copyright Daryle Walker 2001. Permission to copy, use, modify, sell
-// and distribute this software is granted provided this copyright
-// notice appears in all copies. This software is provided "as is" without
-// express or implied warranty, and with no claim as to its suitability for
-// any purpose.
+// Copyright 2001, 2003 Daryle Walker. Use, modification, and distribution are
+// subject to the Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
-// See http://www.boost.org for most recent version including documentation.
+// See <http://www.boost.org/libs/utility/> for the library's home page.
#ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
#define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
protected:
MemberType member;
- explicit base_from_member()
+ base_from_member()
: member()
{}
: member( x1, x2, x3 )
{}
+ template< typename T1, typename T2, typename T3, typename T4 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4 )
+ : member( x1, x2, x3, x4 )
+ {}
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5 )
+ : member( x1, x2, x3, x4, x5 )
+ {}
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5,
+ typename T6 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6 )
+ : member( x1, x2, x3, x4, x5, x6 )
+ {}
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5,
+ typename T6, typename T7 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7 )
+ : member( x1, x2, x3, x4, x5, x6, x7 )
+ {}
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5,
+ typename T6, typename T7, typename T8 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7, T8 x8 )
+ : member( x1, x2, x3, x4, x5, x6, x7, x8 )
+ {}
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5,
+ typename T6, typename T7, typename T8, typename T9 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7, T8 x8,
+ T9 x9 )
+ : member( x1, x2, x3, x4, x5, x6, x7, x8, x9 )
+ {}
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5,
+ typename T6, typename T7, typename T8, typename T9, typename T10 >
+ base_from_member( T1 x1, T2 x2, T3 x3, T4 x4, T5 x5, T6 x6, T7 x7, T8 x8,
+ T9 x9, T10 x10 )
+ : member( x1, x2, x3, x4, x5, x6, x7, x8, x9, x10 )
+ {}
+
}; // boost::base_from_member
} // namespace boost
--- /dev/null
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/lib/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
+#define BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
+
+#include<functional>
+
+namespace boost {
+
+// template<class OP> bool equal_pointees(OP const& x, OP const& y);
+// template<class OP> struct equal_pointees_t;
+//
+// Being OP a model of OptionalPointee (either a pointer or an optional):
+//
+// If both x and y have valid pointees, returns the result of (*x == *y)
+// If only one has a valid pointee, returns false.
+// If none have valid pointees, returns true.
+// No-throw
+template<class OptionalPointee>
+inline
+bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+{
+ return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
+}
+
+template<class OptionalPointee>
+struct equal_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
+{
+ bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
+ { return equal_pointees(x,y) ; }
+} ;
+
+// template<class OP> bool less_pointees(OP const& x, OP const& y);
+// template<class OP> struct less_pointees_t;
+//
+// Being OP a model of OptionalPointee (either a pointer or an optional):
+//
+// If y has not a valid pointee, returns false.
+// ElseIf x has not a valid pointee, returns true.
+// ElseIf both x and y have valid pointees, returns the result of (*x < *y)
+// No-throw
+template<class OptionalPointee>
+inline
+bool less_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+{
+ return !y ? false : ( !x ? true : (*x) < (*y) ) ;
+}
+
+template<class OptionalPointee>
+struct less_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
+{
+ bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
+ { return less_pointees(x,y) ; }
+} ;
+
+} // namespace boost
+
+#endif
+
--- /dev/null
+// Boost enable_if library
+
+// Copyright 2003 © The Trustees of Indiana University.
+
+// 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)
+
+// Authors: Jaakko Järvi (jajarvi at osl.iu.edu)
+// Jeremiah Willcock (jewillco at osl.iu.edu)
+// Andrew Lumsdaine (lums at osl.iu.edu)
+
+
+#ifndef BOOST_UTILITY_ENABLE_IF_HPP
+#define BOOST_UTILITY_ENABLE_IF_HPP
+
+#include "boost/config.hpp"
+
+// Even the definition of enable_if causes problems on some compilers,
+// so it's macroed out for all compilers that do not support SFINAE
+
+#ifndef BOOST_NO_SFINAE
+
+namespace boost
+{
+
+ template <bool B, class T = void>
+ struct enable_if_c {
+ typedef T type;
+ };
+
+ template <class T>
+ struct enable_if_c<false, T> {};
+
+ template <class Cond, class T = void>
+ struct enable_if : public enable_if_c<Cond::value, T> {};
+
+ template <bool B, class T>
+ struct lazy_enable_if_c {
+ typedef typename T::type type;
+ };
+
+ template <class T>
+ struct lazy_enable_if_c<false, T> {};
+
+ template <class Cond, class T>
+ struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
+
+
+ template <bool B, class T = void>
+ struct disable_if_c {
+ typedef T type;
+ };
+
+ template <class T>
+ struct disable_if_c<true, T> {};
+
+ template <class Cond, class T = void>
+ struct disable_if : public disable_if_c<Cond::value, T> {};
+
+ template <bool B, class T>
+ struct lazy_disable_if_c {
+ typedef typename T::type type;
+ };
+
+ template <class T>
+ struct lazy_disable_if_c<true, T> {};
+
+ template <class Cond, class T>
+ struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
+
+} // namespace boost
+
+#else
+
+namespace boost {
+
+ namespace detail { typedef void enable_if_default_T; }
+
+ template <typename T>
+ struct enable_if_does_not_work_on_this_compiler;
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <bool B, class T = detail::enable_if_default_T>
+ struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct enable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct disable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+ template <class Cond, class T = detail::enable_if_default_T>
+ struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
+ { };
+
+} // namespace boost
+
+#endif // BOOST_NO_SFINAE
+
+#endif
// Boost utility_fwd.hpp header file ---------------------------------------//
-// (C) Copyright boost.org 2001. Permission to copy, use, modify, sell
-// and distribute this software is granted provided this copyright
-// notice appears in all copies. This software is provided "as is" without
-// express or implied warranty, and with no claim as to its suitability for
-// any purpose.
+// Copyright 2001, 2003 Boost.org. Use, modification, and distribution are
+// subject to the Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
-// See http://www.boost.org/libs/utility for documentation.
+// See <http://www.boost.org/libs/utility/> for the library's home page.
#ifndef BOOST_UTILITY_FWD_HPP
#define BOOST_UTILITY_FWD_HPP
class base_from_member;
-// From <boost/utility.hpp> ------------------------------------------------//
+// From <boost/noncopyable.hpp> --------------------------------------------//
class noncopyable;
// Also has a few function templates
+
} // namespace boost
// BOOST_VERSION / 100 % 1000 is the minor version
// BOOST_VERSION / 100000 is the major version
-#define BOOST_VERSION 103002
+#define BOOST_VERSION 103100
+
+//
+// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
+// but as a *string* in the form "x_y" where x is the major version
+// number and y is the minor version number. This is used by
+// <config/auto_link.hpp> to select which library version to link to.
+
+#define BOOST_LIB_VERSION "1_31"
#endif
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org/libs/signals
#ifndef BOOST_VISIT_EACH_HPP
// libs/filesystem/src/convenience.cpp -------------------------------------//
-// (C) Copyright Beman Dawes, 2002
-// (C) Copyright Vladimir Prus, 2002
-// Permission to copy, use, modify, sell and distribute this software
-// is granted provided this copyright notice appears in all copies.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// © Copyright Beman Dawes, 2002
+// © Copyright Vladimir Prus, 2002
+// 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)
-// See http://www.boost.org/libs/filesystem for documentation.
+// See library home page at http://www.boost.org/libs/filesystem
+
+//----------------------------------------------------------------------------//
+
+// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
+// the library is being built (possibly exporting rather than importing code)
+#define BOOST_FILESYSTEM_SOURCE
#include <boost/filesystem/convenience.hpp>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
namespace boost
{
namespace filesystem
// create_directories (contributed by Vladimir Prus) -----------------------//
- void create_directories(const path& ph)
+ BOOST_FILESYSTEM_DECL void create_directories(const path& ph)
{
if (ph.empty() || exists(ph)) return;
create_directory(ph);
}
+ BOOST_FILESYSTEM_DECL std::string extension(const path& ph)
+ {
+ std::string leaf = ph.leaf();
+
+ std::string::size_type n = leaf.rfind('.');
+ if (n != std::string::npos)
+ return leaf.substr(n);
+ else
+ return std::string();
+ }
+
+ BOOST_FILESYSTEM_DECL std::string basename(const path& ph)
+ {
+ std::string leaf = ph.leaf();
+
+ std::string::size_type n = leaf.rfind('.');
+ return leaf.substr(0, n);
+ }
+
+ BOOST_FILESYSTEM_DECL path change_extension(const path& ph, const std::string& new_extension)
+ {
+ return ph.branch_path() / (basename(ph) + new_extension);
+ }
+
+
} // namespace filesystem
} // namespace boost
// Exception implementation file -------------------------------------------//
-// < ----------------------------------------------------------------------- >
-// < Copyright © 2002 Beman Dawes >
-// < Copyright © 2001 Dietmar Kühl, All Rights Reserved >
-// < >
-// < Permission to use, copy, modify, distribute and sell this >
-// < software for any purpose is hereby granted without fee, provided >
-// < that the above copyright notice appears in all copies and that >
-// < both that copyright notice and this permission notice appear in >
-// < supporting documentation. The authors make no representations about >
-// < the suitability of this software for any purpose. It is provided >
-// < "as is" without express or implied warranty. >
-// < ----------------------------------------------------------------------- >
-
-// See http://www.boost.org/libs/filesystem for documentation.
+// Copyright © 2002 Beman Dawes
+// Copyright © 2001 Dietmar Kühl
+// 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)
+
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
-#include <boost/config.hpp>
+// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
+// the library is being built (possibly exporting rather than importing code)
+#define BOOST_FILESYSTEM_SOURCE
+
+#include <boost/filesystem/config.hpp>
#include <boost/filesystem/exception.hpp>
namespace fs = boost::filesystem;
# include <errno.h> // for POSIX error codes
# endif
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
//----------------------------------------------------------------------------//
namespace
{
+# ifdef BOOST_WINDOWS
std::string system_message( int sys_err_code )
{
std::string str;
-# ifdef BOOST_WINDOWS
LPVOID lpMsgBuf;
::FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
while ( str.size()
&& (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') )
str.erase( str.size()-1 );
+ return str;
+ }
# else
+ std::string system_message( int )
+ {
+ std::string str;
str += std::strerror( errno );
-# endif
return str;
}
+# endif
struct ec_xlate { int sys_ec; fs::error_code ec; };
const ec_xlate ec_table[] =
+ system_message( sys_err_code );
}
+ const fs::path empty_path;
+ const std::string empty_string;
} // unnamed namespace
namespace boost
{
namespace filesystem
{
+// filesystem_error m_imp class --------------------------------------------//
+// see www.boost.org/more/error_handling.html for implemenation rationale
+
+ class filesystem_error::m_imp
+ {
+ public:
+ std::string m_who;
+ path m_path1;
+ path m_path2;
+ std::string m_what;
+ };
+
// filesystem_error implementation -----------------------------------------//
filesystem_error::filesystem_error(
const std::string & who,
const std::string & message )
- : std::runtime_error(
- other_error_prep( who, message ).c_str() ),
- m_sys_err(0), m_err(other_error), m_who(who)
- {}
+ : m_sys_err(0), m_err(other_error)
+ {
+ try
+ {
+ m_imp_ptr.reset( new m_imp );
+ m_imp_ptr->m_who = who;
+ m_imp_ptr->m_what = other_error_prep( who, message );
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
filesystem_error::filesystem_error(
const std::string & who,
const path & path1,
const std::string & message )
- : std::runtime_error(
- other_error_prep( who, path1, message ).c_str() ),
- m_sys_err(0), m_err(other_error), m_who(who), m_path1(path1)
- {}
+ : m_sys_err(0), m_err(other_error)
+ {
+ try
+ {
+ m_imp_ptr.reset( new m_imp );
+ m_imp_ptr->m_who = who;
+ m_imp_ptr->m_what = other_error_prep( who, path1, message );
+ m_imp_ptr->m_path1 = path1;
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
filesystem_error::filesystem_error(
const std::string & who,
const path & path1,
int sys_err_code )
- : std::runtime_error(
- system_error_prep( who, path1, sys_err_code ).c_str() ),
- m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)),
- m_who(who), m_path1(path1)
- {}
+ : m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code))
+ {
+ try
+ {
+ m_imp_ptr.reset( new m_imp );
+ m_imp_ptr->m_who = who;
+ m_imp_ptr->m_what = system_error_prep( who, path1, sys_err_code );
+ m_imp_ptr->m_path1 = path1;
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
filesystem_error::filesystem_error(
const std::string & who,
const path & path1,
const path & path2,
int sys_err_code )
- : std::runtime_error(
- system_error_prep( who, path1, path2, sys_err_code ).c_str() ),
- m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)),
- m_who(who), m_path1(path1), m_path2(path2)
- {}
+ : m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code))
+ {
+ try
+ {
+ m_imp_ptr.reset( new m_imp );
+ m_imp_ptr->m_who = who;
+ m_imp_ptr->m_what = system_error_prep( who, path1, path2, sys_err_code );
+ m_imp_ptr->m_path1 = path1;
+ m_imp_ptr->m_path2 = path2;
+ }
+ catch (...) { m_imp_ptr.reset(); }
+ }
filesystem_error::~filesystem_error() throw()
{
}
+ const std::string & filesystem_error::who() const
+ {
+ return m_imp_ptr.get() == 0 ? empty_string : m_imp_ptr->m_who;
+ }
+
+ const path & filesystem_error::path1() const
+ {
+ return m_imp_ptr.get() == 0 ? empty_path : m_imp_ptr->m_path1;
+ }
+
+ const path & filesystem_error::path2() const
+ {
+ return m_imp_ptr.get() == 0 ? empty_path : m_imp_ptr->m_path2;
+ }
+
+ const char * filesystem_error::what() const throw()
+ {
+ return m_imp_ptr.get() == 0 ? empty_string.c_str()
+ : m_imp_ptr->m_what.c_str();
+ }
+
namespace detail
{
- int system_error_code() // artifact of POSIX and WINDOWS error reporting
+ BOOST_FILESYSTEM_DECL int system_error_code() // artifact of POSIX and WINDOWS error reporting
{
# ifdef BOOST_WINDOWS
return ::GetLastError();
// directory_posix_windows.cpp ---------------------------------------------//
-// < ----------------------------------------------------------------------- >
-// < Copyright © 2002 Beman Dawes. >
-// < Copyright © 2001 Dietmar Kühl, All Rights Reserved >
-// < >
-// < Permission to use, copy, modify, distribute and sell this >
-// < software for any purpose is hereby granted without fee, provided >
-// < that the above copyright notice appears in all copies and that >
-// < both that copyright notice and this permission notice appear in >
-// < supporting documentation. The authors make no representations about >
-// < the suitability of this software for any purpose. It is provided >
-// < "as is" without expressed or implied warranty. >
-// < ----------------------------------------------------------------------- >
-
-// See http://www.boost.org/libs/filesystem for documentation.
+// Copyright © 2002 Beman Dawes
+// Copyright © 2001 Dietmar Kühl
+// 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)
+
+// See library home page at http://www.boost.org/libs/filesystem
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
-#include <boost/config.hpp>
+// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
+// the library is being built (possibly exporting rather than importing code)
+#define BOOST_FILESYSTEM_SOURCE
+
+#include <boost/filesystem/config.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/exception.hpp>
#include <boost/scoped_array.hpp>
#include <boost/throw_exception.hpp>
-//#include <iostream>
+#include <boost/detail/workaround.hpp>
+#include <cstring>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::strcmp; using ::remove; using ::rename; }
+#endif
namespace fs = boost::filesystem;
# if defined(BOOST_WINDOWS)
# include "windows.h"
+# if defined(__BORLANDC__) || defined(__MWERKS__)
+# if defined(__BORLANDC__)
+ using std::time_t;
+# endif
+# include "utime.h"
+# else
+# include "sys/utime.h"
+# endif
// For Windows, the xxxA form of various function names is used to avoid
// inadvertently getting wide forms of the functions. (The undecorated
// other macros defined. There was a bug report of this happening.)
# else
-# include "sys/stat.h"
# include "dirent.h"
# include "unistd.h"
# include "fcntl.h"
+# include "utime.h"
# endif
+#include <sys/stat.h> // last_write_time() uses stat()
#include <string>
-#include <cstdio>
+#include <cstdio> // for remove, rename
#include <cerrno>
#include <cassert>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
// helpers -----------------------------------------------------------------//
namespace
#endif
+
fs::directory_iterator end_itr;
bool is_empty_directory( const fs::path & dir_path )
unsigned long remove_all_aux( const fs::path & ph )
{
unsigned long count = 1;
- if ( fs::is_directory( ph ) )
+ if ( !fs::symbolic_link_exists( ph ) // don't recurse symbolic links
+ && fs::is_directory( ph ) )
{
for ( fs::directory_iterator itr( ph );
itr != end_itr; ++itr )
{
namespace filesystem
{
+ namespace detail
+ {
// dir_itr_imp -------------------------------------------------------------//
- class directory_iterator::dir_itr_imp
- {
- public:
- path entry_path;
- BOOST_HANDLE handle;
-
- ~dir_itr_imp()
+ class dir_itr_imp
{
- if ( handle != BOOST_INVALID_HANDLE_VALUE ) find_close( handle );
- }
- };
+ public:
+ path entry_path;
+ BOOST_HANDLE handle;
-// directory_iterator implementation ---------------------------------------//
+ ~dir_itr_imp()
+ {
+ if ( handle != BOOST_INVALID_HANDLE_VALUE ) find_close( handle );
+ }
+ };
- // default ctor creates the "end" iterator (by letting base default to 0)
- directory_iterator::directory_iterator() {}
+// dot_or_dot_dot ----------------------------------------------------------//
- directory_iterator::directory_iterator( const path & dir_path )
- {
- m_imp.reset( new dir_itr_imp );
- BOOST_SYSTEM_DIRECTORY_TYPE scratch;
- const char * name = 0; // initialization quiets compiler warnings
- if ( dir_path.empty() )
- m_imp->handle = BOOST_INVALID_HANDLE_VALUE;
- else
- name = find_first_file( dir_path.native_directory_string().c_str(),
- m_imp->handle, scratch ); // sets handle
-
- if ( m_imp->handle != BOOST_INVALID_HANDLE_VALUE )
+ inline bool dot_or_dot_dot( const char * name )
{
- m_imp->entry_path = dir_path;
- m_imp->entry_path.m_path_append( name, path::nocheck );
- while ( m_imp.get()
- && ( m_imp->entry_path.leaf() == "."
- || m_imp->entry_path.leaf() == ".." ) )
- { operator++(); }
+# if !BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x0564) )
+ return std::strcmp( name, "." ) == 0
+ || std::strcmp( name, ".." ) == 0;
+# else
+ // Borland workaround for failure of intrinsics to be placed in
+ // namespace std with certain combinations of compiler options.
+ // To ensure test coverage, the workaround is applied to all
+ // configurations, regardless of option settings.
+ return name[0]=='.'
+ && (name[1]=='\0' || (name[1]=='.' && name[2]=='\0'));
+# endif
}
- else
- {
- boost::throw_exception( filesystem_error(
- "boost::filesystem::directory_iterator constructor",
- dir_path, fs::detail::system_error_code() ) );
- }
- }
- path const & directory_iterator::m_deref() const
- {
- assert( m_imp.get() ); // fails if dereference end iterator
- return m_imp->entry_path;
- }
+// directory_iterator implementation ---------------------------------------//
- void directory_iterator::m_inc()
- {
- assert( m_imp.get() ); // fails on increment end iterator
- assert( m_imp->handle != BOOST_INVALID_HANDLE_VALUE ); // reality check
+ BOOST_FILESYSTEM_DECL void dir_itr_init( dir_itr_imp_ptr & m_imp,
+ const path & dir_path )
+ {
+ m_imp.reset( new dir_itr_imp );
+ BOOST_SYSTEM_DIRECTORY_TYPE scratch;
+ const char * name = 0; // initialization quiets compiler warnings
+ if ( dir_path.empty() )
+ m_imp->handle = BOOST_INVALID_HANDLE_VALUE;
+ else
+ name = find_first_file( dir_path.native_directory_string().c_str(),
+ m_imp->handle, scratch ); // sets handle
+
+ if ( m_imp->handle != BOOST_INVALID_HANDLE_VALUE )
+ {
+ m_imp->entry_path = dir_path;
+ // append name, except ignore "." or ".."
+ if ( !dot_or_dot_dot( name ) )
+ {
+ m_imp->entry_path.m_path_append( name, no_check );
+ }
+ else
+ {
+ m_imp->entry_path.m_path_append( "dummy", no_check );
+ dir_itr_increment( m_imp );
+ }
+ }
+ else
+ {
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::directory_iterator constructor",
+ dir_path, fs::detail::system_error_code() ) );
+ }
+ }
- BOOST_SYSTEM_DIRECTORY_TYPE scratch;
- const char * name;
- if ( (name = find_next_file( m_imp->handle,
- m_imp->entry_path, scratch )) != 0 )
+ BOOST_FILESYSTEM_DECL path & dir_itr_dereference(
+ const dir_itr_imp_ptr & m_imp )
{
- m_imp->entry_path.m_replace_leaf( name );
+ assert( m_imp.get() ); // fails if dereference end iterator
+ return m_imp->entry_path;
}
- else
+
+ BOOST_FILESYSTEM_DECL void dir_itr_increment( dir_itr_imp_ptr & m_imp )
{
+ assert( m_imp.get() ); // fails on increment end iterator
+ assert( m_imp->handle != BOOST_INVALID_HANDLE_VALUE ); // reality check
+
+ BOOST_SYSTEM_DIRECTORY_TYPE scratch;
+ const char * name;
+
+ while ( (name = find_next_file( m_imp->handle,
+ m_imp->entry_path, scratch )) != 0 )
+ {
+ // append name, except ignore "." or ".."
+ if ( !dot_or_dot_dot( name ) )
+ {
+ m_imp->entry_path.m_replace_leaf( name );
+ return;
+ }
+ }
m_imp.reset(); // make base() the end iterator
}
- }
+ } // namespace detail
// free functions ----------------------------------------------------------//
- bool exists( const path & ph )
+ BOOST_FILESYSTEM_DECL bool exists( const path & ph )
{
# ifdef BOOST_POSIX
struct stat path_stat;
# endif
}
- bool is_directory( const path & ph )
+ // suggested by Walter Landry
+ BOOST_FILESYSTEM_DECL bool symbolic_link_exists( const path & ph )
+ {
+# ifdef BOOST_POSIX
+ struct stat path_stat;
+ return ::lstat( ph.native_file_string().c_str(), &path_stat ) == 0
+ && S_ISLNK( path_stat.st_mode );
+# else
+ return false; // Windows has no O/S concept of symbolic links
+ // (.lnk files are an application feature, not
+ // a Windows operating system feature)
+# endif
+ }
+
+ BOOST_FILESYSTEM_DECL bool is_directory( const path & ph )
{
# ifdef BOOST_POSIX
struct stat path_stat;
# endif
}
- bool _is_empty( const path & ph )
+ BOOST_FILESYSTEM_DECL bool _is_empty( const path & ph )
{
# ifdef BOOST_POSIX
struct stat path_stat;
# endif
}
- void create_directory( const path & dir_path )
+ BOOST_FILESYSTEM_DECL std::time_t last_write_time( const path & ph )
+ {
+ // Works for both Windows and POSIX
+ struct stat path_stat;
+ if ( ::stat( ph.string().c_str(), &path_stat ) != 0 )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::last_write_time",
+ ph, fs::detail::system_error_code() ) );
+ return path_stat.st_mtime;
+ }
+
+ BOOST_FILESYSTEM_DECL void last_write_time( const path & ph, const std::time_t new_time )
+ {
+ // Works for both Windows and POSIX
+ ::utimbuf buf;
+ buf.actime = std::time_t();
+ buf.modtime = new_time;
+ if ( ::utime( ph.string().c_str(),
+ new_time == std::time_t() ? 0 : &buf ) != 0 )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::last_write_time",
+ ph, fs::detail::system_error_code() ) );
+ }
+
+ BOOST_FILESYSTEM_DECL void create_directory( const path & dir_path )
{
# ifdef BOOST_POSIX
if ( ::mkdir( dir_path.native_directory_string().c_str(),
dir_path, fs::detail::system_error_code() ) );
}
- bool remove( const path & ph )
+ BOOST_FILESYSTEM_DECL bool remove( const path & ph )
{
if ( exists( ph ) )
{
# ifdef BOOST_POSIX
- if ( ::remove( ph.string().c_str() ) != 0 )
+ if ( std::remove( ph.string().c_str() ) != 0 )
{
+ int error = fs::detail::system_error_code();
+ // POSIX says "If the directory is not an empty directory, rmdir()
+ // shall fail and set errno to EEXIST or ENOTEMPTY."
+ // Linux uses ENOTEMPTY, Solaris uses EEXIST.
+ if ( error == EEXIST ) error = ENOTEMPTY;
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::remove", ph, error ) );
+ }
# else
if ( is_directory( ph ) )
{
else
{
if ( !::DeleteFileA( ph.string().c_str() ) )
-# endif
boost::throw_exception( filesystem_error(
"boost::filesystem::remove",
ph, fs::detail::system_error_code() ) );
}
+# endif
return true;
}
return false;
}
- unsigned long remove_all( const path & ph )
+ BOOST_FILESYSTEM_DECL unsigned long remove_all( const path & ph )
{
- return exists( ph ) ? remove_all_aux( ph ) : 0;
+ return exists( ph )|| symbolic_link_exists( ph )
+ ? remove_all_aux( ph ) : 0;
}
- void rename( const path & old_path,
+ BOOST_FILESYSTEM_DECL void rename( const path & old_path,
const path & new_path )
{
# ifdef BOOST_POSIX
if ( exists( new_path ) // POSIX is too permissive so must check
- || ::rename( old_path.string().c_str(), new_path.string().c_str() ) != 0 )
+ || std::rename( old_path.string().c_str(), new_path.string().c_str() ) != 0 )
# else
if ( !::MoveFileA( old_path.string().c_str(), new_path.string().c_str() ) )
# endif
old_path, new_path, fs::detail::system_error_code() ) );
}
- void copy_file( const path & from_file_ph,
+ BOOST_FILESYSTEM_DECL void copy_file( const path & from_file_ph,
const path & to_file_ph )
{
# ifdef BOOST_POSIX
const std::size_t buf_sz = 32768;
boost::scoped_array<char> buf( new char [buf_sz] );
- int infile, outfile=0; // init quiets compiler warning
+ int infile=0, outfile=0; // init quiets compiler warning
+ struct stat from_stat;
- if ( (infile = ::open( from_file_ph.string().c_str(),
+ if ( ::stat( from_file_ph.string().c_str(), &from_stat ) != 0
+ || (infile = ::open( from_file_ph.string().c_str(),
O_RDONLY )) < 0
|| (outfile = ::open( to_file_ph.string().c_str(),
O_WRONLY | O_CREAT | O_EXCL,
- S_IRWXU|S_IRWXG|S_IRWXO )) < 0 )
+ from_stat.st_mode )) < 0 )
{
if ( infile != 0 ) ::close( infile );
boost::throw_exception( filesystem_error(
from_file_ph, to_file_ph, fs::detail::system_error_code() ) );
}
- path current_path()
+ BOOST_FILESYSTEM_DECL path current_path()
{
# ifdef BOOST_POSIX
long path_max = ::pathconf( ".", _PC_PATH_MAX );
return path( buf.get(), native );
}
- const path & initial_path()
+ BOOST_FILESYSTEM_DECL const path & initial_path()
{
static path init_path;
if ( init_path.empty() ) init_path = current_path();
return init_path;
}
- path system_complete( const path & ph )
+ BOOST_FILESYSTEM_DECL path system_complete( const path & ph )
{
# ifdef BOOST_WINDOWS
if ( ph.empty() ) return ph;
# endif
}
- path complete( const path & ph, const path & base )
+ BOOST_FILESYSTEM_DECL path complete( const path & ph, const path & base )
{
assert( base.is_complete()
&& (ph.is_complete() || !ph.has_root_name()) ); // precondition
// path implementation -----------------------------------------------------//
-// (C) Copyright Beman Dawes 2002. Permission to copy,
-// use, modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided "as is"
-// without express or implied warranty, and with no claim as to its
-// suitability for any purpose.
+// © Copyright Beman Dawes 2002-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)
-// See http://www.boost.org/libs/filesystem for documentation.
+// See library home page at http://www.boost.org/libs/filesystem
//****************************************************************************//
//****************************************************************************//
+// define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
+// the library is being built (possibly exporting rather than importing code)
+#define BOOST_FILESYSTEM_SOURCE
+
// BOOST_POSIX or BOOST_WINDOWS specify which API to use.
# if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX )
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)
#include <vector>
#include <cassert>
+#include <boost/config/abi_prefix.hpp> // must be the last header
+
// helpers -----------------------------------------------------------------//
namespace
const char invalid_chars[] =
"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
- "<>:\"/\\|*?";
+ "<>:\"/\\|";
// note that the terminating '\0' is part of the string - thus the size below
// is sizeof(invalid_chars) rather than sizeof(invalid_chars)-1. I
- const std::string invalid_generic( invalid_chars, sizeof(invalid_chars) );
+ const std::string windows_invalid_chars( invalid_chars, sizeof(invalid_chars) );
const std::string valid_posix(
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-" );
- const std::string valid_boost_file(
- "abcdefghijklmnopqrstuvwxyz0123456789._-" );
- const std::string valid_boost_directory(
- "abcdefghijklmnopqrstuvwxyz0123456789_-" );
+ fs::path::name_check default_check = fs::portable_name;
+ bool safe_to_write_check = true; // write-once-before-read allowed
} // unnamed namespace
{
namespace filesystem
{
+ // name_check functions ----------------------------------------------//
+
+# ifdef BOOST_WINDOWS
+ BOOST_FILESYSTEM_DECL bool native( const std::string & name )
+ {
+ return windows_name( name );
+ }
+# else
+ BOOST_FILESYSTEM_DECL bool native( const std::string & )
+ {
+ return true;
+ }
+# endif
- // error checking functions --------------------------------------------//
+ BOOST_FILESYSTEM_DECL bool no_check( const std::string & ) { return true; }
- bool generic_name( const std::string & name )
+ BOOST_FILESYSTEM_DECL bool portable_posix_name( const std::string & name )
{
return name.size() != 0
- && name.find_first_of( invalid_generic ) == std::string::npos
- && name != "."
- && name != ".."
- && *name.begin() != ' '
- && *(name.end()-1) != ' ';
+ && name.find_first_not_of( valid_posix ) == std::string::npos;
}
- bool posix_name( const std::string & name )
+ BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name )
{
- return name.find_first_not_of( valid_posix ) == std::string::npos
- && name != ".";
+ return name.size() != 0
+ && name.find_first_of( windows_invalid_chars ) == std::string::npos
+ && *(name.end()-1) != ' '
+ && (*(name.end()-1) != '.'
+ || name.length() == 1 || name == "..");
}
- const path & check_posix_leaf( const path & ph )
+ BOOST_FILESYSTEM_DECL bool portable_name( const std::string & name )
{
- if ( !posix_name( ph.leaf() ) )
- boost::throw_exception( filesystem_error(
- "boost::filesystem::check_posix_leaf",
- ph, "invalid posix name: \""
- + ph.leaf() + "\"" ) );
- return ph;
+ return
+ name.size() == 0
+ || name == "."
+ || name == ".."
+ || (windows_name( name )
+ && portable_posix_name( name )
+ && name[0] != '.' && name[0] != '-');
}
- bool boost_file_name( const std::string & name )
+ BOOST_FILESYSTEM_DECL bool portable_directory_name( const std::string & name )
{
- return name.size() <= 31
- && name.find_first_not_of( valid_boost_file ) == std::string::npos
- && name != ".";
+ return
+ name == "."
+ || name == ".."
+ || (portable_name( name )
+ && name.find('.') == std::string::npos);
}
- bool boost_directory_name( const std::string & name )
+ BOOST_FILESYSTEM_DECL bool portable_file_name( const std::string & name )
{
- return name.size() <= 31
- && name.find_first_not_of( valid_boost_directory ) == std::string::npos;
+ std::string::size_type pos;
+ return
+ name == "."
+ || name == ".."
+ || (portable_name( name )
+ && ( (pos = name.find( '.' )) == std::string::npos
+ || (name.find( '.', pos+1 )== std::string::npos
+ && (pos + 5) > name.length() )))
+ ;
}
+
// path implementation -----------------------------------------------------//
path::path( const std::string & src )
{
- m_path_append( src );
+ m_path_append( src, default_name_check() );
}
path::path( const char * src )
{
- m_path_append( src );
+ assert( src != 0 );
+ m_path_append( src, default_name_check() );
}
- path::path( const std::string & src, path_format )
+ path::path( const std::string & src, name_check checker )
{
- m_path_append( src, platform );
+ m_path_append( src, checker );
}
- path::path( const char * src, path_format )
+ path::path( const char * src, name_check checker )
{
- m_path_append( src, platform );
+ assert( src != 0 );
+ m_path_append( src, checker );
}
path & path::operator /=( const path & rhs )
{
- m_path_append( rhs.m_path, nocheck );
+ m_path_append( rhs.m_path, no_check );
return *this;
}
- void path::m_path_append( const std::string & src, source_context context )
+ void path::m_path_append( const std::string & src, name_check checker )
{
- // convert backslash to forward slash if context is "platform"
- // check names if context is "generic"
- // allow system-specific-root if context is not "generic"
+ // convert backslash to forward slash if checker==native
+ // allow system-specific-root if checker==no_check || checker==native
+ assert( checker );
assert( src.size() == std::strlen( src.c_str() ) ); // no embedded 0
if ( src.size() == 0 ) return;
// [root-filesystem]
# ifdef BOOST_WINDOWS
- if ( context != generic && src.size() >= 2 )
+ if ( (checker == no_check || checker == native) && src.size() >= 2 )
{
// drive or device
if ( src[1] == ':' || src[src.size()-1] == ':' )
}
// share
- else if ( (*itr == '/' || (*itr == '\\' && context == platform))
- && (*(itr+1) == '/' || (*(itr+1) == '\\' && context == platform)) )
+ else if ( (*itr == '/' || (*itr == '\\' && checker == native))
+ && (*(itr+1) == '/' || (*(itr+1) == '\\' && checker == native)) )
{
m_path += "//";
for ( itr += 2;
// root directory [ "/" ]
if ( itr != src.end() && (*itr == '/'
# ifdef BOOST_WINDOWS
- || (*itr == '\\' && context == platform)
+ || (*itr == '\\' && checker == native)
# endif
) )
{
// element { "/" element } [ "/" ]
while ( itr != src.end() )
{
+ if ( m_path == "." ) m_path = "";
- // append '/' if needed
- if ( !empty()
- && *(m_path.end()-1) != ':' && *(m_path.end()-1) != '/' )
- m_path += '/';
+ // directory-placeholder
+ if ( *itr == '.' && ((itr+1) == src.end() || *(itr+1) == '/') )
+ {
+ if ( empty() ) m_path += '.';
+ ++itr;
+ }
- if ( *itr == '.'&& (itr+1) != src.end() && *(itr+1) == '.' ) // ".."
+ // parent-directory or name
+ else
{
- if ( m_path.size() >= 2 // there is a named parent directory present
- && *(m_path.end()-1) == '/'
-# ifdef BOOST_WINDOWS
- && *(m_path.end()-2) != ':'
-# endif
- && *(m_path.end()-2) != '.' )
+ // append '/' if needed
+ if ( !empty()
+ && *(m_path.end()-1) != ':' && *(m_path.end()-1) != '/' )
+ m_path += '/';
+
+ // parent-directory
+ if ( *itr == '.'
+ && (itr+1) != src.end() && *(itr+1) == '.'
+ && ((itr+2) == src.end() || *(itr+2) == '/') )
{
- // reference to parent so erase child
- std::string::iterator child( m_path.end()-2 );
+ m_path += "..";
+ ++itr;
+ ++itr;
+ } // parent-directory
- while ( child != m_path.begin() && *child != '/'
+ // name
+ else
+ {
+ std::string name;
+ do
+ { name += *itr; }
+ while ( ++itr != src.end() && *itr != '/'
# ifdef BOOST_WINDOWS
- && *child != ':'
+ && (*itr != '\\' || checker != native)
# endif
- ) --child;
+ );
- // only erase '/' if it is a separator rather than part of the root
- if ( (*child == '/'
- && (child == m_path.begin()
-# ifdef BOOST_WINDOWS
- || *(child-1) == ':'))
- || *child == ':'
-# else
- ))
-# endif
- ) ++child;
-
- m_path.erase( child, m_path.end() );
- }
- else { m_path += ".."; }
- ++itr;
- ++itr;
- } // ".."
- else // element is name
- {
- std::string name;
- do
- { name += *itr; }
- while ( ++itr != src.end() && *itr != '/'
-# ifdef BOOST_WINDOWS
- && (*itr != '\\' || context != platform)
-# endif
- );
-
- if ( context == generic && !generic_name( name ) )
- {
- boost::throw_exception( filesystem_error(
- "boost::filesystem::path",
- "invalid name \"" + name + "\" in path: \"" + src + "\"" ) );
- }
+ if ( !checker( name ) )
+ {
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::path",
+ "invalid name \"" + name + "\" in path: \"" + src + "\"" ) );
+ }
- m_path += name;
- }
+ m_path += name;
+ }
+ } // parent-directory or name
+ // end or "/"
if ( itr != src.end() )
{
if ( *itr == '/'
# ifdef BOOST_WINDOWS
- || (*itr == '\\' && context == platform)
+ || (*itr == '\\' && checker == native)
# endif
) ++itr;
else
}
} // while more elements
+
+ // special case: remove one or more leading "/.."
+
+ std::string::size_type pos = 0, sz = m_path.size();
+
+# ifdef BOOST_WINDOWS
+ if ( sz > 2 && m_path[pos] != '/' && m_path[pos+1] == ':' ) // drive
+ { pos += 2; sz -= 2; }
+# endif
+
+ while ( sz >= 3 && m_path[pos] == '/'
+ && m_path[pos+1] == '.' && m_path[pos+2] == '.'
+ && (sz == 3 || m_path[pos+3] == '/') )
+ {
+ m_path.erase( pos+1, 3 ); // "..[/]"
+ sz -= 3; // on last, 3 should be 2; that doesn't matter
+ }
}
// path conversion functions ------------------------------------------------//
std::string path::native_directory_string() const
{ return native_file_string(); }
-// path decomposition functions ---------------------------------------------//
+// path modification functions -----------------------------------------------//
+
+ path & path::normalize()
+ {
+ if ( m_path.empty() ) return *this;
+ std::string::size_type end, beg(0), start(0);
+
+# ifdef BOOST_WINDOWS
+ if ( m_path.size() > 2
+ && m_path[0] != '/' && m_path[1] == ':' ) start = 2; // drive
+# endif
+
+ while ( (beg=m_path.find( "/..", beg )) != std::string::npos )
+ {
+ end = beg + 3;
+ if ( (beg == 1 && m_path[0] == '.')
+ || (beg == 2 && m_path[0] == '.' && m_path[1] == '.')
+ || (beg > 2 && m_path[beg-3] == '/'
+ && m_path[beg-2] == '.' && m_path[beg-1] == '.') )
+ {
+ beg = end;
+ continue;
+ }
+ if ( end < m_path.size() )
+ {
+ if ( m_path[end] == '/' ) ++end;
+ else { beg = end; continue; } // name starts with ..
+ }
+
+ // end is one past end of substr to be erased; now set beg
+ while ( beg > start && m_path[--beg] != '/' ) {}
+ if ( m_path[beg] == '/') ++beg;
+ m_path.erase( beg, end-beg );
+ if ( beg ) --beg;
+ }
+
+ if ( m_path.empty() ) m_path = ".";
+ else
+ { // remove trailing '/' if not root directory
+ std::string::size_type sz = m_path.size();
+
+# ifdef BOOST_WINDOWS
+ if ( start ) sz -= 2; // drive
+# endif
+
+ if ( sz > 1 && m_path[m_path.size()-1] == '/' )
+ { m_path.erase( m_path.size()-1 ); }
+ }
+ return *this;
+ }
+
+ // path decomposition functions ---------------------------------------------//
path::iterator path::begin() const
{
iterator itr;
- itr.base().path_ptr = this;
- first_name( m_path, itr.base().name );
- itr.base().pos = 0;
+ itr.m_path_ptr = this;
+ first_name( m_path, itr.m_name );
+ itr.m_pos = 0;
return itr;
}
// skip a '/' unless it is a root directory
if ( end_pos && m_path[end_pos-1] == '/'
&& !detail::is_absolute_root( m_path, end_pos ) ) --end_pos;
- return path( m_path.substr( 0, end_pos ), native );
+ return path( m_path.substr( 0, end_pos ), no_check );
}
path path::relative_path() const
if ( ++pos < m_path.size() && m_path[pos] == '/' ) ++pos;
# endif
}
- return path( m_path.substr( pos ) );
+ return path( m_path.substr( pos ), no_check );
}
std::string path::root_name() const
{
return path(
# ifdef BOOST_WINDOWS
- root_name(), native ) /= root_directory();
+ root_name(), no_check ) /= root_directory();
# else
root_directory() );
# endif
bool path::has_relative_path() const { return !relative_path().empty(); }
bool path::has_branch_path() const { return !branch_path().empty(); }
+ // default name_check mechanism ----------------------------------------//
-// path_itr_imp implementation ----------------------------------------------//
+ bool path::default_name_check_writable()
+ {
+ return safe_to_write_check;
+ }
- namespace detail
+ void path::default_name_check( name_check new_check )
{
- void path_itr_imp::operator++()
+ assert( new_check );
+ if ( !safe_to_write_check )
+ boost::throw_exception(
+ filesystem_error( "boost::filesystem::default_name_check",
+ "default name check already set" ));
+ default_check = new_check;
+ safe_to_write_check = false;
+ }
+
+ path::name_check path::default_name_check()
+ {
+ safe_to_write_check = false;
+ return default_check;
+ }
+
+// path::iterator implementation --------------------------------------------//
+
+ void path::iterator::increment()
+ {
+ assert( m_pos < m_path_ptr->m_path.size() ); // detect increment past end
+ m_pos += m_name.size();
+ if ( m_pos == m_path_ptr->m_path.size() )
+ {
+ m_name = ""; // not strictly required, but might aid debugging
+ return;
+ }
+ if ( m_path_ptr->m_path[m_pos] == '/' )
{
- assert( pos < path_ptr->m_path.size() ); // detect increment past end
- pos += name.size();
- if ( pos == path_ptr->m_path.size() )
+# ifdef BOOST_WINDOWS
+ if ( m_name[m_name.size()-1] == ':' // drive or device
+ || (m_name[0] == '/' && m_name[1] == '/') ) // share
{
- name = ""; // not strictly required, but might aid debugging
+ m_name = "/";
return;
}
- if ( path_ptr->m_path[pos] == '/' )
- {
-# ifdef BOOST_WINDOWS
- if ( name[name.size()-1] == ':' // drive or device
- || (name[0] == '/' && name[1] == '/') ) // share
- {
- name = "/";
- return;
- }
# endif
- ++pos;
- }
- std::string::size_type end_pos( path_ptr->m_path.find( '/', pos ) );
- if ( end_pos == std::string::npos ) end_pos = path_ptr->m_path.size();
- name = path_ptr->m_path.substr( pos, end_pos - pos );
+ ++m_pos;
}
+ std::string::size_type end_pos( m_path_ptr->m_path.find( '/', m_pos ) );
+ if ( end_pos == std::string::npos )
+ end_pos = m_path_ptr->m_path.size();
+ m_name = m_path_ptr->m_path.substr( m_pos, end_pos - m_pos );
+ }
- void path_itr_imp::operator--()
- {
- assert( pos ); // detect decrement of begin
- std::string::size_type end_pos( pos );
-
- // skip a '/' unless it is a root directory
- if ( path_ptr->m_path[end_pos-1] == '/'
- && !detail::is_absolute_root( path_ptr->m_path, end_pos ) ) --end_pos;
- pos = leaf_pos( path_ptr->m_path, end_pos );
- name = path_ptr->m_path.substr( pos, end_pos - pos );
- }
+ void path::iterator::decrement()
+ {
+ assert( m_pos ); // detect decrement of begin
+ std::string::size_type end_pos( m_pos );
- } // namespace detail
+ // skip a '/' unless it is a root directory
+ if ( m_path_ptr->m_path[end_pos-1] == '/'
+ && !detail::is_absolute_root( m_path_ptr->m_path, end_pos ) ) --end_pos;
+ m_pos = leaf_pos( m_path_ptr->m_path, end_pos );
+ m_name = m_path_ptr->m_path.substr( m_pos, end_pos - m_pos );
+ }
} // namespace filesystem
} // namespace boost
include $(top_srcdir)/config/common.am
SUBDIRS = src
-
# posix_api.cpp \
# wide_posix_api.cpp \
-# regex_debug.cpp
+# regex_debug.cpp \
# winstances.cpp
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <cstdio>
#include <boost/cregex.hpp>
#include <boost/regex/regex_traits.hpp>
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex_synch.hpp>
#include <boost/regex/v3/regex_cstring.hpp>
+#else
+#include <boost/regex/v4/regex_synch.hpp>
+#include <boost/regex/v4/regex_cstring.hpp>
+#endif
#include <boost/scoped_array.hpp>
#include "primary_transform.hpp"
// helper function to get the locale name,
// works around possibly broken setlocale implementations:
//
-const char* getlocale(int id)
+const char* re_get_locale(int id)
{
static const char* def = "Unknown";
const char* pl = std::setlocale(id, 0);
#ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL wchar_t re_zero_w;
-BOOST_REGEX_DECL wchar_t re_ten_w;
+BOOST_REGEX_DECL boost::regex_wchar_type re_zero_w;
+BOOST_REGEX_DECL boost::regex_wchar_type re_ten_w;
unsigned int nlsw_count = 0;
std::string* wlocale_name = 0;
struct syntax_map_t
{
- wchar_t c;
+ boost::regex_wchar_type c;
unsigned int type;
};
std::list<syntax_map_t>* syntax;
-std::size_t BOOST_REGEX_CALL re_get_message(wchar_t* buf, std::size_t len, std::size_t id)
+std::size_t BOOST_REGEX_CALL re_get_message(boost::regex_wchar_type* buf, std::size_t len, std::size_t id)
{
std::size_t size = _re_get_message(static_cast<char*>(0), 0, id);
if(len < size)
return size;
boost::scoped_array<char> cb(new char[size]);
_re_get_message(cb.get(), size, id);
- size = boost::c_regex_traits<wchar_t>::strwiden(buf, len, cb.get());
+ size = boost::c_regex_traits<boost::regex_wchar_type>::strwiden(buf, len, cb.get());
return size;
}
#endif
void BOOST_REGEX_CALL re_update_classes()
{
BOOST_RE_GUARD_STACK
- if(*re_cls_name != getlocale(LC_CTYPE))
+ if(*re_cls_name != re_get_locale(LC_CTYPE))
{
- *re_cls_name = getlocale(LC_CTYPE);
+ *re_cls_name = re_get_locale(LC_CTYPE);
char buf[256];
unsigned int i;
for(i = 0; i < re_classes_max; ++i)
void BOOST_REGEX_CALL re_update_collate()
{
BOOST_RE_GUARD_STACK
- if(*re_coll_name != getlocale(LC_COLLATE))
+ if(*re_coll_name != re_get_locale(LC_COLLATE))
{
- *re_coll_name = getlocale(LC_COLLATE);
+ *re_coll_name = re_get_locale(LC_COLLATE);
char buf[256];
unsigned int i = 400;
re_get_message(buf, 256, i);
//
// called whenever the global locale changes:
//
- std::string l(getlocale(LC_MESSAGES));
+ std::string l(re_get_locale(LC_MESSAGES));
if(*mess_locale != l)
{
*mess_locale = l;
if(*boost::re_detail::c_traits_base::get_catalogue())
{
message_cat = catopen(boost::re_detail::c_traits_base::get_catalogue(), 0);
-#ifndef BOOST_NO_EXCEPTIONS
if(message_cat == (nl_catd)-1)
{
std::string m("Unable to open message catalog: ");
- throw std::runtime_error(m + boost::re_detail::c_traits_base::get_catalogue());
+ std::runtime_error err(m + boost::re_detail::c_traits_base::get_catalogue());
+ boost::throw_exception(err);
}
-#else
- BOOST_REGEX_NOEH_ASSERT(message_cat != (nl_catd)-1);
-#endif
}
#endif
for(int i = 0; i < boost::REG_E_UNKNOWN; ++i)
// now update the character class map,
// and lower case map:
- std::memset(class_map, 0, map_size);
+ std::memset(class_map, 0, sizeof(class_map));
for(i = 0; i < map_size; ++i)
{
if(std::isalpha(i))
} // namespace re_detail
#ifndef BOOST_NO_WREGEX
-bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last)
+bool BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::lookup_collatename(std::basic_string<regex_wchar_type>& out, const regex_wchar_type* first, const regex_wchar_type* last)
{
BOOST_RE_GUARD_STACK
- std::basic_string<wchar_t> s(first, last);
+ std::basic_string<regex_wchar_type> s(first, last);
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
{
if(t_out[0])
{
- len = strwiden(static_cast<wchar_t*>(0), 0, t_out.c_str());
- scoped_array<wchar_t> wb(new wchar_t[len]);
+ len = strwiden(static_cast<regex_wchar_type*>(0), 0, t_out.c_str());
+ scoped_array<regex_wchar_type> wb(new regex_wchar_type[len]);
strwiden(wb.get(), len, t_out.c_str());
out = wb.get();
}
else
- out.append(1, (wchar_t)0);
+ out.append(1, (regex_wchar_type)0);
}
return result;
}
re_detail::cs_guard g(*re_detail::p_re_lock);
#endif
re_message_update();
- if(*collate_name != getlocale(LC_COLLATE))
+ if(*collate_name != re_get_locale(LC_COLLATE))
{
do_update_collate();
- *collate_name = getlocale(LC_COLLATE);
+ *collate_name = re_get_locale(LC_COLLATE);
}
- if(*ctype_name != getlocale(LC_CTYPE))
+ if(*ctype_name != re_get_locale(LC_CTYPE))
{
do_update_ctype();
- *ctype_name = getlocale(LC_CTYPE);
+ *ctype_name = re_get_locale(LC_CTYPE);
}
sort_type = re_detail::find_sort_syntax(&i, &sort_delim);
}
out.erase((int)sort_delim);
break;
case re_detail::sort_delim:
- for(unsigned int i = 0; i < out.size(); ++i)
+ for(unsigned int j = 0; j < out.size(); ++j)
{
- if((out[i] == sort_delim) && (i+1 < out.size()))
+ if((out[j] == sort_delim) && (j+1 < out.size()))
{
- out.erase(i+1);
+ out.erase(j+1);
break;
}
}
#ifndef BOOST_NO_WREGEX
-unsigned int BOOST_REGEX_CALL c_regex_traits<wchar_t>::syntax_type(size_type c)
+unsigned int BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::syntax_type(size_type c)
{
BOOST_RE_GUARD_STACK
std::list<syntax_map_t>::const_iterator first, last;
return 0;
}
-void BOOST_REGEX_CALL c_regex_traits<wchar_t>::init()
+void BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::init()
{
BOOST_RE_GUARD_STACK
re_detail::re_init_threads();
++nlsw_count;
}
-bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last)
+bool BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::do_lookup_collate(std::basic_string<regex_wchar_type>& out, const regex_wchar_type* first, const regex_wchar_type* last)
{
BOOST_RE_GUARD_STACK
- std::basic_string<wchar_t> s(first, last);
+ std::basic_string<regex_wchar_type> s(first, last);
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
bool result = base_type::do_lookup_collate(t_out, buf.get());
if(result)
{
- len = strwiden(static_cast<wchar_t*>(0), 0, t_out.c_str());
- scoped_array<wchar_t> wb(new wchar_t[len]);
+ len = strwiden(static_cast<regex_wchar_type*>(0), 0, t_out.c_str());
+ scoped_array<regex_wchar_type> wb(new regex_wchar_type[len]);
strwiden(wb.get(), len, t_out.c_str());
out = wb.get();
}
}
-void BOOST_REGEX_CALL c_regex_traits<wchar_t>::update()
+void BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::update()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_HAS_THREADS
re_message_update();
re_update_classes();
re_update_collate();
- std::string l(getlocale(LC_CTYPE));
+ std::string l(re_get_locale(LC_CTYPE));
if(*wlocale_name != l)
{
*wlocale_name = l;
- std::basic_string<wchar_t> s;
- const wchar_t* p = L"zero";
+ std::basic_string<regex_wchar_type> s;
+ const regex_wchar_type* p = (const regex_wchar_type*)L"zero";
if(do_lookup_collate(s, p, p+4))
{
jm_assert(s.size() == 1);
else
re_zero_w = L'0';
- p = L"ten";
+ p = (const regex_wchar_type*)L"ten";
if(do_lookup_collate(s, p, p+3))
{
jm_assert(s.size() == 1);
re_ten_w = L'a';
unsigned int i;
- wchar_t buf[256];
+ regex_wchar_type buf[256];
syntax_map_t sm;
syntax->clear();
for(i = 1; i < syntax_max; ++i)
{
- wchar_t* ptr = buf;
- re_get_message(static_cast<wchar_t*>(buf), 256, i+100);
+ regex_wchar_type* ptr = buf;
+ re_get_message(static_cast<regex_wchar_type*>(buf), 256, i+100);
for(; *ptr; ++ptr)
{
sm.c = *ptr;
}
}
-void BOOST_REGEX_CALL c_regex_traits<wchar_t>::m_free()
+void BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::m_free()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_HAS_THREADS
re_free_collate();
// add reference to static member here to ensure
// that the linker includes it in the .exe:
- if((nlsw_count == 0) && (0 != &c_regex_traits<wchar_t>::init_))
+ if((nlsw_count == 0) && (0 != &c_regex_traits<regex_wchar_type>::init_))
{
// cleanup:
delete wlocale_name;
#endif
}
-bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::do_iswclass(wchar_t c, boost::uint_fast32_t f)
+bool BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::do_iswclass(regex_wchar_type c, boost::uint_fast32_t f)
{
BOOST_RE_GUARD_STACK
if((c & ~0xFF) == 0)
return false;
}
-void BOOST_REGEX_CALL c_regex_traits<wchar_t>::transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)
+void BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::transform(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in)
{
BOOST_RE_GUARD_STACK
#ifndef BOOST_MSVC
out = in;
return;
}
- scoped_array<wchar_t> buf(new wchar_t[n+1]);
- n = std::wcsxfrm(buf.get(), in.c_str(), n+1);
+ scoped_array<regex_wchar_type> buf(new regex_wchar_type[n+1]);
+ n = std::wcsxfrm((wchar_t*)buf.get(), (const wchar_t*)in.c_str(), n+1);
if(n == (std::size_t)(-1))
{
out = in;
out = buf.get();
}
-void BOOST_REGEX_CALL c_regex_traits<wchar_t>::transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)
+void BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::transform_primary(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in)
{
transform(out, in);
switch(sort_type)
}
}
-unsigned c_regex_traits<wchar_t>::sort_type;
-wchar_t c_regex_traits<wchar_t>::sort_delim;
+unsigned c_regex_traits<regex_wchar_type>::sort_type;
+regex_wchar_type c_regex_traits<regex_wchar_type>::sort_delim;
-int BOOST_REGEX_CALL c_regex_traits<wchar_t>::toi(wchar_t c)
+int BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::toi(regex_wchar_type c)
{
if(is_class(c, char_class_digit))
return c - re_zero_w;
return -1; // error!!
}
-int BOOST_REGEX_CALL c_regex_traits<wchar_t>::toi(const wchar_t*& first, const wchar_t* last, int radix)
+int BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::toi(const regex_wchar_type*& first, const regex_wchar_type* last, int radix)
{
unsigned int maxval;
if(radix < 0)
return result;
}
-boost::uint_fast32_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_classname(const wchar_t* first, const wchar_t* last)
+boost::uint_fast32_t BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::lookup_classname(const regex_wchar_type* first, const regex_wchar_type* last)
{
- std::basic_string<wchar_t> s(first, last);
+ std::basic_string<regex_wchar_type> s(first, last);
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
return result;
}
-c_regex_traits<wchar_t> c_regex_traits<wchar_t>::init_;
+c_regex_traits<regex_wchar_type> c_regex_traits<regex_wchar_type>::init_;
-std::size_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::strnarrow(char *s1, std::size_t len, const wchar_t *s2)
+std::size_t BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::strnarrow(char *s1, std::size_t len, const regex_wchar_type *s2)
{
BOOST_RE_GUARD_STACK
- std::size_t size = std::wcslen(s2) + 1;
+ std::size_t size = std::wcslen((const wchar_t*)s2) + 1;
if(size > len)
return size;
- return std::wcstombs(s1, s2, len);
+ return std::wcstombs(s1, (const wchar_t*)s2, len);
}
-std::size_t BOOST_REGEX_CALL c_regex_traits<wchar_t>::strwiden(wchar_t *s1, std::size_t len, const char *s2)
+std::size_t BOOST_REGEX_CALL c_regex_traits<regex_wchar_type>::strwiden(regex_wchar_type *s1, std::size_t len, const char *s2)
{
BOOST_RE_GUARD_STACK
std::size_t size = std::strlen(s2) + 1;
if(size > len)
return size;
- size = std::mbstowcs(s1, s2, len);
+ size = std::mbstowcs((wchar_t*)s1, s2, len);
s1[size] = 0;
return size + 1;
}
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <list>
#include <cctype>
#include <boost/regex/regex_traits.hpp>
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex_synch.hpp>
+#else
+#include <boost/regex/v4/regex_synch.hpp>
+#endif
namespace boost{
}
#ifndef BOOST_NO_WREGEX
-const wchar_t combining_ranges[] = { 0x0300, 0x0361,
+const regex_wchar_type combining_ranges[] = { 0x0300, 0x0361,
0x0483, 0x0486,
0x0903, 0x0903,
0x093E, 0x0940,
0xFE20, 0xFE23,
0xffff, 0xffff, };
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t c)
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(regex_wchar_type c)
{
BOOST_RE_GUARD_STACK
- const wchar_t* p = combining_ranges + 1;
+ const regex_wchar_type* p = combining_ranges + 1;
while(*p < c) p += 2;
--p;
if((c >= *p) && (c <= *(p+1)))
c_traits_base::char_class_alpha | c_traits_base::char_class_lower, // 'ÿ' 255
};
-BOOST_REGEX_DECL wchar_t wide_lower_case_map[] = {
+BOOST_REGEX_DECL regex_wchar_type wide_lower_case_map[] = {
0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
} // namespace boost
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
-
+
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE: c_regex_traits.cpp
#include <boost/regex/config.hpp>
-#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
+#if defined(BOOST_REGEX_HAS_SHORT_WCHAR_T) && !defined(_NATIVE_WCHAR_T_DEFINED)
+# pragma message ("disabling support for class cpp_regex_traits<wchar_t> - rebuild with /Zc:wchar_t if you really need this")
+# define BOOST_NO_WREGEX
+#endif
+
+#if !defined(BOOST_NO_STD_LOCALE)
# ifdef BOOST_MSVC
# pragma warning(disable:4786 4702 4127 4244)
typename parser_buf<charT, traits>::pos_type
parser_buf<charT, traits>::seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which)
{
- typedef typename parser_buf<charT, traits>::pos_type pos_type;
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
std::ptrdiff_t size = this->egptr() - this->eback();
{
if(which & ::std::ios_base::out)
return pos_type(off_type(-1));
- std::ptrdiff_t size = this->egptr() - this->eback();
+ off_type size = this->egptr() - this->eback();
charT* g = this->eback();
if(off_type(sp) <= size)
{
std::istream is;
std::string error_strings[boost::REG_E_UNKNOWN+1];
- message_data(const std::locale& l, const std::string& regex_message_catalogue);
+ message_data(const std::locale& l, std::string regex_message_catalogue);
private:
message_data(const message_data&);
message_data& operator=(const message_data&);
};
-message_data<char>::message_data(const std::locale& l, const std::string& regex_message_catalogue)
+message_data<char>::message_data(const std::locale& l, std::string regex_message_catalogue)
: is(&sbuf)
{
is.imbue(l);
const std::messages<char>* pm = 0;
#ifndef __IBMCPP__
- std::messages<char>::catalog cat = static_cast<std::messages<wchar_t>::catalog>(-1);
+ std::messages<char>::catalog cat = static_cast<std::messages<char>::catalog>(-1);
#else
- std::messages<char>::catalog cat = reinterpret_cast<std::messages<wchar_t>::catalog>(-1);
+ std::messages<char>::catalog cat = reinterpret_cast<std::messages<char>::catalog>(-1);
#endif
if(regex_message_catalogue.size())
{
pm = &BOOST_USE_FACET(std::messages<char>, l);
cat = pm->open(regex_message_catalogue, l);
-#ifndef BOOST_NO_EXCEPTIONS
if(cat < 0)
{
std::string m("Unable to open message catalog: ");
- throw std::runtime_error(m + regex_message_catalogue);
+ std::runtime_error err(m + regex_message_catalogue);
+ boost::throw_exception(err);
}
-#else
- BOOST_REGEX_NOEH_ASSERT(cat >= 0);
-#endif
- }
+ }
#endif
std::memset(syntax_map, cpp_regex_traits<char>::syntax_char, 256);
unsigned i;
// STLport users as well (gcc3.1+STLport5), so enable the
// workaround for all STLport users...
//
-#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+#if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && !defined(BOOST_MSVC)
using namespace std;
+ using stlport::isspace;
# define BOOST_REGEX_STD
#else
# define BOOST_REGEX_STD std::
sort_type = re_detail::find_sort_syntax(this, &(this->sort_delim));
}
+void cpp_regex_traits<char>::swap(cpp_regex_traits<char>& that)
+{
+ std::swap(locale_inst, that.locale_inst); // this one goes first
+ std::swap(pmd, that.pmd);
+ std::swap(psyntax, that.psyntax);
+ std::swap(lower_map, that.lower_map);
+ std::swap(pctype, that.pctype);
+ std::swap(pcollate, that.pcollate);
+ std::swap(sort_type, that.sort_type);
+ std::swap(sort_delim, that.sort_delim);
+}
+
cpp_regex_traits<char>::~cpp_regex_traits()
{
delete pmd;
return old_l;
}
-#ifndef BOOST_NO_WREGEX
+#if !defined(BOOST_NO_WREGEX) && !defined(BOOST_NO_STD_WSTREAMBUF)
namespace re_detail{
if(regex_message_catalogue.size())
{
cat = msgs.open(regex_message_catalogue, l);
-#ifndef BOOST_NO_EXCEPTIONS
if(cat < 0)
{
- std::string m("Unable to open message catalog: ");
- throw std::runtime_error(m + regex_message_catalogue);
+ std::string mess("Unable to open message catalog: ");
+ std::runtime_error err(mess + regex_message_catalogue);
+ boost::throw_exception(err);
}
-#else
- BOOST_REGEX_NOEH_ASSERT(cat >= 0);
-#endif
}
#endif
scoped_array<char> a;
#endif
for(unsigned int j = 0; j < s.size(); ++j)
{
+#if defined(WCHAR_MIN) && (WCHAR_MIN == 0)
+ if(s[j] <= UCHAR_MAX)
+#else
if((s[j] <= UCHAR_MAX) && (s[j] >= 0))
+#endif
syntax_[s[j]] = static_cast<unsigned char>(i);
else
{
if((int)cat >= 0)
msgs.close(cat);
-#endif
+#endif
}
} // namespace re_detail
return ws.size()+1;
}
+void cpp_regex_traits<wchar_t>::swap(cpp_regex_traits<wchar_t>& that)
+{
+ std::swap(locale_inst, that.locale_inst); // this one must go first
+ std::swap(pmd, that.pmd);
+ std::swap(psyntax, that.psyntax);
+ std::swap(lower_map, that.lower_map);
+ std::swap(pctype, that.pctype);
+ std::swap(pcollate, that.pcollate);
+ std::swap(pcdv, that.pcdv);
+ std::swap(sort_type, that.sort_type);
+ std::swap(sort_delim, that.sort_delim);
+}
+
#endif // BOOST_NO_WREGEX
} // namespace boost
#endif
+
+
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#if !defined(BOOST_NO_STD_STRING)
#include <map>
#include <list>
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/fileiter.hpp>
+typedef unsigned match_flag_type;
+#else
+#include <boost/regex/v4/fileiter.hpp>
+typedef boost::match_flag_type match_flag_type;
+#endif
#include <cstdio>
namespace boost{
regex e;
cmatch m;
#ifndef BOOST_REGEX_NO_FILEITER
- match_results<mapfile::iterator, regex::allocator_type> fm;
+ match_results<mapfile::iterator> fm;
#endif
type t;
const char* pbase;
- unsigned line;
#ifndef BOOST_REGEX_NO_FILEITER
mapfile::iterator fbase;
#endif
#ifndef BOOST_REGEX_NO_FILEITER
fm(),
#endif
- t(type_copy), pbase(0), line(0),
+ t(type_copy), pbase(0),
#ifndef BOOST_REGEX_NO_FILEITER
fbase(),
#endif
if(m[i].matched) strings[i] = std::string(m[i].first, m[i].second);
positions[i] = m[i].matched ? m[i].first - pbase : -1;
}
- line = m.line();
}
#ifndef BOOST_REGEX_NO_FILEITER
else
if(fm[i].matched) strings[i] = to_string(fm[i].first, fm[i].second);
positions[i] = fm[i].matched ? fm[i].first - fbase : -1;
}
- line = fm.line();
}
#endif
t = type_copy;
BOOST_RE_GUARD_STACK
#ifndef BOOST_REGEX_NO_FILEITER
fbase = mapfile::iterator();
- fm = match_results<mapfile::iterator, regex::allocator_type>();
+ fm = match_results<mapfile::iterator>();
#endif
}
unsigned int RegEx::SetExpression(const char* p, bool icase)
{
BOOST_RE_GUARD_STACK
- boost::uint_fast32_t f = icase ? regbase::normal | regbase::use_except | regbase::icase : regbase::normal | regbase::use_except;
+ boost::uint_fast32_t f = icase ? regex::normal | regex::use_except | regex::icase : regex::normal | regex::use_except;
return pdata->e.set_expression(p, f);
}
//
// now matching operators:
//
-bool RegEx::Match(const char* p, unsigned int flags)
+bool RegEx::Match(const char* p, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
pdata->t = re_detail::RegExData::type_pc;
return false;
}
-bool RegEx::Search(const char* p, unsigned int flags)
+bool RegEx::Search(const char* p, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
pdata->t = re_detail::RegExData::type_pc;
}
};
}
-unsigned int RegEx::Grep(GrepCallback cb, const char* p, unsigned int flags)
+unsigned int RegEx::Grep(GrepCallback cb, const char* p, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
pdata->t = re_detail::RegExData::type_pc;
};
}
-unsigned int RegEx::Grep(std::vector<std::string>& v, const char* p, unsigned int flags)
+unsigned int RegEx::Grep(std::vector<std::string>& v, const char* p, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
pdata->t = re_detail::RegExData::type_pc;
pred3& operator=(const pred3&);
};
}
-unsigned int RegEx::Grep(std::vector<std::size_t>& v, const char* p, unsigned int flags)
+unsigned int RegEx::Grep(std::vector<std::size_t>& v, const char* p, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
pdata->t = re_detail::RegExData::type_pc;
const char* file;
bool ok;
pred4(GrepFileCallback c, RegEx* i, const char* f) : cb(c), pe(i), file(f), ok(true) {}
- bool operator()(const match_results<mapfile::iterator, regex::allocator_type>& m)
+ bool operator()(const match_results<mapfile::iterator>& m)
{
pe->pdata->t = RegExData::type_pf;
pe->pdata->fm = m;
}
}
-unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recurse, unsigned int flags)
+unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recurse, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
unsigned int result = 0;
}
-unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recurse, unsigned int flags)
+unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recurse, match_flag_type flags)
{
BOOST_RE_GUARD_STACK
unsigned int result = 0;
}
#endif
+#ifdef BOOST_REGEX_V3
+#define regex_replace regex_merge
+#endif
+
std::string RegEx::Merge(const std::string& in, const std::string& fmt,
- bool copy, unsigned int flags)
+ bool copy, match_flag_type flags)
{
std::string result;
re_detail::string_out_iterator<std::string> i(result);
if(!copy) flags |= format_no_copy;
- regex_merge(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags);
+ regex_replace(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags);
return result;
}
std::string RegEx::Merge(const char* in, const char* fmt,
- bool copy, unsigned int flags)
+ bool copy, match_flag_type flags)
{
std::string result;
if(!copy) flags |= format_no_copy;
re_detail::string_out_iterator<std::string> i(result);
- regex_merge(i, in, in + std::strlen(in), pdata->e, fmt, flags);
+ regex_replace(i, in, in + std::strlen(in), pdata->e, fmt, flags);
return result;
}
std::size_t RegEx::Split(std::vector<std::string>& v,
std::string& s,
- unsigned flags,
+ match_flag_type flags,
unsigned max_count)
{
return regex_split(std::back_inserter(v), s, pdata->e, flags, max_count);
return RegEx::npos;
}
-unsigned int RegEx::Line()const
-{
- BOOST_RE_GUARD_STACK
- switch(pdata->t)
- {
- case re_detail::RegExData::type_pc:
- return pdata->m[0].matched ? pdata->m.line() : RegEx::npos;
-#ifndef BOOST_REGEX_NO_FILEITER
- case re_detail::RegExData::type_pf:
- return pdata->fm[0].matched ? pdata->fm.line() : RegEx::npos;
-#endif
- case re_detail::RegExData::type_copy:
- {
- return pdata->line;
- }
- }
- return RegEx::npos;
-}
-
unsigned int RegEx::Marks()const
{
BOOST_RE_GUARD_STACK
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <climits>
#include <stdexcept>
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/fileiter.hpp>
+#else
+#include <boost/regex/v4/fileiter.hpp>
+#endif
#ifndef BOOST_REGEX_NO_FILEITER
CloseHandle(hfile);
hmap = 0;
hfile = 0;
-#ifndef BOOST_NO_EXCEPTIONS
- throw std::runtime_error("Unable to create file mapping.");
-#else
- BOOST_REGEX_NOEH_ASSERT(hmap != INVALID_HANDLE_VALUE);
-#endif
+ std::runtime_error err("Unable to create file mapping.");
+ boost::throw_exception(err);
}
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if(_first == 0)
CloseHandle(hfile);
hmap = 0;
hfile = 0;
-#ifndef BOOST_NO_EXCEPTIONS
- throw std::runtime_error("Unable to create file mapping.");
-#else
- BOOST_REGEX_NOEH_ASSERT(_first != 0);
-#endif
+ std::runtime_error err("Unable to create file mapping.");
}
_last = _first + GetFileSize(hfile, 0);
}
}
else
{
-#ifndef BOOST_NO_EXCEPTIONS
- throw std::runtime_error("Unable to open file.");
-#else
- BOOST_REGEX_NOEH_ASSERT(hfile != 0);
-#endif
+ std::runtime_error err("Unable to open file.");
}
#ifndef BOOST_NO_EXCEPTIONS
}catch(...)
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/regex.hpp>
#endif
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#endif
}
// set default flags:
- boost::uint_fast32_t flags = (f & REG_EXTENDED) ? regbase::extended : regbase::basic;
- expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : 0;
+ boost::uint_fast32_t flags = (f & REG_EXTENDED) ? regex::extended : regex::basic;
+ expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default;
// and translate those that are actually set:
if(f & REG_NOCOLLATE)
- flags |= regbase::nocollate;
+ {
+ flags |= regex::nocollate;
+#ifndef BOOST_REGEX_V3
+ flags &= ~regex::collate;
+#endif
+ }
if(f & REG_NOSUB)
expression->eflags |= match_any;
if(f & REG_NOSPEC)
- flags |= regbase::literal;
+ flags |= regex::literal;
if(f & REG_ICASE)
- flags |= regbase::icase;
+ flags |= regex::icase;
if(f & REG_ESCAPE_IN_LISTS)
- flags |= regbase::escape_in_lists;
+ flags |= regex::escape_in_lists;
if(f & REG_NEWLINE_ALT)
- flags |= regbase::newline_alt;
+ flags |= regex::newline_alt;
+#ifndef BOOST_REGEX_V3
+ if(f & REG_PERLEX)
+ flags |= regex::perlex;
+#endif
const char* p2;
if(f & REG_PEND)
{
BOOST_RE_GUARD_STACK
bool result = false;
- boost::uint_fast32_t flags = match_default | expression->eflags;
+ match_flag_type flags = match_default | expression->eflags;
const char* end;
const char* start;
cmatch m;
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#define BOOST_REGEX_SOURCE
+#include <new>
#include <boost/regex.hpp>
+#include <boost/throw_exception.hpp>
+#if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && defined(_MSC_VER) && (_MSC_VER >= 1300)
+# include <malloc.h>
+#endif
-namespace boost{
+#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3)
+#if BOOST_REGEX_MAX_CACHE_BLOCKS == 0
+#include <new>
+#else
+#include <boost/regex/v4/mem_block_cache.hpp>
+#endif
+#endif
+namespace boost{
+
//
// fix: these are declared out of line here to ensure
// that dll builds contain the Virtual table for these
regbase::regbase(const regbase& b)
: _flags(b._flags){}
+
+namespace re_detail{
+
+//
+// error checking API:
+//
+BOOST_REGEX_DECL void BOOST_REGEX_CALL verify_options(boost::regex::flag_type /*ef*/, match_flag_type mf)
+{
+#ifndef BOOST_REGEX_V3
+ //
+ // can't mix match_extra with POSIX matching rules:
+ //
+ if((mf & match_extra) && (mf & match_posix))
+ {
+ std::logic_error msg("Usage Error: Can't mix regular expression captures with POSIX matching rules");
+ throw_exception(msg);
+ }
+#endif
+}
+
+#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
+
+BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page()
+{
+#if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && defined(_MSC_VER) && (_MSC_VER >= 1300)
+ _resetstkoflw();
+#else
+ //
+ // We need to locate the current page being used by the stack,
+ // move to the page below it and then deallocate and protect
+ // that page. Note that ideally we would protect only the lowest
+ // stack page that has been allocated: in practice there
+ // seems to be no easy way to locate this page, in any case as
+ // long as the next page is protected, then Windows will figure
+ // the rest out for us...
+ //
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ MEMORY_BASIC_INFORMATION mi;
+ DWORD previous_protection_status;
+ //
+ // this is an address in our stack space:
+ //
+ LPBYTE page = (LPBYTE)&page;
+ //
+ // Get the current memory page in use:
+ //
+ VirtualQuery(page, &mi, sizeof(mi));
+ //
+ // Go to the page one below this:
+ //
+ page = (LPBYTE)(mi.BaseAddress)-si.dwPageSize;
+ //
+ // Free and protect everything from the start of the
+ // allocation range, to the end of the page below the
+ // one in use:
+ //
+ if (!VirtualFree(mi.AllocationBase, (LPBYTE)page - (LPBYTE)mi.AllocationBase, MEM_DECOMMIT)
+ || !VirtualProtect(page, si.dwPageSize, PAGE_GUARD | PAGE_READWRITE, &previous_protection_status))
+ {
+ throw std::bad_exception();
+ }
+#endif
+}
+#endif
+
+BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_regex_exception(const std::string& msg)
+{
+ bad_expression e(msg);
+ throw_exception(e);
+}
+
+#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3)
+
+#if BOOST_REGEX_MAX_CACHE_BLOCKS == 0
+
+BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block()
+{
+ return ::operator new(BOOST_REGEX_BLOCKSIZE);
+}
+
+BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p)
+{
+ ::operator delete(p);
+}
+
+#else
+
+mem_block_cache block_cache = { 0, 0, };
+
+BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block()
+{
+ return block_cache.get();
+}
+
+BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p)
+{
+ block_cache.put(p);
+}
+
+#endif
+
+#endif
+
+} // namespace re_detail
+
+
+
} // namespace boost
-#if defined(BOOST_RE_USE_VCL) && defined(BOOST_REGEX_BUILD_DLL)
+#if defined(BOOST_RE_USE_VCL) && defined(BOOST_REGEX_DYN_LINK)
int WINAPI DllEntryPoint(HINSTANCE , unsigned long , void*)
{
}
#endif
+#if defined(__IBMCPP__) && defined(BOOST_REGEX_DYN_LINK)
+//
+// Is this correct - linker complains without it ?
+//
+int main()
+{
+ return 0;
+}
+
+#endif
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <crtdbg.h>
#endif
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex_raw_buffer.hpp>
+#else
+#include <boost/regex/v4/regex_raw_buffer.hpp>
+#endif
#include <boost/regex.hpp>
#ifndef BOOST_RE_OLD_IOSTREAM
#endif
+//
+// regex configuration information: this prints out the settings used
+// when the library was built - include in debugging builds only:
+//
+#ifdef BOOST_REGEX_CONFIG_INFO
+
+#define print_macro regex_lib_print_macro
+#define print_expression regex_lib_print_expression
+#define print_byte_order regex_lib_print_byte_order
+#define print_sign regex_lib_print_sign
+#define print_compiler_macros regex_lib_print_compiler_macros
+#define print_stdlib_macros regex_lib_print_stdlib_macros
+#define print_platform_macros regex_lib_print_platform_macros
+#define print_boost_macros regex_lib_print_boost_macros
+#define print_separator regex_lib_print_separator
+#define OLD_MAIN regex_lib_main
+#define NEW_MAIN regex_lib_main2
+#define NO_RECURSE
+
+#include <libs/regex/test/config_info/regex_config_info.cpp>
+
+BOOST_REGEX_DECL void BOOST_REGEX_CALL print_regex_library_info()
+{
+ std::cout << "\n\n";
+ print_separator();
+ std::cout << "Regex library build configuration:\n\n";
+ regex_lib_main2();
+}
+
+#endif
+
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#define BOOST_REGEX_SOURCE
+#include <boost/regex/config.hpp>
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex_synch.hpp>
+#else
+#include <boost/regex/v4/regex_synch.hpp>
+#endif
namespace boost{
namespace re_detail{
+
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/regex/regex_traits.hpp>
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
#include <boost/cregex.hpp>
+#ifdef BOOST_REGEX_V3
#include <boost/regex/v3/regex_synch.hpp>
#include <boost/regex/v3/regex_cstring.hpp>
+#else
+#include <boost/regex/v4/regex_synch.hpp>
+#include <boost/regex/v4/regex_cstring.hpp>
+#endif
#include <boost/scoped_array.hpp>
#ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL wchar_t re_zero_w;
-BOOST_REGEX_DECL wchar_t re_ten_w;
+BOOST_REGEX_DECL boost::regex_wchar_type re_zero_w;
+BOOST_REGEX_DECL boost::regex_wchar_type re_ten_w;
bool isPlatformNT = false;
struct syntax_map_t
{
- wchar_t c;
+ boost::regex_wchar_type c;
unsigned int type;
};
std::size_t BOOST_REGEX_CALL _re_get_message(char* buf, std::size_t len, unsigned id);
-std::size_t BOOST_REGEX_CALL get_message(wchar_t* buf, std::size_t len, unsigned id)
+std::size_t BOOST_REGEX_CALL get_message(boost::regex_wchar_type* buf, std::size_t len, unsigned id)
{
std::size_t size = _re_get_message(static_cast<char*>(0), 0, id);
if(len < size)
return size;
boost::scoped_array<char> cb(new char[size]);
_re_get_message(cb.get(), size, id);
- size = boost::w32_regex_traits<wchar_t>::strwiden(buf, len, cb.get());
+ size = boost::w32_regex_traits<boost::regex_wchar_type>::strwiden(buf, len, cb.get());
return size;
}
if(*regex_message_catalogue)
{
hresmod = LoadLibraryA(regex_message_catalogue);
-#ifndef BOOST_NO_EXCEPTIONS
if(hresmod == NULL)
{
std::string s("Unable to open dll: ");
- throw std::runtime_error(s + regex_message_catalogue);
+ std::runtime_error err(s + regex_message_catalogue);
+ boost::throw_exception(err);
}
-#else
- BOOST_REGEX_NOEH_ASSERT(hresmod != NULL);
-#endif
}
unsigned int i;
for(i = 0; i < REG_E_UNKNOWN; ++i)
{
class_map[i] &= char_class_win;
}
- class_map['_'] |= char_class_underscore;
+ class_map[(unsigned char)'_'] |= char_class_underscore;
LCMapStringA(GetUserDefaultLCID(), LCMAP_LOWERCASE, buf, map_size, lower_case_map, map_size);
//
// update our collating elements:
#ifndef BOOST_NO_WREGEX
//
// wide string data:
- std::basic_string<wchar_t> ws;
- const wchar_t* wp = L"zero";
- if(w32_regex_traits<wchar_t>::lookup_collatename(ws, wp, wp+4))
+ std::basic_string<regex_wchar_type> ws;
+ const regex_wchar_type* wp = (const regex_wchar_type*)L"zero";
+ if(w32_regex_traits<regex_wchar_type>::lookup_collatename(ws, wp, wp+4))
{
jm_assert(ws.size() == 1);
re_zero_w = *ws.c_str();
}
else
- re_zero_w = L'0';
+ re_zero_w = (regex_wchar_type)L'0';
- wp = L"ten";
- if(w32_regex_traits<wchar_t>::lookup_collatename(ws, wp, wp+3))
+ wp = (const regex_wchar_type*)L"ten";
+ if(w32_regex_traits<regex_wchar_type>::lookup_collatename(ws, wp, wp+3))
{
jm_assert(ws.size() == 1);
re_ten_w = *ws.c_str();
else
re_ten_w = L'a';
- wchar_t wbuf[256];
+ regex_wchar_type wbuf[256];
syntax_map_t sm;
syntax->clear();
for(i = 1; i < syntax_max; ++i)
{
- wchar_t* ptr = wbuf;
+ regex_wchar_type* ptr = wbuf;
get_message(wbuf, 256, i+100);
for(; *ptr; ++ptr)
{
#endif
// add reference to static member here to ensure
// that the linker includes it in the .exe:
- if((--entry_count == 0) && (0 != &w32_regex_traits<char>::i))
+ if((--entry_count == 0) && (0 != &w32_regex_traits<char>::i) && is_init)
do_free();
#ifdef BOOST_HAS_THREADS
g.acquire(false);
#ifndef BOOST_NO_WREGEX
-bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::lookup_collatename(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last)
+bool BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::lookup_collatename(std::basic_string<regex_wchar_type>& out, const regex_wchar_type* first, const regex_wchar_type* last)
{
BOOST_RE_GUARD_STACK
- std::basic_string<wchar_t> s(first, last);
+ std::basic_string<regex_wchar_type> s(first, last);
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
{
if(t_out[0])
{
- len = strwiden(static_cast<wchar_t*>(0), 0, t_out.c_str());
- scoped_array<wchar_t> wb(new wchar_t[len]);
+ len = strwiden(static_cast<regex_wchar_type*>(0), 0, t_out.c_str());
+ scoped_array<regex_wchar_type> wb(new regex_wchar_type[len]);
strwiden(wb.get(), len, t_out.c_str());
out = wb.get();
}
else
- out.append(1,(wchar_t)0);
+ out.append(1,(regex_wchar_type)0);
}
return result;
}
-unsigned int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::syntax_type(size_type c)
+unsigned int BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::syntax_type(size_type c)
{
BOOST_RE_GUARD_STACK
std::list<syntax_map_t>::const_iterator first, last;
return 0;
}
-bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last)
+bool BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::do_lookup_collate(std::basic_string<regex_wchar_type>& out, const regex_wchar_type* first, const regex_wchar_type* last)
{
BOOST_RE_GUARD_STACK
- std::basic_string<wchar_t> s(first, last);
+ std::basic_string<regex_wchar_type> s(first, last);
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
bool result = base_type::do_lookup_collate(t_out, buf.get());
if(result)
{
- len = strwiden(static_cast<wchar_t*>(0), 0, t_out.c_str());
- scoped_array<wchar_t> wb(new wchar_t[len]);
+ len = strwiden(static_cast<regex_wchar_type*>(0), 0, t_out.c_str());
+ scoped_array<regex_wchar_type> wb(new regex_wchar_type[len]);
strwiden(wb.get(), len, t_out.c_str());
out = wb.get();
}
}
-void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::update()
+void BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::update()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_HAS_THREADS
do_init();
}
-w32_regex_traits<wchar_t>::w32_regex_traits()
+w32_regex_traits<regex_wchar_type>::w32_regex_traits()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_HAS_THREADS
++entry_count;
}
-w32_regex_traits<wchar_t>::~w32_regex_traits()
+w32_regex_traits<regex_wchar_type>::~w32_regex_traits()
{
BOOST_RE_GUARD_STACK
#ifdef BOOST_HAS_THREADS
#endif
// add reference to static member here to ensure
// that the linker includes it in the .exe:
- if((--entry_count == 0) && (0 != &w32_regex_traits<wchar_t>::init_))
+ if((--entry_count == 0) && (0 != &w32_regex_traits<regex_wchar_type>::init_) && is_init)
do_free();
#ifdef BOOST_HAS_THREADS
g.acquire(false);
#endif
}
-bool BOOST_REGEX_CALL w32_regex_traits<wchar_t>::do_iswclass(wchar_t c, boost::uint_fast32_t f)
+bool BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::do_iswclass(regex_wchar_type c, boost::uint_fast32_t f)
{
BOOST_RE_GUARD_STACK
if((c & ~0xFF) == 0)
WORD mask;
if(f & char_class_unicode)
return true;
- else if(isPlatformNT && GetStringTypeW(CT_CTYPE1, &c, 1, &mask))
+ else if(isPlatformNT && GetStringTypeW(CT_CTYPE1, (const wchar_t*)&c, 1, &mask))
return BOOST_REGEX_MAKE_BOOL(mask & f & char_class_win);
else if((f & char_class_graph) == char_class_graph)
return true; // all wide characters are considered "graphics"
return false;
}
-void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)
+void BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::transform(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in)
{
BOOST_RE_GUARD_STACK
scoped_array<char> alt;
size_t n;
if(isPlatformNT)
- n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, 0, 0);
+ n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, (const wchar_t*)in.c_str(), -1, 0, 0);
else
{
n = strnarrow(static_cast<char*>(0), 0, in.c_str());
out = in;
return;
}
- scoped_array<wchar_t> buf(new wchar_t[n+1]);
+ scoped_array<regex_wchar_type> buf(new regex_wchar_type[n+1]);
// under win32 we get mapped to an array of bytes
// not characters; since the underlying engine has to
- // deal with chars we widen the bytes to wchar_t to ensure
+ // deal with chars we widen the bytes to regex_wchar_type to ensure
// the sort order remains unchanged when we compare.
scoped_array<char> t(new char[n+1]);
if(isPlatformNT)
- n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, in.c_str(), -1, reinterpret_cast<wchar_t*>(t.get()), (int)n);
+ n = LCMapStringW(GetUserDefaultLCID(), LCMAP_SORTKEY, (const wchar_t*)in.c_str(), -1, reinterpret_cast<wchar_t*>(t.get()), (int)n);
else
n = LCMapStringA(GetUserDefaultLCID(), LCMAP_SORTKEY, alt.get(), -1, t.get(), (int)n);
int i = -1;
do
{
++i;
- buf[i] = (wchar_t)(unsigned char)t[i];
+ buf[i] = (regex_wchar_type)(unsigned char)t[i];
} while(t[i]);
if(n == (size_t)(-1))
{
out = buf.get();
}
-void BOOST_REGEX_CALL w32_regex_traits<wchar_t>::transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)
+void BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::transform_primary(std::basic_string<regex_wchar_type>& out, const std::basic_string<regex_wchar_type>& in)
{
transform(out, in);
for(unsigned int i = 0; i < out.size(); ++i)
}
-int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::toi(wchar_t c)
+int BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::toi(regex_wchar_type c)
{
if(is_class(c, char_class_digit))
return c - re_zero_w;
return -1; // error!!
}
-int BOOST_REGEX_CALL w32_regex_traits<wchar_t>::toi(const wchar_t*& first, const wchar_t* last, int radix)
+int BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::toi(const regex_wchar_type*& first, const regex_wchar_type* last, int radix)
{
unsigned int maxval;
if(radix < 0)
return result;
}
-boost::uint_fast32_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::lookup_classname(const wchar_t* first, const wchar_t* last)
+boost::uint_fast32_t BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::lookup_classname(const regex_wchar_type* first, const regex_wchar_type* last)
{
- std::basic_string<wchar_t> s(first, last);
+ std::basic_string<regex_wchar_type> s(first, last);
std::size_t len = strnarrow(static_cast<char*>(0), 0, s.c_str());
scoped_array<char> buf(new char[len]);
strnarrow(buf.get(), len, s.c_str());
return result;
}
-wchar_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::wtolower(wchar_t c)
+regex_wchar_type BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::wtolower(regex_wchar_type c)
{
BOOST_RE_GUARD_STACK
if(isPlatformNT)
}
-w32_regex_traits<wchar_t> w32_regex_traits<wchar_t>::init_;
+w32_regex_traits<regex_wchar_type> w32_regex_traits<regex_wchar_type>::init_;
-std::size_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::strnarrow(char *s1, std::size_t len, const wchar_t *s2)
+std::size_t BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::strnarrow(char *s1, std::size_t len, const regex_wchar_type *s2)
{
BOOST_RE_GUARD_STACK
- std::size_t size = WideCharToMultiByte(CP_ACP, 0, s2, -1, s1, 0, 0, 0);
+ std::size_t size = WideCharToMultiByte(CP_ACP, 0, (const wchar_t*)s2, -1, s1, 0, 0, 0);
if(size > len)
return size;
- return WideCharToMultiByte(CP_ACP, 0, s2, -1, s1, (int)len, 0, 0);
+ return WideCharToMultiByte(CP_ACP, 0, (const wchar_t*)s2, -1, s1, (int)len, 0, 0);
}
-std::size_t BOOST_REGEX_CALL w32_regex_traits<wchar_t>::strwiden(wchar_t *s1, std::size_t len, const char *s2)
+std::size_t BOOST_REGEX_CALL w32_regex_traits<regex_wchar_type>::strwiden(regex_wchar_type *s1, std::size_t len, const char *s2)
{
BOOST_RE_GUARD_STACK
- std::size_t size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, s1, 0);
+ std::size_t size = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, (wchar_t*)s1, 0);
if(size > len)
return size;
- return MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, s1, (int)len);
+ return MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, s2, -1, (wchar_t*)s1, (int)len);
}
-unsigned short w32_regex_traits<wchar_t>::wide_unicode_classes[] = {
+unsigned short w32_regex_traits<regex_wchar_type>::wide_unicode_classes[] = {
re_detail::w32_traits_base::char_class_cntrl, // '' 0
re_detail::w32_traits_base::char_class_cntrl, // '' 1
re_detail::w32_traits_base::char_class_cntrl, // '' 2
+
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#endif
}
// set default flags:
- boost::uint_fast32_t flags = (f & REG_EXTENDED) ? regbase::extended : regbase::basic;
- expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : 0;
+ boost::uint_fast32_t flags = (f & REG_EXTENDED) ? wregex::extended : wregex::basic;
+ expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default;
// and translate those that are actually set:
if(f & REG_NOCOLLATE)
- flags |= regbase::nocollate;
+ {
+ flags |= wregex::nocollate;
+#ifndef BOOST_REGEX_V3
+ flags &= ~wregex::collate;
+#endif
+ }
if(f & REG_NOSUB)
expression->eflags |= match_any;
if(f & REG_NOSPEC)
- flags |= regbase::literal;
+ flags |= wregex::literal;
if(f & REG_ICASE)
- flags |= regbase::icase;
+ flags |= wregex::icase;
if(f & REG_ESCAPE_IN_LISTS)
- flags |= regbase::escape_in_lists;
+ flags |= wregex::escape_in_lists;
if(f & REG_NEWLINE_ALT)
- flags |= regbase::newline_alt;
+ flags |= wregex::newline_alt;
+#ifndef BOOST_REGEX_V3
+ if(f & REG_PERLEX)
+ flags |= wregex::perlex;
+#endif
const wchar_t* p2;
if(f & REG_PEND)
{
BOOST_RE_GUARD_STACK
bool result = false;
- boost::uint_fast32_t flags = match_default | expression->eflags;
+ match_flag_type flags = match_default | expression->eflags;
const wchar_t* end;
const wchar_t* start;
wcmatch m;
+
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Permission to use, copy, modify, distribute and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation. Dr John Maddock makes no representations
- * about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
+ * Use, modification and distribution are subject to the
+ * Boost Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/regex.hpp>
#endif
+
// Boost.Signals library
-//
-// Copyright (C) 2001, 2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
-#define BOOST_SIGNALS_IN_LIBRARY_SOURCE
+#define BOOST_SIGNALS_SOURCE
#include <boost/signals/connection.hpp>
#include <cassert>
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
+
+ void
+ connection::add_bound_object(const BOOST_SIGNALS_NAMESPACE::detail::bound_object& b)
+ {
+ assert(con.get() != 0);
+ con->bound_objects.push_back(b);
+ }
+
+
void connection::disconnect() const
{
if (this->connected()) {
// Disconnect signal
signal_disconnect(local_con->signal, local_con->signal_data);
-
+
// Disconnect all bound objects
typedef std::list<BOOST_SIGNALS_NAMESPACE::detail::bound_object>::iterator iterator;
- for (iterator i = local_con->bound_objects.begin();
+ for (iterator i = local_con->bound_objects.begin();
i != local_con->bound_objects.end(); ++i) {
assert(i->disconnect != 0);
i->disconnect(i->obj, i->data);
}
}
}
- } // end namespace boost
+ } // end namespace boost
} // end namespace boost
#ifndef BOOST_MSVC
// Boost.Signals library
-//
-// Copyright (C) 2001, 2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
-#define BOOST_SIGNALS_IN_LIBRARY_SOURCE
+#define BOOST_SIGNALS_SOURCE
#include <boost/signals/detail/signal_base.hpp>
#include <cassert>
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
- signal_base_impl::signal_base_impl(const compare_type& comp) :
+ signal_base_impl::signal_base_impl(const compare_type& comp) :
call_depth(0),
slots_(comp)
{
}
}
- connection
+ connection
signal_base_impl::
connect_slot(const any& slot,
const any& name,
// the slot when it is disconnected.
std::auto_ptr<slot_iterator> saved_iter(new slot_iterator());
- // Add the slot to the list.
+ // Add the slot to the list.
- slot_iterator pos =
+ slot_iterator pos =
slots_.insert(stored_slot_type(name,
connection_slot_pair(slot_connection,
slot)));
// destroyed
pos->second.first.set_controlling();
- // The assignment operation here absolutely must not throw, which
- // intuitively makes sense (because any container's insert method
+ // The assignment operation here absolutely must not throw, which
+ // intuitively makes sense (because any container's insert method
// becomes impossible to use in an exception-safe manner without this
// assumption), but doesn't appear to be mentioned in the standard.
*saved_iter = pos;
-
+
// Fill out the connection object appropriately. None of these
// operations can throw
con->signal = this;
con->signal_data = saved_iter.release();
- con->signal_disconnect = &signal_base_impl::slot_disconnected;
-
- // If an exception is thrown the connection will automatically be
- // disconnected.
+ con->signal_disconnect = &signal_base_impl::slot_disconnected;
+
+ // If an exception is thrown the connection will automatically be
+ // disconnected.
scoped_connection safe_connection = slot_connection;
-
+
// Connect each of the bound objects
- for(std::vector<const trackable*>::const_iterator i =
+ for(std::vector<const trackable*>::const_iterator i =
bound_objects.begin();
- i != bound_objects.end();
+ i != bound_objects.end();
++i) {
// Notify the object that the signal is connecting to it by passing
// it a copy of the connection. If the connection
return true;
}
+ std::size_t signal_base_impl::num_slots() const
+ {
+ // Disconnected slots may still be in the list of slots if
+ // a) this is called while slots are being invoked (call_depth > 0)
+ // b) an exception was thrown in remove_disconnected_slots
+ std::size_t count = 0;
+ for (slot_iterator i = slots_.begin(); i != slots_.end(); ++i) {
+ if (i->second.first.connected())
+ ++count;
+ }
+ return count;
+ }
+
void signal_base_impl::disconnect(const any& group)
{
- std::pair<slot_iterator, slot_iterator> group_slots =
+ std::pair<slot_iterator, slot_iterator> group_slots =
slots_.equal_range(group);
while (group_slots.first != group_slots.second) {
slot_iterator next = group_slots.first;
// We won't need the slot iterator after this
std::auto_ptr<slot_iterator> slot(
reinterpret_cast<slot_iterator*>(data));
-
+
// If we're flags.clearing, we don't bother updating the list of slots
if (!self->flags.clearing) {
// If we're in a call, note the fact that a slot has been deleted so
// If the call depth is zero and we have some slots that have been
// disconnected during the calls, remove those slots from the list
- if (impl->call_depth == 0 &&
+ if (impl->call_depth == 0 &&
impl->flags.delayed_disconnect) {
impl->remove_disconnected_slots();
impl->flags.delayed_disconnect = false;
}
}
- signal_base::~signal_base()
- {
- }
+ signal_base::signal_base(const compare_type& comp) : impl()
+ {
+ impl.reset(new signal_base_impl(comp));
+ }
+
+ signal_base::~signal_base()
+ {
+ }
+
} // namespace detail
} // namespace BOOST_SIGNALS_NAMESPACE
} // namespace boost
#ifndef BOOST_MSVC
// Explicit instantiations to keep in the library
template class boost::function2<bool, boost::any, boost::any>;
-template class std::multimap<boost::any,
- boost::BOOST_SIGNALS_NAMESPACE::detail::connection_slot_pair,
+template class std::multimap<boost::any,
+ boost::BOOST_SIGNALS_NAMESPACE::detail::connection_slot_pair,
boost::function2<bool, boost::any, boost::any> >;
#endif
// Boost.Signals library
-//
-// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
-#define BOOST_SIGNALS_IN_LIBRARY_SOURCE
+#define BOOST_SIGNALS_SOURCE
#include <boost/signals/slot.hpp>
basic_connection* con = new basic_connection();
/* nothrow */ {
- // The signal portion isn't really necessary, except that we need a
+ // The signal portion isn't really necessary, except that we need a
// signal for the connection to be connected.
con->signal = static_cast<void*>(this);
con->signal_data = 0;
con->signal_disconnect = &bound_object_destructed;
}
- // This connection watches for destruction of bound objects. Note
+ // This connection watches for destruction of bound objects. Note
// that the reset routine will delete con if an allocation throws
watch_bound_objects.reset(con);
// We create a scoped connection, so that exceptions thrown while
- // adding bound objects will cause a cleanup of the bound objects
+ // adding bound objects will cause a cleanup of the bound objects
// already connected.
scoped_connection safe_connection(watch_bound_objects);
// Notify the object that the slot is connecting to it
BOOST_SIGNALS_NAMESPACE::detail::bound_object binding;
(*i)->signal_connected(watch_bound_objects, binding);
-
+
// This will notify the bound object that the connection just made
// should be disconnected if an exception is thrown before the
// end of this iteration
// Boost.Signals library
-//
-// Copyright (C) 2001, 2002 Doug Gregor (gregod@cs.rpi.edu)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies.
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
-
+
+// Copyright Doug Gregor 2001-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)
+
// For more information, see http://www.boost.org
-#define BOOST_SIGNALS_IN_LIBRARY_SOURCE
+#define BOOST_SIGNALS_SOURCE
#include <boost/signals/trackable.hpp>
#include <algorithm>
void trackable::signal_disconnected(void* obj, void* data)
{
trackable* self = reinterpret_cast<trackable*>(obj);
- connection_iterator* signal =
+ connection_iterator* signal =
reinterpret_cast<connection_iterator*>(data);
// If we're dying, don't bother erasing the connection from the list;
delete signal;
}
- void
- trackable::signal_connected(connection c,
+ void
+ trackable::signal_connected(connection c,
BOOST_SIGNALS_NAMESPACE::detail::bound_object& binding) const
{
// Insert the connection
- connection_iterator pos =
+ connection_iterator pos =
connected_signals.insert(connected_signals.end(), c);
// Make this copy of the object disconnect when destroyed