+2004-11-20 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * update boost to version 1.32.0
+
2004-04-03 Lars Gullik Bjonnes <larsbj@gullik.net>
* libs/filesystem/src/Makefile.am (AM_CXXFLAGS): define
--- /dev/null
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved.
//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose is hereby granted without fee, provided that this copyright and
-// permissions notice appear in all copies and derivatives.
-//
-// This software is provided "as is" without express or implied warranty.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#endif
* See
* http://www.josuttis.com/cppcode
* for details and the latest version.
+ * See
+ * http://www.boost.org/libs/array for Documentation.
+ * for documentation.
*
* (C) Copyright Nicolai M. Josuttis 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.
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
*
+ * 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
* 05 Aug 2001 - minor update (Nico Josuttis)
* 20 Jan 2001 - STLport fix (Beman Dawes)
* 29 Sep 2000 - Initial Revision (Nico Josuttis)
+ *
+ * Jan 29, 2004
*/
-
-// See http://www.boost.org/libs/array for Documentation.
-
#ifndef BOOST_ARRAY_HPP
#define BOOST_ARRAY_HPP
#include <cstddef>
#include <stdexcept>
+#include <boost/assert.hpp>
// Handles broken standard libraries better than <iterator>
#include <boost/detail/iterator.hpp>
// FIXES for broken compilers
#include <boost/config.hpp>
+
namespace boost {
template<class T, std::size_t N>
}
// operator[]
- reference operator[](size_type i) { return elems[i]; }
- const_reference operator[](size_type i) const { return elems[i]; }
+ reference operator[](size_type i)
+ {
+ BOOST_ASSERT( i < N && "out of range" );
+ return elems[i];
+ }
+
+ const_reference operator[](size_type i) const
+ {
+ BOOST_ASSERT( i < N && "out of range" );
+ return elems[i];
+ }
// at() with range check
reference at(size_type i) { rangecheck(i); return elems[i]; }
const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
// front() and back()
- reference front() { return elems[0]; }
- const_reference front() const { return elems[0]; }
- reference back() { return elems[N-1]; }
- const_reference back() const { return elems[N-1]; }
+ reference front()
+ {
+ return elems[0];
+ }
+
+ const_reference front() const
+ {
+ return elems[0];
+ }
+
+ reference back()
+ {
+ return elems[N-1];
+ }
+
+ const_reference back() const
+ {
+ return elems[N-1];
+ }
// size is constant
static size_type size() { return N; }
std::swap_ranges(begin(),end(),y.begin());
}
- // direct access to data
+ // direct access to data (read-only)
const T* data() const { return elems; }
+ // use array as C array (direct read/write access to data)
+ T* c_array() { return elems; }
+
// assignment with type conversion
template <typename T2>
array<T,N>& operator= (const array<T2,N>& rhs) {
std::fill_n(begin(),size(),value);
}
-#ifndef BOOST_NO_PRIVATE_IN_AGGREGATE
- private:
-#endif
// check range (may be private because it is static)
static void rangecheck (size_type i) {
- if (i >= size()) { throw std::range_error("array"); }
+ if (i >= size()) {
+ throw std::range_error("array<>: index out of range");
+ }
}
};
} /* namespace boost */
#endif /*BOOST_ARRAY_HPP*/
-
-
-
-
-
-
-
//
// Copyright (c) 2001, 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// Note: There are no include guards. This is intentional.
//
//
// bind.hpp - binds function objects to arguments
//
-// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 David Abrahams
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
#include <boost/mem_fn.hpp>
#include <boost/type.hpp>
#include <boost/bind/arg.hpp>
+#include <boost/detail/workaround.hpp>
// Borland-specific bug, visit_each() silently fails to produce code
#endif
+// ref_compare
+
+template<class T> bool ref_compare(T const & a, T const & b, long)
+{
+ return a == b;
+}
+
+template<class T> bool ref_compare(reference_wrapper<T> const & a, reference_wrapper<T> const & b, int)
+{
+ return a.get_pointer() == b.get_pointer();
+}
+
// bind_t forward declaration for listN
template<class R, class F, class L> class bind_t;
T & get() { return t_; }
T const & get() const { return t_; }
+ bool operator==(value const & rhs) const
+ {
+ return t_ == rhs.t_;
+ }
+
private:
T t_;
// unwrap
-template<class F> inline F & unwrap(F & f, long)
+template<class F> inline F & unwrap(F * f, long)
{
- return f;
+ return *f;
}
-template<class F> inline F & unwrap(reference_wrapper<F> & f, int)
+template<class F> inline F & unwrap(reference_wrapper<F> * f, int)
{
- return f;
+ return f->get();
}
-template<class F> inline F & unwrap(reference_wrapper<F> const & f, int)
+template<class F> inline F & unwrap(reference_wrapper<F> const * f, int)
{
- return f;
+ return f->get();
}
-// listN
+#if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) )
-#ifdef BOOST_NO_VOID_RETURNS
+template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* * pm, int)
+{
+ return _mfi::dm<R, T>(*pm);
+}
+
+#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+// IBM/VisualAge 6.0 is not able to handle this overload.
+template<class R, class T> inline _mfi::dm<R, T> unwrap(R T::* const * pm, int)
+{
+ return _mfi::dm<R, T>(*pm);
+}
+#endif
-template <class R> struct evaluator0;
-template <class R> struct evaluator1;
-template <class R> struct evaluator2;
-template <class R> struct evaluator3;
-template <class R> struct evaluator4;
-template <class R> struct evaluator5;
-template <class R> struct evaluator6;
-template <class R> struct evaluator7;
-template <class R> struct evaluator8;
-template <class R> struct evaluator9;
#endif
+// listN
+
class list0
{
public:
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 &)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
{
- return unwrap(f, 0)();
+ return unwrap(&f, 0)();
}
- template<class R, class F, class A> R operator()(type<R>, F f, A &) const
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
{
- return unwrap(f, 0)();
+ return unwrap(&f, 0)();
}
- template<class V> void accept(V &) const
+ template<class F, class A> void operator()(type<void>, F & f, A &, int)
{
+ unwrap(&f, 0)();
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
{
- typedef evaluator0<R> type;
- };
+ unwrap(&f, 0)();
+ }
-#endif
+ template<class V> void accept(V &) const
+ {
+ }
+ bool operator==(list0 const &) const
+ {
+ return true;
+ }
};
template<class A1> class list1
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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
{
- return unwrap(f, 0)(a[a1_]);
+ return unwrap(&f, 0)(a[a1_]);
}
- template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_]);
+ return unwrap(&f, 0)(a[a1_]);
}
- template<class V> void accept(V & v) const
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
{
- BOOST_BIND_VISIT_EACH(v, a1_, 0);
+ unwrap(&f, 0)(a[a1_]);
}
-#ifdef BOOST_NO_VOID_RETURNS
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_]);
+ }
- template<class R> struct evaluator
+ template<class V> void accept(V & v) const
{
- typedef evaluator1<R> type;
- };
+ BOOST_BIND_VISIT_EACH(v, a1_, 0);
+ }
-#else
+ bool operator==(list1 const & rhs) const
+ {
+ return ref_compare(a1_, rhs.a1_, 0);
+ }
private:
-#endif
-
A1 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrap(&f, 0)(a[a1_], a[a2_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrap(&f, 0)(a[a1_], a[a2_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
{
- return unwrap(f, 0)(a[a1_], a[a2_]);
+ unwrap(&f, 0)(a[a1_], a[a2_]);
}
- template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
{
- return unwrap(f, 0)(a[a1_], a[a2_]);
+ unwrap(&f, 0)(a[a1_], a[a2_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a2_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list2 const & rhs) const
{
- typedef evaluator2<R> type;
- };
-
-#else
+ return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
+ 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
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_]);
+ return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a3_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list3 const & rhs) const
{
- typedef evaluator3<R> type;
- };
-
-#else
+ return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
+ 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
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a4_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list4 const & rhs) const
{
- typedef evaluator4<R> type;
- };
-
-#else
+ return
+ ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
+ ref_compare(a4_, rhs.a4_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
+ 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
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
+ return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a5_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list5 const & rhs) const
{
- typedef evaluator5<R> type;
- };
-
-#else
+ return
+ ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
+ ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
+ 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
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
+ return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a6_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list6 const & rhs) const
{
- typedef evaluator6<R> type;
- };
-
-#else
+ return
+ ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
+ ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ 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 const & f, A & a, long) const
+ {
+ return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
+ 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
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a7_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list7 const & rhs) const
{
- typedef evaluator7<R> type;
- };
-
-#else
+ return
+ ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
+ ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
+ ref_compare(a7_, rhs.a7_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
+ 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
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
+ return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a8_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list8 const & rhs) const
{
- typedef evaluator8<R> type;
- };
-
-#else
+ return
+ ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
+ ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
+ ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 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)
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ 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 const & f, A & a, long) const
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
+ 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
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
{
- return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
}
template<class V> void accept(V & v) const
BOOST_BIND_VISIT_EACH(v, a9_, 0);
}
-#ifdef BOOST_NO_VOID_RETURNS
-
- template<class R> struct evaluator
+ bool operator==(list9 const & rhs) const
{
- typedef evaluator9<R> type;
- };
-
-#else
+ return
+ ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0) && ref_compare(a3_, rhs.a3_, 0) &&
+ ref_compare(a4_, rhs.a4_, 0) && ref_compare(a5_, rhs.a5_, 0) && ref_compare(a6_, rhs.a6_, 0) &&
+ ref_compare(a7_, rhs.a7_, 0) && ref_compare(a8_, rhs.a8_, 0) && ref_compare(a9_, rhs.a9_, 0);
+ }
private:
-#endif
-
A1 a1_;
A2 a2_;
A3 a3_;
A9 a9_;
};
-#ifdef BOOST_NO_VOID_RETURNS
-
-template <class R> struct evaluator0
-{
- template<class L, class F, class 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 &, F f, A &)
- {
- unwrap(f, 0)();
- }
-};
-
-template <class R> struct evaluator1
-{
- template<class L, class F, class 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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_]);
- }
-};
-
-#endif
-
// bind_t
#ifndef BOOST_NO_VOID_RETURNS
{
public:
+ typedef bind_t this_type;
+
bind_t(F f, L const & l): f_(f), l_(l) {}
-#define BOOST_BIND_EVALUATE return l_(type<result_type>(), f_, a)
+#define BOOST_BIND_RETURN return
#include <boost/bind/bind_template.hpp>
-#undef BOOST_BIND_EVALUATE
+#undef BOOST_BIND_RETURN
};
{
public:
+ typedef implementation this_type;
+
implementation(F f, L const & l): f_(f), l_(l) {}
-#define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
+#define BOOST_BIND_RETURN return
#include <boost/bind/bind_template.hpp>
-#undef BOOST_BIND_EVALUATE
+#undef BOOST_BIND_RETURN
};
public:
+ typedef implementation this_type;
+
implementation(F f, L const & l): f_(f), l_(l) {}
-#define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
+#define BOOST_BIND_RETURN
#include <boost/bind/bind_template.hpp>
-#undef BOOST_BIND_EVALUATE
+#undef BOOST_BIND_RETURN
};
#endif
+// bind_t::operator==
+
+template<class R, class F, class L> bool operator==(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
+{
+ return a.compare(b);
+}
+
+template<class R, class F, class L> bool operator!=(bind_t<R, F, L> const & a, bind_t<R, F, L> const & b)
+{
+ return !a.compare(b);
+}
+
// add_value
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
};
-// g++ 2.95 specific helper; used by the data member overload
-
-template<class T> struct add_cref
-{
- typedef T const & type;
-};
-
-template<> struct add_cref<void>
-{
- typedef void type;
-};
-
} // namespace _bi
// visit_each
// data member pointers
+/*
+
#if defined(__GNUC__) && (__GNUC__ == 2)
+namespace _bi
+{
+
+template<class T> struct add_cref
+{
+ typedef T const & type;
+};
+
+template<class T> struct add_cref< T & >
+{
+ typedef T const & type;
+};
+
+template<> struct add_cref<void>
+{
+ typedef void type;
+};
+
+} // namespace _bi
+
template<class R, class T, class A1>
_bi::bind_t< typename _bi::add_cref<R>::type, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
BOOST_BIND(R T::*f, A1 a1)
#endif
+*/
+
+template<class R, class T, class A1>
+_bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
+ BOOST_BIND(R T::*f, A1 a1)
+{
+ typedef _mfi::dm<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
+}
+
} // namespace boost
#ifndef BOOST_BIND_NO_PLACEHOLDERS
//
// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
namespace boost
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
{
};
+template<int I> bool operator==(arg<I> const &, arg<I> const &)
+{
+ return true;
+}
+
} // namespace boost
#endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED
//
// Copyright (c) 2001 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
//
// Copyright (c) 2001 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
//
// Do not include this header directly.
//
-// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2001-2004 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
result_type operator()()
{
list0 a;
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
result_type operator()() const
{
list0 a;
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1> result_type operator()(A1 & a1)
{
list1<A1 &> a(a1);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1> result_type operator()(A1 & a1) const
{
list1<A1 &> a(a1);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
{
list2<A1 &, A2 &> a(a1, a2);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
{
list2<A1 &, A2 &> a(a1, a2);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
{
list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
{
list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
{
list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
{
list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
{
list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
{
list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
{
list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
{
list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
{
list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
{
list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
{
list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
{
list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
{
list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
{
list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A> result_type eval(A & a)
{
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class A> result_type eval(A & a) const
{
- BOOST_BIND_EVALUATE;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
}
template<class V> void accept(V & v) const
l_.accept(v);
}
+ bool compare(this_type const & rhs) const
+ {
+ return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_;
+ }
+
private:
F f_;
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
namespace boost
namespace _bi
{
-template<class F> void instantiate(F)
-{
-}
-
template<class R, class F> class af0
{
public:
return f_();
}
+ result_type operator()() const
+ {
+ return f_();
+ }
+
private:
F f_;
return f_(a1);
}
+ result_type operator()(A1 a1) const
+ {
+ return f_(a1);
+ }
+
private:
F f_;
return f_(a1, a2);
}
+ result_type operator()(A1 a1, A2 a2) const
+ {
+ return f_(a1, a2);
+ }
+
private:
F f_;
return f_(a1, a2, a3);
}
+ result_type operator()(A1 a1, A2 a2, A3 a3) const
+ {
+ return f_(a1, a2, a3);
+ }
+
private:
F f_;
return f_(a1, a2, a3, a4);
}
+ result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4) const
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
private:
F f_;
template<class R, class F> _bi::af0<R, F> make_adaptable(F f)
{
- _bi::instantiate( &_bi::af0<R, F>::operator() ); // for early error detection
return _bi::af0<R, F>(f);
}
template<class R, class A1, class F> _bi::af1<R, A1, F> make_adaptable(F f)
{
- instantiate( &_bi::af1<R, A1, F>::operator() );
return _bi::af1<R, A1, F>(f);
}
template<class R, class A1, class A2, class F> _bi::af2<R, A1, A2, F> make_adaptable(F f)
{
- instantiate( &_bi::af2<R, A1, A2, F>::operator() );
return _bi::af2<R, A1, A2, F>(f);
}
template<class R, class A1, class A2, class A3, class F> _bi::af3<R, A1, A2, A3, F> make_adaptable(F f)
{
- instantiate( &_bi::af3<R, A1, A2, A3, F>::operator() );
return _bi::af3<R, A1, A2, A3, F>(f);
}
template<class R, class A1, class A2, class A3, class A4, class F> _bi::af4<R, A1, A2, A3, A4, F> make_adaptable(F f)
{
- instantiate( &_bi::af4<R, A1, A2, A3, A4, F>::operator() );
return _bi::af4<R, A1, A2, A3, A4, F>(f);
}
//
// Copyright (c) 2001 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
//
//
// Copyright (c) 2001 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
//
{
BOOST_MEM_FN_RETURN (t.*f_)();
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf0) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf0) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf0
{
BOOST_MEM_FN_RETURN (t.*f_)();
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf0) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf0) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf1
{
BOOST_MEM_FN_RETURN (t.*f_)(a1);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf1) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf1) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf1
{
BOOST_MEM_FN_RETURN (t.*f_)(a1);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf1) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf1) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf2
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf2) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf2) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf2
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf2) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf2) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf3
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf3) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf3) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf3
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf3) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf3) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf4
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf4) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf4) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf4
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf4) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf4) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf5
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf5) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf5) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf5
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf5) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf5) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf6
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf6) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf6) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf6
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf6) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf6) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf7
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf7) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf7) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf7
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf7) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf7) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// mf8
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(mf8) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(mf8) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
// cmf8
{
BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
}
+
+ bool operator==(BOOST_MEM_FN_NAME(cmf8) const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(BOOST_MEM_FN_NAME(cmf8) const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
//
// Copyright (c) 2001 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
//
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/bind.html for documentation.
//
static inline boost::arg<8> _8() { return boost::arg<8>(); }
static inline boost::arg<9> _9() { return boost::arg<9>(); }
-#elif (defined(BOOST_MSVC) && BOOST_MSVC <= 1300) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__)
+#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__)
static boost::arg<1> _1;
static boost::arg<2> _2;
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
namespace boost
// boost cast.hpp header file ----------------------------------------------//
-// (C) Copyright boost.org 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.
+// (C) Copyright Kevlin Henney and Dave Abrahams 1999.
+// Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/conversion for Documentation.
template <class T>
struct signed_numeric_limits : std::numeric_limits<T>
{
- static inline T min()
+ static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
- return std::numeric_limits<T>::min() >= 0
+ return (std::numeric_limits<T>::min)() >= 0
// unary minus causes integral promotion, thus the static_cast<>
- ? static_cast<T>(-std::numeric_limits<T>::max())
- : std::numeric_limits<T>::min();
+ ? static_cast<T>(-(std::numeric_limits<T>::max)())
+ : (std::numeric_limits<T>::min)();
};
};
// long / unsigned long long. Not intended to be full
// numeric_limits replacements, but good enough for numeric_cast<>
template <>
- struct fixed_numeric_limits_base<long long, false>
+ struct fixed_numeric_limits_base< ::boost::long_long_type, false>
{
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
BOOST_STATIC_CONSTANT(bool, is_signed = true);
- static long long max()
+ static ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
# ifdef LONGLONG_MAX
return LONGLONG_MAX;
# endif
}
- static long long min()
+ static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
# ifdef LONGLONG_MIN
return LONGLONG_MIN;
};
template <>
- struct fixed_numeric_limits_base<unsigned long long, false>
+ struct fixed_numeric_limits_base< ::boost::ulong_long_type, false>
{
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
BOOST_STATIC_CONSTANT(bool, is_signed = false);
- static unsigned long long max()
+ static ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
# ifdef ULONGLONG_MAX
return ULONGLONG_MAX;
# endif
}
- static unsigned long long min() { return 0; }
+ static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
};
# endif
} // namespace detail
template <class T>
struct fixed_numeric_limits : public std::numeric_limits<T>
{
- static inline T min()
+ static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
{
- return std::numeric_limits<T>::is_signed && std::numeric_limits<T>::min() >= 0
- ? T(-std::numeric_limits<T>::max()) : std::numeric_limits<T>::min();
+ return std::numeric_limits<T>::is_signed && (std::numeric_limits<T>::min)() >= 0
+ ? T(-(std::numeric_limits<T>::max)()) : (std::numeric_limits<T>::min)();
}
};
const bool result_is_signed = result_traits::is_signed;
const bool same_sign = arg_is_signed == result_is_signed;
- if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, result_traits::min())
- || greater_than_type_max<same_sign, arg_is_signed>::check(arg, result_traits::max())
+ if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, (result_traits::min)())
+ || greater_than_type_max<same_sign, arg_is_signed>::check(arg, (result_traits::max)())
)
#else // We need to use #pragma hacks if available
#pragma option push -w-8012
# endif
if ((arg < 0 && !result_traits::is_signed) // loss of negative range
- || (arg_traits::is_signed && arg < result_traits::min()) // underflow
- || arg > result_traits::max()) // overflow
+ || (arg_traits::is_signed && arg < (result_traits::min)()) // underflow
+ || arg > (result_traits::max)()) // overflow
# if BOOST_MSVC
# pragma warning(pop)
#elif defined(__BORLANDC__)
//
// boost/checked_delete.hpp
//
-// Copyright (c) 1999, 2000, 2001, 2002 boost.org
// Copyright (c) 2002, 2003 Peter Dimov
// Copyright (c) 2003 Daniel Frey
// Copyright (c) 2003 Howard Hinnant
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/utility/checked_delete.html for documentation.
//
//
-// (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.
+// (C) Copyright Jeremy Siek 2000.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// Revision History:
//
//===========================================================================
// Iterator Archetype Classes
- template <class T>
+ template <class T, int I = 0>
class input_iterator_archetype
{
private:
typedef std::input_iterator_tag iterator_category;
typedef T value_type;
struct reference {
- operator value_type() const { return static_object<T>::get(); }
+ operator const value_type&() const { return static_object<T>::get(); }
};
typedef const T* pointer;
typedef std::ptrdiff_t difference_type;
//
-// (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.
+// (C) Copyright Jeremy Siek 2000.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// Revision History:
// 05 May 2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
template <> struct SignedIntegerConcept<int> { void constraints() {} };
template <> struct SignedIntegerConcept<long> { void constraints() {} };
# if defined(BOOST_HAS_LONG_LONG)
- template <> struct SignedIntegerConcept<long long> { void constraints() {} };
+ template <> struct SignedIntegerConcept< ::boost::long_long_type> { void constraints() {} };
# endif
// etc.
#endif
//
// Only include what follows for known and supported compilers:
//
-#if (defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)) \
+#if defined(BOOST_MSVC) \
|| defined(__BORLANDC__) \
|| (defined(__MWERKS__) && defined(_WIN32) && (__MWERKS__ >= 0x3000)) \
|| (defined(__ICL) && defined(_MSC_EXTENSIONS) && (_MSC_VER >= 1200))
// vc7:
# define BOOST_LIB_TOOLSET "vc7"
-#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1310)
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1310)
// vc71:
# define BOOST_LIB_TOOLSET "vc71"
+#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
+
+ // vc80:
+# define BOOST_LIB_TOOLSET "vc80"
+
#elif defined(__BORLANDC__)
// CBuilder 6:
# define BOOST_NO_CV_VOID_SPECIALIZATIONS
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
# define BOOST_NO_DEDUCED_TYPENAME
+// workaround for missing WCHAR_MAX/WCHAR_MIN:
+#include <climits>
+#include <cwchar>
+#ifndef WCHAR_MAX
+# define WCHAR_MAX 0xffff
+#endif
+#ifndef WCHAR_MIN
+# define WCHAR_MIN 0
+#endif
#endif
#if (__BORLANDC__ <= 0x564)
# define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
# define BOOST_NO_TEMPLATE_TEMPLATES
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
// we shouldn't really need this - but too many things choke
// without it, this needs more investigation:
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
#include "boost/config/compiler/common_edg.hpp"
-#if (__COMO_VERSION__ <= 4245) || !defined(BOOST_STRICT_CONFIG)
+#if (__COMO_VERSION__ <= 4245)
-# ifdef _WIN32
-# define BOOST_NO_SWPRINTF
-# endif
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# if defined(_MSC_VER) && _MSC_VER <= 1300
-# define BOOST_NO_STDC_NAMESPACE
# if _MSC_VER > 100
// only set this in non-strict mode:
# define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
// versions check:
// Nothing to do here?
+# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
#endif
-#if (__HP_aCC <= 53800 )
+#if (__HP_aCC >= 50000 ) && (__HP_aCC <= 53800 ) || (__HP_aCC < 31300 )
# define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
#endif
+#define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+
#define BOOST_COMPILER "HP aCC version " BOOST_STRINGIZE(__HP_aCC)
//
#define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
#define BOOST_INTEL BOOST_INTEL_CXX_VERSION
+#if defined(_WIN32) || defined(_WIN64)
+# define BOOST_INTEL_WIN BOOST_INTEL
+#else
+# define BOOST_INTEL_LINUX BOOST_INTEL
+#endif
+
#if (BOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER)
# define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
# define BOOST_NO_TEMPLATE_TEMPLATES
#endif
-#if (BOOST_INTEL_CXX_VERSION <= 600) || !defined(BOOST_STRICT_CONFIG)
+#if (BOOST_INTEL_CXX_VERSION <= 600)
# if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
#endif
+#if (BOOST_INTEL_CXX_VERSION <= 710) && defined(_WIN32)
+# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
+#endif
+
// See http://aspn.activestate.com/ASPN/Mail/Message/boost/1614864
-#if BOOST_INTEL_CXX_VERSION < 700
+#if BOOST_INTEL_CXX_VERSION < 600
# define BOOST_NO_INTRINSIC_WCHAR_T
#else
-// _WCHAR_T_DEFINED is the Win32 spelling
-// _WCHAR_T is the Linux spelling
-# if !defined(_WCHAR_T_DEFINED) && !defined(_WCHAR_T)
+// We should test the macro _WCHAR_T_DEFINED to check if the compiler
+// supports wchar_t natively. *BUT* there is a problem here: the standard
+// headers define this macro if they typedef wchar_t. Anyway, we're lucky
+// because they define it without a value, while Intel C++ defines it
+// to 1. So we can check its value to see if the macro was defined natively
+// or not.
+// Under UNIX, the situation is exactly the same, but the macro _WCHAR_T
+// is used instead.
+# if ((_WCHAR_T_DEFINED + 0) == 0) && ((_WCHAR_T + 0) == 0)
# define BOOST_NO_INTRINSIC_WCHAR_T
# endif
#endif
+//
+// Verify that we have actually got BOOST_NO_INTRINSIC_WCHAR_T
+// set correctly, if we don't do this now, we will get errors later
+// in type_traits code among other things, getting this correct
+// for the Intel compiler is actually remarkably fragile and tricky:
+//
+#if defined(BOOST_NO_INTRINSIC_WCHAR_T)
+#include <cwchar>
+template< typename T > struct assert_no_intrinsic_wchar_t;
+template<> struct assert_no_intrinsic_wchar_t<wchar_t> { typedef void type; };
+// if you see an error here then you need to unset BOOST_NO_INTRINSIC_WCHAR_T
+// where it is defined above:
+typedef assert_no_intrinsic_wchar_t<unsigned short>::type assert_no_intrinsic_wchar_t_;
+#else
+template< typename T > struct assert_intrinsic_wchar_t;
+template<> struct assert_intrinsic_wchar_t<wchar_t> {};
+// if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
+template<> struct assert_intrinsic_wchar_t<unsigned short> {};
+#endif
+
+
#if (BOOST_INTEL_CXX_VERSION <= 800) || !defined(BOOST_STRICT_CONFIG)
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#endif
#endif
//
// last known and checked version:
-#if (BOOST_INTEL_CXX_VERSION > 800)
+#if (BOOST_INTEL_CXX_VERSION > 810)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# elif defined(_MSC_VER)
// (C) Copyright Peter Dimov 2001.
// (C) Copyright David Abrahams 2001 - 2002.
// (C) Copyright Beman Dawes 2001 - 2003.
+// (C) Copyright Stefan Slapeta 2004.
// 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_NO_SFINAE
# endif
-# if(__MWERKS__ <= 0x3202) // 9.2
+# if(__MWERKS__ <= 0x3204) // 9.3
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# endif
# define BOOST_COMPILER_VERSION 9.1
# elif __MWERKS__ == 0x3202
# define BOOST_COMPILER_VERSION 9.2
+# elif __MWERKS__ == 0x3204
+# define BOOST_COMPILER_VERSION 9.3
# else
# define BOOST_COMPILER_VERSION __MWERKS__
# endif
#endif
//
// last known and checked version:
-#if (__MWERKS__ > 0x3202)
+#if (__MWERKS__ > 0x3204)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# endif
#endif
#if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG)
+# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
+# define BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES 1
#endif
//
// turn off the warnings before we #include anything
#pragma warning( disable : 4503 ) // warning: decorated name length exceeded
-#if _MSC_VER <= 1200 // 1200 == VC++ 6.0
+#if _MSC_VER < 1300 // 1200 == VC++ 6.0, 1201 == EVC4.2
#pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
# define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
# define BOOST_NO_VOID_RETURNS
# define BOOST_NO_SWPRINTF
# define BOOST_NO_TEMPLATE_TEMPLATES
# define BOOST_NO_SFINAE
+# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
# if (_MSC_VER > 1200)
# define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
# endif
# define BOOST_NO_SWPRINTF
#endif
-#if _MSC_VER <= 1310
+#if _MSC_VER <= 1400 // 1400 == VC++ 8.0
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
#endif
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
+#ifdef _WIN32_WCE
+# define BOOST_NO_THREADEX
+# define BOOST_NO_GETSYSTEMTIMEASFILETIME
+#endif
+
//
// check for exception handling support:
#ifndef _CPPUNWIND
# define BOOST_COMPILER_VERSION 7.0
# elif _MSC_VER == 1310
# define BOOST_COMPILER_VERSION 7.1
+# elif _MSC_VER == 1400
+# define BOOST_COMPILER_VERSION 8.0
# else
# define BOOST_COMPILER_VERSION _MSC_VER
# endif
#endif
//
// last known and checked version is 1310:
-#if (_MSC_VER > 1310)
+#if (_MSC_VER > 1400)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
# pragma message("Unknown compiler version - please run the configure tests and report the results")
# endif
#endif
-
-
-
-
-
-
-
-
//
// The BSD <ctype.h> has macros only, no functions:
//
-#define BOOST_NO_CTYPE_FUNCTIONS
+#if !defined(__OpenBSD__)
+# define BOOST_NO_CTYPE_FUNCTIONS
+#endif
//
// thread API's not auto detected:
// Using the Mac OS X system BSD-style C library.
-# define BOOST_NO_CTYPE_FUNCTIONS
-# define BOOST_NO_CWCHAR
# ifndef BOOST_HAS_UNISTD_H
# define BOOST_HAS_UNISTD_H
# endif
// a consistent setting of BOOST_HAS_THREADS across
// all translation units (needed for shared_ptr etc).
//
+
+#ifdef _WIN32_WCE
+# define BOOST_NO_ANSI_APIS
+#endif
+
#ifndef BOOST_HAS_PTHREADS
# define BOOST_HAS_WINTHREADS
#endif
#ifndef BOOST_DISABLE_WIN32
// WEK: Added
#define BOOST_HAS_FTIME
+#define BOOST_WINDOWS 1
#endif
-
-//
-// disable min/max macros:
-//
-#ifdef min
-# undef min
-#endif
-#ifdef max
-# undef max
-#endif
-#ifndef NOMINMAX
-# define NOMINMAX
-#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
- // slightly different type. (If this proves to be incorrect, this
- // whole "BOOST_MSVC" section can be removed.)
- inline long min(long __a, long __b) {
- return __b < __a ? __b : __a;
- }
- inline long max(long __a, long __b) {
- return __a < __b ? __b : __a;
- }
- // The "long double" overload is required, otherwise user code calling
- // min/max for floating-point numbers will use the "long" overload.
- // (SourceForge bug #495495)
- inline long double min(long double __a, long double __b) {
- return __b < __a ? __b : __a;
- }
- inline long double max(long double __a, long double __b) {
- return __a < __b ? __b : __a;
- }
-}
-using std::min;
-using std::max;
-# endif
-
-
// in issue 4, version 2 (_XOPEN_VERSION > 500).
# if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
# define BOOST_HAS_GETTIMEOFDAY
-# if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+# if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE+0 >= 500)
# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
# endif
# endif
// Rogue Wave library:
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
-#elif defined(__GLIBCPP__)
+#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
// GNU libstdc++ 3
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
# define BOOST_NO_STD_ALLOCATOR
# endif
# define BOOST_HAS_PARTIAL_STD_ALLOCATOR
-# if (defined(_MSC_VER) && (_MSC_VER < 1300)) && !defined(__BORLANDC__)
+# if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
// 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
# endif
#endif
+//
+// std extension namespace is stdext for vc7.1 and later,
+// the same applies to other compilers that sit on top
+// of vc7.1 (Intel and Comeau):
+//
+#if defined(_MSC_VER) && (_MSC_VER >= 1310) && !defined(__BORLANDC__)
+# define BOOST_STD_EXTENSION_NAMESPACE stdext
+#endif
+
#if (defined(_MSC_VER) && (_MSC_VER <= 1300) && !defined(__BORLANDC__)) || !defined(_CPPLIB_VER) || (_CPPLIB_VER < 306)
// if we're using a dinkum lib that's
# define BOOST_NO_STD_ITERATOR_TRAITS
#endif
-#if defined(__ICL) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
+#if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
// Intel C++ chokes over any non-trivial use of <locale>
// this may be an overly restrictive define, but regex fails without it:
# define BOOST_NO_STD_LOCALE
+
# define BOOST_NO_STD_WSTREAMBUF
#endif
+#if (__LIBCOMO_VERSION__ <= 31) && defined(_WIN32)
+#define BOOST_NO_SWPRINTF
+#endif
+
+#if __LIBCOMO_VERSION__ >= 31
+# define BOOST_HAS_HASH
+# define BOOST_HAS_SLIST
+#endif
+
//
// Intrinsic type_traits support.
// The SGI STL has it's own __type_traits class, which
// config for libstdc++ v3
// not much to go in here:
+#ifdef __GLIBCXX__
+#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
+#else
#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
+#endif
-#ifndef _GLIBCPP_USE_WCHAR_T
+#if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
# define BOOST_NO_CWCHAR
# define BOOST_NO_CWCTYPE
# define BOOST_NO_STD_WSTRING
# define BOOST_NO_STD_WSTREAMBUF
#endif
+
+#if defined(__osf__) && !defined(_REENTRANT) && defined(_GLIBCXX_HAVE_GTHR_DEFAULT)
+// GCC 3.4 on Tru64 forces the definition of _REENTRANT when any std lib header
+// file is included, therefore for consistency we define it here as well.
+# define _REENTRANT
+#endif
+
+#ifdef __GLIBCXX__ // gcc 3.4 and greater:
+# ifdef _GLIBCXX_HAVE_GTHR_DEFAULT
+ //
+ // If the std lib has thread support turned on, then turn it on in Boost
+ // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
+ // while others do not...
+ //
+# define BOOST_HAS_THREADS
+# else
+# define BOOST_DISABLE_THREADS
+# endif
+#endif
+
-#ifndef _GLIBCPP_USE_LONG_LONG
+#if !defined(_GLIBCPP_USE_LONG_LONG) \
+ && !defined(_GLIBCXX_USE_LONG_LONG)\
+ && defined(BOOST_HAS_LONG_LONG)
// May have been set by compiler/*.hpp, but "long long" without library
// support is useless.
# undef BOOST_HAS_LONG_LONG
#endif
-
-
#if defined(__MSL__) && (__MSL__ >= 0x5000)
# define BOOST_HAS_STDINT_H
-# define BOOST_HAS_UNISTD_H
+# if !defined(__PALMOS_TRAPS__)
+# define BOOST_HAS_UNISTD_H
+# endif
// boilerplate code:
# include <boost/config/posix_features.hpp>
#endif
# define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
#endif
-#if BOOST_RWSTD_VER <= 0x020101
+// Sun CC 5.5 patch 113817-07 adds long long specialization, but does not change the
+// library version number (http://sunsolve6.sun.com/search/document.do?assetkey=1-21-113817):
+#if BOOST_RWSTD_VER <= 0x020101 && (!defined(__SUNPRO_CC) || (__SUNPRO_CC < 0x550))
# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
# endif
# define BOOST_NO_STD_ALLOCATOR
#endif
+//
+// If STLport thinks there is no wchar_t at all, then we have to disable
+// the support for the relevant specilazations of std:: templates.
+//
+#if !defined(_STLP_HAS_WCHAR_T) && !defined(_STLP_WCHAR_T_IS_USHORT)
+# ifndef BOOST_NO_STD_WSTRING
+# define BOOST_NO_STD_WSTRING
+# endif
+# ifndef BOOST_NO_STD_WSTREAMBUF
+# define BOOST_NO_STD_WSTREAMBUF
+# endif
+#endif
+
//
// We always have SGI style hash_set, hash_map, and slist:
//
# define BOOST_NO_CWCTYPE
#endif
+//
+// If STLport for some reason was configured so that it thinks that wchar_t
+// is not an intrinsic type, then we have to disable the support for it as
+// well (we would be missing required specializations otherwise).
+//
+#if !defined( _STLP_HAS_WCHAR_T) || defined(_STLP_WCHAR_T_IS_USHORT)
+# undef BOOST_NO_INTRINSIC_WCHAR_T
+# define BOOST_NO_INTRINSIC_WCHAR_T
+#endif
+
//
// Borland ships a version of STLport with C++ Builder 6 that lacks
// hashtables and the like:
# undef BOOST_HAS_HASH
#endif
+//
+// gcc-2.95.3/STLPort does not like the using declarations we use to get ADL with std::min/max
+//
+#if defined(__GNUC__) && (__GNUC__ < 3)
+# include <algorithm> // for std::min and std::max
+# define BOOST_USING_STD_MIN() ((void)0)
+# define BOOST_USING_STD_MAX() ((void)0)
+namespace boost { using std::min; using std::max; }
+#endif
#define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)
#endif
#define BOOST_HAS_MACRO_USE_FACET
+#define BOOST_NO_STD_MESSAGES
#define BOOST_STDLIB "Visual Age default standard library"
namespace std { using ::ptrdiff_t; using ::size_t; }
# endif
+// Workaround for the unfortunate min/max macros defined by some platform headers
+
+#define BOOST_PREVENT_MACRO_SUBSTITUTION
+
+#ifndef BOOST_USING_STD_MIN
+# define BOOST_USING_STD_MIN() using std::min
+#endif
+
+#ifndef BOOST_USING_STD_MAX
+# define BOOST_USING_STD_MAX() using std::max
+#endif
+
// BOOST_NO_STD_MIN_MAX workaround -----------------------------------------//
# ifdef BOOST_NO_STD_MIN_MAX
namespace std {
template <class _Tp>
- inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
+ inline const _Tp& min BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
return __b < __a ? __b : __a;
}
template <class _Tp>
- inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
+ inline const _Tp& max BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
return __a < __b ? __b : __a;
}
}
# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
# endif
-// BOOST_USE_FACET workaround ----------------------------------------------//
+// BOOST_USE_FACET / HAS_FACET workaround ----------------------------------//
// When the standard library does not have a conforming std::use_facet there
// are various workarounds available, but they differ from library to library.
-// This macro provides a consistent way to access a locale's facets.
+// The same problem occurs with has_facet.
+// These macros provide a consistent way to access a locale's facets.
// Usage:
// replace
// std::use_facet<Type>(loc);
// with
// BOOST_USE_FACET(Type, loc);
// Note do not add a std:: prefix to the front of BOOST_USE_FACET!
+// Use for BOOST_HAS_FACET is analagous.
#if defined(BOOST_NO_STD_USE_FACET)
# ifdef BOOST_HAS_TWO_ARG_USE_FACET
# define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
+# define BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast<Type*>(0))
# elif defined(BOOST_HAS_MACRO_USE_FACET)
# define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
+# define BOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type)
# elif defined(BOOST_HAS_STLP_USE_FACET)
# define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
+# define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
# endif
#else
# define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
+# define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
#endif
// BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
# define BOOST_DEDUCED_TYPENAME
#endif
+// long long workaround ------------------------------------------//
+// On gcc (and maybe other compilers?) long long is alway supported
+// but it's use may generate either warnings (with -ansi), or errors
+// (with -pedantic -ansi) unless it's use is prefixed by __extension__
+//
+#if defined(BOOST_HAS_LONG_LONG)
+namespace boost{
+# ifdef __GNUC__
+ __extension__ typedef long long long_long_type;
+ __extension__ typedef unsigned long long ulong_long_type;
+# else
+ typedef long long long_long_type;
+ typedef unsigned long long ulong_long_type;
+# endif
+}
+#endif
+
// BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
//
// Some compilers have problems with function templates whose
// Boost CRC library crc.hpp header file -----------------------------------//
-// Copyright 2001 Daryle Walker. Use, modification, and distribution are
+// Copyright 2001, 2004 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>.)
did_init = true;
}
+ #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ // Align the msb of the remainder to a byte
+ template < std::size_t Bits, bool RightShift >
+ class remainder
+ {
+ public:
+ typedef typename uint_t<Bits>::fast value_type;
+
+ static unsigned char align_msb( value_type rem )
+ { return rem >> (Bits - CHAR_BIT); }
+ };
+
+ // Specialization for the case that the remainder has less
+ // bits than a byte: align the remainder msb to the byte msb
+ template < std::size_t Bits >
+ class remainder< Bits, false >
+ {
+ public:
+ typedef typename uint_t<Bits>::fast value_type;
+
+ static unsigned char align_msb( value_type rem )
+ { return rem << (CHAR_BIT - Bits); }
+ };
+ #endif
// CRC helper routines
template < std::size_t Bits, bool DoReflect >
// Compare a byte to the remainder's highest byte
static unsigned char index( value_type rem, unsigned char x )
- { return x ^ ( rem >> (DoReflect ? 0u : Bits - CHAR_BIT) ); }
+ { return x ^ ( DoReflect ? rem :
+ ((Bits>CHAR_BIT)?( rem >> (Bits - CHAR_BIT) ) :
+ ( rem << (CHAR_BIT - Bits) ))); }
// Shift out the remainder's highest byte
static value_type shift( value_type rem )
// Compare a byte to the remainder's highest byte
static unsigned char index( value_type rem, unsigned char x )
- { return x ^ ( rem >> (Bits - CHAR_BIT) ); }
+ { return x ^ remainder<Bits,(Bits>CHAR_BIT)>::align_msb( rem ); }
// Shift out the remainder's highest byte
static value_type shift( value_type rem )
#include <boost/regex/v4/cregex.hpp>
#endif
-#endif // include guard
+#endif /* include guard */
// boost cstdint.hpp header file ------------------------------------------//
-// (C) Copyright boost.org 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.
+// (C) Copyright Beman Dawes 1999.
+// (C) Copyright Jens Mauer 2001
+// (C) Copyright John Maddock 2001
+// Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/integer for documentation.
} // namespace boost
-#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4)
-// FreeBSD has an <inttypes.h> that contains much of what we need
+#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__)
+// FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need.
# include <inttypes.h>
namespace boost {
# error defaults not correct; you must hand modify boost/cstdint.hpp
# endif
- typedef long long intmax_t;
- typedef unsigned long long uintmax_t;
- typedef long long int64_t;
- typedef long long int_least64_t;
- typedef long long int_fast64_t;
- typedef unsigned long long uint64_t;
- typedef unsigned long long uint_least64_t;
- typedef unsigned long long uint_fast64_t;
+ typedef ::boost::long_long_type intmax_t;
+ typedef ::boost::ulong_long_type uintmax_t;
+ typedef ::boost::long_long_type int64_t;
+ typedef ::boost::long_long_type int_least64_t;
+ typedef ::boost::long_long_type int_fast64_t;
+ typedef ::boost::ulong_long_type uint64_t;
+ typedef ::boost::ulong_long_type uint_least64_t;
+ typedef ::boost::ulong_long_type uint_fast64_t;
# elif ULONG_MAX != 0xffffffff
// boost/cstdlib.hpp header ------------------------------------------------//
-// Copyright Beman Dawes 2001.
-// See accompanying license for terms and conditions of use.
+// Copyright Beman Dawes 2001. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/utility/cstdlib.html for documentation.
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/utility/current_function.html
//
+++ /dev/null
-/*
- *
- * Copyright (c) 2001
- * 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_DETAIL_ALLOCATOR_HPP
-#define BOOST_DETAIL_ALLOCATOR_HPP
-
-#include <boost/config.hpp>
-#include <cstdlib>
-#include <new>
-#include <assert.h>
-#if defined(BOOST_NO_STDC_NAMESPACE)
-namespace std{
-using ::ptrdiff_t;
-using ::size_t;
-}
-#endif
-
-// see if we have SGI alloc class:
-#if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H))
-# define BOOST_HAVE_SGI_ALLOCATOR
-# include <memory>
-# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-namespace boost{ namespace detail{
- typedef std::__sgi_alloc alloc_type;
-}}
-# else
-namespace boost{ namespace detail{
- typedef std::alloc alloc_type;
-}}
-# endif
-#endif
-
-
-namespace boost{ namespace detail{
-
-template <class T>
-void allocator_construct(T* p, const T& t)
-{ new (p) T(t); }
-
-template <class T>
-void allocator_destroy(T* p)
-{
- (void)p; // warning suppression
- p->~T();
-}
-
-} }
-
-#if !defined(BOOST_NO_STD_ALLOCATOR)
-
-#include <memory>
-
-#define BOOST_DEFAULT_ALLOCATOR(T) std::allocator< T >
-
-namespace boost{ namespace detail{
-
-template <class T, class A>
-struct rebind_allocator
-{
- typedef typename A::template rebind<T> binder;
- typedef typename binder::other type;
-};
-
-} // namespace detail
-} // namespace boost
-
-#elif !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__SUNPRO_CC)
-
-// no std::allocator, but the compiler supports the necessary syntax,
-// write our own allocator instead:
-
-#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator< T >
-
-namespace boost{ namespace detail{
-
-template <class T>
-class allocator
-{
-public:
-
- typedef T value_type;
- typedef value_type * pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
-
- template <class U>
- struct rebind
- {
- typedef allocator<U> other;
- };
-
- allocator(){}
-
- template <class U>
- allocator(const allocator<U>&){}
-
- allocator(const allocator&){}
-
- template <class U>
- allocator& operator=(const allocator<U>&)
- { return *this; }
-
- ~allocator(){}
-
- pointer address(reference x) { return &x; }
-
- const_pointer address(const_reference x) const { return &x; }
-
- pointer allocate(size_type n, const void* = 0)
- {
- #ifdef BOOST_HAVE_SGI_ALLOCATOR
- return n != 0 ?
- reinterpret_cast<pointer>(alloc_type::allocate(n * sizeof(value_type)))
- : 0;
- #else
- return n != 0 ?
- reinterpret_cast<pointer>(::operator new(n * sizeof(value_type)))
- : 0;
- #endif
- }
-
- void deallocate(pointer p, size_type n)
- {
- #ifdef BOOST_HAVE_SGI_ALLOCATOR
- assert( (p == 0) == (n == 0) );
- if (p != 0)
- alloc_type::deallocate((void*)p, n);
- #else
- assert( (p == 0) == (n == 0) );
- if (p != 0)
- ::operator delete((void*)p);
- #endif
- }
-
- size_type max_size() const
- { return size_t(-1) / sizeof(value_type); }
-
- void construct(pointer p, const T& val) const
- { allocator_construct(p, val); }
-
- void destroy(pointer p) const
- { allocator_destroy(p); }
-};
-
-template <class T, class A>
-struct rebind_allocator
-{
- typedef typename A::template rebind<T> binder;
- typedef typename binder::other type;
-};
-
-} // namespace detail
-} // namespace boost
-
-#else
-
-// no std::allocator, use workaround version instead,
-// each allocator class must derive from a base class
-// that allocates blocks of bytes:
-
-#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter<T, ::boost::detail::simple_alloc>
-
-namespace boost{ namespace detail{
-
-class simple_alloc
-{
-public:
-
- typedef void value_type;
- typedef value_type * pointer;
- typedef const void* const_pointer;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
-
- simple_alloc(){}
- simple_alloc(const simple_alloc&){}
-
- ~simple_alloc(){}
-
- pointer allocate(size_type n, const void* = 0)
- {
- #ifdef BOOST_HAVE_SGI_ALLOCATOR
- return n != 0 ?
- reinterpret_cast<pointer>(alloc_type::allocate(n))
- : 0;
- #else
- return n != 0 ?
- reinterpret_cast<pointer>(::operator new(n))
- : 0;
- #endif
- }
-
- void deallocate(pointer p, size_type n)
- {
- #ifdef BOOST_HAVE_SGI_ALLOCATOR
- assert( (p == 0) == (n == 0) );
- if (p != 0)
- alloc_type::deallocate((void*)p, n);
- #else
- assert( (p == 0) == (n == 0) );
- if (p != 0)
- ::operator delete((void*)p);
- #endif
- }
-};
-
-template <class T, class Base>
-class allocator_adapter : public Base
-{
-public:
-
- typedef T value_type;
- typedef value_type * pointer;
- typedef const T* const_pointer;
- typedef T& reference;
- typedef const T& const_reference;
- typedef size_t size_type;
- typedef std::ptrdiff_t difference_type;
- typedef Base base_type;
-
- allocator_adapter(){}
- allocator_adapter(const base_type& x) : Base(x){}
- allocator_adapter& operator=(const base_type& x)
- {
- *(static_cast<base_type*>(this)) = x;
- return *this;
- }
-
- ~allocator_adapter(){}
-
- pointer address(reference x) { return &x; }
-
- const_pointer address(const_reference x) const { return &x; }
-
- pointer allocate(size_type n, const void* = 0)
- {
- return n != 0 ?
- reinterpret_cast<pointer>(base_type::allocate(n * sizeof(value_type)))
- : 0;
- }
-
- void deallocate(pointer p, size_type n)
- {
- assert( (p == 0) == (n == 0) );
- if (p != 0)
- static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
- }
-
- size_type max_size() const
- { return size_t(-1) / sizeof(value_type); }
-
- void construct(pointer p, const T& val) const
- { allocator_construct(p, val); }
-
- void destroy(pointer p) const
- { allocator_destroy(p); }
-};
-
-template <class T, class A>
-struct rebind_allocator
-{
- typedef allocator_adapter<T, typename A::base_type> type;
-};
-
-} // namespace detail
-} // namespace boost
-
-#endif
-
-#endif // include guard
//
// Copyright (c) 2001, 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// typedef <implementation-defined> boost::detail::atomic_count;
//
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org>
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#include <bits/atomicity.h>
long operator--()
{
- return !__exchange_and_add(&value_, -1);
+ return __exchange_and_add(&value_, -1) - 1;
}
operator long() const
atomic_count(atomic_count const &);
atomic_count & operator=(atomic_count const &);
- _Atomic_word value_;
+ mutable _Atomic_word value_;
};
} // namespace detail
//
// Copyright (c) 2001, 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
//
//
// Copyright (c) 2001, 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#include <pthread.h>
//
// Copyright (c) 2001, 2002, 2003 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#ifdef BOOST_USE_WINDOWS_H
-// Copyright (c) 2000 David Abrahams. 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) 2000 David Abrahams.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// Copyright (c) 1994
// Hewlett-Packard Company
// boost/catch_exceptions.hpp -----------------------------------------------//
-// Copyright Beman Dawes 1995-2001.
-// See accompanying license for terms and conditions of use.
+// Copyright Beman Dawes 1995-2001. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for documentation.
--- /dev/null
+// Copyright David Abrahams 2002.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+#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>
+
+# 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/detail/is_function_ref_tester.hpp>
+# endif
+
+namespace boost { namespace detail {
+
+namespace indirect_traits {
+
+# 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
+
+using namespace boost::detail::is_function_ref_tester_;
+
+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
+
+}
+
+using namespace indirect_traits;
+
+}} // namespace boost::python::detail
+
+#endif // INDIRECT_TRAITS_DWA2002131_HPP
// This namespace ensures that ADL doesn't mess things up.
namespace is_incrementable_
{
+ // a type returned from operator++ when no increment is found in the
+ // type's own namespace
struct tag {};
-
+
// any soaks up implicit conversions and makes the following
- // operator++ less-preferred than any other such operator which
+ // operator++ less-preferred than any other such operator that
// might be found via ADL.
struct any { template <class T> any(T const&); };
+
+ // This is a last-resort operator++ for when none other is found
tag operator++(any const&);
+ tag operator++(any const&,int);
+# if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
+ || BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+# define BOOST_comma(a,b) (a)
+# else
+ // In case an operator++ is found that returns void, we'll use ++x,0
+ tag operator,(tag,int);
+# define BOOST_comma(a,b) (a,b)
+# endif
+
// two check overloads help us identify which operator++ was picked
char (& check(tag) )[2];
template <class T>
- struct
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- impl
-# else
- is_incrementable
-# endif
+ struct impl
{
static typename remove_cv<T>::type& x;
BOOST_STATIC_CONSTANT(
bool
- , value = sizeof(is_incrementable_::check(++x)) == 1
+ , value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1
);
+ };
- typedef mpl::bool_<(
-# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
- ::boost::detail::is_incrementable_::is_incrementable<T>::
-# endif
- value)> type;
+ template <class T>
+ struct postfix_impl
+ {
+ static typename remove_cv<T>::type& x;
+
+ BOOST_STATIC_CONSTANT(
+ bool
+ , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
+ );
};
}
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+# undef BOOST_comma
+
template <class T>
-struct is_incrementable : is_incrementable_::impl<T>
+struct is_incrementable
+ : mpl::bool_< ::boost::detail::is_incrementable_::impl<T>::value>
+{
+};
+
+template <class T>
+struct is_postfix_incrementable
+ : mpl::bool_< ::boost::detail::is_incrementable_::postfix_impl<T>::value>
{
};
-# else
-using is_incrementable_::is_incrementable;
-# endif
}} // namespace boost::detail
-// (C) 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// Boost versions of
//
# endif
# include <boost/mpl/if.hpp>
-# include <boost/mpl/aux_/has_xxx.hpp>
+# include <boost/mpl/has_xxx.hpp>
# include <cstddef>
// should be the last #include
template <class T>
struct pointer_iterator_traits<T*>
{
- typedef remove_const<T>::type value_type;
+ typedef typename remove_const<T>::type value_type;
typedef T* pointer;
typedef T& reference;
typedef std::random_access_iterator_tag iterator_category;
: std::iterator_traits<Iterator>
{
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
- typedef value_type* pointer;
- typedef value_type& reference;
+ typedef typename std::iterator_traits<Iterator>::value_type* pointer;
+ typedef typename std::iterator_traits<Iterator>::value_type& reference;
};
template <class Iterator>
: std::iterator_traits<Iterator>
{
typedef typename std::iterator_traits<Iterator>::distance_type difference_type;
- typedef const value_type* pointer;
- typedef const value_type& reference;
+ typedef const typename std::iterator_traits<Iterator>::value_type* pointer;
+ typedef const typename std::iterator_traits<Iterator>::value_type& reference;
};
# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
//
// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// typedef <unspecified> boost::detail::lightweight_mutex;
//
static const __mem_type __mem_name = __mem_value
#endif /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */
-// Deal with min/max for MinGW
-#ifdef min
-# undef min
-#endif
-
-#ifdef max
-# undef max
-#endif
-
// Base class for all specializations of numeric_limits.
template <class __number>
class _Numeric_limits_base {
public:
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, false);
- static __number min() throw() { return __number(); }
- static __number max() throw() { return __number(); }
+ static __number min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); }
+ static __number max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __number(); }
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, 0);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, 0);
public:
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true);
- static _Int min() throw() { return __imin; }
- static _Int max() throw() { return __imax; }
+ static _Int min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imin; }
+ static _Int max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return __imax; }
BOOST_STL_DECLARE_LIMITS_MEMBER(int,
digits,
round_to_nearest>
{
public:
- static float min() throw() { return FLT_MIN; }
+ static float min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MIN; }
static float denorm_min() throw() { return FLT_MIN; }
- static float max() throw() { return FLT_MAX; }
+ static float max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MAX; }
static float epsilon() throw() { return FLT_EPSILON; }
static float round_error() throw() { return 0.5f; } // Units: ulps.
};
round_to_nearest>
{
public:
- static double min() throw() { return DBL_MIN; }
+ static double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MIN; }
static double denorm_min() throw() { return DBL_MIN; }
- static double max() throw() { return DBL_MAX; }
+ static double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MAX; }
static double epsilon() throw() { return DBL_EPSILON; }
static double round_error() throw() { return 0.5; } // Units: ulps.
};
round_to_nearest>
{
public:
- static long double min() throw() { return LDBL_MIN; }
+ static long double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MIN; }
static long double denorm_min() throw() { return LDBL_MIN; }
- static long double max() throw() { return LDBL_MAX; }
+ static long double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MAX; }
static long double epsilon() throw() { return LDBL_EPSILON; }
static long double round_error() throw() { return 4; } // Units: ulps.
};
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org>
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#include <bits/atomicity.h>
public:
- lightweight_mutex(): a_(1)
+ lightweight_mutex(): a_(0)
{
}
explicit scoped_lock(lightweight_mutex & m): m_(m)
{
- while( !__exchange_and_add(&m_.a_, -1) )
+ while( __exchange_and_add(&m_.a_, 1) )
{
- __atomic_add(&m_.a_, 1);
+ __atomic_add(&m_.a_, -1);
sched_yield();
}
}
~scoped_lock()
{
- __atomic_add(&m_.a_, 1);
+ __atomic_add(&m_.a_, -1);
}
};
};
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2002 Dan Gohman
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#include <sgidefs.h>
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
//
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
namespace boost
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#include <pthread.h>
//
// Copyright (c) 2002, 2003 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#ifdef BOOST_USE_WINDOWS_H
//
// Copyright (c) 2002, 2003 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#ifdef BOOST_USE_WINDOWS_H
-// (C) Copyright Jeremy Siek 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 Jeremy Siek 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// Revision History:
-// (C) Copyright David Abrahams 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 David Abrahams 2001, Howard Hinnant 2001.
//
-// Template class is_signed and its documentation is:
-// (C) Copyright Howard Hinnant 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// Template class numeric_traits<Number> --
//
// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
#define BOOST_DETAIL_REFERENCE_CONTENT_HPP
-// (C) Copyright David Abrahams 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 David Abrahams 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org for most recent version including documentation.
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
//
//
// Copyright (c) 2001, 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/config.hpp>
shared_count & operator= (shared_count const & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
- if(tmp != 0) tmp->add_ref_copy();
- if(pi_ != 0) pi_->release();
- pi_ = tmp;
+
+ if(tmp != pi_)
+ {
+ if(tmp != 0) tmp->add_ref_copy();
+ if(pi_ != 0) pi_->release();
+ pi_ = tmp;
+ }
return *this;
}
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef WORKAROUND_DWA2002126_HPP
# define WORKAROUND_DWA2002126_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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html
//
}
typedef T _internal_element_type; // for bcc 5.5.1
- weak_ptr<_internal_element_type> _internal_weak_this;
+ mutable weak_ptr<_internal_element_type> _internal_weak_this;
};
} // namespace boost
namespace filesystem
{
-// create_directories (contributed by Vladimir Prus) -----------------------//
-
-
- BOOST_FILESYSTEM_DECL void create_directories(const path& ph);
+ BOOST_FILESYSTEM_DECL bool create_directories(const path& ph);
BOOST_FILESYSTEM_DECL std::string extension(const path& ph);
filesystem_error(
const std::string & who,
const path & path1,
- const std::string & message ); // assumed to be error_code::other_error
+ const std::string & message,
+ error_code ec = other_error );
filesystem_error(
const std::string & who,
#include <boost/filesystem/path.hpp> // includes <boost/filesystem/config.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/iterator.hpp>
+#include <boost/cstdint.hpp>
#include <string>
#include <ctime>
inline bool is_empty( const path & ph ) { return _is_empty( ph ); }
# endif
+ BOOST_FILESYSTEM_DECL bool equivalent( const path & ph1, const path & ph2 );
+ BOOST_FILESYSTEM_DECL boost::intmax_t file_size( const path & ph );
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 --------------------------------------------------------------//
- BOOST_FILESYSTEM_DECL void create_directory( const path & directory_ph );
+ BOOST_FILESYSTEM_DECL bool create_directory( const path & directory_ph );
BOOST_FILESYSTEM_DECL bool remove( const path & ph );
BOOST_FILESYSTEM_DECL unsigned long remove_all( const path & ph );
BOOST_FILESYSTEM_DECL path system_complete( const path & ph );
BOOST_FILESYSTEM_DECL path complete( const path & ph, const path & base = initial_path() );
+// test helper -------------------------------------------------------------//
+
+ // not part of the documented interface because false positives are possible;
+ // there is no law that says that an OS that has large stat.st_size
+ // actually supports large file sizes.
+ BOOST_FILESYSTEM_DECL bool possible_large_file_size_support();
+
+
// directory_iterator helpers ----------------------------------------------//
// forwarding functions avoid need for BOOST_FILESYSTEM_DECL for class
// directory_iterator, and so avoid iterator_facade DLL template problems
class iterator : public boost::iterator_facade<
iterator,
std::string const,
- boost::single_pass_traversal_tag >
+ boost::bidirectional_traversal_tag >
{
private:
friend class boost::iterator_core_access;
static void default_name_check( name_check new_check );
static name_check default_name_check();
+ // relational operators
+ bool operator<( const path & that ) const;
+ bool operator==( const path & that ) const { return !(*this < that) && !(that < *this); }
+ bool operator!=( const path & that ) const { return !(*this == that); }
+ bool operator>( const path & that ) const { return that < *this; }
+ bool operator<=( const path & that ) const { return !(that < *this); }
+ bool operator>=( const path & that ) const { return !(*this < that); }
+
private:
// Note: This is an implementation for POSIX and Windows, where there
// are only minor differences between generic and system-specific
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// format.hpp : primary header
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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/format for library home page
-// ----------------------------------------------------------------------------
-// format.hpp : primary header
// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_HPP
#include <vector>
#include <string>
#include <boost/detail/workaround.hpp>
-#include <boost/format/detail/config_macros.hpp>
+#include <boost/config.hpp>
#ifndef BOOST_NO_STD_LOCALE
#include <locale>
#endif
+// *** Compatibility framework
+#include <boost/format/detail/compat_workarounds.hpp>
+
#ifdef BOOST_NO_LOCALE_ISIDIGIT
#include <cctype> // we'll use the non-locale <cctype>'s std::isdigit(int)
#endif
--- /dev/null
+// ----------------------------------------------------------------------------
+// alt_sstream.hpp : alternative stringstream
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 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/format for library home page
+
+// ----------------------------------------------------------------------------
+
+
+
+#ifndef BOOST_SK_ALT_SSTREAM_HPP
+#define BOOST_SK_ALT_SSTREAM_HPP
+
+#include <string>
+#include <boost/format/detail/compat_workarounds.hpp>
+#include <boost/utility/base_from_member.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/assert.hpp>
+
+namespace boost {
+ namespace io {
+
+ template<class Ch, class Tr=::std::char_traits<Ch>,
+ class Alloc=::std::allocator<Ch> >
+ class basic_altstringbuf;
+
+ template<class Ch, class Tr =::std::char_traits<Ch>,
+ class Alloc=::std::allocator<Ch> >
+ class basic_oaltstringstream;
+
+
+ template<class Ch, class Tr, class Alloc>
+ class basic_altstringbuf
+ : public ::std::basic_streambuf<Ch, Tr>
+ {
+ typedef ::std::basic_streambuf<Ch, Tr> streambuf_t;
+ typedef typename CompatAlloc<Alloc>::compatible_type compat_allocator_type;
+ typedef typename CompatTraits<Tr>::compatible_type compat_traits_type;
+ public:
+ typedef Ch char_type;
+ typedef Tr traits_type;
+ typedef typename compat_traits_type::int_type int_type;
+ typedef typename compat_traits_type::pos_type pos_type;
+ typedef typename compat_traits_type::off_type off_type;
+ typedef Alloc allocator_type;
+ typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
+
+ typedef ::std::streamsize streamsize;
+
+
+ explicit basic_altstringbuf(std::ios_base::openmode mode
+ = std::ios_base::in | std::ios_base::out)
+ : putend_(NULL), is_allocated_(false), mode_(mode)
+ {}
+ explicit basic_altstringbuf(const string_type& s,
+ ::std::ios_base::openmode mode
+ = ::std::ios_base::in | ::std::ios_base::out)
+ : putend_(NULL), is_allocated_(false), mode_(mode)
+ { dealloc(); str(s); }
+ virtual ~basic_altstringbuf()
+ { dealloc(); }
+ using streambuf_t::pbase;
+ using streambuf_t::pptr;
+ using streambuf_t::epptr;
+ using streambuf_t::eback;
+ using streambuf_t::gptr;
+ using streambuf_t::egptr;
+
+ void clear_buffer();
+ void str(const string_type& s);
+
+ // 0-copy access :
+ Ch * begin() const;
+ streamsize size() const;
+ streamsize cur_size() const; // stop at current pointer
+ Ch * pend() const // the highest position reached by pptr() since creation
+ { return ((putend_ < pptr()) ? pptr() : putend_); }
+ streamsize pcount() const
+ { return static_cast<streamsize>( pptr() - pbase()) ;}
+
+ // copy buffer to string :
+ string_type str() const
+ { return string_type(begin(), size()); }
+ string_type cur_str() const
+ { return string_type(begin(), cur_size()); }
+ protected:
+ explicit basic_altstringbuf (basic_altstringbuf * s,
+ ::std::ios_base::openmode mode
+ = ::std::ios_base::in | ::std::ios_base::out)
+ : putend_(NULL), is_allocated_(false), mode_(mode)
+ { dealloc(); str(s); }
+
+ virtual pos_type seekoff(off_type off, ::std::ios_base::seekdir way,
+ ::std::ios_base::openmode which
+ = ::std::ios_base::in | ::std::ios_base::out);
+ virtual pos_type seekpos (pos_type pos,
+ ::std::ios_base::openmode which
+ = ::std::ios_base::in | ::std::ios_base::out);
+ virtual int_type underflow();
+ virtual int_type pbackfail(int_type meta = compat_traits_type::eof());
+ virtual int_type overflow(int_type meta = compat_traits_type::eof());
+ void dealloc();
+ private:
+ enum { alloc_min = 256}; // minimum size of allocations
+
+ Ch *putend_; // remembers (over seeks) the highest value of pptr()
+ bool is_allocated_;
+ ::std::ios_base::openmode mode_;
+ compat_allocator_type alloc_; // the allocator object
+ };
+
+
+// --- class basic_oaltstringstream ----------------------------------------
+ template <class Ch, class Tr, class Alloc>
+ class basic_oaltstringstream
+ : private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >,
+ public ::std::basic_ostream<Ch, Tr>
+ {
+ class No_Op {
+ // used as no-op deleter for (not-owner) shared_pointers
+ public:
+ template<class T>
+ const T & operator()(const T & arg) { return arg; }
+ };
+ typedef ::std::basic_ostream<Ch, Tr> stream_t;
+ typedef boost::base_from_member<boost::shared_ptr<
+ basic_altstringbuf<Ch,Tr, Alloc> > >
+ pbase_type;
+ typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
+ typedef basic_altstringbuf<Ch, Tr, Alloc> stringbuf_t;
+ public:
+ typedef Alloc allocator_type;
+ basic_oaltstringstream()
+ : pbase_type(new stringbuf_t), stream_t(rdbuf())
+ { }
+ basic_oaltstringstream(::boost::shared_ptr<stringbuf_t> buf)
+ : pbase_type(buf), stream_t(rdbuf())
+ { }
+ basic_oaltstringstream(stringbuf_t * buf)
+ : pbase_type(buf, No_Op() ), stream_t(rdbuf())
+ { }
+ stringbuf_t * rdbuf() const
+ { return pbase_type::member.get(); }
+ void clear_buffer()
+ { rdbuf()->clear_buffer(); }
+
+ // 0-copy access :
+ Ch * begin() const
+ { return rdbuf()->begin(); }
+ ::std::streamsize size() const
+ { return rdbuf()->size(); }
+ ::std::streamsize cur_size() const // stops at current position
+ { return rdbuf()->cur_size(); }
+
+ // copy buffer to string :
+ string_type str() const // [pbase, epptr[
+ { return rdbuf()->str(); }
+ string_type cur_str() const // [pbase, pptr[
+ { return rdbuf()->cur_str(); }
+ };
+
+ } // N.S. io
+} // N.S. boost
+
+#include <boost/format/alt_sstream_impl.hpp>
+
+#endif // include guard
+
--- /dev/null
+// ----------------------------------------------------------------------------
+// alt_sstream_impl.hpp : alternative stringstream, templates implementation
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 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/format for library home page
+
+// ----------------------------------------------------------------------------
+
+#ifndef BOOST_SK_ALT_SSTREAM_IMPL_HPP
+#define BOOST_SK_ALT_SSTREAM_IMPL_HPP
+
+namespace boost {
+ namespace io {
+// --- Implementation ------------------------------------------------------//
+
+ template<class Ch, class Tr, class Alloc>
+ void basic_altstringbuf<Ch, Tr, Alloc>::
+ clear_buffer () {
+ const Ch * p = pptr();
+ const Ch * b = pbase();
+ if(p != NULL && p != b) {
+ seekpos(0, ::std::ios_base::out);
+ }
+ p = gptr();
+ b = eback();
+ if(p != NULL && p != b) {
+ seekpos(0, ::std::ios_base::in);
+ }
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ void basic_altstringbuf<Ch, Tr, Alloc>::
+ str (const string_type& s) {
+ std::size_t sz=s.size();
+ if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) {
+ Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
+ // if this didnt throw, we're safe, update the buffer
+ dealloc();
+ sz = s.copy(new_ptr);
+ putend_ = new_ptr + sz;
+ if(mode_ & ::std::ios_base::in)
+ streambuf_t::setg(new_ptr, new_ptr, new_ptr + sz);
+ if(mode_ & ::std::ios_base::out) {
+ streambuf_t::setp(new_ptr, new_ptr + sz);
+ if(mode_ & (::std::ios_base::app | ::std::ios_base::ate))
+ streambuf_t::pbump(sz);
+ if(gptr() == NULL)
+ streambuf_t::setg(new_ptr, NULL, new_ptr);
+ }
+ is_allocated_ = true;
+ }
+ else
+ dealloc();
+ }
+ template<class Ch, class Tr, class Alloc>
+ Ch* basic_altstringbuf<Ch, Tr, Alloc>::
+ begin () const {
+ if(mode_ & ::std::ios_base::out && pptr() != NULL)
+ return pbase();
+ else if(mode_ & ::std::ios_base::in && gptr() != NULL)
+ return eback();
+ return NULL;
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ std::streamsize basic_altstringbuf<Ch, Tr, Alloc>::
+ size () const {
+ if(mode_ & ::std::ios_base::out && pptr())
+ return static_cast<streamsize>( pend() - pbase());
+ else if(mode_ & ::std::ios_base::in && gptr())
+ return static_cast<streamsize>( egptr() - eback());
+ else
+ return 0;
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ std::streamsize basic_altstringbuf<Ch, Tr, Alloc>::
+ cur_size () const {
+ if(mode_ & ::std::ios_base::out && pptr())
+ return static_cast<streamsize>( pptr() - pbase());
+ else if(mode_ & ::std::ios_base::in && gptr())
+ return static_cast<streamsize>( gptr() - eback());
+ else
+ return 0;
+ }
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ seekoff (off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) {
+ if(pptr() != NULL && putend_ < pptr())
+ putend_ = pptr();
+ if(which & ::std::ios_base::in && gptr() != NULL) {
+ // get area
+ if(way == ::std::ios_base::end)
+ off += putend_ - eback();
+ else if(way == ::std::ios_base::cur && (which & ::std::ios_base::out) == 0)
+ off += gptr() - eback();
+ else if(way != ::std::ios_base::beg)
+ off = off_type(-1);
+ if(0 <= off && off <= putend_ - eback()) {
+ // set gptr
+ streambuf_t::gbump(off + (eback() - gptr()));
+ if(which & ::std::ios_base::out && pptr() != NULL)
+ // update pptr to match gptr
+ streambuf_t::pbump(gptr()-pptr());
+ }
+ else
+ off = off_type(-1);
+ }
+ else if(which & ::std::ios_base::out && pptr() != NULL) {
+ // put area
+ if(way == ::std::ios_base::end)
+ off += putend_ - eback();
+ else if(way == ::std::ios_base::cur)
+ off += pptr() - eback();
+ else if(way != ::std::ios_base::beg)
+ off = off_type(-1);
+
+ if(0 <= off && off <= putend_ - eback())
+ // set pptr
+ streambuf_t::pbump((int)(eback() - pptr() + off));
+ else
+ off = off_type(-1);
+ }
+ else // neither in nor out
+ off = off_type(-1);
+ return (pos_type(off));
+ }
+ //- end seekoff(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ seekpos (pos_type pos, ::std::ios_base::openmode which) {
+ off_type off = off_type(pos); // operation guaranteed by §27.4.3.2 table 88
+ if(pptr() != NULL && putend_ < pptr())
+ putend_ = pptr();
+ if(off != off_type(-1)) {
+ if(which & ::std::ios_base::in && gptr() != NULL) {
+ // get area
+ if(0 <= off && off <= putend_ - eback()) {
+ streambuf_t::gbump((int)(eback() - gptr() + off));
+ if(which & ::std::ios_base::out && pptr() != NULL) {
+ // update pptr to match gptr
+ streambuf_t::pbump(gptr()-pptr());
+ }
+ }
+ else
+ off = off_type(-1);
+ }
+ else if(which & ::std::ios_base::out && pptr() != NULL) {
+ // put area
+ if(0 <= off && off <= putend_ - eback())
+ streambuf_t::pbump(eback() - pptr() + off);
+ else
+ off = off_type(-1);
+ }
+ else // neither in nor out
+ off = off_type(-1);
+ return (pos_type(off));
+ }
+ else {
+ BOOST_ASSERT(0); // §27.4.3.2 allows undefined-behaviour here
+ return pos_type(off_type(-1));
+ }
+ }
+ // -end seekpos(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ underflow () {
+ if(gptr() == NULL) // no get area -> nothing to get.
+ return (compat_traits_type::eof());
+ else if(gptr() < egptr()) // ok, in buffer
+ return (compat_traits_type::to_int_type(*gptr()));
+ else if(mode_ & ::std::ios_base::in && pptr() != NULL
+ && (gptr() < pptr() || gptr() < putend_) )
+ { // expand get area
+ if(putend_ < pptr())
+ putend_ = pptr(); // remember pptr reached this far
+ streambuf_t::setg(eback(), gptr(), putend_);
+ return (compat_traits_type::to_int_type(*gptr()));
+ }
+ else // couldnt get anything. EOF.
+ return (compat_traits_type::eof());
+ }
+ // -end underflow(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ pbackfail (int_type meta) {
+ if(gptr() != NULL && (eback() < gptr())
+ && (mode_ & (::std::ios_base::out)
+ || compat_traits_type::eq_int_type(compat_traits_type::eof(), meta)
+ || compat_traits_type::eq(compat_traits_type::to_char_type(meta), gptr()[-1]) ) ) {
+ streambuf_t::gbump(-1); // back one character
+ if(!compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
+ // put-back meta into get area
+ *gptr() = compat_traits_type::to_char_type(meta);
+ return (compat_traits_type::not_eof(meta));
+ }
+ else
+ return (compat_traits_type::eof()); // failed putback
+ }
+ // -end pbackfail(..)
+
+
+ template<class Ch, class Tr, class Alloc>
+ typename basic_altstringbuf<Ch, Tr, Alloc>::int_type
+ basic_altstringbuf<Ch, Tr, Alloc>::
+ overflow (int_type meta) {
+ if(compat_traits_type::eq_int_type(compat_traits_type::eof(), meta))
+ return compat_traits_type::not_eof(meta); // nothing to do
+ else if(pptr() != NULL && pptr() < epptr()) {
+ streambuf_t::sputc(compat_traits_type::to_char_type(meta));
+ return meta;
+ }
+ else if(! (mode_ & ::std::ios_base::out))
+ // no write position, and cant make one
+ return compat_traits_type::eof();
+ else { // make a write position available
+ std::size_t prev_size = pptr() == NULL ? 0 : epptr() - eback();
+ std::size_t new_size = prev_size;
+ // exponential growth : size *= 1.5
+ std::size_t add_size = new_size / 2;
+ if(add_size < alloc_min)
+ add_size = alloc_min;
+ Ch * newptr = NULL, *oldptr = eback();
+
+ // make sure adding add_size wont overflow size_t
+ while (0 < add_size && ((std::numeric_limits<std::size_t>::max)()
+ - add_size < new_size) )
+ add_size /= 2;
+ if(0 < add_size) {
+ new_size += add_size;
+ newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
+ }
+
+ if(0 < prev_size)
+ compat_traits_type::copy(newptr, oldptr, prev_size);
+ if(is_allocated_)
+ alloc_.deallocate(oldptr, prev_size);
+ is_allocated_=true;
+
+ if(prev_size == 0) { // first allocation
+ putend_ = newptr;
+ streambuf_t::setp(newptr, newptr + new_size);
+ if(mode_ & ::std::ios_base::in)
+ streambuf_t::setg(newptr, newptr, newptr + 1);
+ else
+ streambuf_t::setg(newptr, 0, newptr);
+ }
+ else { // update pointers
+ putend_ = putend_ - oldptr + newptr;
+ int pptr_count = pptr()-pbase();
+ int gptr_count = gptr()-eback();
+ streambuf_t::setp(pbase() - oldptr + newptr, newptr + new_size);
+ streambuf_t::pbump(pptr_count);
+ if(mode_ & ::std::ios_base::in)
+ streambuf_t::setg(newptr, newptr + gptr_count, pptr() + 1);
+ else
+ streambuf_t::setg(newptr, 0, newptr);
+ }
+ streambuf_t::sputc(compat_traits_type::to_char_type(meta));
+ return meta;
+ }
+ }
+ // -end overflow(..)
+
+ template<class Ch, class Tr, class Alloc>
+ void basic_altstringbuf<Ch, Tr, Alloc>:: dealloc() {
+ if(is_allocated_)
+ alloc_.deallocate(eback(), (pptr() != NULL ? epptr() : egptr()) - eback());
+ is_allocated_ = false;
+ streambuf_t::setg(0, 0, 0);
+ streambuf_t::setp(0, 0);
+ putend_ = NULL;
+ }
+
+ }// N.S. io
+} // N.S. boost
+
+#endif // include guard
+
--- /dev/null
+// ----------------------------------------------------------------------------
+// compat_workarounds : general framework for non-conformance workarounds
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 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/format for library home page
+
+// ----------------------------------------------------------------------------
+
+
+// this file defines wrapper classes to hide non-conforming
+// std::char_traits<> and std::allocator<> traits
+// and Includes : config_macros.hpp (defines config macros
+// and compiler-specific switches)
+
+// Non-conformant Std-libs fail to supply conformant traits (std::char_traits,
+// std::allocator) and/or the std::string doesnt support them.
+// We don't want to have hundreds of #ifdef workarounds, so we define
+// replacement traits.
+// But both char_traits and allocator traits are visible in the interface,
+// (inside the final string type), thus we need to keep both
+// the replacement type (typedefed to 'compatible_type') for real use,
+// and the original stdlib type (typedef to 'type_for_string') for interface
+// visibility. This is what Compat* classes do (as well as be transparent
+// when good allocator and char traits are present)
+
+#ifndef BOOST_FORMAT_COMPAT_WORKAROUNDS_HPP
+#define BOOST_FORMAT_COMPAT_WORKAROUNDS_HPP
+
+namespace boost {
+ namespace io {
+
+ // gcc-2.95 char traits (non-conformantly named string_char_traits)
+ // lack several functions so we extend them in a replacement class.
+ template<class Tr>
+ class CompatTraits;
+
+ // std::allocator<Ch> in gcc-2.95 is ok, but basic_string only works
+ // with plain 'std::alloc' still, alt_stringbuf requires a functionnal
+ // alloc template argument, so we need a replacement allocator
+ template<class Alloc>
+ class CompatAlloc;
+ } // N.S. io
+}// N.S. boost
+
+
+#include <boost/format/detail/config_macros.hpp>
+ // sets-up macros and load compiler-specific workarounds headers.
+
+#if !defined(BOOST_FORMAT_STREAMBUF_DEFINED)
+// workarounds-gcc-2.95 might have defined own streambuf
+#include <streambuf>
+#endif
+
+#if !defined(BOOST_FORMAT_OSTREAM_DEFINED)
+// workarounds-gcc-2.95 might already have included <iostream>
+#include <ostream>
+#endif
+
+
+
+namespace boost {
+ namespace io {
+
+ // **** CompatTraits general definitions : ----------------------------
+ template<class Tr>
+ class CompatTraits
+ { // general case : be transparent
+ public:
+ typedef Tr compatible_type;
+ };
+
+ // **** CompatAlloc general definitions : -----------------------------
+ template<class Alloc>
+ class CompatAlloc
+ { // general case : be transparent
+ public:
+ typedef Alloc compatible_type;
+ };
+
+ } //N.S. io
+} // N.S. boost
+#endif // include guard
// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// config_macros.hpp : configuration macros for the format library
+// only BOOST_IO_STD is absolutely needed (it should be 'std::' in general)
+// others are compiler-specific workaround macros used in #ifdef switches
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ------------------------------------------------------------------------------
-// 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.
-// ------------------------------------------------------------------------------
+// see http://www.boost.org/libs/format for library home page
+
+
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_CONFIG_MACROS_HPP
#define BOOST_FORMAT_CONFIG_MACROS_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."
+ || defined(BOOST_IO_STD) || defined( BOOST_IO_NEEDS_USING_DECLARATION ) \
+ || defined(BOOST_NO_TEMPLATE_STD_STREAM) \
+ || defined(BOOST_FORMAT_STREAMBUF_DEFINED) || defined(BOOST_FORMAT_OSTREAM_DEFINED)
+#error "boost::format uses a local macro that is already defined."
#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
+#include <boost/format/detail/workarounds_gcc-2_95.hpp>
+#include <boost/format/detail/workarounds_stlport.hpp>
#ifndef BOOST_IO_STD
-# define BOOST_IO_STD std::
+# define BOOST_IO_STD ::std::
#endif
#if defined(BOOST_NO_STD_LOCALE) || \
#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))
+// gcc-2.95's native stringstream is not usable
+#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
#define BOOST_FORMAT_IGNORE_STRINGSTREAM
#endif
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;
}
}
+#if ! defined(BOOST_NO_STD_LOCALE)
+ using std::locale;
+ namespace io {
+ using std::locale;
+ namespace detail {
+ using std::locale;
+ }
+ }
+#endif // locale
}
+ // -end N.S. boost
+#endif // needs_using_declaration
+
+
+// *** hide std::locale if it doesnt exist.
+// this typedef is either std::locale or int, avoids placing ifdefs everywhere
+namespace boost { namespace io { namespace detail {
+#if ! defined(BOOST_NO_STD_LOCALE)
+ typedef BOOST_IO_STD locale locale_t;
+#else
+ typedef int locale_t;
#endif
+} } }
+
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
#endif // BOOST_FORMAT_MACROS_DEFAULT_HPP
-// -*- 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
+// the trick was described in boost's list by Aleksey Gurtovoy
// ----------------------------------------------------------------------------
+// Copyright Samuel Krempp 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/format for library home page
+
+// ----------------------------------------------------------------------------
#ifndef BOOST_MSVC_DISAMBIGUATER_HPP
#define BOOST_MSVC_DISAMBIGUATER_HPP
-#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) // this whole header is specifically for msvc
+#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300)
+ // this whole header is specifically for msvc up to 7.0
#include <boost/format/group.hpp>
#include <ostream>
+// ----------------------------------------------------------------------------
+// unset_macros.hpp
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 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/format for library home page
+
+// ----------------------------------------------------------------------------
+
// *** Undefine 'local' macros :
#ifdef BOOST_NO_OVERLOAD_FOR_NON_CONST
#undef BOOST_NO_OVERLOAD_FOR_NON_CONST
#ifdef BOOST_IO_NEEDS_USING_DECLARATION
#undef BOOST_IO_NEEDS_USING_DECLARATION
#endif
+#ifdef BOOST_NO_TEMPLATE_STD_STREAM
+#undef BOOST_NO_TEMPLATE_STD_STREAM
+#endif
+#ifdef BOOST_FORMAT_STREAMBUF_DEFINED
+#undef BOOST_FORMAT_STREAMBUF_DEFINED
+#endif
+#ifdef BOOST_FORMAT_OSTREAM_DEFINED
+#undef BOOST_FORMAT_OSTREAM_DEFINED
+#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
+// ----------------------------------------------------------------------------
+// workarounds for gcc < 3.0.
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 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/format for library home page
+
+
+// ----------------------------------------------------------------------------
+
+// There's a lot to do, the stdlib shipped with gcc prior to 3.x
+// was terribly non-conforming.
+// . defines macros switches
+// . supplies template classes basic_foo<char,Tr> where gcc only supplies foo.
+// i.e :
+// - basic_ios<char, Tr> from ios
+// - basic_ostream<char, Tr> from ostream
+// - basic_srteambuf<char, Tr> from streambuf
+// these can be used transparently. (it obviously does not work for wchar_t)
+// . specialise CompatAlloc and CompatTraits to wrap gcc-2.95's
+// string_char_traits and std::alloc
+
+#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+ // only for gcc-2.95's native stdlib
+
+#ifndef BOOST_FORMAT_WORKAROUNDS_GCC295_H
+#define BOOST_FORMAT_WORKAROUNDS_GCC295_H
+
+// SGI STL doesnt have <ostream> and others, so we need iostream.
+#include <iostream>
+#define BOOST_FORMAT_OSTREAM_DEFINED
+
+#include <streambuf.h>
+#define BOOST_FORMAT_STREAMBUF_DEFINED
+
+#define BOOST_NO_TEMPLATE_STD_STREAM
+
+#ifndef BOOST_IO_STD
+# define BOOST_IO_STD std::
+#endif
+
+
+
+// ***
+// gcc's simple classes turned into standard-like template classes :
+
+namespace std {
+
+
+ // gcc has string_char_traits, it's incomplete.
+ // we declare a std::char_traits, and specialize CompatTraits<..> on it
+ // to do what is required
+ template<class Ch>
+ class char_traits; // no definition here, we will just use it as a tag.
+
+ template <class Ch, class Tr>
+ class basic_streambuf;
+
+ template <class Tr>
+ class basic_streambuf<char, Tr> : public streambuf {
+ };
+
+ template <class Ch, class Tr=::std::char_traits<Ch> >
+ class basic_ios;
+
+ template <class Tr>
+ class basic_ios<char, Tr> : public ostream {
+ public:
+ basic_ios(streambuf * p) : ostream(p) {};
+ char fill() const { return ios::fill(); } // gcc returns wchar..
+ char fill(char c) { return ios::fill(c); } // gcc takes wchar..
+ char widen(char c) { return c; }
+ char narrow(char c, char def) { return c; }
+ basic_ios& copyfmt(const ios& right) {
+ fill(right.fill());
+ flags(right.flags() );
+ exceptions(right.exceptions());
+ width(right.width());
+ precision(right.precision());
+ return *this;
+ }
+ };
+
+
+ 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 * p) : basic_ios<char,Tr> (p) {}
+ };
+
+} // namespace std
+
+
+namespace boost {
+ namespace io {
+
+
+ // ** CompatTraits gcc2.95 specialisations ----------------------------
+ template<class Ch>
+ class CompatTraits< ::std::string_char_traits<Ch> >
+ : public ::std::string_char_traits<Ch>
+ {
+ public:
+ typedef CompatTraits compatible_type;
+
+ typedef Ch char_type;
+ typedef int int_type;
+ typedef ::std::streampos pos_type;
+ typedef ::std::streamoff off_type;
+
+ static char_type
+ to_char_type(const int_type& meta) {
+ return static_cast<char_type>(meta); }
+ static int_type
+ to_int_type(const char_type& ch) {
+ return static_cast<int_type>(static_cast<unsigned char>(ch) );}
+ static bool
+ eq_int_type(const int_type& left, const int_type& right) {
+ return left == right; }
+ static int_type
+ eof() {
+ return static_cast<int_type>(EOF);
+ }
+ static int_type
+ not_eof(const int_type& meta) {
+ return (meta == eof()) ? 0 : meta;
+ }
+ };
+
+ template<class Ch>
+ class CompatTraits< ::std::char_traits<Ch> > {
+ public:
+ typedef CompatTraits< ::std::string_char_traits<Ch> > compatible_type;
+ };
+
+ // ** CompatAlloc gcc-2.95 specialisations ---------------------------
+ template<>
+ class CompatAlloc< ::std::alloc>
+ {
+ public:
+ typedef ::std::allocator<char> compatible_type;
+ };
+
+ } // N.S. io
+} // N.S. boost
+
+
+
+
+
+#endif // include guard
+
+#endif // if workaround
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// workarounds_stlport.hpp : workaround STLport issues
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+// see http://www.boost.org/libs/format for library home page
-// ------------------------------------------------------------------------------
-// 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
+#if defined(_STLPORT_VERSION) && BOOST_WORKAROUND( BOOST_MSVC, <= 1300)
+// msvc-6-stlport fails to find basic_string::append( iterator, iterator) when linking
+// might affect other MSwindows compilers
+#define BOOST_NO_STRING_APPEND
+#endif
+
// *** This should go to "boost/config/stdlib/stlport.hpp".
// If the streams are not native and there are problems with using templates
#endif
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
#endif // BOOST_MACROS_STLPORT_HPP
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// boost/format/exceptions.hpp
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
-
-// ------------------------------------------------------------------------------
-// exceptions.hpp
-// ------------------------------------------------------------------------------
+// See http://www.boost.org/libs/format for library home page
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_EXCEPTIONS_HPP
#define BOOST_FORMAT_EXCEPTIONS_HPP
namespace boost {
-namespace io {
+ namespace io {
// **** exceptions -----------------------------------------------
-class format_error : public std::exception
-{
-public:
- format_error() {}
- virtual const char *what() const throw()
- {
- return "boost::format_error: "
- "format generic failure";
- }
-};
-
-class bad_format_string : public format_error
-{
-public:
- bad_format_string() {}
- virtual const char *what() const throw()
- {
- return "boost::bad_format_string: "
- "format-string is ill-formed";
- }
-};
-
-class too_few_args : public format_error
-{
-public:
- too_few_args() {}
- virtual const char *what() const throw()
- {
- return "boost::too_few_args: "
- "format-string refered to more arguments than were passed";
- }
-};
-
-class too_many_args : public format_error
-{
-public:
- too_many_args() {}
- virtual const char *what() const throw()
- {
- return "boost::too_many_args: "
- "format-string refered to less arguments than were passed";
- }
-};
-
-
-class out_of_range : public format_error
-{
-public:
- out_of_range() {}
- virtual const char *what() const throw()
- {
- return "boost::out_of_range: "
- "tried to refer to an argument (or item) number which is out of range, "
- "according to the format string.";
- }
-};
-
-
-} // namespace io
+ class format_error : public std::exception
+ {
+ public:
+ format_error() {}
+ virtual const char *what() const throw() {
+ return "boost::format_error: "
+ "format generic failure";
+ }
+ };
+
+ class bad_format_string : public format_error
+ {
+ std::size_t pos_, next_;
+ public:
+ bad_format_string(std::size_t pos, std::size_t size)
+ : pos_(pos), next_(size) {}
+ std::size_t get_pos() const { return pos_; }
+ std::size_t get_next() const { return next_; }
+ virtual const char *what() const throw() {
+ return "boost::bad_format_string: format-string is ill-formed";
+ }
+ };
+
+ class too_few_args : public format_error
+ {
+ std::size_t cur_, expected_;
+ public:
+ too_few_args(std::size_t cur, std::size_t expected)
+ : cur_(cur), expected_(expected) {}
+ std::size_t get_cur() const { return cur_; }
+ std::size_t get_expected() const { return expected_; }
+ virtual const char *what() const throw() {
+ return "boost::too_few_args: "
+ "format-string refered to more arguments than were passed";
+ }
+ };
+
+ class too_many_args : public format_error
+ {
+ std::size_t cur_, expected_;
+ public:
+ too_many_args(std::size_t cur, std::size_t expected)
+ : cur_(cur), expected_(expected) {}
+ std::size_t get_cur() const { return cur_; }
+ std::size_t get_expected() const { return expected_; }
+ virtual const char *what() const throw() {
+ return "boost::too_many_args: "
+ "format-string refered to less arguments than were passed";
+ }
+ };
+
+
+ class out_of_range : public format_error
+ {
+ int index_, beg_, end_; // range is [ beg, end [
+ public:
+ out_of_range(int index, int beg, int end)
+ : index_(index), beg_(beg), end_(end) {}
+ int get_index() const { return index_; }
+ int get_beg() const { return beg_; }
+ int get_end() const { return end_; }
+ virtual const char *what() const throw() {
+ return "boost::out_of_range: "
+ "tried to refer to an argument (or item) number which"
+ " is out of range, according to the format string.";
+ }
+ };
+
+
+ } // namespace io
} // namespace boost
-// -*- 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
-
// ----------------------------------------------------------------------------
-// feed_args.hpp : functions for processing each argument
+// feed_args.hpp : functions for processing each argument
// (feed, feed_manip, and distribute)
// ----------------------------------------------------------------------------
+// Copyright Samuel Krempp 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/format for library home page
+
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_FEED_ARGS_HPP
#define BOOST_FORMAT_FEED_ARGS_HPP
+#include <boost/config.hpp>
+#include <boost/assert.hpp>
+#include <boost/throw_exception.hpp>
+
#include <boost/format/format_class.hpp>
#include <boost/format/group.hpp>
-
#include <boost/format/detail/msvc_disambiguater.hpp>
-#include <boost/throw_exception.hpp>
namespace boost {
namespace io {
namespace detail {
-namespace {
-
- template<class Ch, class Tr>
- void clear_buffer(io::basic_outsstream<Ch,Tr> & os) {
- os.clear_buffer();
- }
- template<class Ch, class Tr>
- void mk_str( std::basic_string<Ch,Tr> & res,
+ template<class Ch, class Tr, class Alloc>
+ void mk_str( std::basic_string<Ch,Tr, Alloc> & res,
const Ch * beg,
std::streamsize size,
std::streamsize w,
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.
+ // 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;
// 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 ) {
+ 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 ) {
+ 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& ) {
+ 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 ) {
+ 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 ) {
+ 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 ) {
+ 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& ) {
+ 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 ) {
+ 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>
+ template< class Ch, class Tr, class Alloc, class T>
void put( T x,
- const format_item<Ch, Tr>& specs,
- std::basic_string<Ch, Tr> & res,
- io::basic_outsstream<Ch, Tr>& oss_ )
+ const format_item<Ch, Tr, Alloc>& specs,
+ typename basic_format<Ch, Tr, Alloc>::string_type& res,
+ typename basic_format<Ch, Tr, Alloc>::internal_streambuf_t & buf,
+ io::detail::locale_t *loc_p = NULL)
{
// does the actual conversion of x, with given params, into a string
- // using the *supplied* strinstream. (the stream state is important)
+ // using the supplied stringbuf.
- typedef std::basic_string<Ch, Tr> string_t;
- typedef format_item<Ch, Tr> format_item_t;
-
- specs.fmtstate_.apply_on(oss_);
+ typedef typename basic_format<Ch, Tr, Alloc>::string_type string_type;
+ typedef typename basic_format<Ch, Tr, Alloc>::format_item_t format_item_t;
+ typedef typename string_type::size_type size_type;
+
+ basic_oaltstringstream<Ch, Tr, Alloc> oss( &buf);
+ specs.fmtstate_.apply_on(oss, loc_p);
// the stream format state can be modified by manipulators in the argument :
- put_head( oss_, x );
+ 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 std::ios_base::fmtflags fl=oss.flags();
const bool internal = (fl & std::ios_base::internal) != 0;
- const std::streamsize w = oss_.width();
+ const std::streamsize w = oss.width();
const bool two_stepped_padding= internal && (w!=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();
+ oss.width(0);
+ put_last( oss, x);
+ const Ch * res_beg = buf.pbase();
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,
+ if(buf.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),
+ buf.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();
+ put_last( oss, x); // may pad
+ const Ch * res_beg = buf.pbase();
+ std::streamsize res_size = buf.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('-') ))
+ if(buf.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
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
+ // Note that res_size<w is possible (in case of bad user-defined formatting)
res.assign(res_beg, res_size);
res_beg=NULL; // invalidate pointers.
- clear_buffer( oss_);
- oss_.width(0);
+
+ // make a new stream, to start re-formatting from scratch :
+ buf.clear_buffer();
+ basic_oaltstringstream<Ch, Tr, Alloc> oss2( &buf);
+ specs.fmtstate_.apply_on(oss2, loc_p);
+ put_head( oss2, x );
+
+ oss2.width(0);
if(prefix_space)
- oss_ << ' ';
- put_last(oss_, x );
- if(oss_.pcount()==0 && specs.pad_scheme_ & format_item_t::spacepad) {
+ oss2 << ' ';
+ put_last(oss2, x );
+ if(buf.pcount()==0 && specs.pad_scheme_ & format_item_t::spacepad) {
prefix_space =true;
- oss_ << ' ';
+ oss2 << ' ';
}
- // minimal-length output
- const Ch * tmp_beg = oss_.begin();
- std::streamsize tmp_size = std::min(oss_.pcount(),
- static_cast<std::streamsize>(specs.truncate_));
+ // we now have the minimal-length output
+ const Ch * tmp_beg = buf.pbase();
+ std::streamsize tmp_size = (std::min)(static_cast<std::streamsize>(specs.truncate_),
+ buf.pcount() );
+
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){}
+ 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());
+ if(d>0) res.append(static_cast<size_type>( d ), oss2.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);
+ BOOST_ASSERT(i+(tmp_size-i)+(std::max)(d,(std::streamsize)0) == w);
+ BOOST_ASSERT(res.size() == (std::size_t)w);
}
}
}
- clear_buffer( oss_);
+ buf.clear_buffer();
} // end- put(..)
-} // local namespace
-
-
- template< class Ch, class Tr, class T>
- void distribute(basic_format<Ch,Tr>& self, T x) {
+ template< class Ch, class Tr, class Alloc, class T>
+ void distribute (basic_format<Ch,Tr, Alloc>& 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
+ boost::throw_exception(too_many_args(self.cur_arg_, self.num_args_));
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_ );
+ put<Ch, Tr, Alloc, T> (x, self.items_[i], self.items_[i].res_,
+ self.buf_, boost::get_pointer(self.loc_) );
}
}
}
- template<class Ch, class Tr, class T>
- basic_format<Ch, Tr>& feed(basic_format<Ch,Tr>& self, T x) {
+ template<class Ch, class Tr, class Alloc, class T>
+ basic_format<Ch, Tr, Alloc>&
+ feed (basic_format<Ch,Tr, Alloc>& self, T x) {
if(self.dumped_) self.clear();
- distribute<Ch, Tr, T> (self, x);
+ distribute<Ch, Tr, Alloc, T> (self, x);
++self.cur_arg_;
if(self.bound_.size() != 0) {
while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] )
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// format_class.hpp : class interface
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+// See http://www.boost.org/libs/format for library home page
-// ------------------------------------------------------------------------------
-// format_class.hpp : class interface
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_CLASS_HPP
#define BOOST_FORMAT_CLASS_HPP
#include <vector>
#include <string>
+#include <boost/optional.hpp> // to store locale when needed
+
#include <boost/format/format_fwd.hpp>
#include <boost/format/internals_fwd.hpp>
#include <boost/format/internals.hpp>
-#include <boost/format/outsstream.hpp>
+#include <boost/format/alt_sstream.hpp>
namespace boost {
- template<class Ch, class Tr>
+ template<class Ch, class Tr, class Alloc>
class basic_format
{
+ typedef typename io::CompatTraits<Tr>::compatible_type compat_traits;
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 io::basic_outsstream<Ch, Tr> internal_stream_t;
+ typedef Ch CharT; // borland fails in operator% if we use Ch and Tr directly
+ typedef std::basic_string<Ch, Tr, Alloc> string_type;
+ typedef typename string_type::size_type size_type;
+ typedef io::detail::format_item<Ch, Tr, Alloc> format_item_t;
+ typedef io::basic_altstringbuf<Ch, Tr, Alloc> internal_streambuf_t;
+
explicit basic_format(const Ch* str=NULL);
- explicit basic_format(const string_t& s);
-#ifndef BOOST_NO_STD_LOCALE
- explicit basic_format(const Ch* str, const std::locale & loc);
- explicit basic_format(const string_t& s, const std::locale & loc);
-#endif
+ explicit basic_format(const string_type& s);
basic_format(const basic_format& x);
basic_format& operator= (const basic_format& x);
void swap(basic_format& x);
- basic_format& clear(); // empty all converted string buffers (except bound items)
+#if !defined(BOOST_NO_STD_LOCALE)
+ explicit basic_format(const Ch* str, const std::locale & loc);
+ explicit basic_format(const string_type& s, const std::locale & loc);
+#endif
+ io::detail::locale_t getloc() const;
+
+ 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
+ basic_format& parse(const string_type&); // resets buffers and parse a new format string
+
+ // ** formatted result ** //
+ size_type size() const; // sum of the current string pieces sizes
+ string_type str() const; // final string
- // pass arguments through those operators :
+ // ** arguments passing ** //
template<class T>
basic_format& operator%(const T& x)
- { return io::detail::feed<CharT, Traits, const T&>(*this,x); }
+ { return io::detail::feed<CharT, Tr, Alloc, 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); }
+ { return io::detail::feed<CharT, Tr, Alloc, T&>(*this,x); }
#endif
- // modifying a format object
+
+ // ** object modifying **//
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);}
+ { return io::detail::modify_item_body<Ch,Tr, Alloc, 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& );
-#else
- operator<< <Ch, Tr> (BOOST_IO_STD basic_ostream<Ch, Tr>&, const basic_format&);
-#endif
-
#if !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS ) \
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x570) \
- && !BOOST_WORKAROUND( _CRAYC, != 0)
+ && !BOOST_WORKAROUND( _CRAYC, != 0) \
+ && !BOOST_WORKAROUND(__DECCXX_VER, <= 60590041)
// 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&);
+
+#ifndef BOOST_NO_TEMPLATE_STD_STREAM
+ template<class Ch2, class Tr2, class Alloc2>
+ friend std::basic_ostream<Ch2, Tr2> &
+ operator<<( std::basic_ostream<Ch2, Tr2> & ,
+ const basic_format<Ch2, Tr2, Alloc2>& );
+#else
+ template<class Ch2, class Tr2, class Alloc2>
+ friend std::ostream &
+ operator<<( std::ostream & ,
+ const basic_format<Ch2, Tr2, Alloc2>& );
+#endif
+
+ template<class Ch2, class Tr2, class Alloc2, class T>
+ friend basic_format<Ch2, Tr2, Alloc2>&
+ io::detail::feed (basic_format<Ch2, Tr2, Alloc2>&, T);
+
+ template<class Ch2, class Tr2, class Alloc2, class T> friend
+ void io::detail::distribute (basic_format<Ch2, Tr2, Alloc2>&, T);
+
+ template<class Ch2, class Tr2, class Alloc2, class T> friend
+ basic_format<Ch2, Tr2, Alloc2>&
+ io::detail::modify_item_body (basic_format<Ch2, Tr2, Alloc2>&, int, T);
+
+ template<class Ch2, class Tr2, class Alloc2, class T> friend
+ basic_format<Ch2, Tr2, Alloc2>&
+ io::detail::bind_arg_body (basic_format<Ch2, Tr2, Alloc2>&, int, const T&);
private:
#endif
- 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
+ // member data --------------------------------------------//
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 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.
+ string_type prefix_; // piece of string to insert before first item
unsigned char exceptions_;
+ internal_streambuf_t buf_; // the internal stream buffer.
+ boost::optional<io::detail::locale_t> loc_;
}; // class basic_format
} // namespace boost
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// format_fwd.hpp : forward declarations
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+// See http://www.boost.org/libs/format for library home page
-// ------------------------------------------------------------------------------
-// format_fwd.hpp : forward declarations, for primary header format.hpp
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_FWD_HPP
#define BOOST_FORMAT_FWD_HPP
#include <string>
#include <iosfwd>
-#include <boost/format/detail/config_macros.hpp>
+#include <boost/format/detail/compat_workarounds.hpp>
namespace boost {
template <class Ch,
-#if !( BOOST_WORKAROUND(__GNUC__, <3) && defined(__STL_CONFIG_H) )
- class Tr = BOOST_IO_STD char_traits<Ch> >
+#if !( BOOST_WORKAROUND(__GNUC__, <3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) )
+ // gcc-2.95's native stdlid needs special treatment
+ class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
#else
- class Tr = std::string_char_traits<Ch> >
+ class Tr = std::string_char_traits<Ch>, class Alloc = std::alloc >
#endif
class basic_format;
typedef basic_format<char > format;
-
#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
+ && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM)
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 {
- 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 {
+ 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>&);
-
+ } // namespace io
} // namespace boost
-// -*- 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
-
// ----------------------------------------------------------------------------
// format_implementation.hpp Implementation of the basic_format class
// ----------------------------------------------------------------------------
+// Copyright Samuel Krempp 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/format for library home page
+
+
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_IMPLEMENTATION_HPP
#define BOOST_FORMAT_IMPLEMENTATION_HPP
+#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/assert.hpp>
#include <boost/format/format_class.hpp>
namespace boost {
-// -------- format:: -------------------------------------------
- template< class Ch, class Tr>
- basic_format<Ch, Tr>:: basic_format(const Ch* str)
+// --- basic_format implementation -----------------------------------------//
+
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch, Tr, Alloc>:: basic_format(const Ch* str)
: style_(0), cur_arg_(0), num_args_(0), dumped_(false),
exceptions_(io::all_error_bits)
{
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)
+#if !defined(BOOST_NO_STD_LOCALE)
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch, Tr, Alloc>:: basic_format(const Ch* str, const std::locale & loc)
: style_(0), cur_arg_(0), num_args_(0), dumped_(false),
- exceptions_(io::all_error_bits)
+ loc_(loc), 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)
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch, Tr, Alloc>:: basic_format(const string_type& s, const std::locale & loc)
: style_(0), cur_arg_(0), num_args_(0), dumped_(false),
- exceptions_(io::all_error_bits)
+ loc_(loc), exceptions_(io::all_error_bits)
{
- oss_.imbue( loc );
parse(s);
}
-#endif //BOOST_NO_STD_LOCALE
+#endif // ! BOOST_NO_STD_LOCALE
+ template< class Ch, class Tr, class Alloc>
+ io::detail::locale_t basic_format<Ch, Tr, Alloc>::
+ getloc() const {
+ return loc_ ? loc_.get() : io::detail::locale_t();
+ }
- template< class Ch, class Tr>
- basic_format<Ch, Tr>:: basic_format(const string_t& s)
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch, Tr, Alloc>:: basic_format(const string_type& s)
: style_(0), cur_arg_(0), num_args_(0), dumped_(false),
exceptions_(io::all_error_bits)
{
parse(s);
}
- 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_)
- {
- }
+ template< class Ch, class Tr, class Alloc> // just don't copy the buf_ member
+ basic_format<Ch, Tr, Alloc>:: 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_), loc_(x.loc_)
+ {
+ }
- template< class Ch, class Tr>
- void basic_format<Ch, Tr>:: swap (basic_format & x) {
+ template< class Ch, class Tr, class Alloc> // just don't copy the buf_ member
+ basic_format<Ch, Tr, Alloc>& basic_format<Ch, Tr, Alloc>::
+ operator= (const basic_format& x) {
+ if(this == &x)
+ return *this;
+ (basic_format<Ch, Tr, Alloc>(x)).swap(*this);
+ return *this;
+ }
+ template< class Ch, class Tr, class Alloc>
+ void basic_format<Ch, Tr, Alloc>::
+ swap (basic_format & x) {
std::swap(exceptions_, x.exceptions_);
std::swap(style_, x.style_);
std::swap(cur_arg_, x.cur_arg_);
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 {
+ template< class Ch, class Tr, class Alloc>
+ unsigned char basic_format<Ch,Tr, Alloc>:: exceptions() const {
return exceptions_;
}
- template< class Ch, class Tr>
- unsigned char basic_format<Ch,Tr>:: exceptions(unsigned char newexcept) {
+ template< class Ch, class Tr, class Alloc>
+ unsigned char basic_format<Ch,Tr, Alloc>:: 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(' ');
+ template<class Ch, class Tr, class Alloc>
+ void basic_format<Ch, Tr, Alloc>::
+ make_or_reuse_data (std::size_t nbitems) {
+#if !defined(BOOST_NO_STD_LOCALE)
+ Ch fill = ( BOOST_USE_FACET(std::ctype<Ch>, getloc()) ). widen(' ');
+#else
+ Ch fill = ' ';
+#endif
if(items_.size() == 0)
items_.assign( nbitems, format_item_t(fill) );
else {
+ if(nbitems>items_.size())
+ items_.resize(nbitems, format_item_t(fill));
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
+ items_[i].reset(fill); // strings are resized, instead of reallocated
}
}
- template< class Ch, class Tr>
- basic_format<Ch,Tr>& basic_format<Ch,Tr>:: clear() {
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch,Tr, Alloc>& basic_format<Ch,Tr, Alloc>::
+ clear () {
// empty the string buffers (except bound arguments)
// and make the format object ready for formatting a new set of arguments
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);
+ 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_;
+ for(; 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() {
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch,Tr, Alloc>& basic_format<Ch,Tr, Alloc>::
+ 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) {
+ template< class Ch, class Tr, class Alloc>
+ basic_format<Ch,Tr, Alloc>& basic_format<Ch,Tr, Alloc>::
+ 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.
+ if( exceptions() & io::out_of_range_bit)
+ boost::throw_exception(io::out_of_range(argN, 1, num_args_+1 ) );
else return *this;
}
bound_[argN-1]=false;
return *this;
}
-
-
- template< class Ch, class Tr>
- std::basic_string<Ch,Tr> basic_format<Ch,Tr>:: str() const {
- dumped_=true;
+ template< class Ch, class Tr, class Alloc>
+ typename basic_format<Ch, Tr, Alloc>::string_type
+ basic_format<Ch,Tr, Alloc>::
+ str () const {
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
+ // not enough variables supplied
+ boost::throw_exception(io::too_few_args(cur_arg_, num_args_));
+
unsigned long i;
- string_t res;
+ string_type res;
res.reserve(size());
res += prefix_;
for(i=0; i < items_.size(); ++i) {
}
res += item.appendix_;
}
+ dumped_=true;
return res;
}
- template< class Ch, class Tr>
- typename basic_format<Ch, Tr>::size_type basic_format<Ch,Tr>::
+ template< class Ch, class Tr, class Alloc>
+ typename basic_format<Ch, Tr, Alloc>::size_type basic_format<Ch,Tr, Alloc>::
size () const {
+ BOOST_USING_STD_MAX();
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 = max BOOST_PREVENT_MACRO_SUBSTITUTION (sz, item.fmtstate_.width_);
sz += + item.appendix_.size();
}
- return static_cast<size_type> (sz);
+ return static_cast<typename string_type::size_type> (sz);
}
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) {
+ template<class Ch, class Tr, class Alloc, class T>
+ basic_format<Ch, Tr, Alloc>&
+ bind_arg_body (basic_format<Ch, Tr, Alloc>& 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.
+ boost::throw_exception(io::out_of_range(argN, 1, self.num_args_+1 ) );
else return self;
}
if(self.bound_.size()==0)
return self;
}
- template<class Ch, class Tr, class T>
- basic_format<Ch, Tr>& modify_item_body( basic_format<Ch, Tr>& self,
- int itemN, T manipulator) {
+ template<class Ch, class Tr, class Alloc, class T> basic_format<Ch, Tr, Alloc>&
+ modify_item_body (basic_format<Ch, Tr, Alloc>& 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.
+ boost::throw_exception(io::out_of_range(itemN, 1, self.items_.size() ));
else return self;
}
self.items_[itemN-1].fmtstate_. template apply_manip<T> ( manipulator );
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// free_funcs.hpp : implementation of the free functions of boost::format
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+// See http://www.boost.org/libs/format for library home page
-// ------------------------------------------------------------------------------
-// free_funcs.hpp : implementation of the free functions declared in namespace format
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_FUNCS_HPP
#define BOOST_FORMAT_FUNCS_HPP
namespace boost {
- template<class Ch, class Tr> inline
- std::basic_string<Ch, Tr> str(const basic_format<Ch, Tr>& f) {
+ template<class Ch, class Tr, class Alloc> inline
+ std::basic_string<Ch, Tr, Alloc> str(const basic_format<Ch, Tr, Alloc>& f) {
// adds up all pieces of strings and converted items, and return the formatted string
return f.str();
}
+ namespace io {
+ using ::boost::str; // keep compatibility with when it was defined in this N.S.
+ } // - namespace io
-
- 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
+#ifndef BOOST_NO_TEMPLATE_STD_STREAM
+ template<class Ch, class Tr, class Alloc>
+ std::basic_ostream<Ch, Tr> &
+ operator<<( std::basic_ostream<Ch, Tr> & os,
+ const basic_format<Ch, Tr, Alloc>& f)
+#else
+ template<class Ch, class Tr, class Alloc>
+ std::ostream &
+ operator<<( std::ostream & os,
+ const basic_format<Ch, Tr, Alloc>& f)
+#endif
+ // effect: "return os << str(f);" but we can do it faster
{
- typedef boost::basic_format<Ch, Tr> format_t;
+ typedef boost::basic_format<Ch, Tr, Alloc> 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
+ // not enough variables supplied
+ boost::throw_exception(io::too_few_args(f.cur_arg_, f.num_args_));
if(f.style_ & format_t::special_needs)
os << f.str();
else {
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// group.hpp : encapsulates a group of manipulators along with an argument
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream
+// See http://www.boost.org/libs/format for library home page
// ----------------------------------------------------------------------------
-// group.hpp : encapsulates a group of manipulators along with an argument
-//
+
// group_head : cut the last element of a group out.
// (is overloaded below on each type of group)
// group_last : returns the last element of a group
// (is overloaded below on each type of group)
-
// ----------------------------------------------------------------------------
}
-#endif //end- #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
+#endif // - BOOST_NO_OVERLOAD_FOR_NON_CONST
} // namespace io
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// internals.hpp : internal structs : stream_format_state, format_item.
+// included by format.hpp
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream
+// See http://www.boost.org/libs/format for library home page
// ----------------------------------------------------------------------------
-// internals.hpp : internal structs. included by format.hpp
-// stream_format_state, and format_item
-// ----------------------------------------------------------------------------
-
#ifndef BOOST_FORMAT_INTERNALS_HPP
#define BOOST_FORMAT_INTERNALS_HPP
#include <string>
-
#include <boost/assert.hpp>
-#include <boost/format/outsstream.hpp>
+#include <boost/optional.hpp>
#include <boost/limits.hpp>
+#include <boost/format/detail/compat_workarounds.hpp>
+#include <boost/format/alt_sstream.hpp> // used as a dummy stream
namespace boost {
namespace io {
namespace detail {
-//----- stream_format_state --------------------------------------------------//
+//---- stream_format_state --------------------------------------------------//
// set of params that define the format state of a stream
template<class Ch, class Tr>
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); }
+// 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
+ void apply_on(basic_ios & os, //- applies format_state to the stream
+ boost::io::detail::locale_t * loc_default = 0) const;
template<class T>
void apply_manip(T manipulator) //- modifies state by applying manipulator
{ apply_manip_body<Ch, Tr, T>( *this, manipulator) ; }
std::ios_base::fmtflags flags_;
std::ios_base::iostate rdstate_;
std::ios_base::iostate exceptions_;
+ boost::optional<boost::io::detail::locale_t> loc_;
};
-//----- format_item ---------------------------------------------------------//
+//---- format_item ---------------------------------------------------------//
// stores all parameters that can be specified in format strings
- template<class Ch, class Tr>
+ template<class Ch, class Tr, class Alloc>
struct format_item
{
enum pad_values { zeropad = 1, spacepad =2, centered=4, tabulation = 8 };
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_ios<Ch, Tr> basic_ios;
+ typedef detail::stream_format_state<Ch, Tr> stream_format_state;
+ typedef ::std::basic_string<Ch, Tr, Alloc> string_type;
format_item(Ch fill) :argN_(argN_no_posit), fmtstate_(fill),
truncate_(max_streamsize()), pad_scheme_(0) {}
void compute_states(); // sets states according to truncate and pad_scheme.
static std::streamsize max_streamsize() {
- return std::numeric_limits<std::streamsize>::max();
+ 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
+ string_type res_; //- result of the formatting of this item
+ string_type appendix_; //- piece of string between this item and the next
stream_format_state fmtstate_;// set by parsing, is only affected by modify_item
- std::streamsize truncate_; //- is set for directives like %.5s that ask truncation
+ std::streamsize truncate_;//- is set for directives like %.5s that ask truncation
unsigned int pad_scheme_;//- several possible padding schemes can mix. see pad_values
};
-//---- Definitions ------------------------------------------------------------
+//--- Definitions ------------------------------------------------------------
-// --- stream_format_state:: -------------------------------------------------
+// - stream_format_state:: -------------------------------------------------
template<class Ch, class Tr>
- void stream_format_state<Ch,Tr>:: apply_on(basic_ios & os) const {
+ void stream_format_state<Ch,Tr>:: apply_on (basic_ios & os,
+ boost::io::detail::locale_t * loc_default) const {
// set the state of this stream according to our params
if(width_ != -1)
os.width(width_);
os.flags(flags_);
os.clear(rdstate_);
os.exceptions(exceptions_);
+#if !defined(BOOST_NO_STD_LOCALE)
+ if(loc_)
+ os.imbue(loc_.get());
+ else if(loc_default)
+ os.imbue(*loc_default);
+#endif
}
template<class Ch, class Tr>
void apply_manip_body( stream_format_state<Ch, Tr>& self,
T manipulator) {
// modify our params according to the manipulator
- basic_outsstream<Ch, Tr> ss;
+ basic_oaltstringstream<Ch, Tr> ss;
self.apply_on( ss );
ss << manipulator;
self.set_by_stream( ss );
// --- format_item:: --------------------------------------------------------
- template<class Ch, class Tr>
- void format_item<Ch, Tr>::
- reset(Ch fill) {
+ template<class Ch, class Tr, class Alloc>
+ void format_item<Ch, Tr, Alloc>::
+ 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() {
+ template<class Ch, class Tr, class Alloc>
+ void format_item<Ch, Tr, Alloc>::
+ compute_states() {
// reflect pad_scheme_ on fmt_state_
// because some pad_schemes has complex consequences on several state params.
if(pad_scheme_ & zeropad) {
-// -*- C++ -*-
-// Boost general library 'format' ---------------------------
-// See http://www.boost.org for updates, documentation, and revision history.
+// ----------------------------------------------------------------------------
+// internals_fwd.hpp : forward declarations, for internal headers
+// ----------------------------------------------------------------------------
-// (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.
+// Copyright Samuel Krempp 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)
-// ideas taken from Rüdiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
+// See http://www.boost.org/libs/format for library home page
-// ------------------------------------------------------------------------------
-// internals_fwd.hpp : forward declarations, for internal headers
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_INTERNAL_FWD_HPP
#define BOOST_FORMAT_INTERNAL_FWD_HPP
namespace detail {
template<class Ch, class Tr> struct stream_format_state;
- template<class Ch, class Tr> struct format_item;
-}
+ template<class Ch, class Tr, class Alloc> struct format_item;
-namespace detail {
-
// these functions were intended as methods,
// but MSVC have problems with template member functions :
-
// 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, T manipulator);
+ template<class Ch, class Tr, class Alloc, class T>
+ basic_format<Ch, Tr, Alloc>&
+ modify_item_body (basic_format<Ch, Tr, Alloc>& self,
+ int itemN, T manipulator);
- template<class Ch, class Tr, class T>
- basic_format<Ch, Tr>& bind_arg_body( basic_format<Ch, Tr>& self,
- int argN, const T& val);
+ template<class Ch, class Tr, class Alloc, class T>
+ basic_format<Ch, Tr, Alloc>&
+ bind_arg_body (basic_format<Ch, Tr, Alloc>& self,
+ int argN, const T& val);
+ // in internals.hpp :
template<class Ch, class Tr, class T>
- void apply_manip_body( stream_format_state<Ch, Tr>& self,
+ void apply_manip_body (stream_format_state<Ch, Tr>& self,
T manipulator);
- // argument feeding (defined in feed_args.hpp ) :
- template<class Ch, class Tr, class T>
- void distribute(basic_format<Ch,Tr>& self, T x);
+ // argument feeding (defined in feed_args.hpp ) :
+ template<class Ch, class Tr, class Alloc, class T>
+ void distribute (basic_format<Ch,Tr, Alloc>& self, T x);
- template<class Ch, class Tr, class T>
- basic_format<Ch, Tr>& feed(basic_format<Ch,Tr>& self, T x);
+ template<class Ch, class Tr, class Alloc, class T>
+ basic_format<Ch, Tr, Alloc>&
+ feed (basic_format<Ch,Tr, Alloc>& self, T x);
} // namespace detail
+++ /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
-// -*- 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 Rudiger Loos's format class
-// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing)
-
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// parsing.hpp : implementation of the parsing member functions
// ( parse, parse_printf_directive)
-// ------------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+
+// Copyright Samuel Krempp 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/format for library home page
+// ----------------------------------------------------------------------------
#ifndef BOOST_FORMAT_PARSING_HPP
#define BOOST_FORMAT_PARSING_HPP
namespace io {
namespace detail {
- template<class Ch, class Stream> inline
- bool wrap_isdigit(Ch c, Stream &os) {
+#if defined(BOOST_NO_STD_LOCALE)
+ // streams will be used for narrow / widen. but these methods are not const
+ template<class T>
+ T& const_or_not(const T& x) {
+ return const_cast<T&> (x);
+ }
+#else
+ template<class T>
+ const T& const_or_not(const T& x) {
+ return x;
+ }
+#endif
+
+ template<class Ch, class Facet> inline
+ char wrap_narrow(const Facet& fac, Ch c, char deflt) {
+ return const_or_not(fac).narrow(c, deflt);
+ }
+
+ template<class Ch, class Facet> inline
+ bool wrap_isdigit(const Facet& fac, Ch c) {
#if ! defined( BOOST_NO_LOCALE_ISIDIGIT )
- return std::isdigit(c, os.rdbuf()->getloc() );
+ return fac.is(std::ctype<Ch>::digit, c);
# else
using namespace std;
return isdigit(c);
#endif
- } //end- wrap_isdigit(..)
+ }
- template<class Iter, class Stream>
- Iter wrap_scan_notdigit(Iter beg, Iter end, const Stream & os) {
+ template<class Iter, class Facet>
+ Iter wrap_scan_notdigit(const Facet & fac, Iter beg, Iter end) {
using namespace std;
- for( ; beg!=end && wrap_isdigit(*beg,os); ++beg) ;
+ for( ; beg!=end && wrap_isdigit(fac, *beg); ++beg) ;
return beg;
}
- 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
+ // Input : [start, last) iterators range and a
+ // a Facet to use its widen/narrow member function
+ // Effects : read sequence and convert digits into integral n, of type Res
+ // Returns : n
+ template<class Res, class Iter, class Facet>
+ Iter str2int (const Iter & start, const Iter & last, Res & res,
+ const Facet& fac)
{
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.
+ for(it=start; it != last && wrap_isdigit(fac, *it); ++it ) {
+ char cur_ch = wrap_narrow(fac, *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
+ // skip printf's "asterisk-fields" directives in the format-string buf
+ // Input : char string, with starting index *pos_p
+ // a Facet merely to use its widen/narrow member function
+ // Effects : advance *pos_p by skipping printf's asterisk fields.
+ // Returns : nothing
+ template<class Iter, class Facet>
+ Iter skip_asterisk(Iter start, Iter last, const Facet& fac)
{
using namespace std;
++ start;
- start = wrap_scan_notdigit(start, last, os);
- if(start!=last && *start== os.widen('$') )
+ start = wrap_scan_notdigit(fac, start, last);
+ if(start!=last && *start== const_or_not(fac).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.
+ // auxiliary func called by parse_printf_directive
+ // for centralising error handling
+ // it either throws if user sets the corresponding flag, or does nothing.
+ inline void maybe_throw_exception(unsigned char exceptions,
+ std::size_t pos, std::size_t size)
{
if(exceptions & io::bad_format_string_bit)
- boost::throw_exception(io::bad_format_string());
+ boost::throw_exception(io::bad_format_string(pos, size) );
}
-
- template<class Ch, class Tr, class Iter, class Stream>
+ // Input: the position of a printf-directive in the format-string
+ // a basic_ios& merely to use its widen/narrow member function
+ // a bitset'exceptions' telling whether to throw exceptions on errors.
+ // Returns:
+ // true if parse succeeded (ignore some errors if exceptions disabled)
+ // false if it failed so bad that the directive should be printed verbatim
+ // Effects:
+ // start is incremented so that *start is the first char after
+ // this directive
+ // *fpar is set with the parameters read in the directive
+ template<class Ch, class Tr, class Alloc, class Iter, class Facet>
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
+ detail::format_item<Ch, Tr, Alloc> * fpar,
+ const Facet& fac,
+ std::size_t offset, unsigned char exceptions)
{
- typedef format_item<Ch, Tr> format_item_t;
- //BOOST_ASSERT( pos_p != 0);
+ typedef typename basic_format<Ch, Tr, Alloc>::format_item_t format_item_t;
fpar->argN_ = format_item_t::argN_no_posit; // if no positional-directive
bool precision_set = false;
bool in_brackets=false;
- if(*start== os.widen('|')) {
+ Iter start0 = start;
+ std::size_t fstring_size = last-start0+offset;
+ if(*start== const_or_not(fac).widen( '|')) {
in_brackets=true;
if( ++start >= last ) {
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0 + offset, fstring_size);
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'))
+ if(*start== const_or_not(fac).widen( '0'))
goto parse_flags;
// handle argument order (%2$d) or possibly width specification: %2d
- if(wrap_isdigit(*start, os)) {
+ if(wrap_isdigit(fac, *start)) {
int n;
- start = str2int(start, last, n, os);
+ start = str2int(start, last, n, fac);
if( start >= last ) {
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
return false;
}
// %N% case : this is already the end of the directive
- if( *start == os.widen('%') ) {
+ if( *start == const_or_not(fac).widen( '%') ) {
fpar->argN_ = n-1;
++start;
if( in_brackets)
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
// but don't return. maybe "%" was used in lieu of '$', so we go on.
else
return true;
}
- if ( *start== os.widen('$') ) {
+ if ( *start== const_or_not(fac).widen( '$') ) {
fpar->argN_ = n-1;
++start;
}
// handle flags
while ( start != last) { // as long as char is one of + - = _ # 0 l h or ' '
// misc switches
- switch ( os.narrow(*start, 0)) {
+ switch ( wrap_narrow(fac, *start, 0)) {
case '\'' : break; // no effect yet. (painful to implement)
case 'l':
case 'h': // short/long modifier : for printf-comaptibility (no action needed)
} // loop on flag.
if( start>=last) {
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
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);
+ if(*start == const_or_not(fac).widen( '*') )
+ start = skip_asterisk(start, last, fac);
+ if(start!=last && wrap_isdigit(fac, *start))
+ start = str2int(start, last, fpar->fmtstate_.width_, fac);
parse_precision:
if( start>= last) {
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
return true;
}
// handle precision spec
- if (*start== os.widen('.')) {
+ if (*start== const_or_not(fac).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);
+ if(start != last && *start == const_or_not(fac).widen( '*') )
+ start = skip_asterisk(start, last, fac);
+ if(start != last && wrap_isdigit(fac, *start)) {
+ start = str2int(start, last, fpar->fmtstate_.precision_, fac);
precision_set = true;
}
else
}
// handle formatting-type flags :
- while( start != last &&
- ( *start== os.widen('l') || *start== os.widen('L') || *start== os.widen('h')) )
+ while( start != last && ( *start== const_or_not(fac).widen( 'l')
+ || *start== const_or_not(fac).widen( 'L')
+ || *start== const_or_not(fac).widen( 'h')) )
++start;
if( start>=last) {
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
return true;
}
- if( in_brackets && *start== os.widen('|') ) {
+ if( in_brackets && *start== const_or_not(fac).widen( '|') ) {
++start;
return true;
}
- switch ( os.narrow(*start, 0) ) {
+ switch ( wrap_narrow(fac, *start, 0) ) {
case 'X':
fpar->fmtstate_.flags_ |= std::ios_base::uppercase;
case 'p': // pointer => set hex.
case 'T':
++start;
if( start >= last)
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
else
fpar->fmtstate_.fill_ = *start;
fpar->pad_scheme_ |= format_item_t::tabulation;
fpar->argN_ = format_item_t::argN_tabulation;
break;
case 't':
- fpar->fmtstate_.fill_ = os.widen(' ');
+ fpar->fmtstate_.fill_ = const_or_not(fac).widen( ' ');
fpar->pad_scheme_ |= format_item_t::tabulation;
fpar->argN_ = format_item_t::argN_tabulation;
break;
fpar->argN_ = format_item_t::argN_ignored;
break;
default:
- maybe_throw_exception(exceptions);
+ maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
}
++start;
if( in_brackets ) {
- if( start != last && *start== os.widen('|') ) {
+ if( start != last && *start== const_or_not(fac).widen( '|') ) {
++start;
return true;
}
- else maybe_throw_exception(exceptions);
+ else maybe_throw_exception(exceptions, start-start0+offset, fstring_size);
}
return true;
}
+ // -end parse_printf_directive()
-
- 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) {
+ template<class String, class Facet>
+ int upper_bound_from_fstring(const String& buf,
+ const typename String::value_type arg_mark,
+ const Facet& fac,
+ 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;
+ using namespace boost::io;
+ typename String::size_type i1=0;
int num_items=0;
- while( (i1=buf.find(arg_mark,i1)) != string_t::npos ) {
+ while( (i1=buf.find(arg_mark,i1)) != String::npos ) {
if( i1+1 >= buf.size() ) {
- if(exceptions & io::bad_format_string_bit)
- boost::throw_exception(io::bad_format_string()); // must not end in ".. %"
+ if(exceptions & bad_format_string_bit)
+ boost::throw_exception(bad_format_string(i1, buf.size() )); // must not end in ".. %"
else break; // stop there, ignore last '%'
}
if(buf[i1+1] == buf[i1] ) {// escaped "%%"
++i1;
// in case of %N% directives, dont count it double (wastes allocations..) :
- i1 = wrap_scan_notdigit(buf.begin()+i1, buf.end(), os) - buf.begin();
+ i1 = detail::wrap_scan_notdigit(fac, buf.begin()+i1, buf.end()) - buf.begin();
if( i1 < buf.size() && buf[i1] == arg_mark )
++i1;
++num_items;
}
return num_items;
}
+ template<class String> inline
+ void append_string(String& dst, const String& src,
+ const typename String::size_type beg,
+ const typename String::size_type end) {
+#if !defined(BOOST_NO_STRING_APPEND)
+ dst.append(src.begin()+beg, src.begin()+end);
+#else
+ dst += src.substr(beg, end-beg);
+#endif
+ }
+
} // detail namespace
} // io namespace
// -----------------------------------------------
// format :: parse(..)
- template<class Ch, class Tr>
- basic_format<Ch, Tr>& basic_format<Ch, Tr>:: parse(const string_t& buf) {
+ template<class Ch, class Tr, class Alloc>
+ basic_format<Ch, Tr, Alloc>& basic_format<Ch, Tr, Alloc>::
+ parse (const string_type& buf) {
// parse the format-string
using namespace std;
-
-
- const Ch arg_mark = oss_.widen('%');
+#if !defined(BOOST_NO_STD_LOCALE)
+ const std::ctype<Ch> & fac = BOOST_USE_FACET( std::ctype<Ch>, getloc());
+#else
+ io::basic_oaltstringstream<Ch, Tr, Alloc> fac;
+ //has widen and narrow even on compilers without locale
+#endif
+
+ const Ch arg_mark = io::detail::const_or_not(fac).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());
+ int num_items = io::detail::upper_bound_from_fstring(buf, arg_mark, fac, 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;
+ typename string_type::size_type i0=0, i1=0;
+ typename string_type::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_;
+ while( (i1=buf.find(arg_mark,i1)) != string_type::npos ) {
+ string_type & 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);
+ io::detail::append_string(piece, buf, i0, i1+1);
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);
+ io::detail::append_string(piece, buf, i0, i1);
++i1;
it = buf.begin()+i1;
bool parse_ok = io::detail::parse_printf_directive(
- it, buf.end(), &items_[cur_item], oss_, exceptions());
+ it, buf.end(), &items_[cur_item], fac, i1, exceptions());
i1 = it - buf.begin();
if( ! parse_ok ) // the directive will be printed verbatim
continue;
// store the final piece of string
{
- string_t & piece = (cur_item==0) ? prefix_ : items_[cur_item-1].appendix_;
- piece += buf.substr(i0);
+ string_type & piece = (cur_item==0) ? prefix_ : items_[cur_item-1].appendix_;
+ io::detail::append_string(piece, buf, i0, buf.size());
}
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());
+ boost::throw_exception(io::bad_format_string(max_argN, 0));
// else do nothing. => positionnal arguments are processed as non-positionnal
}
// set things like it would have been with positional directives :
}
// C: set some member data :
- items_.resize(num_items, format_item_t(oss_.fill()) );
+ items_.resize(num_items, format_item_t(io::detail::const_or_not(fac).widen( ' ')) );
if(special_things) style_ |= special_needs;
num_args_ = max_argN + 1;
// Boost.Function library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2003. Use, modification and
+// Copyright Douglas 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)
#
# Boost.Function library
#
-# Copyright (C) 2001-2003 Doug Gregor (gregod@cs.rpi.edu)
+# Copyright (C) 2001-2003 Douglas Gregor (gregod@cs.rpi.edu)
#
# Permission to copy, use, sell and distribute this software is granted
# provided this copyright notice appears in all copies.
// Boost.Function library
-// Copyright Doug Gregor 2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2002-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Function library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
#include <string>
#include <memory>
#include <new>
+#include <typeinfo>
#include <boost/config.hpp>
#include <boost/assert.hpp>
-#include <boost/type_traits/arithmetic_traits.hpp>
+#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/composite_traits.hpp>
#include <boost/type_traits/is_stateless.hpp>
#include <boost/ref.hpp>
#include <boost/pending/ct_if.hpp>
#include <boost/detail/workaround.hpp>
-
#ifndef BOOST_NO_SFINAE
# include "boost/utility/enable_if.hpp"
+#else
+# include "boost/mpl/bool.hpp"
+#endif
+#include <boost/function_equal.hpp>
+
+// Borrowed from Boost.Python library: determines the cases where we
+// need to use std::type_info::name to compare instead of operator==.
+# if (defined(__GNUC__) && __GNUC__ >= 3) \
+ || defined(_AIX) \
+ || ( defined(__sgi) && defined(__host_mips))
+# include <cstring>
+# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) \
+ (std::strcmp((X).name(),(Y).name()) == 0)
+# else
+# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
#endif
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
#endif
+#define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
+ typename ::boost::enable_if_c<(::boost::type_traits::ice_not< \
+ (::boost::is_integral<Functor>::value)>::value), \
+ Type>::type
+
+
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
namespace boost {
// The operation type to perform on the given functor/function pointer
enum functor_manager_operation_type {
clone_functor_tag,
- destroy_functor_tag
+ destroy_functor_tag,
+ check_functor_type_tag
};
// Tags used to decide between different types of functions
// The trivial manager does nothing but return the same pointer (if we
// are cloning) or return the null pointer (if we are deleting).
- inline any_pointer trivial_manager(any_pointer f,
- functor_manager_operation_type op)
+ template<typename F>
+ struct trivial_manager
{
- if (op == clone_functor_tag)
- return f;
- else
+ static inline any_pointer
+ get(any_pointer f, functor_manager_operation_type op)
+ {
+ switch (op) {
+ case clone_functor_tag: return f;
+
+ case destroy_functor_tag:
+ return make_any_pointer(reinterpret_cast<void*>(0));
+
+ case check_functor_type_tag:
+ {
+ std::type_info* t = static_cast<std::type_info*>(f.obj_ptr);
+ return BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(F), *t)?
+ f
+ : make_any_pointer(reinterpret_cast<void*>(0));
+ }
+ }
+
+ // Clears up a warning with GCC 3.2.3
return make_any_pointer(reinterpret_cast<void*>(0));
- }
+ }
+ };
/**
* The functor_manager class contains a static function "manage" which
static any_pointer
manage(any_pointer functor_ptr, functor_manager_operation_type op)
{
- typedef typename get_function_tag<functor_type>::type tag_type;
- return manager(functor_ptr, op, tag_type());
+ if (op == check_functor_type_tag) {
+ std::type_info* type =
+ static_cast<std::type_info*>(functor_ptr.obj_ptr);
+ return (BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(Functor), *type)?
+ functor_ptr
+ : make_any_pointer(reinterpret_cast<void*>(0)));
+ }
+ else {
+ typedef typename get_function_tag<functor_type>::type tag_type;
+ return manager(functor_ptr, op, tag_type());
+ }
}
};
// A type that is only used for comparisons against zero
struct useless_clear_type {};
+
+#ifdef BOOST_NO_SFINAE
+ // These routines perform comparisons between a Boost.Function
+ // object and an arbitrary function object (when the last
+ // parameter is mpl::bool_<false>) or against zero (when the
+ // last parameter is mpl::bool_<true>). They are only necessary
+ // for compilers that don't support SFINAE.
+ template<typename Function, typename Functor>
+ bool
+ compare_equal(const Function& f, const Functor&, int, mpl::bool_<true>)
+ { return f.empty(); }
+
+ template<typename Function, typename Functor>
+ bool
+ compare_not_equal(const Function& f, const Functor&, int,
+ mpl::bool_<true>)
+ { return !f.empty(); }
+
+ template<typename Function, typename Functor>
+ bool
+ compare_equal(const Function& f, const Functor& g, long,
+ mpl::bool_<false>)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return function_equal(*fp, g);
+ else return false;
+ }
+
+ template<typename Function, typename Functor>
+ bool
+ compare_equal(const Function& f, const reference_wrapper<Functor>& g,
+ int, mpl::bool_<false>)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return fp == g.get_pointer();
+ else return false;
+ }
+
+ template<typename Function, typename Functor>
+ bool
+ compare_not_equal(const Function& f, const Functor& g, long,
+ mpl::bool_<false>)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return !function_equal(*fp, g);
+ else return true;
+ }
+
+ template<typename Function, typename Functor>
+ bool
+ compare_not_equal(const Function& f,
+ const reference_wrapper<Functor>& g, int,
+ mpl::bool_<false>)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return fp != g.get_pointer();
+ else return true;
+ }
+#endif // BOOST_NO_SFINAE
} // end namespace function
} // end namespace detail
// Is this function empty?
bool empty() const { return !manager; }
+ template<typename Functor>
+ Functor* target()
+ {
+ if (!manager) return 0;
+
+ detail::function::any_pointer result =
+ manager(detail::function::make_any_pointer(&typeid(Functor)),
+ detail::function::check_functor_type_tag);
+ if (!result.obj_ptr) return 0;
+ else {
+ typedef typename detail::function::get_function_tag<Functor>::type tag;
+ return get_functor_pointer<Functor>(tag(), 0);
+ }
+ }
+
+ template<typename Functor>
+ const Functor* target() const
+ {
+ if (!manager) return 0;
+
+ detail::function::any_pointer result =
+ manager(detail::function::make_any_pointer(&typeid(Functor)),
+ detail::function::check_functor_type_tag);
+ if (!result.obj_ptr) return 0;
+ else {
+ typedef typename detail::function::get_function_tag<Functor>::type tag;
+ return get_functor_pointer<Functor>(tag(), 0);
+ }
+ }
+
+ template<typename F>
+ bool contains(const F& f) const
+ {
+ if (const F* fp = this->template target<F>()) {
+ return function_equal(*fp, f);
+ } else {
+ return false;
+ }
+ }
+
+#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3
+ // GCC 3.3 and newer cannot copy with the global operator==, due to
+ // problems with instantiation of function return types before it
+ // has been verified that the argument types match up.
+ template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator==(Functor g) const
+ {
+ if (const Functor* fp = target<Functor>())
+ return function_equal(*fp, g);
+ else return false;
+ }
+
+ template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator!=(Functor g) const
+ {
+ if (const Functor* fp = target<Functor>())
+ return !function_equal(*fp, g);
+ else return true;
+ }
+#endif
+
public: // should be protected, but GCC 2.95.3 will fail to allow access
detail::function::any_pointer (*manager)(
detail::function::any_pointer,
detail::function::functor_manager_operation_type);
detail::function::any_pointer functor;
+
+private:
+ template<typename Functor>
+ Functor* get_functor_pointer(detail::function::function_ptr_tag, int)
+ { return reinterpret_cast<Functor*>(&functor.func_ptr); }
+
+ template<typename Functor, typename Tag>
+ Functor* get_functor_pointer(Tag, long)
+ { return static_cast<Functor*>(functor.obj_ptr); }
+
+ template<typename Functor>
+ const Functor*
+ get_functor_pointer(detail::function::function_ptr_tag, int) const
+ { return reinterpret_cast<const Functor*>(&functor.func_ptr); }
+
+ template<typename Functor, typename Tag>
+ const Functor* get_functor_pointer(Tag, long) const
+ { return static_cast<const Functor*>(functor.const_obj_ptr); }
};
/**
bad_function_call() : std::runtime_error("call to empty boost::function") {}
};
-/* Poison comparison between Boost.Function objects (because it is
- * meaningless). The comparisons would otherwise be allowed because of the
- * conversion required to allow syntax such as:
- * boost::function<int, int> f;
- * if (f) { f(5); }
- */
-void operator==(const function_base&, const function_base&);
-void operator!=(const function_base&, const function_base&);
-
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
+#ifndef BOOST_NO_SFINAE
inline bool operator==(const function_base& f,
detail::function::useless_clear_type*)
{
}
#endif
+#ifdef BOOST_NO_SFINAE
+// Comparisons between boost::function objects and arbitrary function objects
+template<typename Functor>
+ inline bool operator==(const function_base& f, Functor g)
+ {
+ typedef mpl::bool_<(is_integral<Functor>::value)> integral;
+ return detail::function::compare_equal(f, g, 0, integral());
+ }
+
+template<typename Functor>
+ inline bool operator==(Functor g, const function_base& f)
+ {
+ typedef mpl::bool_<(is_integral<Functor>::value)> integral;
+ return detail::function::compare_equal(f, g, 0, integral());
+ }
+
+template<typename Functor>
+ inline bool operator!=(const function_base& f, Functor g)
+ {
+ typedef mpl::bool_<(is_integral<Functor>::value)> integral;
+ return detail::function::compare_not_equal(f, g, 0, integral());
+ }
+
+template<typename Functor>
+ inline bool operator!=(Functor g, const function_base& f)
+ {
+ typedef mpl::bool_<(is_integral<Functor>::value)> integral;
+ return detail::function::compare_not_equal(f, g, 0, integral());
+ }
+#else
+
+# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
+// Comparisons between boost::function objects and arbitrary function
+// objects. GCC 3.3 and before has an obnoxious bug that prevents this
+// from working.
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator==(const function_base& f, Functor g)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return function_equal(*fp, g);
+ else return false;
+ }
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator==(Functor g, const function_base& f)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return function_equal(g, *fp);
+ else return false;
+ }
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator!=(const function_base& f, Functor g)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return !function_equal(*fp, g);
+ else return true;
+ }
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator!=(Functor g, const function_base& f)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return !function_equal(g, *fp);
+ else return true;
+ }
+# endif
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator==(const function_base& f, reference_wrapper<Functor> g)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return fp == g.get_pointer();
+ else return false;
+ }
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator==(reference_wrapper<Functor> g, const function_base& f)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return g.get_pointer() == fp;
+ else return false;
+ }
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator!=(const function_base& f, reference_wrapper<Functor> g)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return fp != g.get_pointer();
+ else return true;
+ }
+
+template<typename Functor>
+ BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
+ operator!=(reference_wrapper<Functor> g, const function_base& f)
+ {
+ if (const Functor* fp = f.template target<Functor>())
+ return g.get_pointer() != fp;
+ else return true;
+ }
+
+#endif // Compiler supporting SFINAE
+
namespace detail {
namespace function {
inline bool has_empty_target(const function_base* f)
return f->empty();
}
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
+ inline bool has_empty_target(const void*)
+ {
+ return false;
+ }
+#else
inline bool has_empty_target(...)
{
return false;
}
+#endif
} // end namespace function
} // end namespace detail
} // end namespace boost
+#undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL
+#undef BOOST_FUNCTION_COMPARE_TYPE_ID
+
#endif // BOOST_FUNCTION_BASE_HEADER
// Boost.Function library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
~BOOST_FUNCTION_FUNCTION() { clear(); }
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+ // MSVC 6.0 and prior require all definitions to be inline, but
+ // these definitions can become very costly.
result_type operator()(BOOST_FUNCTION_PARMS) const
{
if (this->empty())
return result;
#endif // BOOST_NO_VOID_RETURNS
}
+#else
+ result_type operator()(BOOST_FUNCTION_PARMS) const;
+#endif
// The distinction between when to use BOOST_FUNCTION_FUNCTION and
// when to use self_type is obnoxious. MSVC cannot handle self_type as
R BOOST_FUNCTION_COMMA
BOOST_FUNCTION_TEMPLATE_ARGS
>::type
- invoker_type;
+ actual_invoker_type;
- invoker = &invoker_type::invoke;
+ invoker = &actual_invoker_type::invoke;
this->manager =
&detail::function::functor_manager<FunctionPtr, Allocator>::manage;
this->functor =
R BOOST_FUNCTION_COMMA
BOOST_FUNCTION_TEMPLATE_ARGS
>::type
- invoker_type;
+ actual_invoker_type;
- invoker = &invoker_type::invoke;
+ invoker = &actual_invoker_type::invoke;
this->manager = &detail::function::functor_manager<
FunctionObj, Allocator>::manage;
#ifndef BOOST_NO_STD_ALLOCATOR
typedef typename Allocator::template rebind<FunctionObj>::other
- allocator_type;
- typedef typename allocator_type::pointer pointer_type;
- allocator_type allocator;
+ rebound_allocator_type;
+ typedef typename rebound_allocator_type::pointer pointer_type;
+ rebound_allocator_type allocator;
pointer_type copy = allocator.allocate(1);
allocator.construct(copy, f);
R BOOST_FUNCTION_COMMA
BOOST_FUNCTION_TEMPLATE_ARGS
>::type
- invoker_type;
+ actual_invoker_type;
- invoker = &invoker_type::invoke;
- this->manager = &detail::function::trivial_manager;
+ invoker = &actual_invoker_type::invoke;
+ this->manager = &detail::function::trivial_manager<FunctionObj>::get;
this->functor =
this->manager(
detail::function::make_any_pointer(
R BOOST_FUNCTION_COMMA
BOOST_FUNCTION_TEMPLATE_ARGS
>::type
- invoker_type;
- invoker = &invoker_type::invoke;
- this->manager = &detail::function::trivial_manager;
+ actual_invoker_type;
+ invoker = &actual_invoker_type::invoke;
+ this->manager = &detail::function::trivial_manager<FunctionObj>::get;
this->functor = detail::function::make_any_pointer(this);
}
f1.swap(f2);
}
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+ template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS,
+ typename Allocator>
+ typename BOOST_FUNCTION_FUNCTION<
+ R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS,
+ Allocator>::result_type
+ BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS,
+
+ Allocator>
+ ::operator()(BOOST_FUNCTION_PARMS) const
+ {
+ if (this->empty())
+ boost::throw_exception(bad_function_call());
+
+ internal_result_type result = invoker(this->functor
+ BOOST_FUNCTION_COMMA
+ BOOST_FUNCTION_ARGS);
+
+# ifndef BOOST_NO_VOID_RETURNS
+ return static_cast<result_type>(result);
+# else
+ return result;
+# endif // BOOST_NO_VOID_RETURNS
+ }
+#endif
+
+// Poison comparisons between boost::function objects of the same type.
+template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
+ typename Allocator>
+ void operator==(const BOOST_FUNCTION_FUNCTION<
+ R BOOST_FUNCTION_COMMA
+ BOOST_FUNCTION_TEMPLATE_ARGS ,
+ Allocator>&,
+ const BOOST_FUNCTION_FUNCTION<
+ R BOOST_FUNCTION_COMMA
+ BOOST_FUNCTION_TEMPLATE_ARGS ,
+ Allocator>&);
+template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
+ typename Allocator>
+ void operator!=(const BOOST_FUNCTION_FUNCTION<
+ R BOOST_FUNCTION_COMMA
+ BOOST_FUNCTION_TEMPLATE_ARGS ,
+ Allocator>&,
+ const BOOST_FUNCTION_FUNCTION<
+ R BOOST_FUNCTION_COMMA
+ BOOST_FUNCTION_TEMPLATE_ARGS ,
+ Allocator>&);
+
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
#if BOOST_FUNCTION_NUM_ARGS == 0
#
# Boost.Function library
#
-# Copyright Doug Gregor 2001-2003. Use, modification and
+# Copyright Douglas 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)
--- /dev/null
+// Copyright Douglas Gregor 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)
+
+// For more information, see http://www.boost.org
+#ifndef BOOST_FUNCTION_EQUAL_HPP
+#define BOOST_FUNCTION_EQUAL_HPP
+
+namespace boost {
+
+namespace detail {
+ template<typename F, typename G>
+ bool function_equal_impl(const F& f, const G& g, long)
+ { return f == g; }
+} // end namespace boost::function
+
+template<typename F, typename G>
+ bool function_equal(const F& f, const G& g)
+ { return ::boost::detail::function_equal_impl(f, g, 0); }
+
+} // end namespace boost
+
+#endif // BOOST_FUNCTION_EQUAL_HPP
-// (C) Copyright Jeremy Siek 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 Jeremy Siek 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// Revision History:
typedef void pointer;
typedef void reference;
- explicit function_output_iterator(const UnaryFunction& f = UnaryFunction())
+ explicit function_output_iterator() {}
+
+ explicit function_output_iterator(const UnaryFunction& f)
: m_f(f) {}
struct output_proxy {
-// (C) Copyright Jens Maurer 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// Revision History:
-// Copyright Peter Dimov and David Abrahams 2002. Permission to copy,
-// use, modify, sell and distribute this software is granted provided
-// this copyright notice appears in all copies of the source. This
-// software is provided "as is" without express or implied warranty,
-// and with no claim as to its suitability for any purpose.
+// Copyright Peter Dimov and David Abrahams 2002.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef GET_POINTER_DWA20021219_HPP
# define GET_POINTER_DWA20021219_HPP
+++ /dev/null
-// (C) Copyright Jeremy Siek and David Abrahams 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.
-//
-// Revision History:
-// 11 Feb 2001 Use new iterator_adaptor interface, Fixes for Borland.
-// (Dave Abrahams)
-// 04 Feb 2001 Support for user-defined iterator categories (Dave Abrahams)
-// 30 Jan 2001 Initial Checkin (Dave Abrahams)
-
-#ifndef BOOST_HALF_OPEN_RANGE_HPP_
-# define BOOST_HALF_OPEN_RANGE_HPP_
-
-# include <boost/counting_iterator.hpp>
-# include <functional>
-# include <cassert>
-# include <boost/operators.hpp>
-# include <string>
-# include <stdexcept>
-# include <iterator>
-
-namespace boost {
-
-namespace detail {
-
- // Template class choose_finish -- allows us to maintain the invariant that
- // start() <= finish() on half_open_range specializations that support random
- // access.
-#ifdef __MWERKS__
- template <class T>
- const T& choose_finish(const T&, const T& finish, std::input_iterator_tag)
- {
- return finish;
- }
-
- template <class T>
- const T& choose_finish(const T&, const T& finish, std::output_iterator_tag)
- {
- return finish;
- }
-
- template <class T>
- const T& choose_finish(const T& start, const T& finish, std::random_access_iterator_tag)
- {
- return finish < start ? start : finish;
- }
-#else
- template <bool is_random_access> struct finish_chooser;
-
- template <>
- struct finish_chooser<false>
- {
- template <class T>
- struct rebind
- {
- static T choose(const T&, const T& finish)
- { return finish; }
- };
- };
-
- template <>
- struct finish_chooser<true>
- {
- template <class T>
- struct rebind
- {
- static T choose(const T& start, const T& finish)
- { return finish < start ? start : finish; }
- };
- };
-
- template <class Category, class Incrementable>
- struct choose_finish
- {
- static const Incrementable choose(const Incrementable& start, const Incrementable& finish)
- {
- return finish_chooser<(
- ::boost::is_convertible<Category*,std::random_access_iterator_tag*>::value
- )>::template rebind<Incrementable>::choose(start, finish);
- }
- };
-#endif
-}
-
-template <class Incrementable>
-struct half_open_range
-{
- typedef typename counting_iterator_generator<Incrementable>::type iterator;
-
- private: // utility type definitions
- // Using iter_t prevents compiler confusion with boost::iterator
- typedef typename counting_iterator_generator<Incrementable>::type iter_t;
-
- typedef std::less<Incrementable> less_value;
- typedef typename iter_t::iterator_category category;
- typedef half_open_range<Incrementable> self;
-
- public:
- typedef iter_t const_iterator;
- typedef typename iterator::value_type value_type;
- typedef typename iterator::difference_type difference_type;
- typedef typename iterator::reference reference;
- typedef typename iterator::reference const_reference;
- typedef typename iterator::pointer pointer;
- typedef typename iterator::pointer const_pointer;
-
- // It would be nice to select an unsigned type, but this is appropriate
- // since the library makes an attempt to select a difference_type which can
- // hold the difference between any two iterators.
- typedef typename iterator::difference_type size_type;
-
- half_open_range(Incrementable start, Incrementable finish)
- : m_start(start),
- m_finish(
-#ifndef __MWERKS__
- detail::choose_finish<category,Incrementable>::choose(start, finish)
-#else
- detail::choose_finish(start, finish, category())
-#endif
- )
- {}
-
- // Implicit conversion from std::pair<Incrementable,Incrementable> allows us
- // to accept the results of std::equal_range(), for example.
- half_open_range(const std::pair<Incrementable,Incrementable>& x)
- : m_start(x.first),
- m_finish(
-#ifndef __MWERKS__
- detail::choose_finish<category,Incrementable>::choose(x.first, x.second)
-#else
- detail::choose_finish(x.first, x.second, category())
-#endif
- )
- {}
-
- half_open_range& operator=(const self& x)
- {
- m_start = x.m_start;
- m_finish = x.m_finish;
- return *this;
- }
-
- half_open_range& operator=(const std::pair<Incrementable,Incrementable>& x)
- {
- m_start = x.first;
- m_finish =
-#ifndef __MWERKS__
- detail::choose_finish<category,Incrementable>::choose(x.first, x.second);
-#else
- detail::choose_finish(x.first, x.second, category();
-#endif
- }
-
- iterator begin() const { return iterator(m_start); }
- iterator end() const { return iterator(m_finish); }
-
- Incrementable front() const { assert(!this->empty()); return m_start; }
- Incrementable back() const { assert(!this->empty()); return boost::prior(m_finish); }
-
- Incrementable start() const { return m_start; }
- Incrementable finish() const { return m_finish; }
-
- size_type size() const { return boost::detail::distance(begin(), end()); }
-
- bool empty() const
- {
- return m_finish == m_start;
- }
-
- void swap(half_open_range& x) {
- std::swap(m_start, x.m_start);
- std::swap(m_finish, x.m_finish);
- }
-
- public: // functions requiring random access elements
-
- // REQUIRES: x is reachable from this->front()
- bool contains(const value_type& x) const
- {
- BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
- return !less_value()(x, m_start) && less_value()(x, m_finish);
- }
-
- bool contains(const half_open_range& x) const
- {
- BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
- return x.empty() || !less_value()(x.m_start, m_start) && !less_value()(m_finish, x.m_finish);
- }
-
- bool intersects(const half_open_range& x) const
- {
- BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
- return less_value()(
- less_value()(this->m_start, x.m_start) ? x.m_start : this->m_start,
- less_value()(this->m_finish, x.m_finish) ? this->m_finish : x.m_finish);
- }
-
- half_open_range& operator&=(const half_open_range& x)
- {
- BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
-
- if (less_value()(this->m_start, x.m_start))
- this->m_start = x.m_start;
-
- if (less_value()(x.m_finish, this->m_finish))
- this->m_finish = x.m_finish;
-
- if (less_value()(this->m_finish, this->m_start))
- this->m_start = this->m_finish;
-
- return *this;
- }
-
- half_open_range& operator|=(const half_open_range& x)
- {
- BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
-
- if (!x.empty())
- {
- if (this->empty())
- {
- *this = x;
- }
- else
- {
- if (less_value()(x.m_start, this->m_start))
- this->m_start = x.m_start;
-
- if (less_value()(this->m_finish, x.m_finish))
- this->m_finish = x.m_finish;
- }
- }
- return *this;
- }
-
- // REQUIRES: x is reachable from this->front()
- const_iterator find(const value_type& x) const
- {
- BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
-
- return const_iterator(this->contains(x) ? x : m_finish);
- }
-
- // REQUIRES: index >= 0 && index < size()
- value_type operator[](size_type index) const
- {
- assert(index >= 0 && index < size());
- return m_start + index;
- }
-
- value_type at(size_type index) const
- {
- if (index < 0 || index >= size())
- throw std::out_of_range(std::string("half_open_range"));
- return m_start + index;
- }
-
- private: // data members
- Incrementable m_start, m_finish;
-};
-
-template <class Incrementable>
-half_open_range<Incrementable> operator|(
- half_open_range<Incrementable> x,
- const half_open_range<Incrementable>& y)
-{
- return x |= y;
-}
-
-template <class Incrementable>
-half_open_range<Incrementable> operator&(
- half_open_range<Incrementable> x,
- const half_open_range<Incrementable>& y)
-{
- return x &= y;
-}
-
-template <class Incrementable>
-inline bool operator==(
- const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- const bool y_empty = y.empty();
- return x.empty() ? y_empty : !y_empty && x.start() == y.start() && x.finish() == y.finish();
-}
-
-template <class Incrementable>
-inline bool operator!=(
- const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return !(x == y);
-}
-
-template <class Incrementable>
-inline half_open_range<Incrementable>
-make_half_open_range(Incrementable first, Incrementable last)
-{
- return half_open_range<Incrementable>(first, last);
-}
-
-template <class Incrementable>
-bool intersects(
- const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return x.intersects(y);
-}
-
-template <class Incrementable>
-bool contains(
- const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return x.contains(y);
-}
-
-} // namespace boost
-
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-namespace std {
-template <class Incrementable> struct less<boost::half_open_range<Incrementable> >
- : binary_function<
- boost::half_open_range<Incrementable>,
- boost::half_open_range<Incrementable>,bool>
-{
- bool operator()(
- const boost::half_open_range<Incrementable>& x,
- const boost::half_open_range<Incrementable>& y) const
- {
- less<Incrementable> cmp;
- return !y.empty() && (
- cmp(x.start(), y.start())
- || !cmp(y.start(), x.start())
- && cmp(x.finish(), y.finish()));
- }
-};
-
-template <class Incrementable> struct less_equal<boost::half_open_range<Incrementable> >
- : binary_function<
- boost::half_open_range<Incrementable>,
- boost::half_open_range<Incrementable>,bool>
-{
- bool operator()(
- const boost::half_open_range<Incrementable>& x,
- const boost::half_open_range<Incrementable>& y) const
- {
- typedef boost::half_open_range<Incrementable> range;
- less<range> cmp;
- return !cmp(y,x);
- }
-};
-template <class Incrementable> struct greater<boost::half_open_range<Incrementable> >
- : binary_function<
- boost::half_open_range<Incrementable>,
- boost::half_open_range<Incrementable>,bool>
-{
- bool operator()(
- const boost::half_open_range<Incrementable>& x,
- const boost::half_open_range<Incrementable>& y) const
- {
- typedef boost::half_open_range<Incrementable> range;
- less<range> cmp;
- return cmp(y,x);
- }
-};
-
-template <class Incrementable> struct greater_equal<boost::half_open_range<Incrementable> >
- : binary_function<
- boost::half_open_range<Incrementable>,
- boost::half_open_range<Incrementable>,bool>
-{
- bool operator()(
- const boost::half_open_range<Incrementable>& x,
- const boost::half_open_range<Incrementable>& y) const
- {
- typedef boost::half_open_range<Incrementable> range;
- less<range> cmp;
- return !cmp(x,y);
- }
-};
-} // namespace std
-
-#else
-
-namespace boost {
-// Can't partially specialize std::less et al, so we must provide the operators
-template <class Incrementable>
-bool operator<(const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return !y.empty() && (
- x.empty() || std::less<Incrementable>()(x.start(), y.start())
- || !std::less<Incrementable>()(y.start(), x.start())
- && std::less<Incrementable>()(x.finish(), y.finish()));
-}
-
-template <class Incrementable>
-bool operator>(const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return y < x;
-}
-
-template <class Incrementable>
-bool operator<=(const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return !(y < x);
-}
-
-template <class Incrementable>
-bool operator>=(const half_open_range<Incrementable>& x,
- const half_open_range<Incrementable>& y)
-{
- return !(x < y);
-}
-} // namespace boost
-
-#endif
-
-
-#endif // BOOST_HALF_OPEN_RANGE_HPP_
# 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/mpl/eval_if.hpp>
# include <boost/pointee.hpp>
namespace boost {
template <class P>
struct indirect_reference
- : mpl::apply_if<
+ : mpl::eval_if<
detail::is_incrementable<P>
, iterator_reference<P>
, detail::smart_ptr_reference<P>
// boost integer.hpp header file -------------------------------------------//
-// Copyright Beman Dawes 1999.
-// See accompanying license for terms and conditions of use.
+// Copyright Beman Dawes and Daryle Walker 1999. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/integer for documentation.
// Boost integer/integer_mask.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.
+// (C) Copyright Daryle Walker 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
-// Boost integer/static_log2.hpp header file -------------------------------//
+// -------------- Boost static_log2.hpp header file ----------------------- //
+//
+// Copyright (C) 2001 Daryle Walker.
+// Copyright (C) 2003 Vesa Karvonen.
+// Copyright (C) 2003 Gennaro Prota.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// ---------------------------------------------------
+// See http://www.boost.org/libs/integer for documentation.
+// ------------------------------------------------------------------------- //
-// (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.
-
-// See http://www.boost.org for updates, documentation, and revision history.
#ifndef BOOST_INTEGER_STATIC_LOG2_HPP
#define BOOST_INTEGER_STATIC_LOG2_HPP
-#include <boost/integer_fwd.hpp> // self include
-
-#include <boost/config.hpp> // for BOOST_STATIC_CONSTANT, etc.
-#include <boost/limits.hpp> // for std::numeric_limits
-
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#include <boost/pending/ct_if.hpp> // for boost::ct_if<>
-#endif
-
-
-namespace boost
-{
-
-
-// Implementation details --------------------------------------------------//
+#include "boost/config.hpp" // for BOOST_STATIC_CONSTANT
-namespace detail
-{
+namespace boost {
-// Forward declarations
-template < unsigned long Val, int Place = 0, int Index
- = std::numeric_limits<unsigned long>::digits >
- struct static_log2_helper_t;
+ namespace detail {
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ namespace static_log2_impl {
-template < unsigned long Val, int Place >
- struct static_log2_helper_t< Val, Place, 1 >;
+ // choose_initial_n<>
+ //
+ // Recursively doubles its integer argument, until it
+ // becomes >= of the "width" (C99, 6.2.6.2p4) of
+ // static_log2_argument_type.
+ //
+ // Used to get the maximum power of two less then the width.
+ //
+ // Example: if on your platform argument_type has 48 value
+ // bits it yields n=32.
+ //
+ // It's easy to prove that, starting from such a value
+ // of n, the core algorithm works correctly for any width
+ // of static_log2_argument_type and that recursion always
+ // terminates with x = 1 and n = 0 (see the algorithm's
+ // invariant).
-#else
+ typedef unsigned long argument_type;
+ typedef int result_type;
-template < int Place >
- struct static_log2_helper_final_step;
-template < unsigned long Val, int Place = 0, int Index
- = std::numeric_limits<unsigned long>::digits >
- struct static_log2_helper_nopts_t;
+ template <result_type n>
+ struct choose_initial_n {
-#endif
+ enum { c = (argument_type(1) << n << n) != 0 };
+ BOOST_STATIC_CONSTANT(
+ result_type,
+ value = !c*n + choose_initial_n<2*c*n>::value
+ );
-// Recursively build the logarithm by examining the upper bits
-template < unsigned long Val, int Place, int Index >
-struct static_log2_helper_t
-{
-private:
- BOOST_STATIC_CONSTANT( int, half_place = Index / 2 );
- BOOST_STATIC_CONSTANT( unsigned long, lower_mask = (1ul << half_place)
- - 1ul );
- BOOST_STATIC_CONSTANT( unsigned long, upper_mask = ~lower_mask );
- BOOST_STATIC_CONSTANT( bool, do_shift = (Val & upper_mask) != 0ul );
+ };
- BOOST_STATIC_CONSTANT( unsigned long, new_val = do_shift ? (Val
- >> half_place) : Val );
- BOOST_STATIC_CONSTANT( int, new_place = do_shift ? (Place + half_place)
- : Place );
- BOOST_STATIC_CONSTANT( int, new_index = Index - half_place );
+ template <>
+ struct choose_initial_n<0> {
+ BOOST_STATIC_CONSTANT(result_type, value = 0);
+ };
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
- typedef static_log2_helper_t<new_val, new_place, new_index> next_step_type;
-#else
- typedef static_log2_helper_nopts_t<new_val, new_place, new_index> next_step_type;
-#endif
-public:
- BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
-}; // boost::detail::static_log2_helper_t
+ // start computing from n_zero - must be a power of two
+ const result_type n_zero = 16;
+ const result_type initial_n = choose_initial_n<n_zero>::value;
-// Non-recursive case
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ // static_log2_impl<>
+ //
+ // * Invariant:
+ // 2n
+ // 1 <= x && x < 2 at the start of each recursion
+ // (see also choose_initial_n<>)
+ //
+ // * Type requirements:
+ //
+ // argument_type maybe any unsigned type with at least n_zero + 1
+ // value bits. (Note: If larger types will be standardized -e.g.
+ // unsigned long long- then the argument_type typedef can be
+ // changed without affecting the rest of the code.)
+ //
-template < unsigned long Val, int Place >
-struct static_log2_helper_t< Val, Place, 1 >
-{
-public:
- BOOST_STATIC_CONSTANT( int, value = Place );
+ template <argument_type x, result_type n = initial_n>
+ struct static_log2_impl {
-}; // boost::detail::static_log2_helper_t
+ enum { c = (x >> n) > 0 }; // x >= 2**n ?
+ BOOST_STATIC_CONSTANT(
+ result_type,
+ value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value)
+ );
-#else
+ };
-template < int Place >
-struct static_log2_helper_final_step
-{
-public:
- BOOST_STATIC_CONSTANT( int, value = Place );
+ template <>
+ struct static_log2_impl<1, 0> {
+ BOOST_STATIC_CONSTANT(result_type, value = 0);
+ };
-}; // boost::detail::static_log2_helper_final_step
+ }
+ } // detail
-template < unsigned long Val, int Place, int Index >
-struct static_log2_helper_nopts_t
-{
-private:
- typedef static_log2_helper_t<Val, Place, Index> recursive_step_type;
- typedef static_log2_helper_final_step<Place> final_step_type;
- typedef typename ct_if<( Index != 1 ), recursive_step_type,
- final_step_type>::type next_step_type;
-public:
- BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
+ // --------------------------------------
+ // static_log2<x>
+ // ----------------------------------------
-}; // boost::detail::static_log2_helper_nopts_t
+ typedef detail::static_log2_impl::argument_type static_log2_argument_type;
+ typedef detail::static_log2_impl::result_type static_log2_result_type;
-#endif
-} // namespace detail
+ template <static_log2_argument_type x>
+ struct static_log2 {
+ BOOST_STATIC_CONSTANT(
+ static_log2_result_type,
+ value = detail::static_log2_impl::static_log2_impl<x>::value
+ );
-// Compile-time log-base-2 evaluator class declaration ---------------------//
+ };
-template < unsigned long Value >
-struct static_log2
-{
- BOOST_STATIC_CONSTANT( int, value
- = detail::static_log2_helper_t<Value>::value );
-};
-template < >
-struct static_log2< 0ul >
-{
- // The logarithm of zero is undefined.
-};
+ template <>
+ struct static_log2<0> { };
+}
-} // namespace boost
-#endif // BOOST_INTEGER_STATIC_LOG2_HPP
+#endif // include guard
// Boost integer/static_min_max.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.
+// (C) Copyright Daryle Walker 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// Boost integer_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.
+// (C) Copyright Dave Abrahams and Daryle Walker 2001. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/integer for documentation.
#ifdef ULLONG_MAX
template < >
- class integer_traits< long long >;
+ class integer_traits< ::boost::long_long_type>;
template < >
- class integer_traits< unsigned long long >;
+ class integer_traits< ::boost::ulong_long_type >;
#endif
/* boost integer_traits.hpp header file
*
* Copyright Jens Maurer 2000
- * Permission to use, copy, modify, sell, and distribute this software
- * 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,
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
*
- * Jens Maurer makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * $Id: integer_traits.hpp,v 1.23 2003/08/27 10:30:53 johnmaddock Exp $
+ * $Id: integer_traits.hpp,v 1.25 2004/09/04 10:34:47 johnmaddock Exp $
*
* Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
*/
#if defined(ULLONG_MAX) && defined(BOOST_HAS_LONG_LONG)
template<>
-class integer_traits<long long>
- : public std::numeric_limits<long long>,
- public detail::integer_traits_base<long long, LLONG_MIN, LLONG_MAX>
+class integer_traits< ::boost::long_long_type>
+ : public std::numeric_limits< ::boost::long_long_type>,
+ public detail::integer_traits_base< ::boost::long_long_type, LLONG_MIN, LLONG_MAX>
{ };
template<>
-class integer_traits<unsigned long long>
- : public std::numeric_limits<unsigned long long>,
- public detail::integer_traits_base<unsigned long long, 0, ULLONG_MAX>
+class integer_traits< ::boost::ulong_long_type>
+ : public std::numeric_limits< ::boost::ulong_long_type>,
+ public detail::integer_traits_base< ::boost::ulong_long_type, 0, ULLONG_MAX>
{ };
#elif defined(ULONG_LONG_MAX) && defined(BOOST_HAS_LONG_LONG)
template<>
-class integer_traits<long long> : public std::numeric_limits<long long>, public detail::integer_traits_base<long long, LONG_LONG_MIN, LONG_LONG_MAX>{ };
+class integer_traits< ::boost::long_long_type> : public std::numeric_limits< ::boost::long_long_type>, public detail::integer_traits_base< ::boost::long_long_type, LONG_LONG_MIN, LONG_LONG_MAX>{ };
template<>
-class integer_traits<unsigned long long>
- : public std::numeric_limits<unsigned long long>,
- public detail::integer_traits_base<unsigned long long, 0, ULONG_LONG_MAX>
+class integer_traits< ::boost::ulong_long_type>
+ : public std::numeric_limits< ::boost::ulong_long_type>,
+ public detail::integer_traits_base< ::boost::ulong_long_type, 0, ULONG_LONG_MAX>
{ };
#elif defined(ULONGLONG_MAX) && defined(BOOST_HAS_LONG_LONG)
template<>
-class integer_traits<long long>
- : public std::numeric_limits<long long>,
- public detail::integer_traits_base<long long, LONGLONG_MIN, LONGLONG_MAX>
+class integer_traits< ::boost::long_long_type>
+ : public std::numeric_limits< ::boost::long_long_type>,
+ public detail::integer_traits_base< ::boost::long_long_type, LONGLONG_MIN, LONGLONG_MAX>
{ };
template<>
-class integer_traits<unsigned long long>
- : public std::numeric_limits<unsigned long long>,
- public detail::integer_traits_base<unsigned long long, 0, ULONGLONG_MAX>
+class integer_traits< ::boost::ulong_long_type>
+ : public std::numeric_limits< ::boost::ulong_long_type>,
+ public detail::integer_traits_base< ::boost::ulong_long_type, 0, ULONGLONG_MAX>
{ };
#elif defined(_LLONG_MAX) && defined(_C2) && defined(BOOST_HAS_LONG_LONG)
template<>
-class integer_traits<long long>
- : public std::numeric_limits<long long>,
- public detail::integer_traits_base<long long, -_LLONG_MAX - _C2, _LLONG_MAX>
+class integer_traits< ::boost::long_long_type>
+ : public std::numeric_limits< ::boost::long_long_type>,
+ public detail::integer_traits_base< ::boost::long_long_type, -_LLONG_MAX - _C2, _LLONG_MAX>
+{ };
+
+template<>
+class integer_traits< ::boost::ulong_long_type>
+ : public std::numeric_limits< ::boost::ulong_long_type>,
+ public detail::integer_traits_base< ::boost::ulong_long_type, 0, _ULLONG_MAX>
+{ };
+
+#elif defined(BOOST_HAS_LONG_LONG)
+//
+// we have long long but no constants, this happens for example with gcc in -ansi mode,
+// we'll just have to work out the values for ourselves (assumes 2's compliment representation):
+//
+template<>
+class integer_traits< ::boost::long_long_type>
+ : public std::numeric_limits< ::boost::long_long_type>,
+ public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) - 1)), ~(1LL << (sizeof(::boost::long_long_type) - 1))>
{ };
template<>
-class integer_traits<unsigned long long>
- : public std::numeric_limits<unsigned long long>,
- public detail::integer_traits_base<unsigned long long, 0, _ULLONG_MAX>
+class integer_traits< ::boost::ulong_long_type>
+ : public std::numeric_limits< ::boost::ulong_long_type>,
+ public detail::integer_traits_base< ::boost::ulong_long_type, 0, ~0uLL>
{ };
#endif
//
// Copyright (c) 2001, 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation.
//
// interator.hpp workarounds for non-conforming standard libraries ---------//
-// (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 Beman Dawes 2000. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/utility for documentation.
+++ /dev/null
-#error obsolete
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// no include guard multiple inclusion intended
# 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)
+#if !defined(BOOST_MSVC) && (defined(BOOST_NO_SFINAE) || defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_IS_CONVERTIBLE_TEMPLATE))
# define BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
#endif
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// no include guard multiple inclusion intended
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ENABLE_IF_23022003THW_HPP
#define BOOST_ENABLE_IF_23022003THW_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/eval_if.hpp>
# include <boost/mpl/identity.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>
+# include <boost/detail/indirect_traits.hpp>
# endif
//
# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY // Adding Thomas' logic?
: mpl::or_<
is_const<Reference>
- , python::detail::is_reference_to_const<Reference>
+ , boost::detail::indirect_traits::is_reference_to_const<Reference>
, is_const<ValueParam>
>
# else
//
template <class Traversal, class ValueParam, class Reference>
struct iterator_facade_default_category
- : mpl::apply_if<
+ : mpl::eval_if<
mpl::and_<
is_reference<Reference>
, is_convertible<Traversal,forward_traversal_tag>
>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Traversal,random_access_traversal_tag>
, mpl::identity<std::random_access_iterator_tag>
, mpl::if_<
, std::forward_iterator_tag
>
>
- , typename mpl::apply_if<
+ , typename mpl::eval_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>
+ , mpl::identity<std::input_iterator_tag>
+ , mpl::identity<Traversal>
>
>
{
//
template <class CategoryOrTraversal, class ValueParam, class Reference>
struct facade_iterator_category
- : mpl::apply_if<
+ : mpl::eval_if<
is_iterator_category<CategoryOrTraversal>
, mpl::identity<CategoryOrTraversal> // old-style categories are fine as-is
, facade_iterator_category_impl<CategoryOrTraversal,ValueParam,Reference>
struct minimum_category_impl
# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
{
+ template <class T1, class T2> struct apply
+ {
+ typedef T2 type;
+ };
typedef void type;
}
# endif
|| is_same<T1,int>::value
# endif
> outer;
-
+
typedef typename outer::template apply<T1,T2> inner;
typedef typename inner::type type;
template <class T1, class T2>
struct apply : minimum_category<T1,T2>
{};
+
+ BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,minimum_category,(mpl::_1,mpl::_2))
};
-
+
# 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
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_FILTER_ITERATOR_23022003THW_HPP
#define BOOST_FILTER_ITERATOR_23022003THW_HPP
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_INDIRECT_ITERATOR_23022003THW_HPP
#define BOOST_INDIRECT_ITERATOR_23022003THW_HPP
#include <boost/indirect_reference.hpp>
#include <boost/detail/iterator.hpp>
-#include <boost/python/detail/indirect_traits.hpp>
+#include <boost/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/eval_if.hpp>
#include <boost/mpl/not.hpp>
-#include <boost/mpl/aux_/has_xxx.hpp>
+#include <boost/mpl/has_xxx.hpp>
-#ifdef BOOST_MPL_NO_AUX_HAS_XXX
+#ifdef BOOST_MPL_CFG_NO_HAS_XXX
# include <boost/shared_ptr.hpp>
# include <boost/scoped_ptr.hpp>
# include <boost/mpl/bool.hpp>
, Category
, typename ia_dflt_help<
Reference
- , mpl::apply_if<
+ , mpl::eval_if<
is_same<Value,use_default>
, indirect_reference<dereferenceable>
, add_reference<Value>
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_INTEROPERABLE_23022003THW_HPP
# define BOOST_INTEROPERABLE_23022003THW_HPP
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
#define BOOST_ITERATOR_ADAPTOR_23022003THW_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>
// 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)
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+
+ template<typename From, typename To>
+ struct enable_if_convertible
+ {
+ typedef typename mpl::if_<
+ mpl::or_<
+ is_same<From,To>
+ , is_convertible<From, To>
+ >
+ , detail::enable_type
+ , int&
+ >::type type;
+ };
+
+# elif defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE)
template <class From, class To>
struct enable_if_convertible
// DefaultNullaryFn, otherwise return T.
template <class T, class DefaultNullaryFn>
struct ia_dflt_help
- : mpl::apply_if<
+ : mpl::eval_if<
is_same<T, use_default>
, DefaultNullaryFn
, mpl::identity<T>
# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
, typename detail::ia_dflt_help<
Value
- , mpl::apply_if<
+ , mpl::eval_if<
is_same<Reference,use_default>
, iterator_value<Base>
, remove_reference<Reference>
, typename detail::ia_dflt_help<
Reference
- , mpl::apply_if<
+ , mpl::eval_if<
is_same<Value,use_default>
, iterator_reference<Base>
, add_reference<Value>
>
type;
};
- template <class T> int static_assert_convertible_to(T);
+
+ // workaround for aC++ CR JAGaf33512
+ template <class Tr1, class Tr2>
+ inline void iterator_adaptor_assert_traversal ()
+ {
+ BOOST_STATIC_ASSERT((is_convertible<Tr1, Tr2>::value));
+ }
}
//
{
friend class iterator_core_access;
+ protected:
typedef typename detail::iterator_adaptor_base<
Derived, Base, Value, Traversal, Reference, Difference
>::type super_t;
-
public:
iterator_adaptor() {}
{ return m_iterator; }
protected:
+ // for convenience in derived classes
+ typedef iterator_adaptor<Derived,Base,Value,Traversal,Reference,Difference> iterator_adaptor_;
+
//
// lvalue access to the Base object for Derived
//
>::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));
+ detail::iterator_adaptor_assert_traversal<my_traversal, cat>();
void advance(typename super_t::difference_type n)
{
-// (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.
+// (C) Copyright Jeremy Siek 2002.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ITERATOR_CATEGORIES_HPP
# define BOOST_ITERATOR_CATEGORIES_HPP
# include <boost/detail/workaround.hpp>
-# include <boost/mpl/apply_if.hpp>
+# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/identity.hpp>
# include <boost/mpl/placeholders.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
//
// Traversal Categories
//
-struct incrementable_traversal_tag {};
+
+struct no_traversal_tag {};
+
+struct incrementable_traversal_tag
+ : no_traversal_tag
+{
+// incrementable_traversal_tag() {}
+// incrementable_traversal_tag(std::output_iterator_tag const&) {};
+};
struct single_pass_traversal_tag
- : incrementable_traversal_tag {};
+ : incrementable_traversal_tag
+{
+// single_pass_traversal_tag() {}
+// single_pass_traversal_tag(std::input_iterator_tag const&) {};
+};
struct forward_traversal_tag
- : single_pass_traversal_tag {};
+ : single_pass_traversal_tag
+{
+// forward_traversal_tag() {}
+// forward_traversal_tag(std::forward_iterator_tag const&) {};
+};
struct bidirectional_traversal_tag
- : forward_traversal_tag {};
+ : forward_traversal_tag
+{
+// bidirectional_traversal_tag() {};
+// bidirectional_traversal_tag(std::bidirectional_iterator_tag const&) {};
+};
struct random_access_traversal_tag
- : bidirectional_traversal_tag {};
+ : bidirectional_traversal_tag
+{
+// random_access_traversal_tag() {};
+// random_access_traversal_tag(std::random_access_iterator_tag const&) {};
+};
namespace detail
{
//
template <class Cat>
struct old_category_to_traversal
- : mpl::apply_if<
+ : mpl::eval_if<
is_convertible<Cat,std::random_access_iterator_tag>
, mpl::identity<random_access_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Cat,std::bidirectional_iterator_tag>
, mpl::identity<bidirectional_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Cat,std::forward_iterator_tag>
, mpl::identity<forward_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Cat,std::input_iterator_tag>
, mpl::identity<single_pass_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Cat,std::output_iterator_tag>
, mpl::identity<incrementable_traversal_tag>
, void
template <class Traversal>
struct pure_traversal_tag
- : mpl::apply_if<
+ : mpl::eval_if<
is_convertible<Traversal,random_access_traversal_tag>
, mpl::identity<random_access_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Traversal,bidirectional_traversal_tag>
, mpl::identity<bidirectional_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Traversal,forward_traversal_tag>
, mpl::identity<forward_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Traversal,single_pass_traversal_tag>
, mpl::identity<single_pass_traversal_tag>
- , mpl::apply_if<
+ , mpl::eval_if<
is_convertible<Traversal,incrementable_traversal_tag>
, mpl::identity<incrementable_traversal_tag>
, void
//
template <class Cat>
struct iterator_category_to_traversal
- : mpl::apply_if< // if already convertible to a traversal tag, we're done.
+ : mpl::eval_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>
>
{};
-# ifdef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
+# ifdef BOOST_MPL_CFG_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
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_ITERATOR_FACADE_23022003THW_HPP
#define BOOST_ITERATOR_FACADE_23022003THW_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/remove_reference.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_pod.hpp>
-#include <boost/mpl/apply_if.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/and.hpp>
+#include <boost/mpl/not.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/mpl/identity.hpp>
#include <boost/iterator/detail/config_def.hpp> // this goes last
typedef bool type;
};
};
-
+
//
// enable if for use in operator implementation.
//
, class Return
>
struct enable_if_interoperable
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ {
+ typedef typename mpl::if_<
+ mpl::or_<
+ is_convertible<Facade1, Facade2>
+ , is_convertible<Facade2, Facade1>
+ >
+ , Return
+ , int[3]
+ >::type type;
+ };
+#else
: ::boost::iterators::enable_if<
mpl::or_<
is_convertible<Facade1, Facade2>
>
, Return
>
- {
- };
+ {};
+#endif
//
// Generates associated types for an iterator_facade with the
typedef typename remove_const<ValueParam>::type value_type;
- typedef typename mpl::apply_if<
+ typedef typename mpl::eval_if<
detail::iterator_writability_disabled<ValueParam,Reference>
, add_pointer<typename add_const<value_type>::type>
, add_pointer<value_type>
# endif
};
+ // iterators whose dereference operators reference the same value
+ // for all iterators into the same sequence (like many input
+ // iterators) need help with their postfix ++: the referenced
+ // value must be read and stored away before the increment occurs
+ // so that *a++ yields the originally referenced element and not
+ // the next one.
+ template <class Iterator>
+ class postfix_increment_proxy
+ {
+ typedef typename iterator_value<Iterator>::type value_type;
+ public:
+ explicit postfix_increment_proxy(Iterator const& x)
+ : stored_value(*x)
+ {}
+
+ // Returning a mutable reference allows nonsense like
+ // (*r++).mutate(), but it imposes fewer assumptions about the
+ // behavior of the value_type. In particular, recall taht
+ // (*r).mutate() is legal if operator* returns by value.
+ value_type&
+ operator*() const
+ {
+ return this->stored_value;
+ }
+ private:
+ mutable value_type stored_value;
+ };
+
+ //
+ // In general, we can't determine that such an iterator isn't
+ // writable -- we also need to store a copy of the old iterator so
+ // that it can be written into.
+ template <class Iterator>
+ class writable_postfix_increment_proxy
+ {
+ typedef typename iterator_value<Iterator>::type value_type;
+ public:
+ explicit writable_postfix_increment_proxy(Iterator const& x)
+ : stored_value(*x)
+ , stored_iterator(x)
+ {}
+
+ // Dereferencing must return a proxy so that both *r++ = o and
+ // value_type(*r++) can work. In this case, *r is the same as
+ // *r++, and the conversion operator below is used to ensure
+ // readability.
+ writable_postfix_increment_proxy const&
+ operator*() const
+ {
+ return *this;
+ }
+
+ // Provides readability of *r++
+ operator value_type&() const
+ {
+ return stored_value;
+ }
+
+ // Provides writability of *r++
+ template <class T>
+ T const& operator=(T const& x) const
+ {
+ *this->stored_iterator = x;
+ return x;
+ }
+
+ // This overload just in case only non-const objects are writable
+ template <class T>
+ T& operator=(T& x) const
+ {
+ *this->stored_iterator = x;
+ return x;
+ }
+
+ // Provides X(r++)
+ operator Iterator const&() const
+ {
+ return stored_iterator;
+ }
+
+ private:
+ mutable value_type stored_value;
+ Iterator stored_iterator;
+ };
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <class Reference, class Value>
+ struct is_non_proxy_reference_impl
+ {
+ static Reference r;
+
+ template <class R>
+ static typename mpl::if_<
+ is_convertible<
+ R const volatile*
+ , Value const volatile*
+ >
+ , char[1]
+ , char[2]
+ >::type& helper(R const&);
+
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(helper(r)) == 1);
+ };
+
+ template <class Reference, class Value>
+ struct is_non_proxy_reference
+ : mpl::bool_<
+ is_non_proxy_reference_impl<Reference, Value>::value
+ >
+ {};
+# else
+ template <class Reference, class Value>
+ struct is_non_proxy_reference
+ : is_convertible<
+ typename remove_reference<Reference>::type
+ const volatile*
+ , Value const volatile*
+ >
+ {};
+# endif
+
+ // A metafunction to choose the result type of postfix ++
+ //
+ // Because the C++98 input iterator requirements say that *r++ has
+ // type T (value_type), implementations of some standard
+ // algorithms like lexicographical_compare may use constructions
+ // like:
+ //
+ // *r++ < *s++
+ //
+ // If *r++ returns a proxy (as required if r is writable but not
+ // multipass), this sort of expression will fail unless the proxy
+ // supports the operator<. Since there are any number of such
+ // operations, we're not going to try to support them. Therefore,
+ // even if r++ returns a proxy, *r++ will only return a proxy if
+ // *r also returns a proxy.
+ template <class Iterator, class Value, class Reference, class CategoryOrTraversal>
+ struct postfix_increment_result
+ : mpl::eval_if<
+ mpl::and_<
+ // A proxy is only needed for readable iterators
+ is_convertible<Reference,Value>
+
+ // No multipass iterator can have values that disappear
+ // before positions can be re-visited
+ , mpl::not_<
+ is_convertible<
+ typename iterator_category_to_traversal<CategoryOrTraversal>::type
+ , forward_traversal_tag
+ >
+ >
+ >
+ , mpl::if_<
+ is_non_proxy_reference<Reference,Value>
+ , postfix_increment_proxy<Iterator>
+ , writable_postfix_increment_proxy<Iterator>
+ >
+ , mpl::identity<Iterator>
+ >
+ {};
// 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
{
// 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>
+ template <class ValueType, class Reference, class Pointer>
struct operator_arrow_result
{
// CWPro8.3 won't accept "operator_arrow_result::type", and we
typedef typename mpl::if_<
is_reference<Reference>
, Pointer
- , operator_arrow_proxy<Value>
+ , operator_arrow_proxy<ValueType>
>::type type;
static type make(Reference x)
};
# endif
- //
- // Iterator is actually an iterator_facade, so we do not have to
- // go through iterator_traits to access the traits.
- //
+ // A proxy return type for operator[], needed to deal with
+ // iterators that may invalidate referents upon destruction.
+ // Consider the temporary iterator in *(a + n)
template <class Iterator>
class operator_brackets_proxy
{
+ // Iterator is actually an iterator_facade, so we do not have to
+ // go through iterator_traits to access the traits.
typedef typename Iterator::reference reference;
typedef typename Iterator::value_type value_type;
Iterator m_iter;
};
- template <class Value, class Reference>
+ // A metafunction that determines whether operator[] must return a
+ // proxy, or whether it can simply return a copy of the value_type.
+ template <class ValueType, 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>
+ : mpl::not_<
+ mpl::and_<
+ // Really we want an is_copy_constructible trait here,
+ // but is_POD will have to suffice in the meantime.
+ boost::is_POD<ValueType>
+ , iterator_writability_disabled<ValueType,Reference>
+ >
>
{};
{
typedef typename mpl::if_<
use_operator_brackets_proxy<Value,Reference>
- , Value
, operator_brackets_proxy<Iterator>
+ , Value
>::type type;
};
template <class Iterator>
- operator_brackets_proxy<Iterator> make_operator_brackets_result(Iterator const& iter, mpl::false_)
+ operator_brackets_proxy<Iterator> make_operator_brackets_result(Iterator const& iter, mpl::true_)
{
return operator_brackets_proxy<Iterator>(iter);
}
template <class Iterator>
- typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::true_)
+ typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::false_)
{
return *iter;
}
, typename I2::difference_type
>
# else
- mpl::apply_if<
+ mpl::eval_if<
is_convertible<I2,I1>
, iterator_difference<I1>
, iterator_difference<I2>
return f2.distance_to(f1);
}
+ //
+ // Curiously Recurring Template interface.
+ //
+ template <class I, class V, class TC, class R, class D>
+ static I& derived(iterator_facade<I,V,TC,R,D>& facade)
+ {
+ return *static_cast<I*>(&facade);
+ }
+
+ template <class I, class V, class TC, class R, class D>
+ static I const& derived(iterator_facade<I,V,TC,R,D> const& facade)
+ {
+ return *static_cast<I const*>(&facade);
+ }
+
private:
// objects of this class are useless
iterator_core_access(); //undefined
//
// Curiously Recurring Template interface.
//
- typedef Derived derived_t;
-
Derived& derived()
{
- return static_cast<Derived&>(*this);
+ return *static_cast<Derived*>(this);
}
Derived const& derived() const
{
- return static_cast<Derived const&>(*this);
+ return *static_cast<Derived const*>(this);
}
typedef detail::iterator_facade_types<
Value, CategoryOrTraversal, Reference, Difference
> associated_types;
+
+ protected:
+ // For use by derived classes
+ typedef iterator_facade<Derived,Value,Reference,Difference> iterator_facade_;
public:
>::make(*this->derived());
}
- typename detail::operator_brackets_result<Derived,Value,Reference>::type
+ 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 this->derived();
}
- Derived operator++(int)
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ typename detail::postfix_increment_result<Derived,Value,Reference,CategoryOrTraversal>::type
+ operator++(int)
{
- Derived tmp(this->derived());
+ typename detail::postfix_increment_result<Derived,Value,Reference,CategoryOrTraversal>::type
+ tmp(this->derived());
++*this;
return tmp;
}
-
+# endif
+
Derived& operator--()
{
iterator_core_access::decrement(this->derived());
# endif
};
+# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+ template <class I, class V, class TC, class R, class D>
+ typename detail::postfix_increment_result<I,V,R,TC>::type
+ operator++(
+ iterator_facade<I,V,TC,R,D>& i
+ , int
+ )
+ {
+ typename detail::postfix_increment_result<I,V,R,TC>::type
+ tmp(*static_cast<I*>(&i));
+
+ ++i;
+
+ return tmp;
+ }
+# endif
+
+
//
- // Operator implementation. The library supplied operators
+ // Comparison 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.
is_interoperable< Derived1, Derived2 >::value \
)); \
return_prefix iterator_core_access::base_op( \
- static_cast<Derived1 const&>(lhs) \
- , static_cast<Derived2 const&>(rhs) \
+ *static_cast<Derived1 const*>(&lhs) \
+ , *static_cast<Derived2 const*>(&rhs) \
, BOOST_ITERATOR_CONVERTIBLE(Derived2,Derived1) \
); \
}
-// 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.
+// Copyright David Abrahams 2003.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef ITERATOR_TRAITS_DWA200347_HPP
# define ITERATOR_TRAITS_DWA200347_HPP
// (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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
transform_iterator(
transform_iterator<OtherUnaryFunction, OtherIterator, OtherReference, OtherValue> const& t
, typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310)
+#if !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
, typename enable_if_convertible<OtherUnaryFunction, UnaryFunction>::type* = 0
#endif
)
// function pointer in the iterator be 0, leading to a runtime
// crash.
template <class UnaryFunction, class Iterator>
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ typename mpl::if_<
+#else
typename iterators::enable_if<
+#endif
is_class<UnaryFunction> // We should probably find a cheaper test than is_class<>
, transform_iterator<UnaryFunction, Iterator>
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ , int[3]
+#endif
>::type
make_transform_iterator(Iterator it)
{
-// 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_13062003HK_HPP
-#define BOOST_ITERATOR_ADAPTOR_13062003HK_HPP
+// Copyright David Abrahams 2004. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#ifndef ITERATOR_ADAPTORS_DWA2004725_HPP
+# define ITERATOR_ADAPTORS_DWA2004725_HPP
#define BOOST_ITERATOR_ADAPTORS_VERSION 0x0200
#include <boost/iterator/iterator_adaptor.hpp>
-#endif // BOOST_ITERATOR_ADAPTOR_13062003HK_HPP
+#endif // ITERATOR_ADAPTORS_DWA2004725_HPP
// last_value function object (documented as part of Boost.Signals)
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Copyright Kevlin Henney, 2000-2003. All rights reserved.
//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose is hereby granted without fee, provided that this copyright and
-// permissions notice appear in all copies and derivatives.
-//
-// This software is provided "as is" without express or implied warranty.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#undef DISABLE_WIDE_CHAR_SUPPORT
#endif
-// (C) Copyright Boost.org 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.
+// (C) Copyright John maddock 1999.
+// (C) David Abrahams 2002. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// use this header as a workaround for missing <limits>
// Add missing specializations for numeric_limits:
#ifdef BOOST_HAS_MS_INT64
# define BOOST_LLT __int64
+# define BOOST_ULLT unsigned __int64
#else
-# define BOOST_LLT long long
+# define BOOST_LLT ::boost::long_long_type
+# define BOOST_ULLT ::boost::ulong_long_type
#endif
namespace std
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
#ifdef BOOST_HAS_MS_INT64
- static BOOST_LLT min(){ return 0x8000000000000000i64; }
- static BOOST_LLT max(){ return 0x7FFFFFFFFFFFFFFFi64; }
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x8000000000000000i64; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x7FFFFFFFFFFFFFFFi64; }
#elif defined(LLONG_MAX)
- static BOOST_LLT min(){ return LLONG_MIN; }
- static BOOST_LLT max(){ return LLONG_MAX; }
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MIN; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MAX; }
#elif defined(LONGLONG_MAX)
- static BOOST_LLT min(){ return LONGLONG_MIN; }
- static BOOST_LLT max(){ return LONGLONG_MAX; }
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MIN; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MAX; }
#else
- static BOOST_LLT min(){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }
- static BOOST_LLT max(){ return ~min(); }
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~(min)(); }
#endif
BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT -1);
BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT) - 1) * 301L / 1000);
};
template<>
- class numeric_limits<unsigned BOOST_LLT>
+ class numeric_limits<BOOST_ULLT>
{
public:
BOOST_STATIC_CONSTANT(bool, is_specialized = true);
#ifdef BOOST_HAS_MS_INT64
- static unsigned BOOST_LLT min(){ return 0ui64; }
- static unsigned BOOST_LLT max(){ return 0xFFFFFFFFFFFFFFFFui64; }
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0ui64; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0xFFFFFFFFFFFFFFFFui64; }
#elif defined(ULLONG_MAX) && defined(ULLONG_MIN)
- static unsigned BOOST_LLT min(){ return ULLONG_MIN; }
- static unsigned BOOST_LLT max(){ return ULLONG_MAX; }
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MIN; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MAX; }
#elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN)
- static unsigned BOOST_LLT min(){ return ULONGLONG_MIN; }
- static unsigned BOOST_LLT max(){ return ULONGLONG_MAX; }
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MIN; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MAX; }
#else
- static unsigned BOOST_LLT min(){ return 0uLL; }
- static unsigned BOOST_LLT max(){ return ~0uLL; }
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0uLL; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~0uLL; }
#endif
BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT);
BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT)) * 301L / 1000);
BOOST_STATIC_CONSTANT(bool, is_integer = true);
BOOST_STATIC_CONSTANT(bool, is_exact = true);
BOOST_STATIC_CONSTANT(int, radix = 2);
- static unsigned BOOST_LLT epsilon() throw() { return 0; };
- static unsigned BOOST_LLT round_error() throw() { return 0; };
+ static BOOST_ULLT epsilon() throw() { return 0; };
+ static BOOST_ULLT round_error() throw() { return 0; };
BOOST_STATIC_CONSTANT(int, min_exponent = 0);
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
- static unsigned BOOST_LLT infinity() throw() { return 0; };
- static unsigned BOOST_LLT quiet_NaN() throw() { return 0; };
- static unsigned BOOST_LLT signaling_NaN() throw() { return 0; };
- static unsigned BOOST_LLT denorm_min() throw() { return 0; };
+ static BOOST_ULLT infinity() throw() { return 0; };
+ static BOOST_ULLT quiet_NaN() throw() { return 0; };
+ static BOOST_ULLT signaling_NaN() throw() { return 0; };
+ static BOOST_ULLT denorm_min() throw() { return 0; };
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
BOOST_STATIC_CONSTANT(bool, is_bounded = false);
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2001 David Abrahams
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/mem_fn.html for documentation.
//
{
return (t.*f_);
}
+
+ bool operator==(dm const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(dm const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
};
} // namespace _mfi
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
-namespace boost {
-namespace mpl {
+// $Source: /cvsroot/boost/boost/boost/mpl/always.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.5 $
-template< typename Value >
-struct always
+#include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/aux_/arity_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_)
+ BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(1, typename T, na)
>
struct apply
{
};
};
+BOOST_MPL_AUX_ARITY_SPEC(1, always)
-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
#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
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/and.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
-#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
- && !defined(BOOST_MPL_PREPROCESSING_MODE)
+#if !defined(BOOST_MPL_CFG_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"
+# include <boost/mpl/bool.hpp>
+# include <boost/mpl/aux_/nested_type_wknd.hpp>
+# include <boost/mpl/aux_/na_spec.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
+
+// agurt, 19/may/04: workaround a conflict with <iso646.h> header's
+// 'or' and 'and' macros, see http://tinyurl.com/3et69; 'defined(and)'
+// has to be checked in a separate condition, otherwise GCC complains
+// about 'and' being an alternative token
+#if defined(_MSC_VER)
+#if defined(and)
+# pragma push_macro("and")
+# undef and
+# define and(x)
+#endif
+#endif
# define BOOST_MPL_PREPROCESSED_HEADER and.hpp
-# include "boost/mpl/aux_/include_preprocessed.hpp"
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#if defined(_MSC_VER)
+#if defined(and)
+# pragma pop_macro("and")
+#endif
+#endif
#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"
+# define AUX778076_OP_NAME and_
+# define AUX778076_OP_VALUE1 false
+# define AUX778076_OP_VALUE2 true
+# include <boost/mpl/aux_/logical_op.hpp>
-#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_AND_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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)
#ifndef BOOST_MPL_APPLY_HPP_INCLUDED
#define BOOST_MPL_APPLY_HPP_INCLUDED
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/apply.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.17 $
+
#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"
+# include <boost/mpl/apply_fwd.hpp>
+# include <boost/mpl/apply_wrap.hpp>
+# include <boost/mpl/placeholders.hpp>
+# include <boost/mpl/lambda.hpp>
+# include <boost/mpl/aux_/na.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
#endif
-#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
-#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
- && !defined(BOOST_MPL_PREPROCESSING_MODE)
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER apply.hpp
-# include "boost/mpl/aux_/include_preprocessed.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 {
+# include <boost/mpl/limits/arity.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_/config/lambda.hpp>
+# include <boost/mpl/aux_/config/dtp.hpp>
+# include <boost/mpl/aux_/nttp_decl.hpp>
+# include <boost/mpl/aux_/config/eti.hpp>
+# include <boost/mpl/aux_/config/msvc.hpp>
+# include <boost/mpl/aux_/config/workaround.hpp>
+
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+namespace boost { namespace mpl {
// local macros, #undef-ined at the end of the header
-# define AUX_APPLY_PARAMS(param) \
+# define AUX778076_APPLY_PARAMS(param) \
BOOST_MPL_PP_PARAMS( \
- BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
, param \
) \
/**/
-# define AUX_APPLY_DEFAULT_PARAMS(param, value) \
+# define AUX778076_APPLY_DEF_PARAMS(param, value) \
BOOST_MPL_PP_DEFAULT_PARAMS( \
- BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
, param \
, value \
) \
/**/
-# define AUX_APPLY_N_PARAMS(n, param) \
+# define AUX778076_APPLY_N_PARAMS(n, param) \
BOOST_MPL_PP_PARAMS(n, param) \
/**/
-# define AUX_APPLY_N_COMMA_PARAMS(n, param) \
+# define AUX778076_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) \
+# define AUX778076_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) \
+# define AUX778076_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"))
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply.hpp>))
#include BOOST_PP_ITERATE()
-# if !defined(BOOST_MPL_NO_APPLY_TEMPLATE)
+# if !defined(BOOST_MPL_CFG_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
+#define AUX778076_COUNT_ARGS_PREFIX apply
+#define AUX778076_COUNT_ARGS_DEFAULT na
+#define AUX778076_COUNT_ARGS_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+#include <boost/mpl/aux_/count_args.hpp>
+}
+
template<
- typename F, AUX_APPLY_DEFAULT_PARAMS(typename T, void_)
+ typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na)
>
struct apply
- : aux::apply_impl_chooser<
- aux::apply_count_args< AUX_APPLY_PARAMS(T) >::value
- >::template result_< F, AUX_APPLY_PARAMS(T) >::type
+ : aux::apply_chooser<
+ aux::apply_count_args< AUX778076_APPLY_PARAMS(T) >::value
+ >::template result_< F, AUX778076_APPLY_PARAMS(T) >::type
{
};
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-# endif // BOOST_MPL_NO_APPLY_TEMPLATE
+# endif // BOOST_MPL_CFG_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
+# undef AUX778076_APPLY_N_SPEC_PARAMS
+# undef AUX778076_APPLY_N_PARTIAL_SPEC_PARAMS
+# undef AUX778076_APPLY_N_COMMA_PARAMS
+# undef AUX778076_APPLY_N_PARAMS
+# undef AUX778076_APPLY_DEF_PARAMS
+# undef AUX778076_APPLY_PARAMS
-} // namespace mpl
-} // namespace boost
+}}
-#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_CFG_NO_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()
+# define i_ BOOST_PP_FRAME_ITERATION(1)
template<
- typename F, AUX_APPLY_N_PARAMS(i, typename T)
+ typename F AUX778076_APPLY_N_COMMA_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
+struct BOOST_PP_CAT(apply,i_)
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ : BOOST_PP_CAT(apply_wrap,i_)<
+ typename lambda<F>::type
+ AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
+ >
{
- 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)
+#else
{
- // Metafunction forwarding confuses vc7
- typedef typename F::template apply<
- AUX_APPLY_N_PARAMS(i, T)
- >::type type;
-
+ typedef typename BOOST_PP_CAT(apply_wrap,i_)<
+ typename lambda<F>::type
+ AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
+ >::type type;
+#endif
BOOST_MPL_AUX_LAMBDA_SUPPORT(
- BOOST_PP_INC(i)
- , BOOST_PP_CAT(apply,i)
- , (F, AUX_APPLY_N_PARAMS(i,T))
+ BOOST_PP_INC(i_)
+ , BOOST_PP_CAT(apply,i_)
+ , (F AUX778076_APPLY_N_COMMA_PARAMS(i_,T))
)
};
-# endif // workarounds
-#if defined(BOOST_MPL_MSVC_ETI_BUG)
-//: workaround for ETI bug
+#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
+/// workaround for ETI bug
template<>
-struct BOOST_PP_CAT(apply,i)<AUX_APPLY_N_SPEC_PARAMS(i, int)>
+struct BOOST_PP_CAT(apply,i_)<AUX778076_APPLY_N_SPEC_PARAMS(i_, int)>
{
typedef int type;
};
#endif
-# endif // i > 0
-
-# if !defined(BOOST_MPL_NO_APPLY_TEMPLATE)
+# if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-#if i == BOOST_MPL_METAFUNCTION_MAX_ARITY
-
-//: primary template (not a specialization!)
+#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+/// primary template (not a specialization!)
template<
- typename F AUX_APPLY_N_COMMA_PARAMS(i, typename T)
+ typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
>
struct apply
- : BOOST_PP_CAT(apply,i)< F AUX_APPLY_N_COMMA_PARAMS(i, T) >
+ : BOOST_PP_CAT(apply,i_)< F AUX778076_APPLY_N_COMMA_PARAMS(i_, T) >
{
};
-
#else
-
template<
- typename F AUX_APPLY_N_COMMA_PARAMS(i, typename T)
+ typename F AUX778076_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) >
+struct apply< F AUX778076_APPLY_N_PARTIAL_SPEC_PARAMS(i_, T, na) >
+ : BOOST_PP_CAT(apply,i_)< F AUX778076_APPLY_N_COMMA_PARAMS(i_, T) >
{
};
+#endif
-#endif // i == BOOST_MPL_METAFUNCTION_MAX_ARITY
-
-# else
+# else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
namespace aux {
template<>
-struct apply_impl_chooser<i>
+struct apply_chooser<i_>
{
template<
- typename F, AUX_APPLY_PARAMS(typename T)
+ typename F, AUX778076_APPLY_PARAMS(typename T)
>
struct result_
{
- typedef BOOST_PP_CAT(apply,i)<
- F AUX_APPLY_N_COMMA_PARAMS(i, T)
+ typedef BOOST_PP_CAT(apply,i_)<
+ F AUX778076_APPLY_N_COMMA_PARAMS(i_, T)
> type;
};
};
} // namespace aux
+#endif
# 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
+# endif // BOOST_MPL_CFG_NO_APPLY_TEMPLATE
-# undef j
+# undef i_
#endif // BOOST_PP_IS_ITERATING
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_APPLY_FWD_HPP_INCLUDED
+#define BOOST_MPL_APPLY_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/apply_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.2 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/aux_/na.hpp>
+#endif
+
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER apply_fwd.hpp
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/preprocessor/default_params.hpp>
+# include <boost/mpl/aux_/config/ctps.hpp>
+# include <boost/mpl/aux_/nttp_decl.hpp>
+
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+// agurt, 15/jan/02: top-level 'apply' template gives an ICE on MSVC
+// (for known reasons)
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+# define BOOST_MPL_CFG_NO_APPLY_TEMPLATE
+#endif
+
+namespace boost { namespace mpl {
+
+// local macro, #undef-ined at the end of the header
+# define AUX778076_APPLY_DEF_PARAMS(param, value) \
+ BOOST_MPL_PP_DEFAULT_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ , value \
+ ) \
+ /**/
+
+# define AUX778076_APPLY_N_COMMA_PARAMS(n, param) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_MPL_PP_PARAMS(n, param) \
+ /**/
+
+# if !defined(BOOST_MPL_CFG_NO_APPLY_TEMPLATE)
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+// forward declaration
+template<
+ typename F, AUX778076_APPLY_DEF_PARAMS(typename T, na)
+ >
+struct apply;
+#else
+namespace aux {
+template< BOOST_AUX_NTTP_DECL(int, arity_) > struct apply_chooser;
+}
+#endif
+
+# endif // BOOST_MPL_CFG_NO_APPLY_TEMPLATE
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply_fwd.hpp>))
+#include BOOST_PP_ITERATE()
+
+
+# undef AUX778076_APPLY_N_COMMA_PARAMS
+# undef AUX778076_APPLY_DEF_PARAMS
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_APPLY_FWD_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i_ BOOST_PP_FRAME_ITERATION(1)
+
+template<
+ typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(apply,i_);
+
+#undef i_
+#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
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
+#define BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/apply_wrap.hpp,v $
+// $Date: 2004/09/03 15:56:55 $
+// $Revision: 1.3 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/aux_/arity.hpp>
+# include <boost/mpl/aux_/has_apply.hpp>
+# include <boost/mpl/aux_/na.hpp>
+# include <boost/mpl/aux_/msvc_never_true.hpp>
+#endif
+
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER apply_wrap.hpp
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/preprocessor/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/eti.hpp>
+# include <boost/mpl/aux_/config/ctps.hpp>
+# include <boost/mpl/aux_/config/msvc.hpp>
+# include <boost/mpl/aux_/config/workaround.hpp>
+
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/logical/and.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/iterate.hpp>
+
+
+namespace boost { namespace mpl {
+
+// local macros, #undef-ined at the end of the header
+# define AUX778076_APPLY_WRAP_PARAMS(n, param) \
+ BOOST_MPL_PP_PARAMS(n, param) \
+ /**/
+
+# define AUX778076_APPLY_WRAP_SPEC_PARAMS(n, param) \
+ BOOST_MPL_PP_ENUM(BOOST_PP_INC(n), param) \
+ /**/
+
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/apply_wrap.hpp>))
+#include BOOST_PP_ITERATE()
+
+
+# undef AUX778076_APPLY_WRAP_SPEC_PARAMS
+# undef AUX778076_APPLY_WRAP_PARAMS
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_APPLY_WRAP_HPP_INCLUDED
+
+///// iteration, depth == 1
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+# define i_ BOOST_PP_FRAME_ITERATION(1)
+
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+// MSVC version
+
+#define AUX778076_MSVC_DTW_NAME BOOST_PP_CAT(msvc_apply,i_)
+#define AUX778076_MSVC_DTW_ORIGINAL_NAME apply
+#define AUX778076_MSVC_DTW_ARITY i_
+#include <boost/mpl/aux_/msvc_dtw.hpp>
+
+template<
+ typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(apply_wrap,i_)
+{
+ // Metafunction forwarding confuses vc6
+ typedef typename BOOST_PP_CAT(msvc_apply,i_)<F>::template result_<
+ AUX778076_APPLY_WRAP_PARAMS(i_, T)
+ >::type type;
+};
+
+# elif defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+// MWCW/Borland version
+
+template<
+ int N, typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(apply_wrap_impl,i_);
+
+#define BOOST_PP_ITERATION_PARAMS_2 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY - i_, <boost/mpl/apply_wrap.hpp>))
+#include BOOST_PP_ITERATE()
+
+template<
+ typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(apply_wrap,i_)
+ : BOOST_PP_CAT(apply_wrap_impl,i_)<
+ ::boost::mpl::aux::arity<F,i_>::value
+ , F
+ BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
+ >::type
+{
+};
+
+# else
+// ISO98 C++, with minor concession to vc7
+
+template<
+ typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
+#if i_ == 0
+ , typename has_apply_ = typename aux::has_apply<F>::type
+#endif
+ >
+struct BOOST_PP_CAT(apply_wrap,i_)
+// metafunction forwarding confuses MSVC 7.0
+#if !BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+ : F::template apply< AUX778076_APPLY_WRAP_PARAMS(i_, T) >
+{
+#else
+{
+ typedef typename F::template apply<
+ AUX778076_APPLY_WRAP_PARAMS(i_, T)
+ >::type type;
+#endif
+};
+
+#if i_ == 0 && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+template< typename F >
+struct BOOST_PP_CAT(apply_wrap,i_)<F,true_>
+ : F::apply
+{
+};
+#endif
+
+# endif // workarounds
+
+#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
+/// workaround for ETI bug
+template<>
+struct BOOST_PP_CAT(apply_wrap,i_)<AUX778076_APPLY_WRAP_SPEC_PARAMS(i_, int)>
+{
+ typedef int type;
+};
+#endif
+
+# undef i_
+
+///// iteration, depth == 2
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+# define j_ BOOST_PP_FRAME_ITERATION(2)
+
+template<
+ typename F BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(apply_wrap_impl,i_)<
+ BOOST_MPL_PP_ADD(i_, j_)
+ , F
+ BOOST_PP_COMMA_IF(i_) AUX778076_APPLY_WRAP_PARAMS(i_, T)
+ >
+{
+ typedef typename F::template apply<
+ AUX778076_APPLY_WRAP_PARAMS(i_, T)
+#if i_ == 0 && j_ == 0
+/// since the defaults are "lost", we have to pass *something* even for nullary
+/// metafunction classes
+ na
+#else
+ BOOST_PP_COMMA_IF(BOOST_PP_AND(i_, j_)) BOOST_MPL_PP_ENUM(j_, na)
+#endif
+ > type;
+};
+
+# undef j_
+
+#endif // BOOST_PP_IS_ITERATING
-//-----------------------------------------------------------------------------
-// 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)
#ifndef BOOST_MPL_ARG_HPP_INCLUDED
#define BOOST_MPL_ARG_HPP_INCLUDED
-#include "boost/mpl/aux_/config/static_constant.hpp"
+// Copyright Peter Dimov 2001-2002
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/arg.hpp,v $
+// $Date: 2004/09/21 13:48:07 $
+// $Revision: 1.12 $
#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"
+# include <boost/mpl/arg_fwd.hpp>
+# include <boost/mpl/aux_/na.hpp>
+# include <boost/mpl/aux_/na_assert.hpp>
+# include <boost/mpl/aux_/arity_spec.hpp>
+# include <boost/mpl/aux_/arg_typedef.hpp>
#endif
-#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
-#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
- && !defined(BOOST_MPL_PREPROCESSING_MODE)
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER arg.hpp
-# include "boost/mpl/aux_/include_preprocessed.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"
+# 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_/nttp_decl.hpp>
+
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
-namespace boost {
-namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
// 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) \
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define AUX778076_ARG_N_DEFAULT_PARAMS(param,value) \
BOOST_MPL_PP_DEFAULT_PARAMS( \
- BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
, param \
, value \
) \
/**/
#else
-# define AUX_ARG_N_DEFAULT_PARAMS(param,value) \
+# define AUX778076_ARG_N_DEFAULT_PARAMS(param,value) \
BOOST_MPL_PP_PARAMS( \
- BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
, param \
) \
/**/
#endif
#define BOOST_PP_ITERATION_PARAMS_1 \
- (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY, "boost/mpl/arg.hpp"))
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/arg.hpp>))
#include BOOST_PP_ITERATE()
-# undef AUX_ARG_N_DEFAULT_PARAMS
+# undef AUX778076_ARG_N_DEFAULT_PARAMS
BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1,int,arg)
-} // namespace mpl
-} // namespace boost
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
-#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_ARG_HPP_INCLUDED
///// iteration
#else
-#define i BOOST_PP_FRAME_ITERATION(1)
+#define i_ BOOST_PP_FRAME_ITERATION(1)
-#if i > 0
+#if i_ > 0
-template<> struct arg<i>
+template<> struct arg<i_>
{
- BOOST_STATIC_CONSTANT(int, value = i);
- typedef arg<BOOST_PP_INC(i)> next;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_STATIC_CONSTANT(int, value = i_);
+ typedef arg<BOOST_PP_INC(i_)> next;
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- AUX_ARG_N_DEFAULT_PARAMS(typename U, void_)
+ AUX778076_ARG_N_DEFAULT_PARAMS(typename U, na)
>
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
+ typedef BOOST_PP_CAT(U,i_) type;
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
template<> struct arg<-1>
{
BOOST_STATIC_CONSTANT(int, value = -1);
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- AUX_ARG_N_DEFAULT_PARAMS(typename U, void_)
+ AUX778076_ARG_N_DEFAULT_PARAMS(typename U, na)
>
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
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
-#endif // i > 0
+#endif // i_ > 0
-#undef i
+#undef i_
#endif // BOOST_PP_IS_ITERATING
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Peter Dimov 2001-2002
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/arg_fwd.hpp,v $
+// $Date: 2004/09/28 13:56:58 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
-namespace boost {
-namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct arg;
-} // namespace mpl
-} // namespace boost
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+BOOST_MPL_AUX_ADL_BARRIER_DECL(arg)
#endif // BOOST_MPL_ARG_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_ASSERT_HPP_INCLUDED
+#define BOOST_MPL_ASSERT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/assert.hpp,v $
+// $Date: 2004/09/28 13:56:58 $
+// $Revision: 1.13 $
+
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/aux_/value_wknd.hpp>
+#include <boost/mpl/aux_/nested_type_wknd.hpp>
+#include <boost/mpl/aux_/yes_no.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/aux_/adl_barrier.hpp>
+
+#include <boost/mpl/aux_/config/nttp.hpp>
+#include <boost/mpl/aux_/config/dtp.hpp>
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#include <boost/preprocessor/cat.hpp>
+
+#if BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+ || (BOOST_MPL_CFG_GCC != 0)
+# define BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
+#endif
+
+#if BOOST_WORKAROUND(__MWERKS__, < 0x3202) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \
+ || BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+# define BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
+#endif
+
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+
+struct failed {};
+
+// agurt, 24/aug/04: MSVC 7.1 workaround here and below: return/accept
+// 'assert<false>' by reference; can't apply it unconditionally -- apparently it
+// degrades quality of GCC diagnostics
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+# define AUX778076_ASSERT_ARG(x) x&
+#else
+# define AUX778076_ASSERT_ARG(x) x
+#endif
+
+template< bool C > struct assert { typedef void* type; };
+template<> struct assert<false> { typedef AUX778076_ASSERT_ARG(assert) type; };
+
+template< bool C >
+int assertion_failed( typename assert<C>::type );
+
+template< bool C >
+struct assertion
+{
+ static int failed( assert<false> );
+};
+
+template<>
+struct assertion<true>
+{
+ static int failed( void* );
+};
+
+struct assert_
+{
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+ template< typename T1, typename T2 = na, typename T3 = na, typename T4 = na > struct types {};
+#endif
+ static assert_ const arg;
+ enum relations { equal = 1, not_equal, greater, greater_equal, less, less_equal };
+};
+
+
+#if !defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
+
+bool operator==( failed, failed );
+bool operator!=( failed, failed );
+bool operator>( failed, failed );
+bool operator>=( failed, failed );
+bool operator<( failed, failed );
+bool operator<=( failed, failed );
+
+#if defined(__EDG_VERSION__)
+template< bool (*)(failed, failed), long x, long y > struct assert_relation {};
+# define BOOST_MPL_AUX_ASSERT_RELATION(x, y, r) assert_relation<r,x,y>
+#else
+template< BOOST_MPL_AUX_NTTP_DECL(long, x), BOOST_MPL_AUX_NTTP_DECL(long, y), bool (*)(failed, failed) >
+struct assert_relation {};
+# define BOOST_MPL_AUX_ASSERT_RELATION(x, y, r) assert_relation<x,y,r>
+#endif
+
+#else // BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
+
+boost::mpl::aux::weighted_tag<1>::type operator==( assert_, assert_ );
+boost::mpl::aux::weighted_tag<2>::type operator!=( assert_, assert_ );
+boost::mpl::aux::weighted_tag<3>::type operator>( assert_, assert_ );
+boost::mpl::aux::weighted_tag<4>::type operator>=( assert_, assert_ );
+boost::mpl::aux::weighted_tag<5>::type operator<( assert_, assert_ );
+boost::mpl::aux::weighted_tag<6>::type operator<=( assert_, assert_ );
+
+template< assert_::relations r, long x, long y > struct assert_relation {};
+
+#endif
+
+
+#if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
+
+template< bool > struct assert_arg_pred_impl { typedef int type; };
+template<> struct assert_arg_pred_impl<true> { typedef void* type; };
+
+template< typename P > struct assert_arg_pred
+{
+ typedef typename P::type p_type;
+ typedef typename assert_arg_pred_impl< p_type::value >::type type;
+};
+
+template< typename P > struct assert_arg_pred_not
+{
+ typedef typename P::type p_type;
+ enum { p = !p_type::value };
+ typedef typename assert_arg_pred_impl<p>::type type;
+};
+
+template< typename Pred >
+failed ************ (Pred::************
+ assert_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type )
+ );
+
+template< typename Pred >
+failed ************ (boost::mpl::not_<Pred>::************
+ assert_not_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type )
+ );
+
+template< typename Pred >
+AUX778076_ASSERT_ARG(assert<false>)
+assert_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type );
+
+template< typename Pred >
+AUX778076_ASSERT_ARG(assert<false>)
+assert_not_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type );
+
+
+#else // BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
+
+template< bool c, typename Pred > struct assert_arg_type_impl
+{
+ typedef failed ************ Pred::* mwcw83_wknd;
+ typedef mwcw83_wknd ************* type;
+};
+
+template< typename Pred > struct assert_arg_type_impl<true,Pred>
+{
+ typedef AUX778076_ASSERT_ARG(assert<false>) type;
+};
+
+template< typename Pred > struct assert_arg_type
+ : assert_arg_type_impl< BOOST_MPL_AUX_VALUE_WKND(BOOST_MPL_AUX_NESTED_TYPE_WKND(Pred))::value, Pred >
+{
+};
+
+template< typename Pred >
+typename assert_arg_type<Pred>::type
+assert_arg(void (*)(Pred), int);
+
+template< typename Pred >
+typename assert_arg_type< boost::mpl::not_<Pred> >::type
+assert_not_arg(void (*)(Pred), int);
+
+# if !defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
+template< long x, long y, bool (*r)(failed, failed) >
+typename assert_arg_type_impl< false,BOOST_MPL_AUX_ASSERT_RELATION(x,y,r) >::type
+assert_rel_arg( BOOST_MPL_AUX_ASSERT_RELATION(x,y,r) );
+# else
+template< assert_::relations r, long x, long y >
+typename assert_arg_type_impl< false,assert_relation<r,x,y> >::type
+assert_rel_arg( assert_relation<r,x,y> );
+# endif
+
+#endif // BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER
+
+#undef AUX778076_ASSERT_ARG
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+
+
+// BOOST_MPL_ASSERT((pred<x,...>))
+
+#define BOOST_MPL_ASSERT(pred) \
+enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<false>( \
+ boost::mpl::assert_arg( (void (*) pred)0, 1 ) \
+ ) \
+ ) \
+}\
+/**/
+
+// BOOST_MPL_ASSERT_NOT((pred<x,...>))
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+# define BOOST_MPL_ASSERT_NOT(pred) \
+enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion<false>::failed( \
+ boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
+ ) \
+ ) \
+}\
+/**/
+#else
+# define BOOST_MPL_ASSERT_NOT(pred) \
+enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<false>( \
+ boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
+ ) \
+ ) \
+}\
+/**/
+#endif
+
+// BOOST_MPL_ASSERT_RELATION(x, ==|!=|<=|<|>=|>, y)
+
+#if defined(BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES)
+
+# if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
+# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
+enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<(x rel y)>( \
+ (boost::mpl::failed ************ ( boost::mpl::assert_relation< \
+ boost::mpl::assert_::relations( sizeof( \
+ boost::mpl::assert_::arg rel boost::mpl::assert_::arg \
+ ) ) \
+ , x \
+ , y \
+ >::************)) 0 ) \
+ ) \
+} \
+/**/
+# else
+# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
+enum { \
+ BOOST_PP_CAT(mpl_assert_rel,__LINE__) = sizeof(boost::mpl::assert_::arg rel boost::mpl::assert_::arg) \
+ , BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) \
+ , BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,__LINE__)>( \
+ boost::mpl::assert_rel_arg( boost::mpl::assert_relation< \
+ boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,__LINE__)) \
+ , x \
+ , y \
+ >() ) \
+ ) \
+ ) \
+} \
+/**/
+# endif
+
+#else // !BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
+
+# if defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
+# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
+enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<(x rel y)>( boost::mpl::assert_rel_arg( \
+ boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))() \
+ ) ) \
+ ) \
+}\
+/**/
+# else
+# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
+enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<(x rel y)>( (boost::mpl::failed ************ ( \
+ boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))::************))0 ) \
+ ) \
+}\
+/**/
+# endif
+
+#endif
+
+
+// BOOST_MPL_ASSERT_MSG( (pred<x,...>::value), USER_PROVIDED_MESSAGE, (types<x,...>) )
+
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
+# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
+ struct msg; \
+ typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \
+ { \
+ using boost::mpl::assert_::types; \
+ static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \
+ { return 0; } \
+ } BOOST_PP_CAT(mpl_assert_arg,__LINE__); \
+ enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \
+ ) \
+ }\
+/**/
+#else
+# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
+ struct msg; \
+ typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \
+ { \
+ static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \
+ { return 0; } \
+ } BOOST_PP_CAT(mpl_assert_arg,__LINE__); \
+ enum { \
+ BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
+ boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \
+ ) \
+ }\
+/**/
+#endif
+
+#endif // BOOST_MPL_ASSERT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_ADL_BARRIER_HPP_INCLUDED
+#define BOOST_MPL_AUX_ADL_BARRIER_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/adl_barrier.hpp,v $
+// $Date: 2004/09/28 13:56:59 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/aux_/config/adl.hpp>
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)
+
+# define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE mpl_
+# define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN namespace mpl_ {
+# define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE }
+# define BOOST_MPL_AUX_ADL_BARRIER_DECL(type) \
+ namespace boost { namespace mpl { \
+ using ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::type; \
+ } } \
+/**/
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+namespace BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE { namespace aux {} }
+namespace boost { namespace mpl { using namespace BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE;
+namespace aux { using namespace BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::aux; }
+}}
+#endif
+
+#else // BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE
+
+# define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE boost::mpl
+# define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN namespace boost { namespace mpl {
+# define BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE }}
+# define BOOST_MPL_AUX_ADL_BARRIER_DECL(type) /**/
+
+#endif
+
+#endif // BOOST_MPL_AUX_ADL_BARRIER_HPP_INCLUDED
+++ /dev/null
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/algorithm_namespace.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_ALGORITHM_NAMESPACE_HPP_INCLUDED
-#define BOOST_MPL_AUX_ALGORITHM_NAMESPACE_HPP_INCLUDED
-
-#if defined(__GNUC__) && __GNUC__ >= 3
-
-# define BOOST_MPL_AUX_AGLORITHM_NAMESPACE_PREFIX algo_::
-# define BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN namespace algo_ {
-# define BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END } using namespace algo_;
-
-#else
-
-# define BOOST_MPL_AUX_AGLORITHM_NAMESPACE_PREFIX /**/
-# define BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN /**/
-# define BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END /**/
-
-#endif
-
-#endif // BOOST_MPL_AUX_ALGORITHM_NAMESPACE_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
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arg_typedef.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.3 $
-#if defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+#include <boost/mpl/aux_/config/lambda.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \
+ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+
# 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
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/arity.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_HPP_INCLUDED
#define BOOST_MPL_AUX_ARITY_HPP_INCLUDED
-#include "boost/mpl/aux_/config/dtp.hpp"
-#include "boost/mpl/aux_/config/nttp.hpp"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arity.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/aux_/config/dtp.hpp>
-#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+#if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
-# include "boost/config.hpp"
+# include <boost/mpl/aux_/nttp_decl.hpp>
+# include <boost/mpl/aux_/config/static_constant.hpp>
-namespace boost {
-namespace mpl {
-namespace aux {
+namespace boost { namespace mpl { namespace aux {
// agurt, 15/mar/02: it's possible to implement the template so that it will
// "just work" and do not require any specialization, but not on the compilers
BOOST_STATIC_CONSTANT(int, value = N);
};
-} // namespace aux
-} // namespace mpl
-} // namespace boost
+}}}
-#endif // BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES
+#endif // BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES
#endif // BOOST_MPL_AUX_ARITY_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arity_spec.hpp,v $
+// $Date: 2004/10/30 06:10:35 $
+// $Revision: 1.5.2.2 $
+
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/limits/arity.hpp>
+#include <boost/mpl/aux_/config/dtp.hpp>
+#include <boost/mpl/aux_/preprocessor/params.hpp>
+#include <boost/mpl/aux_/arity.hpp>
+#include <boost/mpl/aux_/template_arity_fwd.hpp>
+#include <boost/mpl/aux_/config/ttp.hpp>
+#include <boost/mpl/aux_/config/lambda.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
-#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+#if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_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) > \
> \
{ \
BOOST_STATIC_CONSTANT(int \
- , value = BOOST_MPL_METAFUNCTION_MAX_ARITY \
+ , value = BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
); \
}; \
} \
BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(i,typename,name) \
/**/
+
+#if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \
+ && !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
+# define BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(i, name) \
+namespace aux { \
+template< BOOST_MPL_PP_PARAMS(i,typename T) > \
+struct template_arity< name<BOOST_MPL_PP_PARAMS(i,T)> > \
+ : int_<i> \
+{ \
+}; \
+} \
+/**/
+#else
+# define BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/
+#endif
+
+
#endif // BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED
+#define BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/common_name_wknd.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x561)
+// agurt, 12/nov/02: to suppress the bogus "Cannot have both a template class
+// and function named 'xxx'" diagnostic
+# define BOOST_MPL_AUX_COMMON_NAME_WKND(name) \
+namespace name_##wknd { \
+template< typename > void name(); \
+} \
+/**/
+
+#else
+
+# define BOOST_MPL_AUX_COMMON_NAME_WKND(name) /**/
+
+#endif // __BORLANDC__
+
+#endif // BOOST_MPL_AUX_COMMON_NAME_WKND_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_ADL_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_ADL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/adl.hpp,v $
+// $Date: 2004/09/16 14:08:47 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/intel.hpp>
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+// agurt, 25/apr/04: technically, the ADL workaround is only needed for GCC,
+// but putting everything expect public, user-specializable metafunctions into
+// a separate global namespace has a nice side effect of reducing the length
+// of template instantiation symbols, so we apply the workaround on all
+// platforms that can handle it
+
+#if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE) \
+ && ( BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \
+ || BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) \
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
+ || BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, BOOST_TESTED_AT(810)) \
+ )
+
+# define BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE
+
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_ADL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_ARRAYS_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_ARRAYS_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2003-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/arrays.hpp,v $
+// $Date: 2004/09/03 15:56:55 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+ || BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ )
+
+# define BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES
+
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_ARRAYS_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_BIND_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_BIND_HPP_INCLUDED
+
+// Copyright David Abrahams 2002
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/bind.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+ )
+
+# define BOOST_MPL_CFG_NO_BIND_TEMPLATE
+
+#endif
+
+//#define BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+#endif // BOOST_MPL_AUX_CONFIG_BIND_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#if defined(BOOST_MSVC) && BOOST_MSVC < 1300
-# define BOOST_MPL_COMPILER_DIR msvc60
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/compiler.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.9 $
-#elif defined(BOOST_MSVC) && BOOST_MSVC == 1300
-# define BOOST_MPL_COMPILER_DIR msvc70
+#if !defined(BOOST_MPL_CFG_COMPILER_DIR)
-#elif defined(__GNUC__) && !defined(__EDG_VERSION__)
-# define BOOST_MPL_COMPILER_DIR gcc
+# include <boost/mpl/aux_/config/dtp.hpp>
+# include <boost/mpl/aux_/config/ttp.hpp>
+# include <boost/mpl/aux_/config/ctps.hpp>
+# include <boost/mpl/aux_/config/msvc.hpp>
+# include <boost/mpl/aux_/config/gcc.hpp>
+# include <boost/mpl/aux_/config/workaround.hpp>
-#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
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+# define BOOST_MPL_CFG_COMPILER_DIR msvc60
-#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 BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+# define BOOST_MPL_CFG_COMPILER_DIR msvc70
-#elif defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-# define BOOST_MPL_COMPILER_DIR no_ctps
+# elif BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304))
+# define BOOST_MPL_CFG_COMPILER_DIR gcc
-#elif defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS)
-# define BOOST_MPL_COMPILER_DIR no_ttp
+# elif BOOST_WORKAROUND(__BORLANDC__, < 0x600)
+# if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define BOOST_MPL_CFG_COMPILER_DIR bcc551
+# else
+# define BOOST_MPL_CFG_COMPILER_DIR bcc
+# endif
+
+# elif BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+# define BOOST_MPL_CFG_COMPILER_DIR dmc
+
+# elif defined(__MWERKS__)
+# if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define BOOST_MPL_CFG_COMPILER_DIR mwcw
+# else
+# define BOOST_MPL_CFG_COMPILER_DIR plain
+# endif
+
+# elif defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# define BOOST_MPL_CFG_COMPILER_DIR no_ctps
+
+# elif defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
+# define BOOST_MPL_CFG_COMPILER_DIR no_ttp
+
+# else
+# define BOOST_MPL_CFG_COMPILER_DIR plain
+# endif
-#else
-# define BOOST_MPL_COMPILER_DIR plain
-#endif
+#endif // BOOST_MPL_CFG_COMPILER_DIR
#endif // BOOST_MPL_AUX_CONFIG_COMPILER_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/ctps.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_CTPS_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_CTPS_HPP_INCLUDED
-#include "boost/config.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/ctps.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/workaround.hpp>
+#include <boost/config.hpp>
-#if !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION) \
+#if !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
- && defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG))
+ && BOOST_WORKAROUND(__BORLANDC__, < 0x600)
-# define BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION
+# define BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC
#endif
-// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is defined in "boost/config.hpp"
+// BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION is defined in <boost/config.hpp>
#endif // BOOST_MPL_AUX_CONFIG_CTPS_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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_DTP_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_DTP_HPP_INCLUDED
-#include "boost/config.hpp"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/dtp.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.9 $
+
+#include <boost/mpl/aux_/config/workaround.hpp>
// MWCW 7.x-8.0 "losts" default template parameters of nested class
// templates when their owner classes are passed as arguments to other
// 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(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
- && defined(__BORLANDC__) && __BORLANDC__ >= 0x560 && \
- (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG))
+ && BOOST_WORKAROUND(__BORLANDC__, >= 0x560) \
+ && BOOST_WORKAROUND(__BORLANDC__, < 0x600)
-# define BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES
+# define BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES
#endif
-#if !defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) \
+#if !defined(BOOST_MPL_CFG_BROKEN_DEFAULT_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) \
+ && ( BOOST_WORKAROUND(__MWERKS__, <= 0x3001) \
+ || BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
+ || defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) \
)
-# define BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES
+# define BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES
#endif
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/eti.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_ETI_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_ETI_HPP_INCLUDED
-#include "boost/config.hpp"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/eti.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
// flags for MSVC 6.5's so-called "early template instantiation bug"
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
-# if BOOST_MSVC < 1300
-# define BOOST_MPL_MSVC_60_ETI_BUG
-# endif
-# define BOOST_MPL_MSVC_ETI_BUG
+#if !defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+
+# define BOOST_MPL_CFG_MSVC_60_ETI_BUG
+
+#endif
+
+#if !defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+
+# define BOOST_MPL_CFG_MSVC_70_ETI_BUG
+
+#endif
+
+#if !defined(BOOST_MPL_CFG_MSVC_ETI_BUG) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) \
+ || defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG) \
+ )
+
+# define BOOST_MPL_CFG_MSVC_ETI_BUG
+
#endif
#endif // BOOST_MPL_AUX_CONFIG_ETI_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_GCC_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_GCC_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/gcc.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.2 $
+
+#if defined(__GNUC__) && !defined(__EDG_VERSION__)
+# define BOOST_MPL_CFG_GCC ((__GNUC__ << 8) | __GNUC_MINOR__)
+#else
+# define BOOST_MPL_CFG_GCC 0
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_GCC_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_HAS_APPLY_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_HAS_APPLY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/has_apply.hpp,v $
+// $Date: 2004/09/13 06:10:10 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/aux_/config/has_xxx.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_HAS_APPLY) \
+ && ( defined(BOOST_MPL_CFG_NO_HAS_XXX) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, < 300) \
+ || BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202)) \
+ )
+
+# define BOOST_MPL_CFG_NO_HAS_APPLY
+
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_HAS_APPLY_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_HAS_XXX_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_HAS_XXX_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+// Copyright David Abrahams 2002-2003
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/has_xxx.hpp,v $
+// $Date: 2004/09/03 15:56:56 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/config/overload_resolution.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+// agurt, 11/jan/03: signals a stub-only 'has_xxx' implementation
+
+#if !defined(BOOST_MPL_CFG_NO_HAS_XXX) \
+ && ( defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) \
+ || BOOST_WORKAROUND(__GNUC__, <= 2) \
+ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) \
+ )
+
+# define BOOST_MPL_CFG_NO_HAS_XXX
+
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_HAS_XXX_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_INTEGRAL_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_INTEGRAL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/integral.hpp,v $
+// $Date: 2004/09/07 08:51:32 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !defined(BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && BOOST_WORKAROUND(__BORLANDC__, < 0x600)
+
+# define BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS
+
+#endif
+
+#if !defined(BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && ( BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || BOOST_WORKAROUND(__EDG_VERSION__, <= 238) \
+ )
+
+# define BOOST_MPL_CFG_NO_NESTED_VALUE_ARITHMETIC
+
+#endif
+
+#endif // BOOST_MPL_AUX_CONFIG_INTEGRAL_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED
+#define BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/intel.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.1 $
+
+
+// BOOST_INTEL_CXX_VERSION is defined here:
+#include <boost/config.hpp>
+
+#endif // BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/lambda.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_LAMBDA_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_LAMBDA_HPP_INCLUDED
-#include "boost/mpl/aux_/config/ttp.hpp"
-#include "boost/config.hpp"
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/lambda.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/config/ttp.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
// agurt, 15/jan/02: full-fledged implementation requires both
// template template parameters _and_ partial specialization
-#if defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
- || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
- && !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
-# define BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
-#endif
+#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \
+ && ( defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
+ || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ )
-//#define BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT
-//#define BOOST_MPL_NO_LAMBDA_HEURISTIC
+# define BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
+
+#endif
#endif // BOOST_MPL_AUX_CONFIG_LAMBDA_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/msvc.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_MSVC_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_MSVC_HPP_INCLUDED
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/msvc.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.3 $
+
+
// BOOST_MSVC is defined here:
-#include "boost/config.hpp"
+#include <boost/config.hpp>
#endif // BOOST_MPL_AUX_CONFIG_MSVC_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/msvc_typename.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_MSVC_TYPENAME_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_MSVC_TYPENAME_HPP_INCLUDED
-#include "boost/config.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/msvc_typename.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
# define BOOST_MSVC_TYPENAME
#else
# define BOOST_MSVC_TYPENAME typename
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/nttp.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_NTTP_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_NTTP_HPP_INCLUDED
-#include "boost/mpl/aux_/config/msvc.hpp"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/nttp.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-// MSVC 6.5 ICE-s on the code as simple as this:
+// MSVC 6.5 ICE-s on the code as simple as this (see "aux_/nttp_decl.hpp"
+// for a workaround):
//
// namespace std {
// template< typename Char > struct string;
// namespace boost { namespace mpl {
// template< int > struct arg;
// }}
-//
-// fortunately, a workaround is simple as well:
-//
-// typedef int nttp_int;
-// template< nttp_int > struct arg;
-
-#if defined(BOOST_MSVC) && BOOST_MSVC < 1300
-#include "boost/preprocessor/cat.hpp"
-
-#if !defined(BOOST_MPL_PREPROCESSING_MODE)
-namespace boost { namespace mpl {
-typedef int nttp_int;
-typedef long nttp_long;
-}}
-#endif
+#if !defined(BOOST_MPL_CFG_NTTP_BUG) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE) \
+ && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-# define BOOST_MPL_AUX_NTTP_DECL(T, x) BOOST_PP_CAT(nttp_,T) x /**/
+# define BOOST_MPL_CFG_NTTP_BUG
-#else
-# define BOOST_MPL_AUX_NTTP_DECL(T, x) T x /**/
#endif
#endif // BOOST_MPL_AUX_CONFIG_NTTP_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/aux_/config/workaround.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/overload_resolution.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.9 $
+
+#include <boost/mpl/aux_/config/workaround.hpp>
-#if !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION) \
+#if !defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
- && ( BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
+ && ( BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
|| BOOST_WORKAROUND(__MWERKS__, < 0x3001) \
)
-# define BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION
+# define BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION
#endif
#ifndef BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED
-// Copyright (c) 2000-04 Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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)
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// 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 $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.6 $
-#include "boost/mpl/aux_/config/workaround.hpp"
+#include <boost/mpl/aux_/config/workaround.hpp>
-#if !defined(BOOST_MPL_BROKEN_PP_MACRO_EXPANSION) \
+#if !defined(BOOST_MPL_CFG_BROKEN_PP_MACRO_EXPANSION) \
&& ( BOOST_WORKAROUND(__MWERKS__, <= 0x3003) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
)
-# define BOOST_MPL_BROKEN_PP_MACRO_EXPANSION
+# define BOOST_MPL_CFG_BROKEN_PP_MACRO_EXPANSION
#endif
-//#define BOOST_MPL_NO_OWN_PP_PRIMITIVES
+#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
+# define BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES
+#endif
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING) \
- && BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x833))
-
+ && BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
# define BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING
-
#endif
+
#endif // BOOST_MPL_AUX_CONFIG_PREPROCESSOR_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/static_constant.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_STATIC_CONSTANT_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_STATIC_CONSTANT_HPP_INCLUDED
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/static_constant.hpp,v $
+// $Date: 2004/09/07 08:51:32 $
+// $Revision: 1.4 $
+
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
// BOOST_STATIC_CONSTANT is defined here:
-# include "boost/config.hpp"
+# include <boost/config.hpp>
+#else
+// undef the macro for the preprocessing mode
+# undef BOOST_STATIC_CONSTANT
#endif
#endif // BOOST_MPL_AUX_CONFIG_STATIC_CONSTANT_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/ttp.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_TTP_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_TTP_HPP_INCLUDED
-#include "boost/config.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/ttp.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.7 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-#if defined(BOOST_NO_TEMPLATE_TEMPLATES) \
- && ( !defined(BOOST_MSVC) || BOOST_MSVC < 1300 )
+#if !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
+ && defined(BOOST_NO_TEMPLATE_TEMPLATES)
-# define BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS
+# define BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS
#endif
-#if !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \
+#if !defined(BOOST_MPL_CFG_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)) \
+ && ( BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0302)) \
+ || BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
)
-# define BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+# define BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
#endif
-//-----------------------------------------------------------------------------
-// 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
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/use_preprocessed.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.7 $
+
+// #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/config/workaround.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_WORKAROUND_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED
-#include "boost/detail/workaround.hpp"
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/workaround.hpp,v $
+// $Date: 2004/09/02 15:40:45 $
+// $Revision: 1.3 $
+
+#include <boost/detail/workaround.hpp>
#endif // BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_AUX_FULL_LAMBDA_HPP_INCLUDED
+#define BOOST_MPL_AUX_FULL_LAMBDA_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/full_lambda.hpp,v $
+// $Date: 2004/09/04 01:10:19 $
+// $Revision: 1.14 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/lambda_fwd.hpp>
+# include <boost/mpl/bind_fwd.hpp>
+# include <boost/mpl/protect.hpp>
+# include <boost/mpl/quote.hpp>
+# include <boost/mpl/arg.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/mpl/int_fwd.hpp>
+# include <boost/mpl/aux_/template_arity.hpp>
+# include <boost/mpl/aux_/na_spec.hpp>
+# include <boost/mpl/aux_/config/ttp.hpp>
+# if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+# include <boost/mpl/if.hpp>
+# endif
+#endif
+
+#include <boost/mpl/aux_/lambda_arity_param.hpp>
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER full_lambda.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_/preprocessor/enum.hpp>
+# include <boost/mpl/aux_/preprocessor/repeat.hpp>
+# include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
+
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+namespace boost { namespace mpl {
+
+// local macros, #undef-ined at the end of the header
+# define AUX778076_LAMBDA_PARAMS(i_, param) \
+ BOOST_MPL_PP_PARAMS(i_, param) \
+ /**/
+
+# define AUX778076_BIND_PARAMS(param) \
+ BOOST_MPL_PP_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ ) \
+ /**/
+
+# define AUX778076_BIND_N_PARAMS(i_, param) \
+ BOOST_PP_COMMA_IF(i_) \
+ BOOST_MPL_PP_PARAMS(i_, param) \
+ /**/
+
+# define AUX778076_ARITY_PARAM(param) \
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(param) \
+ /**/
+
+
+#define n_ BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+namespace aux {
+
+template<
+ BOOST_MPL_PP_DEFAULT_PARAMS(n_,bool C,false)
+ >
+struct lambda_or
+ : true_
+{
+};
+
+template<>
+struct lambda_or< BOOST_MPL_PP_ENUM(n_,false) >
+ : false_
+{
+};
+
+} // namespace aux
+#undef n_
+
+template<
+ typename T
+ , typename Tag
+ AUX778076_ARITY_PARAM(typename Arity)
+ >
+struct lambda
+{
+ typedef false_ is_le;
+ typedef T result_;
+ typedef T type;
+};
+
+template<
+ typename T
+ >
+struct is_lambda_expression
+ : lambda<T>::is_le
+{
+};
+
+
+template< int N, typename Tag >
+struct lambda< arg<N>,Tag AUX778076_ARITY_PARAM(int_<-1>) >
+{
+ typedef true_ is_le;
+ typedef mpl::arg<N> result_; // qualified for the sake of MIPSpro 7.41
+ typedef mpl::protect<result_> type;
+};
+
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/aux_/full_lambda.hpp>))
+#include BOOST_PP_ITERATE()
+
+/// special case for 'protect'
+template< typename T, typename Tag >
+struct lambda< mpl::protect<T>,Tag AUX778076_ARITY_PARAM(int_<1>) >
+{
+ typedef false_ is_le;
+ typedef mpl::protect<T> result_;
+ typedef result_ type;
+};
+
+/// specializations for the main 'bind' form
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T)
+ , typename Tag
+ >
+struct lambda<
+ bind<F,AUX778076_BIND_PARAMS(T)>
+ , Tag
+ AUX778076_ARITY_PARAM(int_<BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)>)
+ >
+{
+ typedef false_ is_le;
+ typedef bind<F, AUX778076_BIND_PARAMS(T)> result_;
+ typedef result_ type;
+};
+
+
+#if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+
+template<
+ typename F
+ , typename Tag1
+ , typename Tag2
+ , typename Arity
+ >
+struct lambda<
+ lambda<F,Tag1,Arity>
+ , Tag2
+ , int_<3>
+ >
+{
+ typedef lambda< F,Tag2 > l1;
+ typedef lambda< Tag1,Tag2 > l2;
+
+ typedef typename l1::is_le is_le;
+ typedef bind1< quote1<aux::template_arity>, typename l1::result_ > arity_;
+ typedef lambda< typename if_<is_le,arity_,Arity>::type,Tag2 > l3;
+
+ typedef aux::le_result3<is_le, Tag2, mpl::lambda, l1, l2, l3> le_result_;
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+#elif !defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
+
+/// workaround for MWCW 8.3+/EDG < 303, leads to ambiguity on Digital Mars
+template<
+ typename F, typename Tag1, typename Tag2
+ >
+struct lambda<
+ lambda< F,Tag1 >
+ , Tag2
+ >
+{
+ typedef lambda< F,Tag2 > l1;
+ typedef lambda< Tag1,Tag2 > l2;
+
+ typedef typename l1::is_le is_le;
+ typedef aux::le_result2<is_le, Tag2, mpl::lambda, l1, l2> le_result_;
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+#endif
+
+# undef AUX778076_ARITY_PARAM
+# undef AUX778076_BIND_N_PARAMS
+# undef AUX778076_BIND_PARAMS
+# undef AUX778076_LAMBDA_PARAMS
+
+#if !defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+BOOST_MPL_AUX_NA_SPEC(2, lambda)
+#else
+BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
+#endif
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_AUX_FULL_LAMBDA_HPP_INCLUDED
+
+///// iteration, depth == 1
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+#define i_ BOOST_PP_FRAME_ITERATION(1)
+
+#if i_ > 0
+
+namespace aux {
+
+# define AUX778076_RESULT(unused, i_, T) \
+ BOOST_PP_COMMA_IF(i_) \
+ typename BOOST_PP_CAT(T, BOOST_PP_INC(i_))::result_ \
+ /**/
+
+# define AUX778076_TYPE(unused, i_, T) \
+ BOOST_PP_COMMA_IF(i_) \
+ typename BOOST_PP_CAT(T, BOOST_PP_INC(i_))::type \
+ /**/
+
+template<
+ typename IsLE, typename Tag
+ , template< AUX778076_LAMBDA_PARAMS(i_, typename P) > class F
+ , AUX778076_LAMBDA_PARAMS(i_, typename L)
+ >
+struct BOOST_PP_CAT(le_result,i_)
+{
+ typedef F<
+ BOOST_MPL_PP_REPEAT(i_, AUX778076_TYPE, L)
+ > result_;
+
+ typedef result_ type;
+};
+
+template<
+ typename Tag
+ , template< AUX778076_LAMBDA_PARAMS(i_, typename P) > class F
+ , AUX778076_LAMBDA_PARAMS(i_, typename L)
+ >
+struct BOOST_PP_CAT(le_result,i_)< true_,Tag,F,AUX778076_LAMBDA_PARAMS(i_, L) >
+{
+ typedef BOOST_PP_CAT(bind,i_)<
+ BOOST_PP_CAT(quote,i_)<F,Tag>
+ , BOOST_MPL_PP_REPEAT(i_, AUX778076_RESULT, L)
+ > result_;
+
+ typedef mpl::protect<result_> type;
+};
+
+# undef AUX778076_TYPE
+# undef AUX778076_RESULT
+
+} // namespace aux
+
+
+# define AUX778076_LAMBDA_TYPEDEF(unused, i_, T) \
+ typedef lambda< BOOST_PP_CAT(T, BOOST_PP_INC(i_)), Tag > \
+ BOOST_PP_CAT(l,BOOST_PP_INC(i_)); \
+/**/
+
+# define AUX778076_IS_LE_TYPEDEF(unused, i_, unused2) \
+ typedef typename BOOST_PP_CAT(l,BOOST_PP_INC(i_))::is_le \
+ BOOST_PP_CAT(is_le,BOOST_PP_INC(i_)); \
+/**/
+
+# define AUX778076_IS_LAMBDA_EXPR(unused, i_, unused2) \
+ BOOST_PP_COMMA_IF(i_) \
+ BOOST_PP_CAT(is_le,BOOST_PP_INC(i_))::value \
+/**/
+
+template<
+ template< AUX778076_LAMBDA_PARAMS(i_, typename P) > class F
+ , AUX778076_LAMBDA_PARAMS(i_, typename T)
+ , typename Tag
+ >
+struct lambda<
+ F<AUX778076_LAMBDA_PARAMS(i_, T)>
+ , Tag
+ AUX778076_ARITY_PARAM(int_<i_>)
+ >
+{
+ BOOST_MPL_PP_REPEAT(i_, AUX778076_LAMBDA_TYPEDEF, T)
+ BOOST_MPL_PP_REPEAT(i_, AUX778076_IS_LE_TYPEDEF, unused)
+
+ typedef typename aux::lambda_or<
+ BOOST_MPL_PP_REPEAT(i_, AUX778076_IS_LAMBDA_EXPR, unused)
+ >::type is_le;
+
+ typedef aux::BOOST_PP_CAT(le_result,i_)<
+ is_le, Tag, F, AUX778076_LAMBDA_PARAMS(i_, l)
+ > le_result_;
+
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+
+# undef AUX778076_IS_LAMBDA_EXPR
+# undef AUX778076_IS_LE_TYPEDEF
+# undef AUX778076_LAMBDA_TYPEDEF
+
+#endif // i_ > 0
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T)
+ , typename Tag
+ >
+struct lambda<
+ BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_, T)>
+ , Tag
+ AUX778076_ARITY_PARAM(int_<BOOST_PP_INC(i_)>)
+ >
+{
+ typedef false_ is_le;
+ typedef BOOST_PP_CAT(bind,i_)<
+ F
+ AUX778076_BIND_N_PARAMS(i_, T)
+ > result_;
+
+ typedef result_ type;
+};
+
+#undef i_
+#endif // BOOST_PP_IS_ITERATING
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_HAS_APPLY_HPP_INCLUDED
+#define BOOST_MPL_AUX_HAS_APPLY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/has_apply.hpp,v $
+// $Date: 2004/09/03 15:56:55 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/has_xxx.hpp>
+#include <boost/mpl/aux_/config/has_apply.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+#if !defined(BOOST_MPL_CFG_NO_HAS_APPLY)
+BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_apply, apply, false)
+#else
+template< typename T, typename fallback_ = false_ >
+struct has_apply
+ : fallback_
+{
+};
+#endif
+}}}
+
+#endif // BOOST_MPL_AUX_HAS_APPLY_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
+#define BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/has_type.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/has_xxx.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_type, type, true)
+}}}
+
+#endif // BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED
+++ /dev/null
-
-#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) \
- && !BOOST_WORKAROUND(__GNUC__, <= 2) \
- && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x833))
-
-# 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)
-
-# 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"
-
-// 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);
-// note that the code is _not_ standard-conforming, but it works,
-// and it resolves some nasty ICE cases with the above implementation
-
-// Modified dwa 8/Oct/02 to handle reference types.
-
-namespace boost { namespace mpl { namespace aux {
-
-struct has_xxx_tag;
-
-# 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
-{
- // 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<>
-struct msvc_is_incomplete<int>
-{
- BOOST_STATIC_CONSTANT(bool, value = false);
-};
-
-}}}
-
-# 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); \
-}; \
-/**/
-
-# 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_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) \
-/**/
-
-#endif // BOOST_MPL_AUX_HAS_XXX_HPP_INCLUDED
+++ /dev/null
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/ice_cast.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_ICE_CAST_HPP_INCLUDED
-#define BOOST_MPL_AUX_ICE_CAST_HPP_INCLUDED
-
-#include "boost/mpl/aux_/config/workaround.hpp"
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
- || BOOST_WORKAROUND(__GNUC__, < 3)
-# 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
-# define BOOST_MPL_AUX_ICE_CAST(T, expr) static_cast<T>(expr)
-#endif
-
-#endif // BOOST_MPL_AUX_ICE_CAST_HPP_INCLUDED
-// Copyright (c) 2001-04 Aleksey Gurtovoy
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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)
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// 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!
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.5 $
-#include "boost/mpl/aux_/config/compiler.hpp"
-#include "boost/mpl/aux_/config/preprocessor.hpp"
-#include "boost/preprocessor/cat.hpp"
-#include "boost/preprocessor/stringize.hpp"
+#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 \
+ BOOST_MPL_CFG_COMPILER_DIR/BOOST_MPL_PREPROCESSED_HEADER \
/**/
#else
# define AUX_PREPROCESSED_HEADER \
- BOOST_PP_CAT(BOOST_MPL_COMPILER_DIR,/)##BOOST_MPL_PREPROCESSED_HEADER \
+ BOOST_PP_CAT(BOOST_MPL_CFG_COMPILER_DIR,/)##BOOST_MPL_PREPROCESSED_HEADER \
/**/
#endif
-// + file: boost/mpl/aux_/intergal_wrapper.hpp
-// + last modified: 12/apr/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/integral_wrapper.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.10 $
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
-#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"
+#include <boost/mpl/integral_c_tag.hpp>
+#include <boost/mpl/aux_/static_cast.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-#include "boost/preprocessor/cat.hpp"
+#include <boost/preprocessor/cat.hpp>
#if !defined(AUX_WRAPPER_NAME)
# define AUX_WRAPPER_NAME BOOST_PP_CAT(AUX_WRAPPER_VALUE_TYPE,_)
# 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 >
+# define AUX_WRAPPER_INST(value) BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::AUX_WRAPPER_NAME< value >
# endif
#endif
-namespace boost { namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
template< AUX_WRAPPER_PARAMS(N) >
struct AUX_WRAPPER_NAME
typedef AUX_WRAPPER_NAME type;
#endif
typedef AUX_WRAPPER_VALUE_TYPE value_type;
+ typedef integral_c_tag tag;
// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC),
// while some other don't like 'value + 1' (Borland), and some don't like
AUX_WRAPPER_VALUE_TYPE const AUX_WRAPPER_INST(N)::value;
#endif
-}} // namespace boost::mpl
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
#undef AUX_WRAPPER_NAME
#undef AUX_WRAPPER_PARAMS
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/is_msvc_eti_arg.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.4 $
+
+#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_CFG_MSVC_ETI_BUG)
-#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
+#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
template< typename T >
struct is_msvc_eti_arg
BOOST_STATIC_CONSTANT(bool, value = false);
};
-#else
+#else // BOOST_MPL_CFG_MSVC_60_ETI_BUG
struct eti_int_convertible
{
);
};
-#endif // BOOST_MPL_MSVC_60_ETI_BUG
+#endif
template<>
struct is_msvc_eti_arg<int>
BOOST_STATIC_CONSTANT(bool, value = true);
};
-#endif // BOOST_MPL_MSVC_ETI_BUG
+#endif // BOOST_MPL_CFG_MSVC_ETI_BUG
-}}} // namespace boost::mpl::aux
+}}}
#endif // BOOST_MPL_AUX_IS_MSVC_ETI_ARG_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/lambda_arity_param.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_ARITY_PARAM_HPP_INCLUDED
#define BOOST_MPL_AUX_LAMBDA_ARITY_PARAM_HPP_INCLUDED
-#include "boost/mpl/aux_/config/ttp.hpp"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_arity_param.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/ttp.hpp>
-#if !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+#if !defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
# define BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(param)
#else
# define BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(param) , param
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_spec.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.8 $
+
+#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)
+#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
# define BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(i, name) \
template< \
struct lambda< \
name< BOOST_MPL_PP_PARAMS(i, T) > \
, Tag \
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<i>) \
> \
{ \
+ typedef false_ is_le; \
typedef name< BOOST_MPL_PP_PARAMS(i, T) > type; \
}; \
/**/
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/lambda_support.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_SUPPORT_HPP_INCLUDED
#define BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED
-#include "boost/mpl/aux_/config/lambda.hpp"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_support.hpp,v $
+// $Date: 2004/10/30 08:21:50 $
+// $Revision: 1.11.2.1 $
+
+#include <boost/mpl/aux_/config/lambda.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) /**/
# define BOOST_MPL_AUX_LAMBDA_SUPPORT(i,name,params) /**/
#else
-# include "boost/mpl/aux_/config/workaround.hpp"
-# include "boost/mpl/aux_/preprocessor/params.hpp"
-# include "boost/preprocessor/tuple/to_list.hpp"
-# include "boost/preprocessor/list/for_each_i.hpp"
-# include "boost/preprocessor/inc.hpp"
-# include "boost/preprocessor/cat.hpp"
+# include <boost/mpl/int_fwd.hpp>
+# include <boost/mpl/aux_/yes_no.hpp>
+# include <boost/mpl/aux_/na_fwd.hpp>
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/preprocessor/enum.hpp>
+# include <boost/mpl/aux_/config/msvc.hpp>
+# include <boost/mpl/aux_/config/workaround.hpp>
+
+# include <boost/preprocessor/tuple/to_list.hpp>
+# include <boost/preprocessor/list/for_each_i.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC(R,typedef_,i,param) \
typedef_ param BOOST_PP_CAT(arg,BOOST_PP_INC(i)); \
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
# define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
- BOOST_STATIC_CONSTANT(int, arity = i); \
+ typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::int_<i> arity; \
BOOST_PP_LIST_FOR_EACH_I_R( \
1 \
, BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \
// MSVC-optimized implementation
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
- BOOST_STATIC_CONSTANT(int, arity = i); \
+ typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::int_<i> arity; \
BOOST_PP_LIST_FOR_EACH_I_R( \
1 \
, BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \
#else // __EDG_VERSION__
+namespace boost { namespace mpl { namespace aux {
+template< typename T > struct has_rebind_tag;
+}}}
+
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
- BOOST_STATIC_CONSTANT(int, arity = i); \
+ typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::int_<i> arity; \
BOOST_PP_LIST_FOR_EACH_I_R( \
1 \
, BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \
typedef BOOST_PP_CAT(name,_rebind) rebind; \
/**/
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
+# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
+template< BOOST_MPL_PP_PARAMS(i,typename T) > \
+::boost::mpl::aux::yes_tag operator|( \
+ ::boost::mpl::aux::has_rebind_tag<int> \
+ , name<BOOST_MPL_PP_PARAMS(i,T)>* \
+ ); \
+::boost::mpl::aux::no_tag operator|( \
+ ::boost::mpl::aux::has_rebind_tag<int> \
+ , name< BOOST_MPL_PP_ENUM(i,::boost::mpl::na) >* \
+ ); \
+/**/
+#elif !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
+# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
+template< BOOST_MPL_PP_PARAMS(i,typename T) > \
+::boost::mpl::aux::yes_tag operator|( \
+ ::boost::mpl::aux::has_rebind_tag<int> \
+ , ::boost::mpl::aux::has_rebind_tag< name<BOOST_MPL_PP_PARAMS(i,T)> >* \
+ ); \
+/**/
+#else
+# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) /**/
+#endif
+
# if !defined(__BORLANDC__)
# define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
}; \
+BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
class BOOST_PP_CAT(name,_rebind) \
{ \
public: \
# define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
}; \
+BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
class BOOST_PP_CAT(name,_rebind) \
{ \
public: \
#endif // __EDG_VERSION__
-#endif // BOOST_MPL_NO_FULL_LAMBDA_SUPPORT
+#endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
#endif // BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/msvc_eti_base.hpp,v $
+// $Date: 2004/11/10 23:38:09 $
+// $Revision: 1.6.2.1 $
+
+#include <boost/mpl/aux_/is_msvc_eti_arg.hpp>
+#include <boost/mpl/aux_/config/eti.hpp>
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
namespace boost { namespace mpl { namespace aux {
-#if defined(BOOST_MPL_MSVC_ETI_BUG)
+#if defined(BOOST_MPL_CFG_MSVC_70_ETI_BUG)
template< bool > struct msvc_eti_base_impl
{
template< typename T > struct result_
+ : T
{
typedef T type;
};
template< typename T > struct result_
{
typedef result_ type;
+ typedef result_ first;
+ typedef result_ second;
+ typedef result_ tag;
+ enum { value = 0 };
};
};
{
};
-#else
+#else // !BOOST_MPL_CFG_MSVC_70_ETI_BUG
template< typename T > struct msvc_eti_base
+ : T
{
+#if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304))
+ msvc_eti_base();
+#endif
typedef T type;
};
-#endif // BOOST_MPL_MSVC_ETI_BUG
+#endif
+
+template<> struct msvc_eti_base<int>
+{
+ typedef msvc_eti_base type;
+ typedef msvc_eti_base first;
+ typedef msvc_eti_base second;
+ typedef msvc_eti_base tag;
+ enum { value = 0 };
+};
-}}} // namespace boost::mpl::aux
+}}}
#endif // BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/msvc_never_true.hpp,v $
+// $Date: 2004/09/02 15:40:43 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-namespace boost {
-namespace mpl {
-namespace aux {
+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_MSVC
#endif // BOOST_MPL_AUX_MSVC_NEVER_TRUE_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_NA_HPP_INCLUDED
+#define BOOST_MPL_AUX_NA_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na.hpp,v $
+// $Date: 2004/10/30 08:21:50 $
+// $Revision: 1.5.2.1 $
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/aux_/na_fwd.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+
+namespace boost { namespace mpl {
+
+template< typename T >
+struct is_na
+ : false_
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ using false_::value;
+#endif
+};
+
+template<>
+struct is_na<na>
+ : true_
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ using true_::value;
+#endif
+};
+
+template< typename T >
+struct is_not_na
+ : true_
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ using true_::value;
+#endif
+};
+
+template<>
+struct is_not_na<na>
+ : false_
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ using false_::value;
+#endif
+};
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+template< typename T, typename U > struct if_na
+{
+ typedef T type;
+};
+
+template< typename U > struct if_na<na,U>
+{
+ typedef U type;
+};
+#else
+template< typename T > struct if_na_impl
+{
+ template< typename U > struct apply
+ {
+ typedef T type;
+ };
+};
+
+template<> struct if_na_impl<na>
+{
+ template< typename U > struct apply
+ {
+ typedef U type;
+ };
+};
+
+template< typename T, typename U > struct if_na
+ : if_na_impl<T>::template apply<U>
+{
+};
+#endif
+
+}}
+
+#endif // BOOST_MPL_AUX_NA_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED
+#define BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na_assert.hpp,v $
+// $Date: 2004/09/28 13:56:59 $
+// $Revision: 1.2 $
+
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+# include <boost/mpl/assert.hpp>
+# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \
+ BOOST_MPL_ASSERT_NOT((boost::mpl::is_na<type>)) \
+/**/
+#else
+# include <boost/static_assert.hpp>
+# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \
+ BOOST_STATIC_ASSERT(!boost::mpl::is_na<x>::value) \
+/**/
+#endif
+
+#endif // BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
+#define BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/Attic/na_fwd.hpp,v $
+// $Date: 2004/10/30 08:22:23 $
+// $Revision: 1.1.2.1 $
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+
+// n.a. == not available
+struct na
+{
+ typedef na type;
+ enum { value = 0 };
+};
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+BOOST_MPL_AUX_ADL_BARRIER_DECL(na)
+
+#endif // BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED
+#define BOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/na_spec.hpp,v $
+// $Date: 2004/11/08 18:23:49 $
+// $Revision: 1.2.2.1 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/lambda_fwd.hpp>
+# include <boost/mpl/int.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/mpl/aux_/na.hpp>
+# include <boost/mpl/aux_/arity.hpp>
+# include <boost/mpl/aux_/template_arity_fwd.hpp>
+#endif
+
+#include <boost/mpl/aux_/preprocessor/params.hpp>
+#include <boost/mpl/aux_/preprocessor/enum.hpp>
+#include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
+#include <boost/mpl/aux_/lambda_arity_param.hpp>
+#include <boost/mpl/aux_/config/dtp.hpp>
+#include <boost/mpl/aux_/config/eti.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
+#include <boost/mpl/aux_/config/ttp.hpp>
+#include <boost/mpl/aux_/config/lambda.hpp>
+#include <boost/mpl/aux_/config/overload_resolution.hpp>
+
+
+#define BOOST_MPL_AUX_NA_PARAMS(i) \
+ BOOST_MPL_PP_ENUM(i, na) \
+/**/
+
+#if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \
+namespace aux { \
+template< BOOST_MPL_AUX_NTTP_DECL(int, N) > \
+struct arity< \
+ name< BOOST_MPL_AUX_NA_PARAMS(i) > \
+ , N \
+ > \
+ : int_< BOOST_MPL_LIMIT_METAFUNCTION_ARITY > \
+{ \
+}; \
+} \
+/**/
+#else
+# define BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) /**/
+#endif
+
+#define BOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \
+template<> \
+struct name< BOOST_MPL_AUX_NA_PARAMS(i) > \
+{ \
+ template< \
+ BOOST_MPL_PP_PARAMS(i, typename T) \
+ BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
+ > \
+ struct apply \
+ : name< BOOST_MPL_PP_PARAMS(i, T) > \
+ { \
+ }; \
+}; \
+/**/
+
+#if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
+# define BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
+template<> \
+struct lambda< \
+ name< BOOST_MPL_AUX_NA_PARAMS(i) > \
+ , void_ \
+ , true_ \
+ > \
+{ \
+ typedef false_ is_le; \
+ typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
+}; \
+template<> \
+struct lambda< \
+ name< BOOST_MPL_AUX_NA_PARAMS(i) > \
+ , void_ \
+ , false_ \
+ > \
+{ \
+ typedef false_ is_le; \
+ typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
+}; \
+/**/
+#else
+# define BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
+template< typename Tag > \
+struct lambda< \
+ name< BOOST_MPL_AUX_NA_PARAMS(i) > \
+ , Tag \
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \
+ > \
+{ \
+ typedef false_ is_le; \
+ typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > result_; \
+ typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
+}; \
+/**/
+#endif
+
+#if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) \
+ || defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \
+ && defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION)
+# define BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) \
+namespace aux { \
+template< BOOST_MPL_PP_PARAMS(j, typename T) > \
+struct template_arity< \
+ name< BOOST_MPL_PP_PARAMS(j, T) > \
+ > \
+ : int_<j> \
+{ \
+}; \
+\
+template<> \
+struct template_arity< \
+ name< BOOST_MPL_PP_ENUM(i, na) > \
+ > \
+ : int_<-1> \
+{ \
+}; \
+} \
+/**/
+#else
+# define BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) /**/
+#endif
+
+#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
+# define BOOST_MPL_AUX_NA_SPEC_ETI(i, name) \
+template<> \
+struct name< BOOST_MPL_PP_ENUM(i, int) > \
+{ \
+ typedef int type; \
+ enum { value = 0 }; \
+}; \
+/**/
+#else
+# define BOOST_MPL_AUX_NA_SPEC_ETI(i, name) /**/
+#endif
+
+#define BOOST_MPL_AUX_NA_PARAM(param) param = na
+
+#define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
+BOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \
+BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
+BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \
+BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, i, name) \
+/**/
+
+#define BOOST_MPL_AUX_NA_SPEC(i, name) \
+BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
+BOOST_MPL_AUX_NA_SPEC_ETI(i, name) \
+/**/
+
+#define BOOST_MPL_AUX_NA_SPEC2(i, j, name) \
+BOOST_MPL_AUX_NA_SPEC_MAIN(i, name) \
+BOOST_MPL_AUX_NA_SPEC_ETI(i, name) \
+BOOST_MPL_AUX_NA_SPEC_LAMBDA(i, name) \
+BOOST_MPL_AUX_NA_SPEC_ARITY(i, name) \
+BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(i, j, name) \
+/**/
+
+
+#endif // BOOST_MPL_AUX_NA_SPEC_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#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)
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/nested_type_wknd.hpp,v $
+// $Date: 2004/09/28 13:56:59 $
+// $Revision: 1.7 $
-namespace boost { namespace mpl { namespace aux {
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-template< typename T >
-struct nested_type_wknd
+#if BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0302)) \
+ || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
+ || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x530)) \
+ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+
+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>
-
+#if BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) \
+ aux::nested_type_wknd<T> \
+/**/
#else
+# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) \
+ ::boost::mpl::aux::nested_type_wknd<T> \
+/**/
+#endif
+
+#else // !BOOST_MPL_CFG_GCC et al.
# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) T::type
-#endif // __GNUC__
+#endif
#endif // BOOST_MPL_AUX_NESTED_TYPE_WKND_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_NTTP_DECL_HPP_INCLUDED
+#define BOOST_MPL_AUX_NTTP_DECL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/nttp_decl.hpp,v $
+// $Date: 2004/09/02 15:40:44 $
+// $Revision: 1.1 $
+
+#include <boost/mpl/aux_/config/nttp.hpp>
+
+#if defined(BOOST_MPL_CFG_NTTP_BUG)
+
+typedef int _mpl_nttp_int;
+typedef long _mpl_nttp_long;
+
+# include <boost/preprocessor/cat.hpp>
+# define BOOST_MPL_AUX_NTTP_DECL(T, x) BOOST_PP_CAT(_mpl_nttp_,T) x /**/
+
+#else
+
+# define BOOST_MPL_AUX_NTTP_DECL(T, x) T x /**/
+
+#endif
+
+#endif // BOOST_MPL_AUX_NTTP_DECL_HPP_INCLUDED
-// preprocessed version of 'boost/mpl/aux_/config/use_preprocessed.hpp' header
-// see the original for copyright information
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/and.hpp" header
+// -- DO NOT modify by hand!
namespace boost { namespace mpl {
} // namespace aux
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
- , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
+ typename BOOST_MPL_AUX_NA_PARAM(T1)
+ , typename BOOST_MPL_AUX_NA_PARAM(T2)
, typename T3 = true_, typename T4 = true_, typename T5 = true_
>
struct and_
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, and_
- , (T1, T2, T3, T4, T5)
+ , ( T1, T2, T3, T4, T5)
)
};
-BOOST_MPL_AUX_VOID_SPEC_EXT(
+BOOST_MPL_AUX_NA_SPEC2(
2
, 5
, and_
)
-}} // namespace boost::mpl
-
+}}
-// preprocessed version of 'boost/mpl/apply.hpp' header
-// see the original for copyright information
-namespace boost {
-namespace mpl {
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/apply.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
template<
- typename F, typename T1 = void_, typename T2 = void_
- , typename T3 = void_, typename T4 = void_, typename T5 = void_
+ typename F
>
-struct apply;
+struct apply0
-template< typename F >
-struct apply0 : F
+ : apply_wrap0<
+ typename lambda<F>::type
+
+ >
{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 1
+ , apply0
+ , (F )
+ )
};
template<
typename F
>
-struct apply< F,void_,void_,void_,void_,void_ >
+struct apply< F,na,na,na,na,na >
: apply0<F>
{
};
typename F, typename T1
>
struct apply1
- : F::template apply<
- T1
+
+ : apply_wrap1<
+ typename lambda<F>::type
+ , T1
>
{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 2
+ , apply1
+ , (F, T1)
+ )
};
template<
typename F, typename T1
>
-struct apply< F,T1,void_,void_,void_,void_ >
+struct apply< F,T1,na,na,na,na >
: apply1< F,T1 >
{
};
typename F, typename T1, typename T2
>
struct apply2
- : F::template apply<
- T1, T2
+
+ : apply_wrap2<
+ typename lambda<F>::type
+ , T1, T2
>
{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 3
+ , apply2
+ , (F, T1, T2)
+ )
};
template<
typename F, typename T1, typename T2
>
-struct apply< F,T1,T2,void_,void_,void_ >
+struct apply< F,T1,T2,na,na,na >
: apply2< F,T1,T2 >
{
};
typename F, typename T1, typename T2, typename T3
>
struct apply3
- : F::template apply<
- T1, T2, T3
+
+ : apply_wrap3<
+ typename lambda<F>::type
+ , T1, T2, T3
>
{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 4
+ , apply3
+ , (F, T1, T2, T3)
+ )
};
template<
typename F, typename T1, typename T2, typename T3
>
-struct apply< F,T1,T2,T3,void_,void_ >
+struct apply< F,T1,T2,T3,na,na >
: apply3< F,T1,T2,T3 >
{
};
typename F, typename T1, typename T2, typename T3, typename T4
>
struct apply4
- : F::template apply<
- T1, T2, T3, T4
+
+ : apply_wrap4<
+ typename lambda<F>::type
+ , T1, T2, T3, T4
>
{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 5
+ , apply4
+ , (F, T1, T2, T3, T4)
+ )
};
template<
typename F, typename T1, typename T2, typename T3, typename T4
>
-struct apply< F,T1,T2,T3,T4,void_ >
+struct apply< F,T1,T2,T3,T4,na >
: apply4< F,T1,T2,T3,T4 >
{
};
, typename T5
>
struct apply5
- : F::template apply<
- T1, T2, T3, T4, T5
+
+ : apply_wrap5<
+ typename lambda<F>::type
+ , T1, T2, T3, T4, T5
>
{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(
+ 6
+ , apply5
+ , (F, T1, T2, T3, T4, T5)
+ )
};
-// primary template (not a specialization!)
+/// primary template (not a specialization!)
+
template<
typename F, typename T1, typename T2, typename T3, typename T4
, typename T5
{
};
-} // namespace mpl
-} // namespace boost
+}}
--- /dev/null
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/apply_fwd.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
+
+template<
+ typename F, typename T1 = na, typename T2 = na, typename T3 = na
+ , typename T4 = na, typename T5 = na
+ >
+struct apply;
+
+template<
+ typename F
+ >
+struct apply0;
+
+template<
+ typename F, typename T1
+ >
+struct apply1;
+
+template<
+ typename F, typename T1, typename T2
+ >
+struct apply2;
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ >
+struct apply3;
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ >
+struct apply4;
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct apply5;
+
+}}
+
--- /dev/null
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/apply_wrap.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
+
+template<
+ typename F
+
+ , typename has_apply_ = typename aux::has_apply<F>::type
+
+ >
+struct apply_wrap0
+
+ : F::template apply< >
+{
+};
+
+template< typename F >
+struct apply_wrap0< F,true_ >
+ : F::apply
+{
+};
+
+template<
+ typename F, typename T1
+
+ >
+struct apply_wrap1
+
+ : F::template apply<T1>
+{
+};
+
+template<
+ typename F, typename T1, typename T2
+
+ >
+struct apply_wrap2
+
+ : F::template apply< T1,T2 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3
+
+ >
+struct apply_wrap3
+
+ : F::template apply< T1,T2,T3 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+
+ >
+struct apply_wrap4
+
+ : F::template apply< T1,T2,T3,T4 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+
+ >
+struct apply_wrap5
+
+ : F::template apply< T1,T2,T3,T4,T5 >
+{
+};
+
+}}
+
-// preprocessed version of 'boost/mpl/arg.hpp' header
-// see the original for copyright information
-namespace boost {
-namespace mpl {
+// Copyright Peter Dimov 2001-2002
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
-template<> struct arg<-1>
+// Preprocessed version of "boost/mpl/arg.hpp" header
+// -- DO NOT modify by hand!
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+template<> struct arg< -1 >
{
- static int const value = -1;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_STATIC_CONSTANT(int, value = -1);
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- typename U1 = void_, typename U2 = void_, typename U3 = void_
- , typename U4 = void_, typename U5 = void_
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
>
struct apply
{
typedef U1 type;
-
- private:
- static bool const nv = !is_void_<type>::value;
- BOOST_STATIC_ASSERT(nv);
-
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
template<> struct arg<1>
{
- static int const value = 1;
+ BOOST_STATIC_CONSTANT(int, value = 1);
typedef arg<2> next;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- typename U1 = void_, typename U2 = void_, typename U3 = void_
- , typename U4 = void_, typename U5 = void_
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
>
struct apply
{
typedef U1 type;
-
- private:
- static bool const nv = !is_void_<type>::value;
- BOOST_STATIC_ASSERT(nv);
-
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
template<> struct arg<2>
{
- static int const value = 2;
+ BOOST_STATIC_CONSTANT(int, value = 2);
typedef arg<3> next;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- typename U1 = void_, typename U2 = void_, typename U3 = void_
- , typename U4 = void_, typename U5 = void_
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
>
struct apply
{
typedef U2 type;
-
- private:
- static bool const nv = !is_void_<type>::value;
- BOOST_STATIC_ASSERT(nv);
-
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
template<> struct arg<3>
{
- static int const value = 3;
+ BOOST_STATIC_CONSTANT(int, value = 3);
typedef arg<4> next;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- typename U1 = void_, typename U2 = void_, typename U3 = void_
- , typename U4 = void_, typename U5 = void_
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
>
struct apply
{
typedef U3 type;
-
- private:
- static bool const nv = !is_void_<type>::value;
- BOOST_STATIC_ASSERT(nv);
-
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
template<> struct arg<4>
{
- static int const value = 4;
+ BOOST_STATIC_CONSTANT(int, value = 4);
typedef arg<5> next;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- typename U1 = void_, typename U2 = void_, typename U3 = void_
- , typename U4 = void_, typename U5 = void_
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
>
struct apply
{
typedef U4 type;
-
- private:
- static bool const nv = !is_void_<type>::value;
- BOOST_STATIC_ASSERT(nv);
-
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
template<> struct arg<5>
{
- static int const value = 5;
+ BOOST_STATIC_CONSTANT(int, value = 5);
typedef arg<6> next;
- BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, tag)
+ BOOST_MPL_AUX_ARG_TYPEDEF(na, type)
template<
- typename U1 = void_, typename U2 = void_, typename U3 = void_
- , typename U4 = void_, typename U5 = void_
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
>
struct apply
{
typedef U5 type;
-
- private:
- static bool const nv = !is_void_<type>::value;
- BOOST_STATIC_ASSERT(nv);
-
+ BOOST_MPL_AUX_ASSERT_NOT_NA(type);
};
};
-BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1, int, arg)
-
-} // namespace mpl
-} // namespace boost
+BOOST_MPL_AUX_NONTYPE_ARITY_SPEC(1,int, arg)
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
--- /dev/null
+
+// Copyright Peter Dimov 2001
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/bind.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
+
+namespace aux {
+
+template<
+ typename T, typename U1, typename U2, typename U3, typename U4
+ , typename U5
+ >
+struct resolve_bind_arg
+{
+ typedef T type;
+};
+
+template<
+ typename T
+ , typename Arg
+ >
+struct replace_unnamed_arg
+{
+ typedef Arg next;
+ typedef T type;
+};
+
+template<
+ typename Arg
+ >
+struct replace_unnamed_arg< arg< -1 >, Arg >
+{
+ typedef typename Arg::next next;
+ typedef Arg type;
+};
+
+template<
+ int N, typename U1, typename U2, typename U3, typename U4, typename U5
+ >
+struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 >
+{
+ typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename U1, typename U2, typename U3, typename U4
+ , typename U5
+ >
+struct resolve_bind_arg< bind< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5 >
+{
+ typedef bind< F,T1,T2,T3,T4,T5 > f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+template<
+ typename F
+ >
+struct bind0
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
+ ///
+ public:
+ typedef typename apply_wrap0<
+ f_
+ >::type type;
+
+ };
+};
+
+namespace aux {
+
+template<
+ typename F, typename U1, typename U2, typename U3, typename U4
+ , typename U5
+ >
+struct resolve_bind_arg<
+ bind0<F>, U1, U2, U3, U4, U5
+ >
+{
+ typedef bind0<F> f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(1, bind0)
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0)
+
+template<
+ typename F
+ >
+struct bind< F,na,na,na,na,na >
+ : bind0<F>
+{
+};
+
+template<
+ typename F, typename T1
+ >
+struct bind1
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
+ ///
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ public:
+ typedef typename apply_wrap1<
+ f_
+ , typename t1::type
+ >::type type;
+
+ };
+};
+
+namespace aux {
+
+template<
+ typename F, typename T1, typename U1, typename U2, typename U3
+ , typename U4, typename U5
+ >
+struct resolve_bind_arg<
+ bind1< F,T1 >, U1, U2, U3, U4, U5
+ >
+{
+ typedef bind1< F,T1 > f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(2, bind1)
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1)
+
+template<
+ typename F, typename T1
+ >
+struct bind< F,T1,na,na,na,na >
+ : bind1< F,T1 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2
+ >
+struct bind2
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
+ ///
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next n3;
+ typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
+ ///
+ public:
+ typedef typename apply_wrap2<
+ f_
+ , typename t1::type, typename t2::type
+ >::type type;
+
+ };
+};
+
+namespace aux {
+
+template<
+ typename F, typename T1, typename T2, typename U1, typename U2
+ , typename U3, typename U4, typename U5
+ >
+struct resolve_bind_arg<
+ bind2< F,T1,T2 >, U1, U2, U3, U4, U5
+ >
+{
+ typedef bind2< F,T1,T2 > f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(3, bind2)
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2)
+
+template<
+ typename F, typename T1, typename T2
+ >
+struct bind< F,T1,T2,na,na,na >
+ : bind2< F,T1,T2 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ >
+struct bind3
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
+ ///
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next n3;
+ typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
+ ///
+ typedef aux::replace_unnamed_arg< T3,n3 > r3;
+ typedef typename r3::type a3;
+ typedef typename r3::next n4;
+ typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
+ ///
+ public:
+ typedef typename apply_wrap3<
+ f_
+ , typename t1::type, typename t2::type, typename t3::type
+ >::type type;
+
+ };
+};
+
+namespace aux {
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename U1
+ , typename U2, typename U3, typename U4, typename U5
+ >
+struct resolve_bind_arg<
+ bind3< F,T1,T2,T3 >, U1, U2, U3, U4, U5
+ >
+{
+ typedef bind3< F,T1,T2,T3 > f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(4, bind3)
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3)
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ >
+struct bind< F,T1,T2,T3,na,na >
+ : bind3< F,T1,T2,T3 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ >
+struct bind4
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
+ ///
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next n3;
+ typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
+ ///
+ typedef aux::replace_unnamed_arg< T3,n3 > r3;
+ typedef typename r3::type a3;
+ typedef typename r3::next n4;
+ typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
+ ///
+ typedef aux::replace_unnamed_arg< T4,n4 > r4;
+ typedef typename r4::type a4;
+ typedef typename r4::next n5;
+ typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
+ ///
+ public:
+ typedef typename apply_wrap4<
+ f_
+ , typename t1::type, typename t2::type, typename t3::type
+ , typename t4::type
+ >::type type;
+
+ };
+};
+
+namespace aux {
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename U1, typename U2, typename U3, typename U4, typename U5
+ >
+struct resolve_bind_arg<
+ bind4< F,T1,T2,T3,T4 >, U1, U2, U3, U4, U5
+ >
+{
+ typedef bind4< F,T1,T2,T3,T4 > f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(5, bind4)
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4)
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ >
+struct bind< F,T1,T2,T3,T4,na >
+ : bind4< F,T1,T2,T3,T4 >
+{
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct bind5
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_;
+ ///
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next n3;
+ typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
+ ///
+ typedef aux::replace_unnamed_arg< T3,n3 > r3;
+ typedef typename r3::type a3;
+ typedef typename r3::next n4;
+ typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
+ ///
+ typedef aux::replace_unnamed_arg< T4,n4 > r4;
+ typedef typename r4::type a4;
+ typedef typename r4::next n5;
+ typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4;
+ ///
+ typedef aux::replace_unnamed_arg< T5,n5 > r5;
+ typedef typename r5::type a5;
+ typedef typename r5::next n6;
+ typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5;
+ ///
+ public:
+ typedef typename apply_wrap5<
+ f_
+ , typename t1::type, typename t2::type, typename t3::type
+ , typename t4::type, typename t5::type
+ >::type type;
+
+ };
+};
+
+namespace aux {
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename U1, typename U2, typename U3, typename U4
+ , typename U5
+ >
+struct resolve_bind_arg<
+ bind5< F,T1,T2,T3,T4,T5 >, U1, U2, U3, U4, U5
+ >
+{
+ typedef bind5< F,T1,T2,T3,T4,T5 > f_;
+ typedef typename apply_wrap5< f_,U1,U2,U3,U4,U5 >::type type;
+};
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(6, bind5)
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5)
+
+/// primary template (not a specialization!)
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct bind
+ : bind5< F,T1,T2,T3,T4,T5 >
+{
+};
+
+/// if_/eval_if specializations
+template< template< typename T1, typename T2, typename T3 > class F, typename Tag >
+struct quote3;
+
+template< typename T1, typename T2, typename T3 > struct if_;
+
+template<
+ typename Tag, typename T1, typename T2, typename T3
+ >
+struct bind3<
+ quote3< if_,Tag >
+ , T1, T2, T3
+ >
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef mpl::arg<1> n1;
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next n3;
+ typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
+ ///
+ typedef aux::replace_unnamed_arg< T3,n3 > r3;
+ typedef typename r3::type a3;
+ typedef typename r3::next n4;
+ typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
+ ///
+ typedef typename if_<
+ typename t1::type
+ , t2, t3
+ >::type f_;
+
+ public:
+ typedef typename f_::type type;
+ };
+};
+
+template<
+ template< typename T1, typename T2, typename T3 > class F, typename Tag
+ >
+struct quote3;
+
+template< typename T1, typename T2, typename T3 > struct eval_if;
+
+template<
+ typename Tag, typename T1, typename T2, typename T3
+ >
+struct bind3<
+ quote3< eval_if,Tag >
+ , T1, T2, T3
+ >
+{
+ template<
+ typename U1 = na, typename U2 = na, typename U3 = na
+ , typename U4 = na, typename U5 = na
+ >
+ struct apply
+ {
+ private:
+ typedef mpl::arg<1> n1;
+ typedef aux::replace_unnamed_arg< T1,n1 > r1;
+ typedef typename r1::type a1;
+ typedef typename r1::next n2;
+ typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1;
+ ///
+ typedef aux::replace_unnamed_arg< T2,n2 > r2;
+ typedef typename r2::type a2;
+ typedef typename r2::next n3;
+ typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2;
+ ///
+ typedef aux::replace_unnamed_arg< T3,n3 > r3;
+ typedef typename r3::type a3;
+ typedef typename r3::next n4;
+ typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3;
+ ///
+ typedef typename eval_if<
+ typename t1::type
+ , t2, t3
+ >::type f_;
+
+ public:
+ typedef typename f_::type type;
+ };
+};
+
+}}
+
--- /dev/null
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/bind_fwd.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
+
+template<
+ typename F, typename T1 = na, typename T2 = na, typename T3 = na
+ , typename T4 = na, typename T5 = na
+ >
+struct bind;
+
+template<
+ typename F
+ >
+struct bind0;
+
+template<
+ typename F, typename T1
+ >
+struct bind1;
+
+template<
+ typename F, typename T1, typename T2
+ >
+struct bind2;
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ >
+struct bind3;
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ >
+struct bind4;
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct bind5;
+
+}}
+
--- /dev/null
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/aux_/full_lambda.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
+
+namespace aux {
+
+template<
+ bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false
+ , bool C5 = false
+ >
+struct lambda_or
+ : true_
+{
+};
+
+template<>
+struct lambda_or< false,false,false,false,false >
+ : false_
+{
+};
+
+} // namespace aux
+
+template<
+ typename T
+ , typename Tag
+ , typename Arity
+ >
+struct lambda
+{
+ typedef false_ is_le;
+ typedef T result_;
+ typedef T type;
+};
+
+template<
+ typename T
+ >
+struct is_lambda_expression
+ : lambda<T>::is_le
+{
+};
+
+template< int N, typename Tag >
+struct lambda< arg<N>,Tag, int_< -1 > >
+{
+ typedef true_ is_le;
+ typedef mpl::arg<N> result_; // qualified for the sake of MIPSpro 7.41
+ typedef mpl::protect<result_> type;
+};
+
+template<
+ typename F
+ , typename Tag
+ >
+struct lambda<
+ bind0<F>
+ , Tag
+ , int_<1>
+ >
+{
+ typedef false_ is_le;
+ typedef bind0<
+ F
+ > result_;
+
+ typedef result_ type;
+};
+
+namespace aux {
+
+template<
+ typename IsLE, typename Tag
+ , template< typename P1 > class F
+ , typename L1
+ >
+struct le_result1
+{
+ typedef F<
+ typename L1::type
+ > result_;
+
+ typedef result_ type;
+};
+
+template<
+ typename Tag
+ , template< typename P1 > class F
+ , typename L1
+ >
+struct le_result1< true_,Tag,F,L1 >
+{
+ typedef bind1<
+ quote1< F,Tag >
+ , typename L1::result_
+ > result_;
+
+ typedef mpl::protect<result_> type;
+};
+
+} // namespace aux
+
+template<
+ template< typename P1 > class F
+ , typename T1
+ , typename Tag
+ >
+struct lambda<
+ F<T1>
+ , Tag
+ , int_<1>
+ >
+{
+ typedef lambda< T1,Tag > l1;
+ typedef typename l1::is_le is_le1;
+ typedef typename aux::lambda_or<
+ is_le1::value
+ >::type is_le;
+
+ typedef aux::le_result1<
+ is_le, Tag, F, l1
+ > le_result_;
+
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+template<
+ typename F, typename T1
+ , typename Tag
+ >
+struct lambda<
+ bind1< F,T1 >
+ , Tag
+ , int_<2>
+ >
+{
+ typedef false_ is_le;
+ typedef bind1<
+ F
+ , T1
+ > result_;
+
+ typedef result_ type;
+};
+
+namespace aux {
+
+template<
+ typename IsLE, typename Tag
+ , template< typename P1, typename P2 > class F
+ , typename L1, typename L2
+ >
+struct le_result2
+{
+ typedef F<
+ typename L1::type, typename L2::type
+ > result_;
+
+ typedef result_ type;
+};
+
+template<
+ typename Tag
+ , template< typename P1, typename P2 > class F
+ , typename L1, typename L2
+ >
+struct le_result2< true_,Tag,F,L1,L2 >
+{
+ typedef bind2<
+ quote2< F,Tag >
+ , typename L1::result_, typename L2::result_
+ > result_;
+
+ typedef mpl::protect<result_> type;
+};
+
+} // namespace aux
+
+template<
+ template< typename P1, typename P2 > class F
+ , typename T1, typename T2
+ , typename Tag
+ >
+struct lambda<
+ F< T1,T2 >
+ , Tag
+ , int_<2>
+ >
+{
+ typedef lambda< T1,Tag > l1;
+ typedef lambda< T2,Tag > l2;
+
+ typedef typename l1::is_le is_le1;
+ typedef typename l2::is_le is_le2;
+
+
+ typedef typename aux::lambda_or<
+ is_le1::value, is_le2::value
+ >::type is_le;
+
+ typedef aux::le_result2<
+ is_le, Tag, F, l1, l2
+ > le_result_;
+
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+template<
+ typename F, typename T1, typename T2
+ , typename Tag
+ >
+struct lambda<
+ bind2< F,T1,T2 >
+ , Tag
+ , int_<3>
+ >
+{
+ typedef false_ is_le;
+ typedef bind2<
+ F
+ , T1, T2
+ > result_;
+
+ typedef result_ type;
+};
+
+namespace aux {
+
+template<
+ typename IsLE, typename Tag
+ , template< typename P1, typename P2, typename P3 > class F
+ , typename L1, typename L2, typename L3
+ >
+struct le_result3
+{
+ typedef F<
+ typename L1::type, typename L2::type, typename L3::type
+ > result_;
+
+ typedef result_ type;
+};
+
+template<
+ typename Tag
+ , template< typename P1, typename P2, typename P3 > class F
+ , typename L1, typename L2, typename L3
+ >
+struct le_result3< true_,Tag,F,L1,L2,L3 >
+{
+ typedef bind3<
+ quote3< F,Tag >
+ , typename L1::result_, typename L2::result_, typename L3::result_
+ > result_;
+
+ typedef mpl::protect<result_> type;
+};
+
+} // namespace aux
+
+template<
+ template< typename P1, typename P2, typename P3 > class F
+ , typename T1, typename T2, typename T3
+ , typename Tag
+ >
+struct lambda<
+ F< T1,T2,T3 >
+ , Tag
+ , int_<3>
+ >
+{
+ typedef lambda< T1,Tag > l1;
+ typedef lambda< T2,Tag > l2;
+ typedef lambda< T3,Tag > l3;
+
+ typedef typename l1::is_le is_le1;
+ typedef typename l2::is_le is_le2;
+ typedef typename l3::is_le is_le3;
+
+
+ typedef typename aux::lambda_or<
+ is_le1::value, is_le2::value, is_le3::value
+ >::type is_le;
+
+ typedef aux::le_result3<
+ is_le, Tag, F, l1, l2, l3
+ > le_result_;
+
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3
+ , typename Tag
+ >
+struct lambda<
+ bind3< F,T1,T2,T3 >
+ , Tag
+ , int_<4>
+ >
+{
+ typedef false_ is_le;
+ typedef bind3<
+ F
+ , T1, T2, T3
+ > result_;
+
+ typedef result_ type;
+};
+
+namespace aux {
+
+template<
+ typename IsLE, typename Tag
+ , template< typename P1, typename P2, typename P3, typename P4 > class F
+ , typename L1, typename L2, typename L3, typename L4
+ >
+struct le_result4
+{
+ typedef F<
+ typename L1::type, typename L2::type, typename L3::type
+ , typename L4::type
+ > result_;
+
+ typedef result_ type;
+};
+
+template<
+ typename Tag
+ , template< typename P1, typename P2, typename P3, typename P4 > class F
+ , typename L1, typename L2, typename L3, typename L4
+ >
+struct le_result4< true_,Tag,F,L1,L2,L3,L4 >
+{
+ typedef bind4<
+ quote4< F,Tag >
+ , typename L1::result_, typename L2::result_, typename L3::result_
+ , typename L4::result_
+ > result_;
+
+ typedef mpl::protect<result_> type;
+};
+
+} // namespace aux
+
+template<
+ template< typename P1, typename P2, typename P3, typename P4 > class F
+ , typename T1, typename T2, typename T3, typename T4
+ , typename Tag
+ >
+struct lambda<
+ F< T1,T2,T3,T4 >
+ , Tag
+ , int_<4>
+ >
+{
+ typedef lambda< T1,Tag > l1;
+ typedef lambda< T2,Tag > l2;
+ typedef lambda< T3,Tag > l3;
+ typedef lambda< T4,Tag > l4;
+
+ typedef typename l1::is_le is_le1;
+ typedef typename l2::is_le is_le2;
+ typedef typename l3::is_le is_le3;
+ typedef typename l4::is_le is_le4;
+
+
+ typedef typename aux::lambda_or<
+ is_le1::value, is_le2::value, is_le3::value, is_le4::value
+ >::type is_le;
+
+ typedef aux::le_result4<
+ is_le, Tag, F, l1, l2, l3, l4
+ > le_result_;
+
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename Tag
+ >
+struct lambda<
+ bind4< F,T1,T2,T3,T4 >
+ , Tag
+ , int_<5>
+ >
+{
+ typedef false_ is_le;
+ typedef bind4<
+ F
+ , T1, T2, T3, T4
+ > result_;
+
+ typedef result_ type;
+};
+
+namespace aux {
+
+template<
+ typename IsLE, typename Tag
+ , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
+ , typename L1, typename L2, typename L3, typename L4, typename L5
+ >
+struct le_result5
+{
+ typedef F<
+ typename L1::type, typename L2::type, typename L3::type
+ , typename L4::type, typename L5::type
+ > result_;
+
+ typedef result_ type;
+};
+
+template<
+ typename Tag
+ , template< typename P1, typename P2, typename P3, typename P4, typename P5 > class F
+ , typename L1, typename L2, typename L3, typename L4, typename L5
+ >
+struct le_result5< true_,Tag,F,L1,L2,L3,L4,L5 >
+{
+ typedef bind5<
+ quote5< F,Tag >
+ , typename L1::result_, typename L2::result_, typename L3::result_
+ , typename L4::result_, typename L5::result_
+ > result_;
+
+ typedef mpl::protect<result_> type;
+};
+
+} // namespace aux
+
+template<
+ template<
+ typename P1, typename P2, typename P3, typename P4
+ , typename P5
+ >
+ class F
+ , typename T1, typename T2, typename T3, typename T4, typename T5
+ , typename Tag
+ >
+struct lambda<
+ F< T1,T2,T3,T4,T5 >
+ , Tag
+ , int_<5>
+ >
+{
+ typedef lambda< T1,Tag > l1;
+ typedef lambda< T2,Tag > l2;
+ typedef lambda< T3,Tag > l3;
+ typedef lambda< T4,Tag > l4;
+ typedef lambda< T5,Tag > l5;
+
+ typedef typename l1::is_le is_le1;
+ typedef typename l2::is_le is_le2;
+ typedef typename l3::is_le is_le3;
+ typedef typename l4::is_le is_le4;
+ typedef typename l5::is_le is_le5;
+
+
+ typedef typename aux::lambda_or<
+ is_le1::value, is_le2::value, is_le3::value, is_le4::value
+ , is_le5::value
+ >::type is_le;
+
+ typedef aux::le_result5<
+ is_le, Tag, F, l1, l2, l3, l4, l5
+ > le_result_;
+
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ , typename Tag
+ >
+struct lambda<
+ bind5< F,T1,T2,T3,T4,T5 >
+ , Tag
+ , int_<6>
+ >
+{
+ typedef false_ is_le;
+ typedef bind5<
+ F
+ , T1, T2, T3, T4, T5
+ > result_;
+
+ typedef result_ type;
+};
+
+/// special case for 'protect'
+template< typename T, typename Tag >
+struct lambda< mpl::protect<T>,Tag, int_<1> >
+{
+ typedef false_ is_le;
+ typedef mpl::protect<T> result_;
+ typedef result_ type;
+};
+
+/// specializations for the main 'bind' form
+
+template<
+ typename F, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ , typename Tag
+ >
+struct lambda<
+ bind< F,T1,T2,T3,T4,T5 >
+ , Tag
+ , int_<6>
+ >
+{
+ typedef false_ is_le;
+ typedef bind< F,T1,T2,T3,T4,T5 > result_;
+ typedef result_ type;
+};
+
+template<
+ typename F
+ , typename Tag1
+ , typename Tag2
+ , typename Arity
+ >
+struct lambda<
+ lambda< F,Tag1,Arity >
+ , Tag2
+ , int_<3>
+ >
+{
+ typedef lambda< F,Tag2 > l1;
+ typedef lambda< Tag1,Tag2 > l2;
+ typedef typename l1::is_le is_le;
+ typedef bind1< quote1<aux::template_arity>, typename l1::result_ > arity_;
+ typedef lambda< typename if_< is_le,arity_,Arity >::type, Tag2 > l3;
+ typedef aux::le_result3<is_le, Tag2, mpl::lambda, l1, l2, l3> le_result_;
+ typedef typename le_result_::result_ result_;
+ typedef typename le_result_::type type;
+};
+
+BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
+
+}}
+
-// preprocessed version of 'boost/mpl/aux_/config/use_preprocessed.hpp' header
-// see the original for copyright information
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/or.hpp" header
+// -- DO NOT modify by hand!
namespace boost { namespace mpl {
} // namespace aux
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
- , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
+ typename BOOST_MPL_AUX_NA_PARAM(T1)
+ , typename BOOST_MPL_AUX_NA_PARAM(T2)
, typename T3 = false_, typename T4 = false_, typename T5 = false_
>
struct or_
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, or_
- , (T1, T2, T3, T4, T5)
+ , ( T1, T2, T3, T4, T5)
)
};
-BOOST_MPL_AUX_VOID_SPEC_EXT(
+BOOST_MPL_AUX_NA_SPEC2(
2
, 5
, or_
)
-}} // namespace boost::mpl
-
+}}
-// preprocessed version of 'boost/mpl/aux_/config/use_preprocessed.hpp' header
-// see the original for copyright information
-namespace boost {
-namespace mpl {
+// Copyright Aleksey Gurtovoy 2001-2004
+// Copyright Peter Dimov 2001-2003
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Preprocessed version of "boost/mpl/placeholders.hpp" header
+// -- DO NOT modify by hand!
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg< -1 > _;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_)
namespace placeholders {
-using boost::mpl::_;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_;
}
-// agurt, 17/mar/02: one more placeholder for the last 'apply#'
-// specialization
+}}
+/// agurt, 17/mar/02: one more placeholder for the last 'apply#'
+/// specialization
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<1> _1;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_1)
+
namespace placeholders {
-using boost::mpl::_1;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_1;
}
+}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<2> _2;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_2)
+
namespace placeholders {
-using boost::mpl::_2;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_2;
}
+}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<3> _3;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_3)
+
namespace placeholders {
-using boost::mpl::_3;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_3;
}
+}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<4> _4;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_4)
+
namespace placeholders {
-using boost::mpl::_4;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_4;
}
+}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<5> _5;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_5)
+
namespace placeholders {
-using boost::mpl::_5;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_5;
}
+}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<6> _6;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_6)
+
namespace placeholders {
-using boost::mpl::_6;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_6;
}
-} // namespace mpl
-} // namespace boost
-
+}}
--- /dev/null
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/quote.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl {
+
+template< typename T, bool has_type_ >
+struct quote_impl
+ : T
+{
+};
+
+template< typename T >
+struct quote_impl< T,false >
+{
+ typedef T type;
+};
+
+template<
+ template< typename P1 > class F
+ , typename Tag = void_
+ >
+struct quote1
+{
+ template< typename U1 > struct apply
+
+ : quote_impl<
+ F<U1>
+ , aux::has_type< F<U1> >::value
+ >
+
+ {
+ };
+};
+
+template<
+ template< typename P1, typename P2 > class F
+ , typename Tag = void_
+ >
+struct quote2
+{
+ template< typename U1, typename U2 > struct apply
+
+ : quote_impl<
+ F< U1,U2 >
+ , aux::has_type< F< U1,U2 > >::value
+ >
+
+ {
+ };
+};
+
+template<
+ template< typename P1, typename P2, typename P3 > class F
+ , typename Tag = void_
+ >
+struct quote3
+{
+ template< typename U1, typename U2, typename U3 > struct apply
+
+ : quote_impl<
+ F< U1,U2,U3 >
+ , aux::has_type< F< U1,U2,U3 > >::value
+ >
+
+ {
+ };
+};
+
+template<
+ template< typename P1, typename P2, typename P3, typename P4 > class F
+ , typename Tag = void_
+ >
+struct quote4
+{
+ template<
+ typename U1, typename U2, typename U3, typename U4
+ >
+ struct apply
+
+ : quote_impl<
+ F< U1,U2,U3,U4 >
+ , aux::has_type< F< U1,U2,U3,U4 > >::value
+ >
+
+ {
+ };
+};
+
+template<
+ template<
+ typename P1, typename P2, typename P3, typename P4
+ , typename P5
+ >
+ class F
+ , typename Tag = void_
+ >
+struct quote5
+{
+ template<
+ typename U1, typename U2, typename U3, typename U4
+ , typename U5
+ >
+ struct apply
+
+ : quote_impl<
+ F< U1,U2,U3,U4,U5 >
+ , aux::has_type< F< U1,U2,U3,U4,U5 > >::value
+ >
+
+ {
+ };
+};
+
+}}
+
--- /dev/null
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+// Preprocessed version of "boost/mpl/aux_/template_arity.hpp" header
+// -- DO NOT modify by hand!
+
+namespace boost { namespace mpl { namespace aux {
+
+template< int N > struct arity_tag
+{
+ typedef char (&type)[N + 1];
+};
+
+template<
+ int C1, int C2, int C3, int C4, int C5, int C6
+ >
+struct max_arity
+{
+ BOOST_STATIC_CONSTANT(int, value =
+ ( C6 > 0 ? C6 : ( C5 > 0 ? C5 : ( C4 > 0 ? C4 : ( C3 > 0 ? C3 : ( C2 > 0 ? C2 : ( C1 > 0 ? C1 : -1 ) ) ) ) ) )
+
+ );
+};
+
+arity_tag<0>::type arity_helper(...);
+
+template<
+ template< typename P1 > class F
+ , typename T1
+ >
+typename arity_tag<1>::type
+arity_helper(type_wrapper< F<T1> >, arity_tag<1>);
+
+template<
+ template< typename P1, typename P2 > class F
+ , typename T1, typename T2
+ >
+typename arity_tag<2>::type
+arity_helper(type_wrapper< F< T1,T2 > >, arity_tag<2>);
+
+template<
+ template< typename P1, typename P2, typename P3 > class F
+ , typename T1, typename T2, typename T3
+ >
+typename arity_tag<3>::type
+arity_helper(type_wrapper< F< T1,T2,T3 > >, arity_tag<3>);
+
+template<
+ template< typename P1, typename P2, typename P3, typename P4 > class F
+ , typename T1, typename T2, typename T3, typename T4
+ >
+typename arity_tag<4>::type
+arity_helper(type_wrapper< F< T1,T2,T3,T4 > >, arity_tag<4>);
+
+template<
+ template<
+ typename P1, typename P2, typename P3, typename P4
+ , typename P5
+ >
+ class F
+ , typename T1, typename T2, typename T3, typename T4, typename T5
+ >
+typename arity_tag<5>::type
+arity_helper(type_wrapper< F< T1,T2,T3,T4,T5 > >, arity_tag<5>);
+
+template<
+ template<
+ typename P1, typename P2, typename P3, typename P4
+ , typename P5, typename P6
+ >
+ class F
+ , typename T1, typename T2, typename T3, typename T4, typename T5
+ , typename T6
+ >
+typename arity_tag<6>::type
+arity_helper(type_wrapper< F< T1,T2,T3,T4,T5,T6 > >, arity_tag<6>);
+template< typename F, int N >
+struct template_arity_impl
+{
+ BOOST_STATIC_CONSTANT(int, value =
+ sizeof(arity_helper(type_wrapper<F>(), arity_tag<N>())) - 1
+ );
+};
+
+template< typename F >
+struct template_arity
+{
+ BOOST_STATIC_CONSTANT(int, value = (
+ max_arity< template_arity_impl< F,1 >::value, template_arity_impl< F,2 >::value, template_arity_impl< F,3 >::value, template_arity_impl< F,4 >::value, template_arity_impl< F,5 >::value, template_arity_impl< F,6 >::value >::value
+
+ ));
+
+ typedef mpl::int_<value> type;
+};
+
+}}}
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/preprocessor/def_params_tail.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_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
#define BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
-#include "boost/mpl/limits/arity.hpp"
-#include "boost/mpl/aux_/config/dtp.hpp"
-#include "boost/mpl/aux_/config/preprocessor.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/preprocessor/comma_if.hpp"
-#include "boost/preprocessor/logical/and.hpp"
-#include "boost/preprocessor/identity.hpp"
-#include "boost/preprocessor/empty.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/def_params_tail.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.6 $
-// BOOST_MPL_PP_DEF_PARAMS_TAIL(1,T): , T1 = void_, .., Tn = void_
-// BOOST_MPL_PP_DEF_PARAMS_TAIL(2,T): , T2 = void_, .., Tn = void_
-// BOOST_MPL_PP_DEF_PARAMS_TAIL(n,T): <nothing>
+#include <boost/mpl/limits/arity.hpp>
+#include <boost/mpl/aux_/config/dtp.hpp>
+#include <boost/mpl/aux_/config/preprocessor.hpp>
-#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
+#include <boost/preprocessor/comma_if.hpp>
+#include <boost/preprocessor/logical/and.hpp>
+#include <boost/preprocessor/identity.hpp>
+#include <boost/preprocessor/empty.hpp>
-# include "boost/mpl/aux_/preprocessor/filter_params.hpp"
-# include "boost/mpl/aux_/preprocessor/sub.hpp"
+// BOOST_MPL_PP_DEF_PARAMS_TAIL(1,T,value): , T1 = value, .., Tn = value
+// BOOST_MPL_PP_DEF_PARAMS_TAIL(2,T,value): , T2 = value, .., Tn = value
+// BOOST_MPL_PP_DEF_PARAMS_TAIL(n,T,value): <nothing>
+
+#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
+
+# include <boost/mpl/aux_/preprocessor/filter_params.hpp>
+# include <boost/mpl/aux_/preprocessor/sub.hpp>
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1( \
i \
- , BOOST_MPL_PP_SUB(BOOST_MPL_METAFUNCTION_MAX_ARITY,i) \
+ , BOOST_MPL_PP_SUB(BOOST_MPL_LIMIT_METAFUNCTION_ARITY,i) \
, param \
, value_func \
) \
#else
-# include "boost/preprocessor/arithmetic/add.hpp"
-# include "boost/preprocessor/arithmetic/sub.hpp"
-# include "boost/preprocessor/inc.hpp"
-# include "boost/preprocessor/tuple/elem.hpp"
-# include "boost/preprocessor/repeat.hpp"
-# include "boost/preprocessor/cat.hpp"
+# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/repeat.hpp>
+# include <boost/preprocessor/cat.hpp>
# define BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC(unused, i, op) \
- BOOST_PP_COMMA_IF(i) \
- BOOST_PP_CAT( \
+ , BOOST_PP_CAT( \
BOOST_PP_TUPLE_ELEM(3, 1, op) \
, BOOST_PP_ADD_D(1, i, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3, 0, op))) \
) BOOST_PP_TUPLE_ELEM(3, 2, op)() \
/**/
# define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
- BOOST_PP_REPEAT_1( \
- BOOST_PP_SUB_D(1, BOOST_MPL_METAFUNCTION_MAX_ARITY, i) \
+ BOOST_PP_REPEAT( \
+ BOOST_PP_SUB_D(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, i) \
, BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC \
, (i, param, value_func) \
) \
/**/
-#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
+
+#endif // BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES
#define BOOST_MPL_PP_DEF_PARAMS_TAIL(i, param, value) \
BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
/**/
-#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
# define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
/**/
--- /dev/null
+
+#ifndef BOOST_MPL_AUX_PREPROCESSOR_DEFAULT_PARAMS_HPP_INCLUDED
+#define BOOST_MPL_AUX_PREPROCESSOR_DEFAULT_PARAMS_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/default_params.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/preprocessor.hpp>
+
+// BOOST_MPL_PP_DEFAULT_PARAMS(0,T,int): <nothing>
+// BOOST_MPL_PP_DEFAULT_PARAMS(1,T,int): T1 = int
+// BOOST_MPL_PP_DEFAULT_PARAMS(2,T,int): T1 = int, T2 = int
+// BOOST_MPL_PP_DEFAULT_PARAMS(n,T,int): T1 = int, T2 = int, .., Tn = int
+
+#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
+
+# include <boost/preprocessor/cat.hpp>
+
+# define BOOST_MPL_PP_DEFAULT_PARAMS(n,p,v) \
+ BOOST_PP_CAT(BOOST_MPL_PP_DEFAULT_PARAMS_,n)(p,v) \
+ /**/
+
+# define BOOST_MPL_PP_DEFAULT_PARAMS_0(p,v)
+# define BOOST_MPL_PP_DEFAULT_PARAMS_1(p,v) p##1=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_2(p,v) p##1=v,p##2=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_3(p,v) p##1=v,p##2=v,p##3=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_4(p,v) p##1=v,p##2=v,p##3=v,p##4=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_5(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_6(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_7(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v,p##7=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_8(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v,p##7=v,p##8=v
+# define BOOST_MPL_PP_DEFAULT_PARAMS_9(p,v) p##1=v,p##2=v,p##3=v,p##4=v,p##5=v,p##6=v,p##7=v,p##8=v,p##9=v
+
+#else
+
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/repeat.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+# define BOOST_MPL_PP_AUX_DEFAULT_PARAM_FUNC(unused, i, pv) \
+ BOOST_PP_COMMA_IF(i) \
+ BOOST_PP_CAT( BOOST_PP_TUPLE_ELEM(2,0,pv), BOOST_PP_INC(i) ) \
+ = BOOST_PP_TUPLE_ELEM(2,1,pv) \
+ /**/
+
+# define BOOST_MPL_PP_DEFAULT_PARAMS(n, param, value) \
+ BOOST_PP_REPEAT( \
+ n \
+ , BOOST_MPL_PP_AUX_DEFAULT_PARAM_FUNC \
+ , (param,value) \
+ ) \
+ /**/
+
+#endif
+
+#endif // BOOST_MPL_AUX_PREPROCESSOR_DEFAULT_PARAMS_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/preprocessor/enum.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_PREPROCESSOR_ENUM_HPP_INCLUDED
#define BOOST_MPL_AUX_PREPROCESSOR_ENUM_HPP_INCLUDED
-#include "boost/mpl/aux_/config/preprocessor.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/enum.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/preprocessor.hpp>
// BOOST_MPL_PP_ENUM(0,int): <nothing>
// BOOST_MPL_PP_ENUM(1,int): int
// BOOST_MPL_PP_ENUM(2,int): int, int
// BOOST_MPL_PP_ENUM(n,int): int, int, .., int
-#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
+#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
-# include "boost/preprocessor/cat.hpp"
+# include <boost/preprocessor/cat.hpp>
# define BOOST_MPL_PP_ENUM(n, param) \
BOOST_PP_CAT(BOOST_MPL_PP_ENUM_,n)(param) \
#else
-# include "boost/preprocessor/comma_if.hpp"
-# include "boost/preprocessor/repeat.hpp"
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/repeat.hpp>
# define BOOST_MPL_PP_AUX_ENUM_FUNC(unused, i, param) \
BOOST_PP_COMMA_IF(i) param \
/**/
# define BOOST_MPL_PP_ENUM(n, param) \
- BOOST_PP_REPEAT_1( \
+ BOOST_PP_REPEAT( \
n \
, BOOST_MPL_PP_AUX_ENUM_FUNC \
, param \
) \
/**/
-#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
+#endif
#endif // BOOST_MPL_AUX_PREPROCESSOR_ENUM_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/preprocessor/filter_params.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_PREPROCESSOR_FILTER_PARAMS_HPP_INCLUDED
#define BOOST_MPL_AUX_PREPROCESSOR_FILTER_PARAMS_HPP_INCLUDED
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/filter_params.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.4 $
+
#define BOOST_MPL_PP_FILTER_PARAMS_0(p1,p2,p3,p4,p5,p6,p7,p8,p9)
#define BOOST_MPL_PP_FILTER_PARAMS_1(p1,p2,p3,p4,p5,p6,p7,p8,p9) p1
#define BOOST_MPL_PP_FILTER_PARAMS_2(p1,p2,p3,p4,p5,p6,p7,p8,p9) p1,p2
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/preprocessor/params.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_PREPROCESSOR_PARAMS_HPP_INCLUDED
#define BOOST_MPL_AUX_PREPROCESSOR_PARAMS_HPP_INCLUDED
-#include "boost/mpl/aux_/config/preprocessor.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/params.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/aux_/config/preprocessor.hpp>
// BOOST_MPL_PP_PARAMS(0,T): <nothing>
// BOOST_MPL_PP_PARAMS(1,T): T1
// BOOST_MPL_PP_PARAMS(2,T): T1, T2
// BOOST_MPL_PP_PARAMS(n,T): T1, T2, .., Tn
-#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
+#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
-# include "boost/preprocessor/cat.hpp"
+# include <boost/preprocessor/cat.hpp>
# define BOOST_MPL_PP_PARAMS(n,p) \
BOOST_PP_CAT(BOOST_MPL_PP_PARAMS_,n)(p) \
#else
-# include "boost/preprocessor/comma_if.hpp"
-# include "boost/preprocessor/repeat.hpp"
-# include "boost/preprocessor/inc.hpp"
-# include "boost/preprocessor/cat.hpp"
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/repeat.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
# define BOOST_MPL_PP_AUX_PARAM_FUNC(unused, i, param) \
BOOST_PP_COMMA_IF(i) \
/**/
# define BOOST_MPL_PP_PARAMS(n, param) \
- BOOST_PP_REPEAT_1( \
+ BOOST_PP_REPEAT( \
n \
, BOOST_MPL_PP_AUX_PARAM_FUNC \
, param \
) \
/**/
-#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
+#endif
#endif // BOOST_MPL_AUX_PREPROCESSOR_PARAMS_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/preprocessor/sub.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_PREPROCESSOR_SUB_HPP_INCLUDED
#define BOOST_MPL_AUX_PREPROCESSOR_SUB_HPP_INCLUDED
-#include "boost/mpl/aux_/preprocessor/tuple.hpp"
-#include "boost/mpl/aux_/config/preprocessor.hpp"
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/sub.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.7 $
+
+#include <boost/mpl/aux_/config/preprocessor.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES)
+
+# include <boost/mpl/aux_/preprocessor/tuple.hpp>
-#if defined(BOOST_MPL_BROKEN_PP_MACRO_EXPANSION)
-# include "boost/preprocessor/cat.hpp"
+#if defined(BOOST_MPL_CFG_BROKEN_PP_MACRO_EXPANSION)
+# include <boost/preprocessor/cat.hpp>
# define BOOST_MPL_PP_SUB(i,j) \
BOOST_MPL_PP_SUB_DELAY(i,j) \
# define BOOST_MPL_PP_SUB_DELAY(i,j) \
BOOST_MPL_PP_TUPLE_11_ELEM_##i BOOST_MPL_PP_SUB_##j \
/**/
-#endif // BOOST_MPL_BROKEN_PP_MACRO_EXPANSION
-
-#define BOOST_MPL_PP_SUB_0 (0,1,2,3,4,5,6,7,8,9,10)
-#define BOOST_MPL_PP_SUB_1 (0,0,1,2,3,4,5,6,7,8,9)
-#define BOOST_MPL_PP_SUB_2 (0,0,0,1,2,3,4,5,6,7,8)
-#define BOOST_MPL_PP_SUB_3 (0,0,0,0,1,2,3,4,5,6,7)
-#define BOOST_MPL_PP_SUB_4 (0,0,0,0,0,1,2,3,4,5,6)
-#define BOOST_MPL_PP_SUB_5 (0,0,0,0,0,0,1,2,3,4,5)
-#define BOOST_MPL_PP_SUB_6 (0,0,0,0,0,0,0,1,2,3,4)
-#define BOOST_MPL_PP_SUB_7 (0,0,0,0,0,0,0,0 1,2,3)
-#define BOOST_MPL_PP_SUB_8 (0,0,0,0,0,0,0,0,0,1,2)
-#define BOOST_MPL_PP_SUB_9 (0,0,0,0,0,0,0,0,0,0,1)
-#define BOOST_MPL_PP_SUB_10 (0,0,0,0,0,0,0,0,0,0,0)
+#endif
+
+# define BOOST_MPL_PP_SUB_0 (0,1,2,3,4,5,6,7,8,9,10)
+# define BOOST_MPL_PP_SUB_1 (0,0,1,2,3,4,5,6,7,8,9)
+# define BOOST_MPL_PP_SUB_2 (0,0,0,1,2,3,4,5,6,7,8)
+# define BOOST_MPL_PP_SUB_3 (0,0,0,0,1,2,3,4,5,6,7)
+# define BOOST_MPL_PP_SUB_4 (0,0,0,0,0,1,2,3,4,5,6)
+# define BOOST_MPL_PP_SUB_5 (0,0,0,0,0,0,1,2,3,4,5)
+# define BOOST_MPL_PP_SUB_6 (0,0,0,0,0,0,0,1,2,3,4)
+# define BOOST_MPL_PP_SUB_7 (0,0,0,0,0,0,0,0,1,2,3)
+# define BOOST_MPL_PP_SUB_8 (0,0,0,0,0,0,0,0,0,1,2)
+# define BOOST_MPL_PP_SUB_9 (0,0,0,0,0,0,0,0,0,0,1)
+# define BOOST_MPL_PP_SUB_10 (0,0,0,0,0,0,0,0,0,0,0)
+
+#else
+
+# include <boost/preprocessor/arithmetic/sub.hpp>
+
+# define BOOST_MPL_PP_SUB(i,j) \
+ BOOST_PP_SUB(i,j) \
+ /**/
+
+#endif
#endif // BOOST_MPL_AUX_PREPROCESSOR_SUB_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/preprocessor/tuple.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_PREPROCESSOR_TUPLE_HPP_INCLUDED
#define BOOST_MPL_AUX_PREPROCESSOR_TUPLE_HPP_INCLUDED
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/tuple.hpp,v $
+// $Date: 2004/09/02 15:40:56 $
+// $Revision: 1.5 $
+
#define BOOST_MPL_PP_TUPLE_11_ELEM_0(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10) e0
#define BOOST_MPL_PP_TUPLE_11_ELEM_1(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10) e1
#define BOOST_MPL_PP_TUPLE_11_ELEM_2(e0,e1,e2,e3,e4,e5,e6,e7,e8,e9,e10) e2
#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
+// Copyright Aleksey Gurtovoy 2001-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/aux_/config/workaround.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/static_cast.hpp,v $
+// $Date: 2004/09/02 15:40:44 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__GNUC__, < 3) \
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_AUX_TEMPLATE_ARITY_HPP_INCLUDED
+#define BOOST_MPL_AUX_TEMPLATE_ARITY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/template_arity.hpp,v $
+// $Date: 2004/09/07 12:24:48 $
+// $Revision: 1.11 $
+
+#include <boost/mpl/aux_/config/ttp.hpp>
+#include <boost/mpl/aux_/config/lambda.hpp>
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/aux_/template_arity_fwd.hpp>
+# include <boost/mpl/int.hpp>
+# if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
+# if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+# include <boost/mpl/aux_/type_wrapper.hpp>
+# endif
+# else
+# include <boost/mpl/aux_/has_rebind.hpp>
+# endif
+#endif
+
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER template_arity.hpp
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
+# if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING)
+
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/preprocessor/range.hpp>
+# include <boost/mpl/aux_/preprocessor/repeat.hpp>
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/nttp_decl.hpp>
+
+# include <boost/preprocessor/seq/fold_left.hpp>
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/inc.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+# define AUX778076_ARITY BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+
+namespace boost { namespace mpl { namespace aux {
+
+template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct arity_tag
+{
+ typedef char (&type)[N + 1];
+};
+
+# define AUX778076_MAX_ARITY_OP(unused, state, i_) \
+ ( BOOST_PP_CAT(C,i_) > 0 ? BOOST_PP_CAT(C,i_) : state ) \
+/**/
+
+template<
+ BOOST_MPL_PP_PARAMS(AUX778076_ARITY, BOOST_MPL_AUX_NTTP_DECL(int, C))
+ >
+struct max_arity
+{
+ BOOST_STATIC_CONSTANT(int, value =
+ BOOST_PP_SEQ_FOLD_LEFT(
+ AUX778076_MAX_ARITY_OP
+ , -1
+ , BOOST_MPL_PP_RANGE(1, AUX778076_ARITY)
+ )
+ );
+};
+
+# undef AUX778076_MAX_ARITY_OP
+
+arity_tag<0>::type arity_helper(...);
+
+# define BOOST_PP_ITERATION_LIMITS (1, AUX778076_ARITY)
+# define BOOST_PP_FILENAME_1 <boost/mpl/aux_/template_arity.hpp>
+# include BOOST_PP_ITERATE()
+
+template< typename F, BOOST_MPL_AUX_NTTP_DECL(int, N) >
+struct template_arity_impl
+{
+ BOOST_STATIC_CONSTANT(int, value =
+ sizeof(arity_helper(type_wrapper<F>(),arity_tag<N>())) - 1
+ );
+};
+
+# define AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION(unused, i_, F) \
+ BOOST_PP_COMMA_IF(i_) template_arity_impl<F,BOOST_PP_INC(i_)>::value \
+/**/
+
+template< typename F >
+struct template_arity
+{
+ BOOST_STATIC_CONSTANT(int, value = (
+ max_arity< BOOST_MPL_PP_REPEAT(
+ AUX778076_ARITY
+ , AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION
+ , F
+ ) >::value
+ ));
+
+ typedef mpl::int_<value> type;
+};
+
+# undef AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION
+
+# undef AUX778076_ARITY
+
+}}}
+
+# endif // BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
+# else // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
+
+# include <boost/mpl/aux_/config/eti.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+
+template< bool >
+struct template_arity_impl
+{
+ template< typename F > struct result_
+ : mpl::int_<-1>
+ {
+ };
+};
+
+template<>
+struct template_arity_impl<true>
+{
+ template< typename F > struct result_
+ : F::arity
+ {
+ };
+};
+
+template< typename F >
+struct template_arity
+ : template_arity_impl< ::boost::mpl::aux::has_rebind<F>::value >
+ ::template result_<F>
+{
+};
+
+#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG)
+template<>
+struct template_arity<int>
+ : mpl::int_<-1>
+{
+};
+#endif
+
+}}}
+
+# endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_AUX_TEMPLATE_ARITY_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i_ BOOST_PP_FRAME_ITERATION(1)
+
+template<
+ template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F
+ , BOOST_MPL_PP_PARAMS(i_, typename T)
+ >
+typename arity_tag<i_>::type
+arity_helper(type_wrapper< F<BOOST_MPL_PP_PARAMS(i_, T)> >, arity_tag<i_>);
+
+#undef i_
+#endif // BOOST_PP_IS_ITERATING
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/template_arity_fwd.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_TEMPLATE_ARITY_FWD_HPP_INCLUDED
#define BOOST_MPL_AUX_TEMPLATE_ARITY_FWD_HPP_INCLUDED
-namespace boost {
-namespace mpl {
-namespace aux {
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/template_arity_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:44 $
+// $Revision: 1.4 $
+
+namespace boost { namespace mpl { namespace aux {
template< typename F > struct template_arity;
-} // namespace aux
-} // namespace mpl
-} // namespace boost
+}}}
#endif // BOOST_MPL_AUX_TEMPLATE_ARITY_FWD_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2000-2004
+// Copyright Peter Dimov 2000-2003
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/aux_/config/ctps.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/type_wrapper.hpp,v $
+// $Date: 2004/09/28 13:56:59 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/aux_/config/ctps.hpp>
-namespace boost {
-namespace mpl {
-namespace aux {
+namespace boost { namespace mpl { namespace aux {
template< typename T > struct type_wrapper
{
};
#endif
-} // namespace aux
-} // namespace mpl
-} // namespace boost
+}}}
#endif // BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/value_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_VALUE_WKND_HPP_INCLUDED
#define BOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED
-#include "boost/mpl/aux_/config/eti.hpp"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/value_wknd.hpp,v $
+// $Date: 2004/09/28 13:56:59 $
+// $Revision: 1.13 $
-#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
- || defined(BOOST_MPL_MSVC_60_ETI_BUG)
-
-# include "boost/mpl/int.hpp"
+#include <boost/mpl/aux_/static_cast.hpp>
+#include <boost/mpl/aux_/config/integral.hpp>
+#include <boost/mpl/aux_/config/eti.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-namespace boost { namespace mpl { namespace aux {
+#if defined(BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS) \
+ || defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
-template< typename C_ >
-struct value_wknd
+# include <boost/mpl/int.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+template< typename C_ > struct value_wknd
: C_
{
};
-#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
-template<>
-struct value_wknd<int>
+#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
+template<> struct value_wknd<int>
: int_<1>
{
+ using int_<1>::value;
};
#endif
+}}}
-}}} // namespace boost::mpl::aux
-
-# if !defined(BOOST_MPL_MSVC_60_ETI_BUG)
-# define BOOST_MPL_AUX_VALUE_WKND(C) ::boost::mpl::aux::value_wknd< C >
-# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) BOOST_MPL_AUX_VALUE_WKND(C)
-# else
-# define BOOST_MPL_AUX_VALUE_WKND(C) C
-# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) ::boost::mpl::aux::value_wknd< C >
-# endif
+#if !defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
+# define BOOST_MPL_AUX_VALUE_WKND(C) \
+ ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::aux::value_wknd< C > \
+/**/
+# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) BOOST_MPL_AUX_VALUE_WKND(C)
#else
+# define BOOST_MPL_AUX_VALUE_WKND(C) C
+# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) \
+ ::boost::mpl::aux::value_wknd< C > \
+/**/
+#endif
+
+#else // BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS
# define BOOST_MPL_AUX_VALUE_WKND(C) C
# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) C
-#endif // __BORLANDC__ || BOOST_MPL_MSVC_60_ETI_BUG
+#endif
+
+#if BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+# define BOOST_MPL_AUX_NESTED_VALUE_WKND(T, C) \
+ BOOST_MPL_AUX_STATIC_CAST(T, C::value) \
+/**/
+#else
+# define BOOST_MPL_AUX_NESTED_VALUE_WKND(T, C) \
+ BOOST_MPL_AUX_VALUE_WKND(C)::value \
+/**/
+#endif
#endif // BOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED
+++ /dev/null
-//-----------------------------------------------------------------------------
-// boost mpl/aux_/void_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_VOID_SPEC_HPP_INCLUDED
-#define BOOST_MPL_AUX_VOID_SPEC_HPP_INCLUDED
-
-#include "boost/mpl/lambda_fwd.hpp"
-#include "boost/mpl/void.hpp"
-#include "boost/mpl/int_fwd.hpp"
-#include "boost/mpl/aux_/preprocessor/params.hpp"
-#include "boost/mpl/aux_/preprocessor/enum.hpp"
-#include "boost/mpl/aux_/preprocessor/def_params_tail.hpp"
-#include "boost/mpl/aux_/arity.hpp"
-#include "boost/mpl/aux_/template_arity_fwd.hpp"
-#include "boost/mpl/aux_/lambda_arity_param.hpp"
-#include "boost/mpl/aux_/algorithm_namespace.hpp"
-#include "boost/mpl/aux_/config/dtp.hpp"
-#include "boost/mpl/aux_/config/nttp.hpp"
-#include "boost/mpl/aux_/config/ttp.hpp"
-#include "boost/mpl/aux_/config/lambda.hpp"
-#include "boost/mpl/aux_/config/overload_resolution.hpp"
-
-#include "boost/config.hpp"
-
-#define BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) \
- BOOST_MPL_PP_ENUM(i, void_) \
-/**/
-
-#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
-# define BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) \
-namespace aux { \
-template< BOOST_MPL_AUX_NTTP_DECL(int, N) > \
-struct arity< \
- name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \
- , N \
- > \
-{ \
- BOOST_STATIC_CONSTANT(int \
- , value = BOOST_MPL_METAFUNCTION_MAX_ARITY \
- ); \
-}; \
-} \
-/**/
-#else
-# define BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) /**/
-#endif
-
-#define BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \
-template<> \
-struct name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \
-{ \
- template< \
- BOOST_MPL_PP_PARAMS(i, typename T) \
- BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, void_) \
- > \
- struct apply \
- : name< BOOST_MPL_PP_PARAMS(i, T) > \
- { \
- }; \
-}; \
-/**/
-
-#if defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
-# define BOOST_MPL_AUX_VOID_SPEC_LAMBDA(i, name) \
-template<> \
-struct lambda< \
- name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \
- , void_ \
- , true \
- > \
-{ \
- typedef name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > type; \
-}; \
-/**/
-#else
-# define BOOST_MPL_AUX_VOID_SPEC_LAMBDA(i, name) \
-template<> \
-struct lambda< \
- name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \
- , void_ \
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \
- > \
-{ \
- typedef name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > type; \
-}; \
-/**/
-#endif
-
-#if defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) || \
- defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) && \
- defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION)
-# define BOOST_MPL_AUX_VOID_SPEC_TEMPLATE_ARITY(i, j, name) \
-namespace aux { \
-template< BOOST_MPL_PP_PARAMS(j, typename T) > \
-struct template_arity< \
- name< BOOST_MPL_PP_PARAMS(j, T) > \
- > \
-{ \
- BOOST_STATIC_CONSTANT(int, value = j); \
-}; \
-\
-template<> \
-struct template_arity< \
- name< BOOST_MPL_PP_ENUM(i, void_) > \
- > \
-{ \
- BOOST_STATIC_CONSTANT(int, value = -1); \
-}; \
-} \
-/**/
-#else
-# define BOOST_MPL_AUX_VOID_SPEC_TEMPLATE_ARITY(i, j, name) /**/
-#endif
-
-
-#define BOOST_MPL_AUX_VOID_SPEC_PARAM(param) param = void_
-
-#define BOOST_MPL_AUX_VOID_SPEC(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_LAMBDA(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_TEMPLATE_ARITY(i, i, name) \
-/**/
-
-#define BOOST_MPL_AUX_VOID_SPEC_EXT(i, j, name) \
-BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_LAMBDA(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_ARITY(i, name) \
-BOOST_MPL_AUX_VOID_SPEC_TEMPLATE_ARITY(i, j, name) \
-/**/
-
-#define BOOST_MPL_AUX_ALGORITHM_VOID_SPEC(i, name) \
-BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN \
-BOOST_MPL_AUX_VOID_SPEC_MAIN(i, name) \
-BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END \
-BOOST_MPL_AUX_VOID_SPEC_LAMBDA(i, BOOST_MPL_AUX_AGLORITHM_NAMESPACE_PREFIX name) \
-BOOST_MPL_AUX_VOID_SPEC_ARITY(i, BOOST_MPL_AUX_AGLORITHM_NAMESPACE_PREFIX name) \
-BOOST_MPL_AUX_VOID_SPEC_TEMPLATE_ARITY(i, i, BOOST_MPL_AUX_AGLORITHM_NAMESPACE_PREFIX name) \
-/**/
-
-#endif // BOOST_MPL_AUX_VOID_SPEC_HPP_INCLUDED
#ifndef BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
#define BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
-// + file: boost/mpl/aux_/yes_no.hpp
-// + last modified: 05/nov/03
-
-// Copyright Aleksey Gurtovoy 2000-03
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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)
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
+// $Source: /cvsroot/boost/boost/boost/mpl/aux_/yes_no.hpp,v $
+// $Date: 2004/09/28 13:56:59 $
+// $Revision: 1.7 $
+
+#include <boost/mpl/aux_/nttp_decl.hpp>
+#include <boost/mpl/aux_/config/arrays.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-#include "boost/mpl/aux_/config/workaround.hpp"
-#include "boost/mpl/aux_/config/msvc.hpp"
namespace boost { namespace mpl { namespace aux {
};
-template< long n > struct weighted_tag
+template< BOOST_MPL_AUX_NTTP_DECL(long, n) > struct weighted_tag
{
#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
typedef char (&type)[n];
#endif
};
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
- || BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+#if defined(BOOST_MPL_CFG_NO_DEPENDENT_ARRAY_TYPES)
template<> struct weighted_tag<0>
{
typedef char (&type)[1];
};
#endif
-}}} // namespace boost::mpl::aux
+}}}
#endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_BIND_HPP_INCLUDED
+#define BOOST_MPL_BIND_HPP_INCLUDED
+
+// Copyright Peter Dimov 2001
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/bind.hpp,v $
+// $Date: 2004/10/26 14:57:26 $
+// $Revision: 1.12.2.1 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/bind_fwd.hpp>
+# include <boost/mpl/placeholders.hpp>
+# include <boost/mpl/next.hpp>
+# include <boost/mpl/protect.hpp>
+# include <boost/mpl/apply_wrap.hpp>
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/na.hpp>
+# include <boost/mpl/aux_/arity_spec.hpp>
+# include <boost/mpl/aux_/type_wrapper.hpp>
+# include <boost/mpl/aux_/yes_no.hpp>
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# include <boost/type_traits/is_reference.hpp>
+# endif
+#endif
+
+#include <boost/mpl/aux_/config/bind.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# if defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+# define BOOST_MPL_PREPROCESSED_HEADER basic_bind.hpp
+# else
+# define BOOST_MPL_PREPROCESSED_HEADER bind.hpp
+# endif
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/preprocessor/default_params.hpp>
+# include <boost/mpl/aux_/preprocessor/def_params_tail.hpp>
+# include <boost/mpl/aux_/preprocessor/partial_spec_params.hpp>
+# include <boost/mpl/aux_/preprocessor/ext_params.hpp>
+# include <boost/mpl/aux_/preprocessor/repeat.hpp>
+# include <boost/mpl/aux_/preprocessor/enum.hpp>
+# include <boost/mpl/aux_/preprocessor/add.hpp>
+# include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
+# include <boost/mpl/aux_/config/ctps.hpp>
+# include <boost/mpl/aux_/config/ttp.hpp>
+# include <boost/mpl/aux_/config/dtp.hpp>
+# include <boost/mpl/aux_/nttp_decl.hpp>
+
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/inc.hpp>
+
+namespace boost { namespace mpl {
+
+// local macros, #undef-ined at the end of the header
+# define AUX778076_APPLY \
+ BOOST_PP_CAT(apply_wrap,BOOST_MPL_LIMIT_METAFUNCTION_ARITY) \
+ /**/
+
+# if defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
+# define AUX778076_DMC_PARAM() , int dummy_
+# else
+# define AUX778076_DMC_PARAM()
+# endif
+
+# define AUX778076_BIND_PARAMS(param) \
+ BOOST_MPL_PP_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ ) \
+ /**/
+
+# define AUX778076_BIND_DEFAULT_PARAMS(param, value) \
+ BOOST_MPL_PP_DEFAULT_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ , value \
+ ) \
+ /**/
+
+# define AUX778076_BIND_N_PARAMS(n, param) \
+ BOOST_PP_COMMA_IF(n) BOOST_MPL_PP_PARAMS(n, param) \
+ /**/
+
+# define AUX778076_BIND_N_SPEC_PARAMS(n, param, def) \
+ BOOST_PP_COMMA_IF(n) \
+ BOOST_MPL_PP_PARTIAL_SPEC_PARAMS(n, param, def) \
+ /**/
+
+#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+# define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
+ AUX778076_BIND_DEFAULT_PARAMS(param, value) \
+ /**/
+#else
+# define AUX778076_BIND_NESTED_DEFAULT_PARAMS(param, value) \
+ AUX778076_BIND_PARAMS(param) \
+ /**/
+#endif
+
+namespace aux {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template<
+ typename T, AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg
+{
+ typedef T type;
+};
+
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+template<
+ typename T
+ , typename Arg
+ >
+struct replace_unnamed_arg
+{
+ typedef Arg next;
+ typedef T type;
+};
+
+template<
+ typename Arg
+ >
+struct replace_unnamed_arg< arg<-1>,Arg >
+{
+ typedef typename Arg::next next;
+ typedef Arg type;
+};
+
+# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+template<
+ BOOST_MPL_AUX_NTTP_DECL(int, N), AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg< arg<N>,AUX778076_BIND_PARAMS(U) >
+{
+ typedef typename AUX778076_APPLY<mpl::arg<N>, AUX778076_BIND_PARAMS(U)>::type type;
+};
+
+#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T), AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg< bind<F,AUX778076_BIND_PARAMS(T)>,AUX778076_BIND_PARAMS(U) >
+{
+ typedef bind<F,AUX778076_BIND_PARAMS(T)> f_;
+ typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
+};
+#endif
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+// agurt, 15/jan/02: it's not a intended to be used as a function class, and
+// MSVC6.5 has problems with 'apply' name here (the code compiles, but doesn't
+// work), so I went with the 'result_' here, and in all other similar cases
+template< bool >
+struct resolve_arg_impl
+{
+ template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
+ {
+ typedef T type;
+ };
+};
+
+template<>
+struct resolve_arg_impl<true>
+{
+ template< typename T, AUX778076_BIND_PARAMS(typename U) > struct result_
+ {
+ typedef typename AUX778076_APPLY<
+ T
+ , AUX778076_BIND_PARAMS(U)
+ >::type type;
+ };
+};
+
+// for 'resolve_bind_arg'
+template< typename T > struct is_bind_template;
+
+template<
+ typename T, AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg
+ : resolve_arg_impl< is_bind_template<T>::value >
+ ::template result_< T,AUX778076_BIND_PARAMS(U) >
+{
+};
+
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+template< typename T >
+struct replace_unnamed_arg_impl
+{
+ template< typename Arg > struct result_
+ {
+ typedef Arg next;
+ typedef T type;
+ };
+};
+
+template<>
+struct replace_unnamed_arg_impl< arg<-1> >
+{
+ template< typename Arg > struct result_
+ {
+ typedef typename next<Arg>::type next;
+ typedef Arg type;
+ };
+};
+
+template< typename T, typename Arg >
+struct replace_unnamed_arg
+ : replace_unnamed_arg_impl<T>::template result_<Arg>
+{
+};
+
+# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+// agurt, 10/mar/02: the forward declaration has to appear before any of
+// 'is_bind_helper' overloads, otherwise MSVC6.5 issues an ICE on it
+template< BOOST_MPL_AUX_NTTP_DECL(int, arity_) > struct bind_chooser;
+
+aux::no_tag is_bind_helper(...);
+template< typename T > aux::no_tag is_bind_helper(protect<T>*);
+
+// overload for "main" form
+// agurt, 15/mar/02: MSVC 6.5 fails to properly resolve the overload
+// in case if we use 'aux::type_wrapper< bind<...> >' here, and all
+// 'bind' instantiations form a complete type anyway
+#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T)
+ >
+aux::yes_tag is_bind_helper(bind<F,AUX778076_BIND_PARAMS(T)>*);
+#endif
+
+template< BOOST_MPL_AUX_NTTP_DECL(int, N) >
+aux::yes_tag is_bind_helper(arg<N>*);
+
+template< bool is_ref_ = true >
+struct is_bind_template_impl
+{
+ template< typename T > struct result_
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+};
+
+template<>
+struct is_bind_template_impl<false>
+{
+ template< typename T > struct result_
+ {
+ BOOST_STATIC_CONSTANT(bool, value =
+ sizeof(aux::is_bind_helper(static_cast<T*>(0)))
+ == sizeof(aux::yes_tag)
+ );
+ };
+};
+
+template< typename T > struct is_bind_template
+ : is_bind_template_impl< ::boost::detail::is_reference_impl<T>::value >
+ ::template result_<T>
+{
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace aux
+
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/bind.hpp>))
+#include BOOST_PP_ITERATE()
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
+/// if_/eval_if specializations
+# define AUX778076_SPEC_NAME if_
+# define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+
+#if !defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
+# define AUX778076_SPEC_NAME eval_if
+# define BOOST_PP_ITERATION_PARAMS_1 (3,(3, 3, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+#endif
+#endif
+
+// real C++ version is already taken care of
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+
+namespace aux {
+// apply_count_args
+#define AUX778076_COUNT_ARGS_PREFIX bind
+#define AUX778076_COUNT_ARGS_DEFAULT na
+#define AUX778076_COUNT_ARGS_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+#include <boost/mpl/aux_/count_args.hpp>
+}
+
+// bind
+template<
+ typename F, AUX778076_BIND_PARAMS(typename T) AUX778076_DMC_PARAM()
+ >
+struct bind
+ : aux::bind_chooser<
+ aux::bind_count_args<AUX778076_BIND_PARAMS(T)>::value
+ >::template result_< F,AUX778076_BIND_PARAMS(T) >::type
+{
+};
+
+BOOST_MPL_AUX_ARITY_SPEC(
+ BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+ , bind
+ )
+
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(
+ BOOST_PP_INC(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+ , bind
+ )
+
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+# undef AUX778076_BIND_NESTED_DEFAULT_PARAMS
+# undef AUX778076_BIND_N_SPEC_PARAMS
+# undef AUX778076_BIND_N_PARAMS
+# undef AUX778076_BIND_DEFAULT_PARAMS
+# undef AUX778076_BIND_PARAMS
+# undef AUX778076_DMC_PARAM
+# undef AUX778076_APPLY
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_BIND_HPP_INCLUDED
+
+///// iteration, depth == 1
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+# define i_ BOOST_PP_FRAME_ITERATION(1)
+
+#if defined(AUX778076_SPEC_NAME)
+
+// lazy metafunction specialization
+template< template< BOOST_MPL_PP_PARAMS(i_, typename T) > class F, typename Tag >
+struct BOOST_PP_CAT(quote,i_);
+
+template< BOOST_MPL_PP_PARAMS(i_, typename T) > struct AUX778076_SPEC_NAME;
+
+template<
+ typename Tag AUX778076_BIND_N_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(bind,i_)<
+ BOOST_PP_CAT(quote,i_)<AUX778076_SPEC_NAME,Tag>
+ AUX778076_BIND_N_PARAMS(i_,T)
+ >
+{
+ template<
+ AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
+ >
+ struct apply
+ {
+ private:
+ typedef mpl::arg<1> n1;
+# define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+
+ typedef typename AUX778076_SPEC_NAME<
+ typename t1::type
+ , BOOST_MPL_PP_EXT_PARAMS(2, BOOST_PP_INC(i_), t)
+ >::type f_;
+
+ public:
+ typedef typename f_::type type;
+ };
+};
+
+#undef AUX778076_SPEC_NAME
+
+#else // AUX778076_SPEC_NAME
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
+ >
+struct BOOST_PP_CAT(bind,i_)
+{
+ template<
+ AUX778076_BIND_NESTED_DEFAULT_PARAMS(typename U, na)
+ >
+ struct apply
+ {
+ private:
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+ typedef aux::replace_unnamed_arg< F,mpl::arg<1> > r0;
+ typedef typename r0::type a0;
+ typedef typename r0::next n1;
+ typedef typename aux::resolve_bind_arg<a0,AUX778076_BIND_PARAMS(U)>::type f_;
+ ///
+# else
+ typedef typename aux::resolve_bind_arg<F,AUX778076_BIND_PARAMS(U)>::type f_;
+
+# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT
+
+# if i_ > 0
+# define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, <boost/mpl/bind.hpp>))
+# include BOOST_PP_ITERATE()
+# endif
+
+ public:
+
+# define AUX778076_ARG(unused, i_, t) \
+ BOOST_PP_COMMA_IF(i_) \
+ typename BOOST_PP_CAT(t,BOOST_PP_INC(i_))::type \
+/**/
+
+ typedef typename BOOST_PP_CAT(apply_wrap,i_)<
+ f_
+ BOOST_PP_COMMA_IF(i_) BOOST_MPL_PP_REPEAT(i_, AUX778076_ARG, t)
+ >::type type;
+
+# undef AUX778076_ARG
+ };
+};
+
+namespace aux {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T), AUX778076_BIND_PARAMS(typename U)
+ >
+struct resolve_bind_arg<
+ BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>,AUX778076_BIND_PARAMS(U)
+ >
+{
+ typedef BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)> f_;
+ typedef typename AUX778076_APPLY<f_, AUX778076_BIND_PARAMS(U)>::type type;
+};
+
+#else
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T)
+ >
+aux::yes_tag
+is_bind_helper(BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T)>*);
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace aux
+
+BOOST_MPL_AUX_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
+BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(BOOST_PP_INC(i_), BOOST_PP_CAT(bind,i_))
+
+# if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+#if i_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
+/// primary template (not a specialization!)
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
+ >
+struct bind
+ : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
+{
+};
+#else
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T) AUX778076_DMC_PARAM()
+ >
+struct bind< F AUX778076_BIND_N_SPEC_PARAMS(i_, T, na) >
+ : BOOST_PP_CAT(bind,i_)<F AUX778076_BIND_N_PARAMS(i_,T) >
+{
+};
+#endif
+
+# else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace aux {
+
+template<>
+struct bind_chooser<i_>
+{
+ template<
+ typename F, AUX778076_BIND_PARAMS(typename T)
+ >
+ struct result_
+ {
+ typedef BOOST_PP_CAT(bind,i_)< F AUX778076_BIND_N_PARAMS(i_,T) > type;
+ };
+};
+
+} // namespace aux
+
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# endif // BOOST_MPL_CFG_NO_BIND_TEMPLATE
+
+#endif // AUX778076_SPEC_NAME
+
+# undef i_
+
+///// iteration, depth == 2
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+# define j_ BOOST_PP_FRAME_ITERATION(2)
+# if !defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+
+ typedef aux::replace_unnamed_arg< BOOST_PP_CAT(T,j_),BOOST_PP_CAT(n,j_) > BOOST_PP_CAT(r,j_);
+ typedef typename BOOST_PP_CAT(r,j_)::type BOOST_PP_CAT(a,j_);
+ typedef typename BOOST_PP_CAT(r,j_)::next BOOST_PP_CAT(n,BOOST_PP_INC(j_));
+ typedef aux::resolve_bind_arg<BOOST_PP_CAT(a,j_), AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
+ ///
+# else
+ typedef aux::resolve_bind_arg< BOOST_PP_CAT(T,j_),AUX778076_BIND_PARAMS(U)> BOOST_PP_CAT(t,j_);
+
+# endif
+# undef j_
+
+#endif // BOOST_PP_IS_ITERATING
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_BIND_FWD_HPP_INCLUDED
+#define BOOST_MPL_BIND_FWD_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/bind_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.2 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/aux_/na.hpp>
+#endif
+
+#include <boost/mpl/aux_/config/bind.hpp>
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER bind_fwd.hpp
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/preprocessor/default_params.hpp>
+# include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
+
+# include <boost/preprocessor/comma_if.hpp>
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+namespace boost { namespace mpl {
+
+// local macros, #undef-ined at the end of the header
+
+# if defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
+# define AUX778076_DMC_PARAM() , int dummy_ = 0
+# else
+# define AUX778076_DMC_PARAM()
+# endif
+
+# define AUX778076_BIND_DEFAULT_PARAMS(param, value) \
+ BOOST_MPL_PP_DEFAULT_PARAMS( \
+ BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
+ , param \
+ , value \
+ ) \
+ AUX778076_DMC_PARAM() \
+ /**/
+
+# define AUX778076_BIND_N_PARAMS(n, param) \
+ BOOST_PP_COMMA_IF(n) BOOST_MPL_PP_PARAMS(n, param) \
+ AUX778076_DMC_PARAM() \
+ /**/
+
+#if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
+template<
+ typename F, AUX778076_BIND_DEFAULT_PARAMS(typename T, na)
+ >
+struct bind;
+#endif
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/bind_fwd.hpp>))
+#include BOOST_PP_ITERATE()
+
+# undef AUX778076_BIND_N_PARAMS
+# undef AUX778076_BIND_DEFAULT_PARAMS
+# undef AUX778076_DMC_PARAM
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_BIND_FWD_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i_ BOOST_PP_FRAME_ITERATION(1)
+
+template<
+ typename F AUX778076_BIND_N_PARAMS(i_, typename T)
+ >
+struct BOOST_PP_CAT(bind,i_);
+
+#undef i_
+#endif // BOOST_PP_IS_ITERATING
#ifndef BOOST_MPL_BOOL_HPP_INCLUDED
#define BOOST_MPL_BOOL_HPP_INCLUDED
-// + file: boost/mpl/bool.hpp
-// + last modified: 12/apr/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/bool_fwd.hpp"
-#include "boost/mpl/aux_/config/static_constant.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/bool.hpp,v $
+// $Date: 2004/09/26 09:54:25 $
+// $Revision: 1.6 $
+
+#include <boost/mpl/bool_fwd.hpp>
+#include <boost/mpl/integral_c_tag.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
-namespace boost { namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
template< bool C_ > struct bool_
{
BOOST_STATIC_CONSTANT(bool, value = C_);
+ typedef integral_c_tag tag;
typedef bool_ type;
typedef bool value_type;
operator bool() const { return this->value; }
bool const bool_<C_>::value;
#endif
-}} // namespace boost::mpl
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
#endif // BOOST_MPL_BOOL_HPP_INCLUDED
#ifndef BOOST_MPL_BOOL_FWD_HPP_INCLUDED
#define BOOST_MPL_BOOL_FWD_HPP_INCLUDED
-// + file: boost/mpl/bool_fwd.hpp
-// + last modified: 08/mar/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-namespace boost { namespace mpl {
+// $Source: /cvsroot/boost/boost/boost/mpl/bool_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
template< bool C_ > struct bool_;
typedef bool_<true> true_;
typedef bool_<false> false_;
-}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+
+BOOST_MPL_AUX_ADL_BARRIER_DECL(bool_)
+BOOST_MPL_AUX_ADL_BARRIER_DECL(true_)
+BOOST_MPL_AUX_ADL_BARRIER_DECL(false_)
#endif // BOOST_MPL_BOOL_FWD_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_EVAL_IF_HPP_INCLUDED
+#define BOOST_MPL_EVAL_IF_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/eval_if.hpp,v $
+// $Date: 2004/11/15 13:12:51 $
+// $Revision: 1.2.2.1 $
+
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/gcc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(C)
+ , typename BOOST_MPL_AUX_NA_PARAM(F1)
+ , typename BOOST_MPL_AUX_NA_PARAM(F2)
+ >
+struct eval_if
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || ( BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, >= 0x0300) \
+ && BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304)) \
+ )
+{
+ typedef typename if_<C,F1,F2>::type f_;
+ typedef typename f_::type type;
+#else
+ : if_<C,F1,F2>::type
+{
+#endif
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,eval_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 eval_if_c
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
+ || ( BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, >= 0x0300) \
+ && BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304)) \
+ )
+{
+ typedef typename if_c<C,F1,F2>::type f_;
+ typedef typename f_::type type;
+#else
+ : if_c<C,F1,F2>::type
+{
+#endif
+};
+
+BOOST_MPL_AUX_NA_SPEC(3, eval_if)
+
+}}
+
+#endif // BOOST_MPL_EVAL_IF_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_HAS_XXX_HPP_INCLUDED
+#define BOOST_MPL_HAS_XXX_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2002-2004
+// Copyright David Abrahams 2002-2003
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/has_xxx.hpp,v $
+// $Date: 2004/09/03 15:56:55 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/aux_/type_wrapper.hpp>
+#include <boost/mpl/aux_/yes_no.hpp>
+#include <boost/mpl/aux_/config/has_xxx.hpp>
+#include <boost/mpl/aux_/config/msvc_typename.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
+
+#include <boost/preprocessor/cat.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_HAS_XXX)
+
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+
+// agurt, 11/sep/02: MSVC-specific version (< 7.1), based on a USENET
+// newsgroup's posting by John Madsen (comp.lang.c++.moderated,
+// 1999-11-12 19:17:06 GMT); the code is _not_ standard-conforming, but
+// it works way more reliably than the SFINAE-based implementation
+
+// Modified dwa 8/Oct/02 to handle reference types.
+
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/bool.hpp>
+
+namespace boost { namespace mpl { namespace aux {
+
+struct has_xxx_tag;
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+template< typename U > struct msvc_incomplete_array
+{
+ typedef char (&type)[sizeof(U) + 1];
+};
+#endif
+
+template< typename T >
+struct msvc_is_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< typename U >
+ static typename msvc_incomplete_array<U>::type tester(type_wrapper<U>);
+#else
+ template< typename U >
+ static char (& tester(type_wrapper<U>) )[sizeof(U)+1];
+#endif
+
+ BOOST_STATIC_CONSTANT(bool, value =
+ sizeof(tester(type_wrapper<T>())) == 1
+ );
+};
+
+template<>
+struct msvc_is_incomplete<int>
+{
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+}}}
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF_(trait, name, default_) \
+template< typename T, typename name = ::boost::mpl::aux::has_xxx_tag > \
+struct BOOST_PP_CAT(trait,_impl) : T \
+{ \
+ static boost::mpl::aux::no_tag \
+ test(void(*)(::boost::mpl::aux::has_xxx_tag)); \
+ \
+ static boost::mpl::aux::yes_tag test(...); \
+ \
+ BOOST_STATIC_CONSTANT(bool, value = \
+ sizeof(test(static_cast<void(*)(name)>(0))) \
+ != sizeof(boost::mpl::aux::no_tag) \
+ ); \
+ typedef boost::mpl::bool_<value> type; \
+}; \
+\
+template< typename T, typename fallback_ = boost::mpl::bool_<default_> > \
+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); \
+ typedef boost::mpl::bool_<false> type; \
+}; \
+/**/
+
+#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
+
+
+// SFINAE-based implementations below are derived from a USENET newsgroup's
+// posting by Rani Sharoni (comp.lang.c++.moderated, 2002-03-17 07:45:09 PST)
+
+# elif BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))
+
+// MSVC 7.1+
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \
+template< typename T > struct BOOST_PP_CAT(trait,_wrapper_); \
+template< typename T > \
+boost::mpl::aux::yes_tag BOOST_PP_CAT(trait,_helper_)( \
+ BOOST_PP_CAT(trait,_wrapper_)<T> const volatile* \
+ , BOOST_PP_CAT(trait,_wrapper_)<BOOST_MSVC_TYPENAME T::name>* = 0 \
+ ); \
+\
+boost::mpl::aux::no_tag BOOST_PP_CAT(trait,_helper_)(...); \
+\
+template< typename T, typename fallback_ = boost::mpl::bool_<default_> > \
+struct trait \
+{ \
+ typedef BOOST_PP_CAT(trait,_wrapper_)<T> t_; \
+ BOOST_STATIC_CONSTANT(bool, value = \
+ sizeof((BOOST_PP_CAT(trait,_helper_))(static_cast<t_*>(0))) \
+ == sizeof(boost::mpl::aux::yes_tag) \
+ ); \
+ typedef boost::mpl::bool_<value> type; \
+}; \
+/**/
+
+# else // other SFINAE-capable compilers
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \
+template< typename T, typename fallback_ = boost::mpl::bool_<default_> > \
+struct trait \
+{ \
+ struct gcc_3_2_wknd \
+ { \
+ 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(gcc_3_2_wknd::test(static_cast<t_*>(0))) \
+ == sizeof(boost::mpl::aux::yes_tag) \
+ ); \
+ typedef boost::mpl::bool_<value> type; \
+}; \
+/**/
+
+# endif // BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+
+
+#else // BOOST_MPL_CFG_NO_HAS_XXX
+
+// placeholder implementation
+
+# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \
+template< typename T, typename fallback_ = boost::mpl::bool_<default_> > \
+struct trait \
+{ \
+ BOOST_STATIC_CONSTANT(bool, value = fallback_::value); \
+ typedef fallback_ type; \
+}; \
+/**/
+
+#endif
+
+#define BOOST_MPL_HAS_XXX_TRAIT_DEF(name) \
+ BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(has_,name), name, false) \
+/**/
+
+#endif // BOOST_MPL_HAS_XXX_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// 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"
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/identity.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
-namespace boost {
-namespace mpl {
+namespace boost { namespace mpl {
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T)
+ typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct identity
{
typedef T type;
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,identity,(T))
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1, identity, (T))
};
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T)
+ typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct make_identity
{
typedef identity<T> type;
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,make_identity,(T))
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1, make_identity, (T))
};
-BOOST_MPL_AUX_VOID_SPEC(1, identity)
-BOOST_MPL_AUX_VOID_SPEC(1, make_identity)
+BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, identity)
+BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, make_identity)
-} // namespace mpl
-} // namespace boost
+}}
#endif // BOOST_MPL_IDENTITY_HPP_INCLUDED
#ifndef BOOST_MPL_IF_HPP_INCLUDED
#define BOOST_MPL_IF_HPP_INCLUDED
-// + file: boost/mpl/if.hpp
-// + last modified: 17/sep/03
-
-// Copyright (c) 2000-03 Boost.org
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// 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_/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"
+// $Source: /cvsroot/boost/boost/boost/mpl/if.hpp,v $
+// $Date: 2004/09/07 08:51:31 $
+// $Revision: 1.25 $
-#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
-# include "boost/mpl/arg_fwd.hpp"
-#endif
+#include <boost/mpl/aux_/value_wknd.hpp>
+#include <boost/mpl/aux_/static_cast.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+#include <boost/mpl/aux_/config/integral.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-namespace boost {
-namespace mpl {
+namespace boost { namespace mpl {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN
-
template<
bool C
, typename T1
typedef T2 type;
};
+// agurt, 05/sep/04: nondescriptive parameter names for the sake of DigitalMars
+// (and possibly MWCW < 8.0); see http://article.gmane.org/gmane.comp.lib.boost.devel/108959
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(C)
- , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T1)
- , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
+ typename BOOST_MPL_AUX_NA_PARAM(T1)
+ , typename BOOST_MPL_AUX_NA_PARAM(T2)
+ , typename BOOST_MPL_AUX_NA_PARAM(T3)
>
struct if_
{
private:
// agurt, 02/jan/03: two-step 'type' definition for the sake of aCC
typedef if_c<
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561))
- BOOST_MPL_AUX_VALUE_WKND(C)::value
+#if defined(BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS)
+ BOOST_MPL_AUX_VALUE_WKND(T1)::value
#else
- BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(C)::value)
+ BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(T1)::value)
#endif
- , T1
, T2
+ , T3
> almost_type_;
public:
typedef typename almost_type_::type type;
- BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2))
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(T1,T2,T3))
};
#else
// (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(T1)
- , typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T2)
+ typename BOOST_MPL_AUX_NA_PARAM(C_)
+ , typename BOOST_MPL_AUX_NA_PARAM(T1)
+ , typename BOOST_MPL_AUX_NA_PARAM(T2)
>
struct if_
{
- enum { msvc70_wknd_ = C_::value };
+ enum { msvc_wknd_ = BOOST_MPL_AUX_MSVC_VALUE_WKND(C_)::value };
- typedef typename aux::if_impl< BOOST_MPL_AUX_STATIC_CAST(bool, msvc70_wknd_) >
+ typedef typename aux::if_impl< BOOST_MPL_AUX_STATIC_CAST(bool, msvc_wknd_) >
::template result_<T1,T2>::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C_,T1,T2))
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-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
+BOOST_MPL_AUX_NA_SPEC(3, if_)
-} // namespace mpl
-} // namespace boost
+}}
#endif // BOOST_MPL_IF_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_INT_HPP_INCLUDED
+#define BOOST_MPL_INT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/int.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/int_fwd.hpp>
+
+#define AUX_WRAPPER_VALUE_TYPE int
+#include <boost/mpl/aux_/integral_wrapper.hpp>
+
+#endif // BOOST_MPL_INT_HPP_INCLUDED
#ifndef BOOST_MPL_INT_FWD_HPP_INCLUDED
#define BOOST_MPL_INT_FWD_HPP_INCLUDED
-// + file: boost/mpl/int_fwd.hpp
-// + last modified: 08/mar/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-namespace boost { namespace mpl {
-template< int N > struct int_;
-}}
+// $Source: /cvsroot/boost/boost/boost/mpl/int_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+
+template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct int_;
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+BOOST_MPL_AUX_ADL_BARRIER_DECL(int_)
#endif // BOOST_MPL_INT_FWD_HPP_INCLUDED
#ifndef BOOST_MPL_INTEGRAL_C_HPP_INCLUDED
#define BOOST_MPL_INTEGRAL_C_HPP_INCLUDED
-// + file: boost/mpl/integral_c.hpp
-// + last modified: 08/mar/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/integral_c_fwd.hpp"
-#include "boost/mpl/aux_/ice_cast.hpp"
-#include "boost/mpl/aux_/config/ctps.hpp"
-#include "boost/mpl/aux_/config/workaround.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/integral_c.hpp,v $
+// $Date: 2004/09/07 08:51:31 $
+// $Revision: 1.21 $
+
+#include <boost/mpl/integral_c_fwd.hpp>
+#include <boost/mpl/aux_/config/ctps.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
#if BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800))
// the type of non-type template arguments may not depend on template arguments
#define AUX_WRAPPER_NAME integral_c
#define AUX_WRAPPER_VALUE_TYPE T
#define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< T, value >
-#include "boost/mpl/aux_/integral_wrapper.hpp"
+#include <boost/mpl/aux_/integral_wrapper.hpp>
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
-namespace boost { namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
// 'bool' constant doesn't have 'next'/'prior' members
template< bool C >
struct integral_c<bool, C>
typedef integral_c type;
operator bool() const { return this->value; }
};
-}}
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
#endif
#endif // BOOST_MPL_INTEGRAL_C_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_INTEGRAL_C_TAG_HPP_INCLUDED
+#define BOOST_MPL_INTEGRAL_C_TAG_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/integral_c_tag.hpp,v $
+// $Date: 2004/09/28 13:56:58 $
+// $Revision: 1.2 $
+
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+#include <boost/mpl/aux_/config/static_constant.hpp>
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+struct integral_c_tag { BOOST_STATIC_CONSTANT(int, value = 0); };
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+BOOST_MPL_AUX_ADL_BARRIER_DECL(integral_c_tag)
+
+#endif // BOOST_MPL_INTEGRAL_C_TAG_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_LAMBDA_HPP_INCLUDED
+#define BOOST_MPL_LAMBDA_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2001-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/lambda.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.5 $
+
+#include <boost/mpl/lambda_fwd.hpp>
+#include <boost/mpl/bind.hpp>
+#include <boost/mpl/aux_/config/lambda.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
+# include <boost/mpl/aux_/full_lambda.hpp>
+#else
+# include <boost/mpl/aux_/lambda_no_ctps.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
+# define BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS
+#endif
+
+#endif // BOOST_MPL_LAMBDA_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2001-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/aux_/lambda_arity_param.hpp"
-#include "boost/mpl/aux_/config/lambda.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/lambda_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.7 $
+
+#include <boost/mpl/void_fwd.hpp>
+#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/aux_/config/lambda.hpp>
-namespace boost {
-namespace mpl {
+#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
-#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT)
+# include <boost/mpl/int.hpp>
+# include <boost/mpl/aux_/lambda_arity_param.hpp>
+# include <boost/mpl/aux_/template_arity_fwd.hpp>
+
+namespace boost { namespace mpl {
template<
- typename T
- , typename Tag
- BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity)
+ typename T = na
+ , typename Tag = void_
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(
+ typename Arity = int_< aux::template_arity<T>::value >
+ )
>
struct lambda;
-#else
+}}
+
+#else // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
+
+# include <boost/mpl/bool.hpp>
+
+namespace boost { namespace mpl {
template<
- typename T
- , typename Tag
- , bool Protect
+ typename T = na
+ , typename Tag = void_
+ , typename Protect = true_
>
struct lambda;
-#endif
+}}
-} // namespace mpl
-} // namespace boost
+#endif
#endif // BOOST_MPL_LAMBDA_FWD_HPP_INCLUDED
-//-----------------------------------------------------------------------------
-// boost mpl/limits/arity.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_LIMITS_ARITY_HPP_INCLUDED
#define BOOST_MPL_LIMITS_ARITY_HPP_INCLUDED
-#if !defined(BOOST_MPL_METAFUNCTION_MAX_ARITY)
-# define BOOST_MPL_METAFUNCTION_MAX_ARITY 5
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/limits/arity.hpp,v $
+// $Date: 2004/09/02 15:40:57 $
+// $Revision: 1.4 $
+
+#if !defined(BOOST_MPL_LIMIT_METAFUNCTION_ARITY)
+# define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 5
#endif
#endif // BOOST_MPL_LIMITS_ARITY_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_NEXT_HPP_INCLUDED
+#define BOOST_MPL_NEXT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/next.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.7 $
+
+#include <boost/mpl/next_prior.hpp>
+
+#endif // BOOST_MPL_NEXT_HPP_INCLUDED
--- /dev/null
+
+#ifndef BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
+#define BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/next_prior.hpp,v $
+// $Date: 2004/09/17 06:09:38 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/common_name_wknd.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_COMMON_NAME_WKND(next)
+BOOST_MPL_AUX_COMMON_NAME_WKND(prior)
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct next
+{
+ typedef typename T::next type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,next,(T))
+};
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ >
+struct prior
+{
+ typedef typename T::prior type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,prior,(T))
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, next)
+BOOST_MPL_AUX_NA_SPEC(1, prior)
+
+}}
+
+#endif // BOOST_MPL_NEXT_PRIOR_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// 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"
+// $Source: /cvsroot/boost/boost/boost/mpl/not.hpp,v $
+// $Date: 2004/09/02 15:40:41 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
+#include <boost/mpl/aux_/nested_type_wknd.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
-namespace boost {
-namespace mpl {
+namespace boost { namespace mpl {
namespace aux {
-template< long C_ > // 'long' is intentional here
+template< BOOST_MPL_AUX_NTTP_DECL(long, C_) > // 'long' is intentional here
struct not_impl
: bool_<!C_>
{
template<
- typename BOOST_MPL_AUX_VOID_SPEC_PARAM(T)
+ typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct not_
: aux::not_impl<
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,not_,(T))
};
-BOOST_MPL_AUX_VOID_SPEC(1,not_)
+BOOST_MPL_AUX_NA_SPEC(1,not_)
-} // namespace mpl
-} // namespace boost
+}}
#endif // BOOST_MPL_NOT_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// 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"
+// $Source: /cvsroot/boost/boost/boost/mpl/or.hpp,v $
+// $Date: 2004/09/02 15:40:42 $
+// $Revision: 1.4 $
+
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_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_/na_spec.hpp>
+# include <boost/mpl/aux_/lambda_support.hpp>
+# include <boost/mpl/aux_/config/msvc.hpp>
+
+// agurt, 19/may/04: workaround a conflict with <iso646.h> header's
+// 'or' and 'and' macros, see http://tinyurl.com/3et69; 'defined(or)'
+// has to be checked in a separate condition, otherwise GCC complains
+// about 'or' being an alternative token
+#if defined(_MSC_VER)
+#if defined(or)
+# pragma push_macro("or")
+# undef or
+# define or(x)
+#endif
+#endif
# define BOOST_MPL_PREPROCESSED_HEADER or.hpp
-# include "boost/mpl/aux_/include_preprocessed.hpp"
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#if defined(_MSC_VER)
+#if defined(or)
+# pragma pop_macro("or")
+#endif
+#endif
#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"
+# define AUX778076_OP_NAME or_
+# define AUX778076_OP_VALUE1 true
+# define AUX778076_OP_VALUE2 false
+# include <boost/mpl/aux_/logical_op.hpp>
-#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_OR_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2001-2004
+// Copyright Peter Dimov 2001-2003
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
+// $Source: /cvsroot/boost/boost/boost/mpl/placeholders.hpp,v $
+// $Date: 2004/09/16 14:08:46 $
+// $Revision: 1.4 $
+
+
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
-# include "boost/mpl/arg.hpp"
+# include <boost/mpl/arg.hpp>
+# include <boost/mpl/aux_/adl_barrier.hpp>
+
+# if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)
+# define BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(type) \
+ using ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::type; \
+ /**/
+# else
+# define BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(type) /**/
+# endif
+
#endif
-#include "boost/mpl/aux_/config/use_preprocessed.hpp"
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
-#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER placeholders.hpp
-# include "boost/mpl/aux_/include_preprocessed.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 {
+# include <boost/mpl/aux_/nttp_decl.hpp>
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/cat.hpp>
// watch out for GNU gettext users, who #define _(x)
-#if !defined(_) || defined(BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+#if !defined(_) || defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
typedef arg<-1> _;
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_)
namespace placeholders {
-using boost::mpl::_;
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_;
}
+
+}}
#endif
-//: agurt, 17/mar/02: one more placeholder for the last 'apply#'
-//: specialization
+/// 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"))
+ (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY + 1, <boost/mpl/placeholders.hpp>))
#include BOOST_PP_ITERATE()
-} // namespace mpl
-} // namespace boost
-
-#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
///// iteration
#else
-#define i BOOST_PP_FRAME_ITERATION(1)
+#define i_ BOOST_PP_FRAME_ITERATION(1)
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+
+typedef arg<i_> BOOST_PP_CAT(_,i_);
-typedef arg<i> BOOST_PP_CAT(_,i);
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+
+namespace boost { namespace mpl {
+
+BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(BOOST_PP_CAT(_,i_))
namespace placeholders {
-using boost::mpl::BOOST_PP_CAT(_,i);
+using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::BOOST_PP_CAT(_,i_);
}
-#undef i
+}}
+
+#undef i_
#endif // BOOST_PP_IS_ITERATING
--- /dev/null
+
+#ifndef BOOST_MPL_PROTECT_HPP_INCLUDED
+#define BOOST_MPL_PROTECT_HPP_INCLUDED
+
+// Copyright Peter Dimov 2001
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/protect.hpp,v $
+// $Date: 2004/09/07 21:37:24 $
+// $Revision: 1.10 $
+
+#include <boost/mpl/aux_/arity.hpp>
+#include <boost/mpl/aux_/config/dtp.hpp>
+#include <boost/mpl/aux_/nttp_decl.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+
+namespace boost { namespace mpl {
+
+template<
+ typename BOOST_MPL_AUX_NA_PARAM(T)
+ , int not_le_ = 0
+ >
+struct protect : T
+{
+#if BOOST_WORKAROUND(__EDG_VERSION__, == 238)
+ typedef mpl::protect type;
+#else
+ typedef protect type;
+#endif
+};
+
+#if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
+namespace aux {
+template< BOOST_MPL_AUX_NTTP_DECL(int, N), typename T >
+struct arity< protect<T>, N >
+ : arity<T,N>
+{
+};
+} // namespace aux
+#endif
+
+BOOST_MPL_AUX_NA_SPEC_MAIN(1, protect)
+#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
+BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(1, 1, protect)
+#endif
+
+}}
+
+#endif // BOOST_MPL_PROTECT_HPP_INCLUDED
--- /dev/null
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_MPL_QUOTE_HPP_INCLUDED
+#define BOOST_MPL_QUOTE_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Source: /cvsroot/boost/boost/boost/mpl/quote.hpp,v $
+// $Date: 2004/09/02 15:40:42 $
+// $Revision: 1.5 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <boost/mpl/void.hpp>
+# include <boost/mpl/aux_/has_type.hpp>
+#endif
+
+#include <boost/mpl/aux_/config/ttp.hpp>
+
+#if defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS)
+# define BOOST_MPL_CFG_NO_QUOTE_TEMPLATE
+#endif
+
+#if !defined(BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS) \
+ && defined(BOOST_MPL_CFG_NO_HAS_XXX)
+# define BOOST_MPL_CFG_NO_IMPLICIT_METAFUNCTIONS
+#endif
+
+#include <boost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER quote.hpp
+# include <boost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <boost/mpl/limits/arity.hpp>
+# include <boost/mpl/aux_/preprocessor/params.hpp>
+# include <boost/mpl/aux_/config/ctps.hpp>
+# include <boost/mpl/aux_/config/workaround.hpp>
+
+# include <boost/preprocessor/iterate.hpp>
+# include <boost/preprocessor/cat.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_QUOTE_TEMPLATE)
+
+namespace boost { namespace mpl {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename T, bool has_type_ >
+struct quote_impl
+ : T
+{
+};
+
+template< typename T >
+struct quote_impl<T,false>
+{
+ typedef T type;
+};
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+template< bool > struct quote_impl
+{
+ template< typename T > struct result_
+ : T
+ {
+ };
+};
+
+template<> struct quote_impl<false>
+{
+ template< typename T > struct result_
+ {
+ typedef T type;
+ };
+};
+
+#endif
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/quote.hpp>))
+#include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_QUOTE_TEMPLATE
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_QUOTE_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i_ BOOST_PP_FRAME_ITERATION(1)
+
+template<
+ template< BOOST_MPL_PP_PARAMS(i_, typename P) > class F
+ , typename Tag = void_
+ >
+struct BOOST_PP_CAT(quote,i_)
+{
+ template< BOOST_MPL_PP_PARAMS(i_, typename U) > struct apply
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ : quote_impl<
+ F< BOOST_MPL_PP_PARAMS(i_, U) >
+ , aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value
+ >
+#else
+ : quote_impl< aux::has_type< F< BOOST_MPL_PP_PARAMS(i_, U) > >::value >
+ ::template result_< F< BOOST_MPL_PP_PARAMS(i_, U) > >
+#endif
+ {
+ };
+};
+
+#undef i_
+#endif // BOOST_PP_IS_ITERATING
#ifndef BOOST_MPL_SIZE_T_HPP_INCLUDED
#define BOOST_MPL_SIZE_T_HPP_INCLUDED
-// + file: boost/mpl/size_t.hpp
-// + last modified: 08/mar/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/size_t_fwd.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/size_t.hpp,v $
+// $Date: 2004/09/02 15:40:42 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/size_t_fwd.hpp>
#define AUX_WRAPPER_VALUE_TYPE std::size_t
#define AUX_WRAPPER_NAME size_t
#define AUX_WRAPPER_PARAMS(N) std::size_t N
-#include "boost/mpl/aux_/integral_wrapper.hpp"
+#include <boost/mpl/aux_/integral_wrapper.hpp>
#endif // BOOST_MPL_SIZE_T_HPP_INCLUDED
#ifndef BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
#define BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
-// + file: boost/mpl/size_t_fwd.hpp
-// + last modified: 08/mar/03
-
-// Copyright (c) 2000-03
-// Aleksey Gurtovoy
+// Copyright Aleksey Gurtovoy 2000-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/config.hpp" // make sure 'size_t' is placed into 'std'
+// $Source: /cvsroot/boost/boost/boost/mpl/size_t_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:42 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+#include <boost/config.hpp> // make sure 'size_t' is placed into 'std'
#include <cstddef>
-namespace boost { namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
+
template< std::size_t N > struct size_t;
-}}
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+BOOST_MPL_AUX_ADL_BARRIER_DECL(size_t)
#endif // BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2001-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-#include "boost/mpl/void_fwd.hpp"
-#include "boost/mpl/bool.hpp"
-#include "boost/mpl/aux_/config/msvc.hpp"
-#include "boost/mpl/aux_/config/workaround.hpp"
+// $Source: /cvsroot/boost/boost/boost/mpl/void.hpp,v $
+// $Date: 2004/09/02 15:40:42 $
+// $Revision: 1.9 $
+
+#include <boost/mpl/void_fwd.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/aux_/na_spec.hpp>
+#include <boost/mpl/aux_/config/msvc.hpp>
+#include <boost/mpl/aux_/config/workaround.hpp>
-namespace boost {
-namespace mpl {
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
// [JDG Feb-4-2003] made void_ a complete type to allow it to be
// instantiated so that it can be passed in as an object that can be
// a zero arity functor evaluation call.
struct void_ { typedef void_ type; };
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+
+namespace boost { namespace mpl {
+
template< typename T >
struct is_void_
: false_
#endif
};
-} // namespace mpl
-} // namespace boost
+template< typename T >
+struct is_not_void_
+ : true_
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ using true_::value;
+#endif
+};
+
+template<>
+struct is_not_void_<void_>
+ : false_
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ using false_::value;
+#endif
+};
+
+BOOST_MPL_AUX_NA_SPEC(1, is_void_)
+BOOST_MPL_AUX_NA_SPEC(1, is_not_void_)
+
+}}
#endif // BOOST_MPL_VOID_HPP_INCLUDED
#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
+// Copyright Aleksey Gurtovoy 2001-2004
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
-namespace boost {
-namespace mpl {
+// $Source: /cvsroot/boost/boost/boost/mpl/void_fwd.hpp,v $
+// $Date: 2004/09/02 15:40:42 $
+// $Revision: 1.3 $
+
+#include <boost/mpl/aux_/adl_barrier.hpp>
+
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
struct void_;
-} // namespace mpl
-} // namespace boost
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
+BOOST_MPL_AUX_ADL_BARRIER_DECL(void_)
#endif // BOOST_MPL_VOID_FWD_HPP_INCLUDED
#include "boost/multi_array/multi_array_ref.hpp"
#include "boost/multi_array/algorithm.hpp"
#include "boost/array.hpp"
+#include "boost/mpl/if.hpp"
#include "boost/type_traits.hpp"
#include <algorithm>
#include <cstddef>
namespace boost {
namespace detail {
namespace multi_array {
+
struct populate_index_ranges {
multi_array_types::index_range
operator()(multi_array_types::index base,
return multi_array_types::index_range(base,base+extent);
}
};
+
+#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_multi_array_impl.
+//
+template <typename T, std::size_t NumDims, typename TPtr>
+char is_multi_array_impl_help(const_multi_array_view<T,NumDims,TPtr>&);
+template <typename T, std::size_t NumDims, typename TPtr>
+char is_multi_array_impl_help(const_sub_array<T,NumDims,TPtr>&);
+template <typename T, std::size_t NumDims, typename TPtr>
+char is_multi_array_impl_help(const_multi_array_ref<T,NumDims,TPtr>&);
+
+char ( &is_multi_array_impl_help(...) )[2];
+
+template <class T>
+struct is_multi_array_impl
+{
+ static T x;
+ BOOST_STATIC_CONSTANT(bool, value = sizeof((is_multi_array_impl_help)(x)) == 1);
+
+ typedef mpl::bool_<value> type;
+};
+
+template <bool multi_array = false>
+struct disable_multi_array_impl_impl
+{
+ typedef int type;
+};
+
+template <>
+struct disable_multi_array_impl_impl<true>
+{
+ // forming a pointer to a reference triggers SFINAE
+ typedef int& type;
+};
+
+
+template <class T>
+struct disable_multi_array_impl :
+ disable_multi_array_impl_impl<is_multi_array_impl<T>::value>
+{ };
+
+
+template <>
+struct disable_multi_array_impl<int>
+{
+ typedef int type;
+};
+
+
+#endif
+
} //namespace multi_array
} // namespace detail
};
explicit multi_array() :
- super_type((T*)initial_base_) {
- allocate_space();
+ super_type((T*)initial_base_,c_storage_order(),
+ /*index_bases=*/0, /*extents=*/0) {
+ allocate_space();
}
-
+
template <class ExtentList>
explicit multi_array(
ExtentList const& extents
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
- , typename detail::multi_array::disable_non_sub_array<ExtentList>::type* = 0
-#endif
- ) :
+ , typename mpl::if_<
+ detail::multi_array::is_multi_array_impl<ExtentList>,
+ int&,int>::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,
boost::copy_n(rhs.base_,rhs.num_elements(),base_);
}
+
+ //
+ // A multi_array is constructible from any multi_array_ref, subarray, or
+ // array_view object. The following constructors ensure that.
+ //
+
+ // Due to limited support for partial template ordering,
+ // MSVC 6&7 confuse the following with the most basic ExtentList
+ // constructor.
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template <typename OPtr>
+ multi_array(const const_multi_array_ref<T,NumDims,OPtr>& rhs,
+ const general_storage_order<NumDims>& so = c_storage_order())
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ // Warning! storage order may change, hence the following copy technique.
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+ template <typename OPtr>
+ multi_array(const detail::multi_array::
+ const_sub_array<T,NumDims,OPtr>& rhs,
+ const general_storage_order<NumDims>& so = c_storage_order())
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+
+ template <typename OPtr>
+ multi_array(const detail::multi_array::
+ const_multi_array_view<T,NumDims,OPtr>& rhs,
+ const general_storage_order<NumDims>& so = c_storage_order())
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+#else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+ // More limited support for MSVC
+
+
+ multi_array(const const_multi_array_ref<T,NumDims>& rhs)
+ : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ // Warning! storage order may change, hence the following copy technique.
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+ multi_array(const const_multi_array_ref<T,NumDims>& rhs,
+ const general_storage_order<NumDims>& so)
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ // Warning! storage order may change, hence the following copy technique.
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+ multi_array(const detail::multi_array::
+ const_sub_array<T,NumDims>& rhs)
+ : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+ multi_array(const detail::multi_array::
+ const_sub_array<T,NumDims>& rhs,
+ const general_storage_order<NumDims>& so)
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+
+ multi_array(const detail::multi_array::
+ const_multi_array_view<T,NumDims>& rhs)
+ : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+ multi_array(const detail::multi_array::
+ const_multi_array_view<T,NumDims>& rhs,
+ const general_storage_order<NumDims>& so)
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+#endif // !BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ // Thes constructors are necessary because of more exact template matches.
+ multi_array(const multi_array_ref<T,NumDims>& rhs)
+ : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ // Warning! storage order may change, hence the following copy technique.
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+ multi_array(const multi_array_ref<T,NumDims>& rhs,
+ const general_storage_order<NumDims>& so)
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ // Warning! storage order may change, hence the following copy technique.
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
+
+ multi_array(const detail::multi_array::
+ sub_array<T,NumDims>& rhs)
+ : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
multi_array(const detail::multi_array::
- const_sub_array<T,NumDims,OPtr>& rhs) :
- super_type(rhs) {
+ sub_array<T,NumDims>& rhs,
+ const general_storage_order<NumDims>& so)
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
allocate_space();
std::copy(rhs.begin(),rhs.end(),this->begin());
}
- // For some reason, gcc 2.95.2 doesn't pick the above template
- // member function when passed a subarray, so i was forced to
- // duplicate the functionality here...
+
+ multi_array(const detail::multi_array::
+ multi_array_view<T,NumDims>& rhs)
+ : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape())
+ {
+ allocate_space();
+ std::copy(rhs.begin(),rhs.end(),this->begin());
+ }
+
multi_array(const detail::multi_array::
- sub_array<T,NumDims>& rhs) :
- super_type(rhs) {
+ multi_array_view<T,NumDims>& rhs,
+ const general_storage_order<NumDims>& so)
+ : super_type(0,so,rhs.index_bases(),rhs.shape())
+ {
allocate_space();
std::copy(rhs.begin(),rhs.end(),this->begin());
}
#include "boost/multi_array/storage_order.hpp"
#include "boost/multi_array/types.hpp"
#include "boost/config.hpp"
-#include "boost/mpl/apply_if.hpp"
+#include "boost/mpl/eval_if.hpp"
#include "boost/mpl/if.hpp"
#include "boost/mpl/size_t.hpp"
#include "boost/mpl/aux_/msvc_eti_base.hpp"
BOOST_STATIC_CONSTANT(std::size_t, dimensionality = NumDims::value);
typedef typename
- mpl::apply_if_c<(dimensionality == 1),
+ mpl::eval_if_c<(dimensionality == 1),
choose_value_accessor_one<T>,
choose_value_accessor_n<T,dimensionality>
>::type type;
private:
static index from_start()
- { return std::numeric_limits<index>::min(); }
+ { return (std::numeric_limits<index>::min)(); }
static index to_end()
- { return std::numeric_limits<index>::max(); }
+ { return (std::numeric_limits<index>::max)(); }
public:
index start_, finish_, stride_;
bool degenerate_;
// 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
+ // This ensures that const_multi_array_ref types with different TPtr
+ // types can convert to each other
template <typename OPtr>
- const_multi_array_ref(const const_multi_array_ref<T,NumDims,
- OPtr>& other)
+ const_multi_array_ref(const const_multi_array_ref<T,NumDims,OPtr>& other)
: base_(other.base_), storage_(other.storage_),
extent_list_(other.extent_list_),
stride_list_(other.stride_list_),
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
protected:
#else
public:
#endif
+
+ typedef boost::array<size_type,NumDims> size_list;
+ typedef boost::array<index,NumDims> index_list;
+
// This is used by multi_array, which is a subclass of this
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_(0), // playing it "safe"; so we learn of errors
- storage_(c_storage_order()),
- origin_offset_(0), directional_offset_(0),
- num_elements_(rhs.num_elements())
- {
- using boost::copy_n;
- copy_n(rhs.shape(),rhs.num_dimensions(),extent_list_.begin());
- copy_n(rhs.strides(),rhs.num_dimensions(),stride_list_.begin());
- copy_n(rhs.index_bases(),rhs.num_dimensions(),index_base_list_.begin());
- }
- typedef boost::array<size_type,NumDims> size_list;
- typedef boost::array<index,NumDims> index_list;
+ // This constructor supports multi_array's default constructor
+ // and constructors from multi_array_ref, subarray, and array_view
+ explicit
+ const_multi_array_ref(TPtr base,
+ const storage_order_type& so,
+ const index * index_bases,
+ const size_type* extents) :
+ base_(base), storage_(so), origin_offset_(0), directional_offset_(0)
+ {
+ // If index_bases or extents is null, then initialize the corresponding
+ // private data to zeroed lists.
+ if(index_bases) {
+ boost::copy_n(index_bases,NumDims,index_base_list_.begin());
+ } else {
+ std::fill_n(index_base_list_.begin(),NumDims,0);
+ }
+ if(extents) {
+ init_multi_array_ref(extents);
+ } else {
+ boost::array<index,NumDims> extent_list;
+ extent_list.assign(0);
+ init_multi_array_ref(extent_list.begin());
+ }
+ }
+
TPtr base_;
storage_order_type storage_;
}
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+protected:
+#else
+public:
+#endif
+ // RG - move me!
template <class InputIterator>
void init_multi_array_ref(InputIterator extents_iter) {
boost::function_requires<InputIteratorConcept<InputIterator> >();
// 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_ =
typedef typename super_type::index index;
typedef typename super_type::extent_range extent_range;
-
+ typedef typename super_type::storage_order_type storage_order_type;
+ typedef typename super_type::index_list index_list;
+ typedef typename super_type::size_list size_list;
template <std::size_t NDims>
struct const_array_view {
const general_storage_order<NumDims>& so) :
super_type(base,ranges,so) { }
- template <typename OPtr>
- multi_array_ref(const detail::multi_array::
- const_sub_array<T,NumDims,OPtr>& rhs)
- : super_type(rhs) {}
// Assignment from other ConstMultiArray types.
template <typename ConstMultiArray>
this->index_bases());
}
- // RG - rbegin() and rend() written naively to thwart MSVC ICE.
+ // rbegin() and rend() written naively to thwart MSVC ICE.
reverse_iterator rbegin() {
reverse_iterator ri(end());
return ri;
protected:
// This is only supplied to support multi_array's default constructor
- explicit multi_array_ref(T* base) :
- super_type(base) {
- }
-
+ explicit multi_array_ref(T* base,
+ const storage_order_type& so,
+ const index* index_bases,
+ const size_type* extents) :
+ super_type(base,so,index_bases,extents) { }
};
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
// Boost next_prior.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.
+// (C) Copyright Dave Abrahams and Daniel Walker 1999-2003. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/utility for documentation.
-// (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.
-
+// -------------------------------------
+//
+// (C) Copyright Gennaro Prota 2003.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// ------------------------------------------------------
#ifndef BOOST_NON_TYPE_HPP_GP_20030417
#define BOOST_NON_TYPE_HPP_GP_20030417
// Boost noncopyable.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.
+// (C) Copyright Beman Dawes 1999-2003. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/utility for documentation.
// Contributed by Dave Abrahams
-class noncopyable
+namespace noncopyable_ // protection from unintended ADL
{
- protected:
- noncopyable() {}
- ~noncopyable() {}
- private: // emphasize the following members are private
- noncopyable( const noncopyable& );
- const noncopyable& operator=( const noncopyable& );
-};
+ class noncopyable
+ {
+ protected:
+ noncopyable() {}
+ ~noncopyable() {}
+ private: // emphasize the following members are private
+ noncopyable( const noncopyable& );
+ const noncopyable& operator=( const noncopyable& );
+ };
+}
+
+typedef noncopyable_::noncopyable noncopyable;
} // namespace boost
// Boost operators.hpp header file ----------------------------------------//
-// (C) Copyright David Abrahams, Jeremy Siek, and Daryle Walker 1999-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 David Abrahams, Jeremy Siek, Daryle Walker 1999-2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/utility/operators.htm for documentation.
#ifndef BOOST_OPTIONAL_FLC_19NOV2002_HPP
#define BOOST_OPTIONAL_FLC_19NOV2002_HPP
-#include<new>
-#include<algorithm>
-
-#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:
-// When a templated assignment operator exist, an implicit conversion
-// constructing an optional<T> is used when assigment of the form:
-// optional<T> opt ; opt = T(...);
-// is compiled.
-// However, optional's ctor is _explicit_ and the assignemt shouldn't compile.
-// Therefore, for VC6.0 templated assignment is disabled.
-//
-#define BOOST_OPTIONAL_NO_CONVERTING_ASSIGNMENT
-#endif
-
-#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
-// VC7.0 has the following bug:
-// When both a non-template and a template copy-ctor exist
-// and the templated version is made 'explicit', the explicit is also
-// given to the non-templated version, making the class non-implicitely-copyable.
-//
-#define BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
-#endif
-
-#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
-{
- // 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]; }
-} ;
-
-template<class T>
-struct types_when_isnt_ref
-{
- 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 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 ;
-} ;
-
-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_base ( detail::none_t const& )
- :
- m_initialized(false) {}
-
- // Creates an optional<T> initialized with 'val'.
- // Can throw if T::T(T const&) does
- 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
-
- // Creates a deep copy of another convertible optional<U>
- // Requires a valid conversion from U to T.
- // Can throw if T::T(U const&) does
- template<class U>
- explicit optional ( optional<U> const& rhs )
- :
- base()
- {
- 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 ) : base(rhs) {}
-
- // No-throw (assuming T::~T() doesn't)
- ~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)
- // Requires a valid conversion from U to T.
- // Basic Guarantee: If T::T( U const& ) throws, this is left UNINITIALIZED
- template<class U>
- optional& operator= ( optional<U> const& rhs )
- {
- this->destroy(); // no-throw
-
- if ( rhs.is_initialized() )
- {
- // An exception can be thrown here.
- // It it happens, THIS will be left uninitialized.
- this->assign(rhs.get());
- }
- return *this ;
- }
-#endif
-
- // 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 )
- {
- this->assign( rhs ) ;
- return *this ;
- }
-
- // 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 )
- {
- this->assign( val ) ;
- return *this ;
- }
-
- // 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_ )
- {
- this->assign( none_ ) ;
- return *this ;
- }
-
- // Returns a reference to the value if this is initialized, otherwise,
- // the behaviour is UNDEFINED
- // No-throw
- 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
- 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
- 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 this->safe_bool() ; }
-
- // This is provided for those compilers which don't like the conversion to bool
- // on some contexts.
- bool operator!() const { return !this->is_initialized() ; }
-} ;
-
-// Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
-// No-throw
-template<class T>
-inline
-BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type
-get ( optional<T> const& opt )
-{
- return opt.get() ;
-}
-
-template<class T>
-inline
-BOOST_DEDUCED_TYPENAME optional<T>::reference_type
-get ( optional<T>& opt )
-{
- return opt.get() ;
-}
-
-// 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 T>
-inline
-BOOST_DEDUCED_TYPENAME optional<T>::pointer_const_type
-get_pointer ( optional<T> const& opt )
-{
- return opt.get_ptr() ;
-}
-
-template<class T>
-inline
-BOOST_DEDUCED_TYPENAME optional<T>::pointer_type
-get_pointer ( optional<T>& opt )
-{
- return opt.get_ptr() ;
-}
-
-// 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
-// "boost/detail/compressed_pair.hpp"
-//
-namespace optional_detail {
-
-// GCC < 3.2 gets the using declaration at namespace scope (FLC, DWA)
-#if BOOST_WORKAROUND(__GNUC__, < 3) \
- || BOOST_WORKAROUND(__GNUC__, == 3) && __GNUC_MINOR__ <= 2
- using std::swap;
-#define BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
-#endif
-
-// optional's swap:
-// If both are initialized, calls swap(T&, T&), with whatever exception guarantess are given there.
-// If only one is initialized, calls I.reset() and U.reset(*I), with the Basic Guarantee
-// If both are uninitialized, do nothing (no-throw)
-template<class T>
-inline
-void optional_swap ( optional<T>& x, optional<T>& y )
-{
- if ( !x && !!y )
- {
- x.reset(*y); // Basic guarantee.
- y.reset();
- }
- else if ( !!x && !y )
- {
- y.reset(*x); // Basic guarantee.
- x.reset();
- }
- else if ( !!x && !!y )
- {
-// GCC > 3.2 and all other compilers have the using declaration at function scope (FLC)
-#ifndef BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
- // allow for Koenig lookup
- using std::swap ;
-#endif
- swap(*x,*y);
- }
-}
-
-} // namespace optional_detail
-
-template<class T> inline void swap ( optional<T>& x, optional<T>& y )
-{
- optional_detail::optional_swap(x,y);
-}
-
-} // namespace boost
+#include "boost/optional/optional.hpp"
#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_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
+#define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
+
+#include<new>
+#include<algorithm>
+
+#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:
+// When a templated assignment operator exist, an implicit conversion
+// constructing an optional<T> is used when assigment of the form:
+// optional<T> opt ; opt = T(...);
+// is compiled.
+// However, optional's ctor is _explicit_ and the assignemt shouldn't compile.
+// Therefore, for VC6.0 templated assignment is disabled.
+//
+#define BOOST_OPTIONAL_NO_CONVERTING_ASSIGNMENT
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+// VC7.0 has the following bug:
+// When both a non-template and a template copy-ctor exist
+// and the templated version is made 'explicit', the explicit is also
+// given to the non-templated version, making the class non-implicitely-copyable.
+//
+#define BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
+#endif
+
+#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 in_place_factory_base ;
+class typed_in_place_factory_base ;
+
+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
+{
+ // 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]; }
+} ;
+
+template<class T>
+struct types_when_isnt_ref
+{
+ 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 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 ;
+} ;
+
+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_base ( detail::none_t const& )
+ :
+ m_initialized(false) {}
+
+ // Creates an optional<T> initialized with 'val'.
+ // Can throw if T::T(T const&) does
+ 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, in_place_factory_base 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, typed_in_place_factory_base 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() ; }
+
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
+ void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; }
+#else
+ void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->T::~T() ; m_initialized = false ; }
+#endif
+
+ 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
+
+ // Creates a deep copy of another convertible optional<U>
+ // Requires a valid conversion from U to T.
+ // Can throw if T::T(U const&) does
+ template<class U>
+ explicit optional ( optional<U> const& rhs )
+ :
+ base()
+ {
+ 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 ) : base(rhs) {}
+
+ // No-throw (assuming T::~T() doesn't)
+ ~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)
+ // Requires a valid conversion from U to T.
+ // Basic Guarantee: If T::T( U const& ) throws, this is left UNINITIALIZED
+ template<class U>
+ optional& operator= ( optional<U> const& rhs )
+ {
+ this->destroy(); // no-throw
+
+ if ( rhs.is_initialized() )
+ {
+ // An exception can be thrown here.
+ // It it happens, THIS will be left uninitialized.
+ this->assign(rhs.get());
+ }
+ return *this ;
+ }
+#endif
+
+ // 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 )
+ {
+ this->assign( rhs ) ;
+ return *this ;
+ }
+
+ // 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 )
+ {
+ this->assign( val ) ;
+ return *this ;
+ }
+
+ // 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_ )
+ {
+ this->assign( none_ ) ;
+ return *this ;
+ }
+
+ // Returns a reference to the value if this is initialized, otherwise,
+ // the behaviour is UNDEFINED
+ // No-throw
+ 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
+ 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
+ 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 this->safe_bool() ; }
+
+ // This is provided for those compilers which don't like the conversion to bool
+ // on some contexts.
+ bool operator!() const { return !this->is_initialized() ; }
+} ;
+
+// Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type
+get ( optional<T> const& opt )
+{
+ return opt.get() ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_type
+get ( optional<T>& opt )
+{
+ return opt.get() ;
+}
+
+// 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 T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_const_type
+get_pointer ( optional<T> const& opt )
+{
+ return opt.get_ptr() ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_type
+get_pointer ( optional<T>& opt )
+{
+ return opt.get_ptr() ;
+}
+
+// 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
+// "boost/detail/compressed_pair.hpp"
+//
+namespace optional_detail {
+
+// GCC < 3.2 gets the using declaration at namespace scope (FLC, DWA)
+#if BOOST_WORKAROUND(__GNUC__, < 3) \
+ || BOOST_WORKAROUND(__GNUC__, == 3) && __GNUC_MINOR__ <= 2
+ using std::swap;
+#define BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
+#endif
+
+// optional's swap:
+// If both are initialized, calls swap(T&, T&), with whatever exception guarantess are given there.
+// If only one is initialized, calls I.reset() and U.reset(*I), with the Basic Guarantee
+// If both are uninitialized, do nothing (no-throw)
+template<class T>
+inline
+void optional_swap ( optional<T>& x, optional<T>& y )
+{
+ if ( !x && !!y )
+ {
+ x.reset(*y); // Basic guarantee.
+ y.reset();
+ }
+ else if ( !!x && !y )
+ {
+ y.reset(*x); // Basic guarantee.
+ x.reset();
+ }
+ else if ( !!x && !!y )
+ {
+// GCC > 3.2 and all other compilers have the using declaration at function scope (FLC)
+#ifndef BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
+ // allow for Koenig lookup
+ using std::swap ;
+#endif
+ swap(*x,*y);
+ }
+}
+
+} // namespace optional_detail
+
+template<class T> inline void swap ( optional<T>& x, optional<T>& y )
+{
+ optional_detail::optional_swap(x,y);
+}
+
+} // namespace boost
+
+#endif
+
-// (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.
+// (C) Copyright Jeremy Siek 2000.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// The ct_if implementation that avoids partial specialization is
// based on the IF class by Ulrich W. Eisenecker and Krzysztof
# 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>
+# include <boost/mpl/eval_if.hpp>
namespace boost {
template <class P>
struct pointee
- : mpl::apply_if<
+ : mpl::eval_if<
detail::is_incrementable<P>
, detail::iterator_pointee<P>
, detail::smart_ptr_pointee<P>
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# /* BOOST_PP_LESS */
#
-# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
+# if BOOST_PP_CONFIG_FLAGS() & (BOOST_PP_CONFIG_MWCC() | BOOST_PP_CONFIG_DMC())
# define BOOST_PP_LESS(x, y) BOOST_PP_BITAND(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL(x, y))
# elif ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LESS(x, y) BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL, 0 BOOST_PP_TUPLE_EAT_2)(x, y)
#
# /* BOOST_PP_LESS_D */
#
-# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
+# if BOOST_PP_CONFIG_FLAGS() & (BOOST_PP_CONFIG_MWCC() | BOOST_PP_CONFIG_DMC())
# define BOOST_PP_LESS_D(d, x, y) BOOST_PP_BITAND(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL_D(d, x, y))
# elif ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# define BOOST_PP_LESS_D(d, x, y) BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL_D, 0 BOOST_PP_TUPLE_EAT_3)(d, x, y)
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_255(c, y) 0
# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_256(c, y) 0
#
-# define BOOST_PP_NOT_EQUAL_0(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_1(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_2(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_3(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_4(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_5(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_6(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_7(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_8(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_9(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_10(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_11(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_12(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_13(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_14(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_15(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_16(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_17(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_18(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_19(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_20(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_21(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_22(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_23(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_24(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_25(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_26(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_27(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_28(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_29(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_30(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_31(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_32(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_33(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_34(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_35(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_36(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_37(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_38(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_39(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_40(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_41(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_42(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_43(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_44(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_45(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_46(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_47(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_48(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_49(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_50(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_51(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_52(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_53(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_54(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_55(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_56(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_57(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_58(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_59(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_60(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_61(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_62(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_63(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_64(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_65(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_66(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_67(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_68(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_69(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_70(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_71(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_72(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_73(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_74(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_75(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_76(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_77(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_78(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_79(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_80(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_81(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_82(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_83(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_84(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_85(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_86(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_87(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_88(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_89(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_90(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_91(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_92(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_93(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_94(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_95(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_96(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_97(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_98(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_99(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_100(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_101(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_102(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_103(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_104(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_105(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_106(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_107(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_108(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_109(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_110(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_111(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_112(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_113(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_114(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_115(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_116(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_117(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_118(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_119(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_120(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_121(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_122(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_123(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_124(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_125(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_126(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_127(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_128(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_129(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_130(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_131(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_132(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_133(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_134(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_135(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_136(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_137(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_138(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_139(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_140(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_141(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_142(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_143(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_144(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_145(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_146(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_147(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_148(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_149(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_150(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_151(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_152(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_153(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_154(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_155(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_156(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_157(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_158(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_159(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_160(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_161(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_162(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_163(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_164(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_165(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_166(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_167(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_168(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_169(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_170(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_171(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_172(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_173(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_174(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_175(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_176(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_177(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_178(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_179(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_180(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_181(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_182(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_183(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_184(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_185(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_186(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_187(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_188(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_189(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_190(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_191(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_192(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_193(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_194(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_195(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_196(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_197(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_198(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_199(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_200(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_201(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_202(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_203(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_204(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_205(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_206(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_207(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_208(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_209(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_210(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_211(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_212(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_213(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_214(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_215(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_216(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_217(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_218(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_219(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_220(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_221(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_222(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_223(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_224(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_225(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_226(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_227(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_228(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_229(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_230(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_231(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_232(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_233(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_234(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_235(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_236(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_237(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_238(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_239(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_240(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_241(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_242(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_243(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_244(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_245(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_246(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_247(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_248(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_249(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_250(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_251(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_252(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_253(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_254(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_255(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_256(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# define BOOST_PP_NOT_EQUAL_0(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_1(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_2(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_3(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_4(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_5(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_6(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_7(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_8(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_9(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_10(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_11(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_12(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_13(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_14(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_15(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_16(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_17(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_18(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_19(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_20(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_21(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_22(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_23(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_24(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_25(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_26(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_27(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_28(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_29(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_30(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_31(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_32(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_33(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_34(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_35(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_36(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_37(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_38(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_39(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_40(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_41(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_42(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_43(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_44(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_45(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_46(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_47(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_48(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_49(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_50(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_51(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_52(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_53(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_54(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_55(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_56(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_57(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_58(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_59(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_60(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_61(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_62(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_63(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_64(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_65(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_66(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_67(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_68(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_69(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_70(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_71(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_72(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_73(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_74(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_75(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_76(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_77(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_78(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_79(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_80(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_81(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_82(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_83(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_84(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_85(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_86(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_87(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_88(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_89(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_90(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_91(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_92(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_93(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_94(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_95(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_96(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_97(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_98(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_99(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_100(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_101(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_102(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_103(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_104(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_105(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_106(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_107(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_108(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_109(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_110(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_111(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_112(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_113(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_114(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_115(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_116(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_117(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_118(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_119(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_120(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_121(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_122(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_123(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_124(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_125(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_126(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_127(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_128(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_129(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_130(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_131(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_132(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_133(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_134(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_135(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_136(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_137(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_138(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_139(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_140(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_141(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_142(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_143(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_144(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_145(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_146(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_147(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_148(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_149(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_150(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_151(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_152(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_153(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_154(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_155(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_156(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_157(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_158(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_159(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_160(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_161(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_162(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_163(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_164(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_165(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_166(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_167(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_168(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_169(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_170(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_171(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_172(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_173(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_174(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_175(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_176(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_177(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_178(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_179(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_180(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_181(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_182(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_183(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_184(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_185(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_186(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_187(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_188(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_189(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_190(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_191(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_192(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_193(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_194(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_195(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_196(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_197(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_198(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_199(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_200(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_201(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_202(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_203(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_204(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_205(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_206(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_207(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_208(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_209(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_210(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_211(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_212(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_213(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_214(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_215(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_216(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_217(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_218(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_219(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_220(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_221(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_222(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_223(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_224(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_225(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_226(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_227(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_228(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_229(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_230(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_231(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_232(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_233(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_234(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_235(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_236(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_237(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_238(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_239(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_240(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_241(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_242(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_243(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_244(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_245(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_246(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_247(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_248(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_249(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_250(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_251(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_252(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_253(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_254(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_255(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_256(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
+# else
+# define BOOST_PP_NOT_EQUAL_0(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_1(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_2(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_3(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_4(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_5(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_6(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_7(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_8(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_9(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_10(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_11(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_12(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_13(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_14(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_15(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_16(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_17(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_18(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_19(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_20(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_21(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_22(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_23(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_24(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_25(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_26(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_27(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_28(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_29(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_30(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_31(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_32(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_33(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_34(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_35(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_36(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_37(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_38(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_39(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_40(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_41(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_42(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_43(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_44(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_45(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_46(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_47(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_48(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_49(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_50(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_51(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_52(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_53(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_54(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_55(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_56(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_57(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_58(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_59(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_60(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_61(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_62(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_63(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_64(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_65(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_66(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_67(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_68(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_69(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_70(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_71(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_72(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_73(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_74(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_75(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_76(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_77(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_78(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_79(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_80(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_81(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_82(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_83(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_84(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_85(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_86(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_87(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_88(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_89(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_90(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_91(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_92(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_93(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_94(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_95(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_96(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_97(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_98(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_99(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_100(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_101(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_102(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_103(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_104(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_105(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_106(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_107(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_108(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_109(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_110(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_111(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_112(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_113(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_114(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_115(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_116(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_117(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_118(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_119(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_120(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_121(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_122(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_123(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_124(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_125(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_126(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_127(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_128(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_129(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_130(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_131(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_132(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_133(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_134(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_135(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_136(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_137(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_138(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_139(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_140(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_141(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_142(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_143(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_144(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_145(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_146(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_147(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_148(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_149(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_150(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_151(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_152(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_153(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_154(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_155(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_156(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_157(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_158(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_159(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_160(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_161(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_162(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_163(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_164(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_165(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_166(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_167(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_168(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_169(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_170(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_171(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_172(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_173(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_174(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_175(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_176(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_177(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_178(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_179(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_180(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_181(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_182(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_183(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_184(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_185(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_186(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_187(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_188(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_189(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_190(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_191(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_192(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_193(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_194(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_195(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_196(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_197(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_198(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_199(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_200(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_201(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_202(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_203(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_204(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_205(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_206(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_207(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_208(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_209(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_210(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_211(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_212(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_213(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_214(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_215(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_216(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_217(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_218(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_219(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_220(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_221(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_222(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_223(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_224(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_225(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_226(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_227(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_228(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_229(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_230(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_231(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_232(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_233(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_234(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_235(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_236(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_237(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_238(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_239(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_240(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_241(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_242(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_243(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_244(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_245(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_246(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_247(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_248(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_249(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_250(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_251(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_252(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_253(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_254(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_255(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# define BOOST_PP_NOT_EQUAL_256(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
+# endif
#
# endif
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# define BOOST_PP_CONFIG_MWCC() 0x0008
# define BOOST_PP_CONFIG_BCC() 0x0010
# define BOOST_PP_CONFIG_EDG() 0x0020
+# define BOOST_PP_CONFIG_DMC() 0x0040
#
# ifndef BOOST_PP_CONFIG_FLAGS
# if defined(__SPIRIT_PP__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
# elif defined(__MWERKS__)
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MWCC())
+# elif defined(__DMC__)
+# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_DMC())
# elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_BCC())
# elif defined(_MSC_VER)
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# 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>
+# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# include <boost/preprocessor/control/detail/dmc/while.hpp>
# else
# include <boost/preprocessor/control/detail/while.hpp>
# endif
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
+# include <boost/preprocessor/config/config.hpp>
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# include <boost/preprocessor/detail/dmc/auto_rec.hpp>
+# else
+#
# ifndef BOOST_PREPROCESSOR_DETAIL_AUTO_REC_HPP
# define BOOST_PREPROCESSOR_DETAIL_AUTO_REC_HPP
#
# define BOOST_PP_NODE_255(p) BOOST_PP_IIF(p(255), 255, 256)
#
# endif
+# endif
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# define BOOST_PP_CHECK_OO(par) BOOST_PP_CHECK_D ## par
# endif
#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
# define BOOST_PP_CHECK_D(x, type) BOOST_PP_CHECK_1(BOOST_PP_CAT(BOOST_PP_CHECK_RESULT_, type x))
# define BOOST_PP_CHECK_1(chk) BOOST_PP_CHECK_2(chk)
# define BOOST_PP_CHECK_2(res, _) res
-# else
+# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
# define BOOST_PP_CHECK_D(x, type) BOOST_PP_CHECK_1(type x)
# define BOOST_PP_CHECK_1(chk) BOOST_PP_CHECK_2(chk)
# define BOOST_PP_CHECK_2(chk) BOOST_PP_CHECK_3((BOOST_PP_CHECK_RESULT_ ## chk))
# define BOOST_PP_CHECK_3(im) BOOST_PP_CHECK_5(BOOST_PP_CHECK_4 im)
# define BOOST_PP_CHECK_4(res, _) res
# define BOOST_PP_CHECK_5(res) res
+# else // DMC
+# define BOOST_PP_CHECK_D(x, type) BOOST_PP_CHECK_OO((type x))
+# define BOOST_PP_CHECK_OO(par) BOOST_PP_CHECK_0 ## par
+# define BOOST_PP_CHECK_0(chk) BOOST_PP_CHECK_1(BOOST_PP_CAT(BOOST_PP_CHECK_RESULT_, chk))
+# define BOOST_PP_CHECK_1(chk) BOOST_PP_CHECK_2(chk)
+# define BOOST_PP_CHECK_2(res, _) res
# endif
#
# define BOOST_PP_CHECK_RESULT_1 1, BOOST_PP_NIL
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# *
# * See http://www.boost.org for most recent version.
# */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# define BOOST_PP_LIST_FILTER_O_I(d, im, elem) BOOST_PP_LIST_FILTER_O_D(d, im, elem)
# endif
#
-# define BOOST_PP_LIST_FILTER_O_D(d, pred, data, res, elem) (pred, data, BOOST_PP_IF(pred(d, data, elem), (elem, res), res))
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# define BOOST_PP_LIST_FILTER_O_D(d, pred, data, res, elem) (pred, data, BOOST_PP_IF(pred(d, data, elem), (elem, res), res))
+# else
+# define BOOST_PP_LIST_FILTER_O_D(d, pred, data, res, elem) (pred, data, BOOST_PP_IF(pred##(d, data, elem), (elem, res), res))
+# endif
#
# /* BOOST_PP_LIST_FILTER_D */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
#
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
# include <boost/preprocessor/list/detail/edg/fold_left.hpp>
+# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# include <boost/preprocessor/list/detail/dmc/fold_left.hpp>
# else
# include <boost/preprocessor/list/detail/fold_left.hpp>
# endif
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
--- /dev/null
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_BINARY_PARAMS_HPP
+# define BOOST_PREPROCESSOR_REPETITION_ENUM_BINARY_PARAMS_HPP
+#
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/punctuation/comma_if.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_ENUM_BINARY_PARAMS */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_BINARY_PARAMS(count, p1, p2) BOOST_PP_REPEAT(count, BOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
+# else
+# define BOOST_PP_ENUM_BINARY_PARAMS(count, p1, p2) BOOST_PP_ENUM_BINARY_PARAMS_I(count, p1, p2)
+# define BOOST_PP_ENUM_BINARY_PARAMS_I(count, p1, p2) BOOST_PP_REPEAT(count, BOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
+# endif
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_ENUM_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_BINARY_PARAMS_M_IM(z, n, BOOST_PP_TUPLE_REM_2 pp)
+# define BOOST_PP_ENUM_BINARY_PARAMS_M_IM(z, n, im) BOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, im)
+# else
+# define BOOST_PP_ENUM_BINARY_PARAMS_M(z, n, pp) BOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, pp), BOOST_PP_TUPLE_ELEM(2, 1, pp))
+# endif
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
+# define BOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, p1, p2) BOOST_PP_ENUM_BINARY_PARAMS_M_II(z, n, p1, p2)
+# define BOOST_PP_ENUM_BINARY_PARAMS_M_II(z, n, p1, p2) BOOST_PP_COMMA_IF(n) p1 ## n p2 ## n
+# else
+# define BOOST_PP_ENUM_BINARY_PARAMS_M_I(z, n, p1, p2) BOOST_PP_COMMA_IF(n) BOOST_PP_CAT(p1, n) BOOST_PP_CAT(p2, n)
+# endif
+#
+# /* BOOST_PP_ENUM_BINARY_PARAMS_Z */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_ENUM_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(count, BOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
+# else
+# define BOOST_PP_ENUM_BINARY_PARAMS_Z(z, count, p1, p2) BOOST_PP_ENUM_BINARY_PARAMS_Z_I(z, count, p1, p2)
+# define BOOST_PP_ENUM_BINARY_PARAMS_Z_I(z, count, p1, p2) BOOST_PP_REPEAT_ ## z(count, BOOST_PP_ENUM_BINARY_PARAMS_M, (p1, p2))
+# endif
+#
+# endif
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# include <boost/preprocessor/repetition/detail/edg/for.hpp>
# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
# include <boost/preprocessor/repetition/detail/msvc/for.hpp>
+# elif BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
+# include <boost/preprocessor/repetition/detail/dmc/for.hpp>
# else
# include <boost/preprocessor/repetition/detail/for.hpp>
# endif
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
--- /dev/null
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPETITION_REPEAT_FROM_TO_HPP
+# define BOOST_PREPROCESSOR_REPETITION_REPEAT_FROM_TO_HPP
+#
+# include <boost/preprocessor/arithmetic/add.hpp>
+# include <boost/preprocessor/arithmetic/sub.hpp>
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/control/while.hpp>
+# include <boost/preprocessor/debug/error.hpp>
+# include <boost/preprocessor/detail/auto_rec.hpp>
+# include <boost/preprocessor/repetition/repeat.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <boost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_REPEAT_FROM_TO */
+#
+# if 0
+# define BOOST_PP_REPEAT_FROM_TO(first, last, macro, data)
+# endif
+#
+# define BOOST_PP_REPEAT_FROM_TO BOOST_PP_CAT(BOOST_PP_REPEAT_FROM_TO_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
+#
+# define BOOST_PP_REPEAT_FROM_TO_1(f, l, m, dt) BOOST_PP_REPEAT_FROM_TO_D_1(BOOST_PP_AUTO_REC(BOOST_PP_WHILE_P, 256), f, l, m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_2(f, l, m, dt) BOOST_PP_REPEAT_FROM_TO_D_2(BOOST_PP_AUTO_REC(BOOST_PP_WHILE_P, 256), f, l, m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_3(f, l, m, dt) BOOST_PP_REPEAT_FROM_TO_D_3(BOOST_PP_AUTO_REC(BOOST_PP_WHILE_P, 256), f, l, m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_4(f, l, m, dt) BOOST_PP_ERROR(0x0003)
+#
+# define BOOST_PP_REPEAT_FROM_TO_1ST BOOST_PP_REPEAT_FROM_TO_1
+# define BOOST_PP_REPEAT_FROM_TO_2ND BOOST_PP_REPEAT_FROM_TO_2
+# define BOOST_PP_REPEAT_FROM_TO_3RD BOOST_PP_REPEAT_FROM_TO_3
+#
+# /* BOOST_PP_REPEAT_FROM_TO_D */
+#
+# if 0
+# define BOOST_PP_REPEAT_FROM_TO_D(d, first, last, macro, data)
+# endif
+#
+# define BOOST_PP_REPEAT_FROM_TO_D BOOST_PP_CAT(BOOST_PP_REPEAT_FROM_TO_D_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_REPEAT_FROM_TO_D_1(d, f, l, m, dt) BOOST_PP_REPEAT_1(BOOST_PP_SUB_D(d, l, f), BOOST_PP_REPEAT_FROM_TO_M_1, (d, f, m, dt))
+# define BOOST_PP_REPEAT_FROM_TO_D_2(d, f, l, m, dt) BOOST_PP_REPEAT_2(BOOST_PP_SUB_D(d, l, f), BOOST_PP_REPEAT_FROM_TO_M_2, (d, f, m, dt))
+# define BOOST_PP_REPEAT_FROM_TO_D_3(d, f, l, m, dt) BOOST_PP_REPEAT_3(BOOST_PP_SUB_D(d, l, f), BOOST_PP_REPEAT_FROM_TO_M_3, (d, f, m, dt))
+# else
+# define BOOST_PP_REPEAT_FROM_TO_D_1(d, f, l, m, dt) BOOST_PP_REPEAT_FROM_TO_D_1_I(d, f, l, m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_D_2(d, f, l, m, dt) BOOST_PP_REPEAT_FROM_TO_D_2_I(d, f, l, m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_D_3(d, f, l, m, dt) BOOST_PP_REPEAT_FROM_TO_D_3_I(d, f, l, m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_D_1_I(d, f, l, m, dt) BOOST_PP_REPEAT_1(BOOST_PP_SUB_D(d, l, f), BOOST_PP_REPEAT_FROM_TO_M_1, (d, f, m, dt))
+# define BOOST_PP_REPEAT_FROM_TO_D_2_I(d, f, l, m, dt) BOOST_PP_REPEAT_2(BOOST_PP_SUB_D(d, l, f), BOOST_PP_REPEAT_FROM_TO_M_2, (d, f, m, dt))
+# define BOOST_PP_REPEAT_FROM_TO_D_3_I(d, f, l, m, dt) BOOST_PP_REPEAT_3(BOOST_PP_SUB_D(d, l, f), BOOST_PP_REPEAT_FROM_TO_M_3, (d, f, m, dt))
+# endif
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_REPEAT_FROM_TO_M_1(z, n, dfmd) BOOST_PP_REPEAT_FROM_TO_M_1_IM(z, n, BOOST_PP_TUPLE_REM_4 dfmd)
+# define BOOST_PP_REPEAT_FROM_TO_M_2(z, n, dfmd) BOOST_PP_REPEAT_FROM_TO_M_2_IM(z, n, BOOST_PP_TUPLE_REM_4 dfmd)
+# define BOOST_PP_REPEAT_FROM_TO_M_3(z, n, dfmd) BOOST_PP_REPEAT_FROM_TO_M_3_IM(z, n, BOOST_PP_TUPLE_REM_4 dfmd)
+# define BOOST_PP_REPEAT_FROM_TO_M_1_IM(z, n, im) BOOST_PP_REPEAT_FROM_TO_M_1_I(z, n, im)
+# define BOOST_PP_REPEAT_FROM_TO_M_2_IM(z, n, im) BOOST_PP_REPEAT_FROM_TO_M_2_I(z, n, im)
+# define BOOST_PP_REPEAT_FROM_TO_M_3_IM(z, n, im) BOOST_PP_REPEAT_FROM_TO_M_3_I(z, n, im)
+# else
+# define BOOST_PP_REPEAT_FROM_TO_M_1(z, n, dfmd) BOOST_PP_REPEAT_FROM_TO_M_1_I(z, n, BOOST_PP_TUPLE_ELEM(4, 0, dfmd), BOOST_PP_TUPLE_ELEM(4, 1, dfmd), BOOST_PP_TUPLE_ELEM(4, 2, dfmd), BOOST_PP_TUPLE_ELEM(4, 3, dfmd))
+# define BOOST_PP_REPEAT_FROM_TO_M_2(z, n, dfmd) BOOST_PP_REPEAT_FROM_TO_M_2_I(z, n, BOOST_PP_TUPLE_ELEM(4, 0, dfmd), BOOST_PP_TUPLE_ELEM(4, 1, dfmd), BOOST_PP_TUPLE_ELEM(4, 2, dfmd), BOOST_PP_TUPLE_ELEM(4, 3, dfmd))
+# define BOOST_PP_REPEAT_FROM_TO_M_3(z, n, dfmd) BOOST_PP_REPEAT_FROM_TO_M_3_I(z, n, BOOST_PP_TUPLE_ELEM(4, 0, dfmd), BOOST_PP_TUPLE_ELEM(4, 1, dfmd), BOOST_PP_TUPLE_ELEM(4, 2, dfmd), BOOST_PP_TUPLE_ELEM(4, 3, dfmd))
+# endif
+#
+# define BOOST_PP_REPEAT_FROM_TO_M_1_I(z, n, d, f, m, dt) BOOST_PP_REPEAT_FROM_TO_M_1_II(z, BOOST_PP_ADD_D(d, n, f), m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_M_2_I(z, n, d, f, m, dt) BOOST_PP_REPEAT_FROM_TO_M_2_II(z, BOOST_PP_ADD_D(d, n, f), m, dt)
+# define BOOST_PP_REPEAT_FROM_TO_M_3_I(z, n, d, f, m, dt) BOOST_PP_REPEAT_FROM_TO_M_3_II(z, BOOST_PP_ADD_D(d, n, f), m, dt)
+#
+# define BOOST_PP_REPEAT_FROM_TO_M_1_II(z, n, m, dt) m(z, n, dt)
+# define BOOST_PP_REPEAT_FROM_TO_M_2_II(z, n, m, dt) m(z, n, dt)
+# define BOOST_PP_REPEAT_FROM_TO_M_3_II(z, n, m, dt) m(z, n, dt)
+#
+# endif
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# * 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.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# */
#
# /* Revised by Paul Mensonides (2002) */
# /* **************************************************************************
# * *
-# * (C) Copyright Paul Mensonides 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 at to its suitability for any purpose. *
+# * (C) Copyright Paul Mensonides 2002.
+# * Distributed under the Boost Software License, Version 1.0. (See
+# * accompanying file LICENSE_1_0.txt or copy at
+# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
// boost progress.hpp header file ------------------------------------------//
-// Copyright Beman Dawes 1994-99.
-// See accompanying license for terms and conditions of use.
+// Copyright Beman Dawes 1994-99. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/timer for documentation.
-// (C) Copyright Jeremy Siek 1999-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 Jeremy Siek 1999-2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/property_map for documentation.
typedef boost::lvalue_property_map_tag category;
inline safe_iterator_property_map(
- RandomAccessIterator first = RandomAccessIterator(),
+ RandomAccessIterator first,
std::size_t n = 0,
const IndexMap& _id = IndexMap() )
: iter(first), n(n), index(_id) { }
+ inline safe_iterator_property_map() { }
inline R operator[](key_type v) const {
assert(get(index, v) < n);
return *(iter + get(index, v)) ;
-// (C) Copyright Jeremy Siek, 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 Jeremy Siek, 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/property_map for documentation.
m_map(m) {}
private:
- typename lvalue_pmap_iter::reference
+ typename super_t::reference
dereference() const
{
return m_map[*(this->base_reference())];
m_map(m) {}
private:
- typename readable_pmap_iter::reference
+ typename super_t::reference
dereference() const
{
return get(m_map, *(this->base_reference()));
+++ /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
// Copyright (C) 2001, 2002 Peter Dimov
// Copyright (C) 2002 David Abrahams
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/bind/ref.html for documentation.
//
# undef BOOST_REF_CONST
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
template<typename T>
class is_reference_wrapper
: public mpl::false_
{
};
-template<typename T>
-class is_reference_wrapper<reference_wrapper<T> >
- : public mpl::true_
-{
-};
-
template<typename T>
class unwrap_reference
{
typedef T type;
};
-template<typename T>
-class unwrap_reference<reference_wrapper<T> >
-{
- public:
- typedef T type;
-};
+# define AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(X) \
+template<typename T> \
+class is_reference_wrapper< X > \
+ : public mpl::true_ \
+{ \
+}; \
+\
+template<typename T> \
+class unwrap_reference< X > \
+{ \
+ public: \
+ typedef T type; \
+}; \
+/**/
+
+AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper<T>)
+#if !defined(BOOST_NO_CV_SPECIALIZATIONS)
+AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper<T> const)
+AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper<T> volatile)
+AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper<T> const volatile)
+#endif
+
+# undef AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF
+
# else // no partial specialization
} // namespace boost
#include <boost/cregex.hpp>
-//
-// add using declarations to bring POSIX API functions into
-// global scope, only if this is C++ (and not C).
-//
+/*
+* add using declarations to bring POSIX API functions into
+* global scope, only if this is C++ (and not C).
+*/
#ifdef __cplusplus
using boost::regoff_t;
using boost::REG_E_UNKNOWN;
using boost::reg_errcode_t;
-#endif // __cplusplus
+#endif /* __cplusplus */
-#endif // BOOST_RE_REGEX_H
+#endif /* BOOST_RE_REGEX_H */
#ifndef BOOST_REGEX_CONFIG_HPP
#define BOOST_REGEX_CONFIG_HPP
-//
-// Borland C++ Fix/error check
-// this has to go *before* we include any std lib headers:
-//
+/*
+ Borland C++ Fix/error check
+ this has to go *before* we include any std lib headers:
+*/
#if defined(__BORLANDC__)
# include <boost/regex/config/borland.hpp>
#endif
# include <vector>
# include <boost/config.hpp>
# include <boost/cstdint.hpp>
-# include <boost/detail/allocator.hpp>
+# include <boost/regex/config/allocator.hpp>
# include <boost/regex/config/cstring.hpp>
# include <boost/throw_exception.hpp>
# include <boost/scoped_ptr.hpp>
# include <locale>
# endif
#else
- //
- // C build,
- // don't include <boost/config.hpp> because that may
- // do C++ specific things in future...
- //
+ /*
+ * C build,
+ * don't include <boost/config.hpp> because that may
+ * do C++ specific things in future...
+ */
# include <stdlib.h>
# include <stddef.h>
# ifdef _MSC_VER
/* Obsolete macro, use BOOST_VERSION instead: */
#define BOOST_RE_VERSION 320
-// fix:
+/* fix: */
#if defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif
-//
-// If there isn't good enough wide character support then there will
-// be no wide character regular expressions:
-//
+/*
+* 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))
# if !defined(BOOST_NO_WREGEX)
# define BOOST_NO_WREGEX
# endif
#else
# 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>
+ /* 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> */
# include <wctype.h>
# define __STLPORT_CWCTYPE
# define _STLP_CWCTYPE
#endif
-//
-// If Win32 support has been disabled for boost in general, then
-// it is for regex in particular:
-//
+/*
+* If Win32 support has been disabled for boost in general, then
+* it is for regex in particular:
+*/
#if defined(BOOST_DISABLE_WIN32) && !defined(BOOST_REGEX_NO_W32)
# define BOOST_REGEX_NO_W32
#endif
-// some versions of gcc can't merge template instances:
+/* some versions of gcc can't merge template instances: */
#if defined(__CYGWIN__)
# define BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE
#endif
-// fix problems with bool as a macro,
-// this probably doesn't affect any current compilers:
+/* fix problems with bool as a macro,
+* this probably doesn't affect any current compilers: */
#if defined(bool) || defined(true) || defined(false)
# define BOOST_REGEX_NO_BOOL
#endif
-// We don't make our templates external if the compiler
-// can't handle it:
+/* 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(BOOST_INTEL))\
&& !defined(BOOST_MSVC) && !defined(__BORLANDC__)
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
#endif
-// disable our own file-iterators and mapfiles if we can't
-// support them:
+/* disable our own file-iterators and mapfiles if we can't
+ support them: */
#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
# define BOOST_REGEX_NO_FILEITER
#endif
# endif
# define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>(x)
#endif
-#endif // __cplusplus
+#endif /* __cplusplus */
-// backwards compatibitity:
+/* backwards compatibitity: */
#if defined(BOOST_RE_NO_LIB)
# define BOOST_REGEX_NO_LIB
#endif
# define BOOST_REGEX_DECL
#endif
-#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
+#if !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
*
****************************************************************************/
-// backwards compatibility:
+/* backwards compatibility: */
#ifdef BOOST_RE_LOCALE_C
# define BOOST_REGEX_USE_C_LOCALE
#endif
# define BOOST_REGEX_USE_CPP_LOCALE
#endif
-// Win32 defaults to native Win32 locale:
+/* Win32 defaults to native Win32 locale: */
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
# define BOOST_REGEX_USE_WIN32_LOCALE
#endif
-// otherwise use C locale:
+/* otherwise use C locale: */
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
# define BOOST_REGEX_USE_C_LOCALE
#endif
****************************************************************************/
#ifdef BOOST_NO_EXCEPTIONS
-//
-// If there are no exceptions then we must report critical-errors
-// the only way we know how; by terminating.
-//
+/*
+* If there are no exceptions then we must report critical-errors
+* the only way we know how; by terminating.
+*/
# define BOOST_REGEX_NOEH_ASSERT(x)\
if(0 == (x))\
{\
boost::throw_exception(e);\
}
#else
-//
-// With exceptions then error handling is taken care of and
-// there is no need for these checks:
-//
+/*
+* With exceptions then error handling is taken care of and
+* there is no need for these checks:
+*/
# define BOOST_REGEX_NOEH_ASSERT(x)
#endif
# if !defined(BOOST_NO_STD_LOCALE) && !defined (__STL_NO_NATIVE_MBSTATE_T) && !defined(_STLP_NO_NATIVE_MBSTATE_T)
using ::mbstate_t;
# endif
-# endif // BOOST_NO_WREGEX
+# endif /* BOOST_NO_WREGEX */
using ::fseek;
using ::fread;
using ::ftell;
--- /dev/null
+/*
+ *
+ * Copyright (c) 2001
+ * 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_DETAIL_ALLOCATOR_HPP
+#define BOOST_DETAIL_ALLOCATOR_HPP
+
+#include <boost/config.hpp>
+#include <cstdlib>
+#include <new>
+#include <assert.h>
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+using ::ptrdiff_t;
+using ::size_t;
+}
+#endif
+
+// see if we have SGI alloc class:
+#if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H))
+# define BOOST_HAVE_SGI_ALLOCATOR
+# include <memory>
+# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+namespace boost{ namespace detail{
+ typedef std::__sgi_alloc alloc_type;
+}}
+# else
+namespace boost{ namespace detail{
+ typedef std::alloc alloc_type;
+}}
+# endif
+#endif
+
+
+namespace boost{ namespace detail{
+
+template <class T>
+void allocator_construct(T* p, const T& t)
+{ new (p) T(t); }
+
+template <class T>
+void allocator_destroy(T* p)
+{
+ (void)p; // warning suppression
+ p->~T();
+}
+
+} }
+
+#if !defined(BOOST_NO_STD_ALLOCATOR)
+
+#include <memory>
+
+#define BOOST_DEFAULT_ALLOCATOR(T) std::allocator< T >
+
+namespace boost{ namespace detail{
+
+template <class T, class A>
+struct rebind_allocator
+{
+ typedef typename A::template rebind<T> binder;
+ typedef typename binder::other type;
+};
+
+} // namespace detail
+} // namespace boost
+
+#elif !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__SUNPRO_CC)
+
+// no std::allocator, but the compiler supports the necessary syntax,
+// write our own allocator instead:
+
+#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator< T >
+
+namespace boost{ namespace detail{
+
+template <class T>
+class allocator
+{
+public:
+
+ typedef T value_type;
+ typedef value_type * pointer;
+ typedef const T* const_pointer;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ template <class U>
+ struct rebind
+ {
+ typedef allocator<U> other;
+ };
+
+ allocator(){}
+
+ template <class U>
+ allocator(const allocator<U>&){}
+
+ allocator(const allocator&){}
+
+ template <class U>
+ allocator& operator=(const allocator<U>&)
+ { return *this; }
+
+ ~allocator(){}
+
+ pointer address(reference x) { return &x; }
+
+ const_pointer address(const_reference x) const { return &x; }
+
+ pointer allocate(size_type n, const void* = 0)
+ {
+ #ifdef BOOST_HAVE_SGI_ALLOCATOR
+ return n != 0 ?
+ reinterpret_cast<pointer>(alloc_type::allocate(n * sizeof(value_type)))
+ : 0;
+ #else
+ return n != 0 ?
+ reinterpret_cast<pointer>(::operator new(n * sizeof(value_type)))
+ : 0;
+ #endif
+ }
+
+ void deallocate(pointer p, size_type n)
+ {
+ #ifdef BOOST_HAVE_SGI_ALLOCATOR
+ assert( (p == 0) == (n == 0) );
+ if (p != 0)
+ alloc_type::deallocate((void*)p, n);
+ #else
+ assert( (p == 0) == (n == 0) );
+ if (p != 0)
+ ::operator delete((void*)p);
+ #endif
+ }
+
+ size_type max_size() const
+ { return size_t(-1) / sizeof(value_type); }
+
+ void construct(pointer p, const T& val) const
+ { allocator_construct(p, val); }
+
+ void destroy(pointer p) const
+ { allocator_destroy(p); }
+};
+
+template <class T, class A>
+struct rebind_allocator
+{
+ typedef typename A::template rebind<T> binder;
+ typedef typename binder::other type;
+};
+
+} // namespace detail
+} // namespace boost
+
+#else
+
+// no std::allocator, use workaround version instead,
+// each allocator class must derive from a base class
+// that allocates blocks of bytes:
+
+#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter<T, ::boost::detail::simple_alloc>
+
+namespace boost{ namespace detail{
+
+class simple_alloc
+{
+public:
+
+ typedef void value_type;
+ typedef value_type * pointer;
+ typedef const void* const_pointer;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ simple_alloc(){}
+ simple_alloc(const simple_alloc&){}
+
+ ~simple_alloc(){}
+
+ pointer allocate(size_type n, const void* = 0)
+ {
+ #ifdef BOOST_HAVE_SGI_ALLOCATOR
+ return n != 0 ?
+ reinterpret_cast<pointer>(alloc_type::allocate(n))
+ : 0;
+ #else
+ return n != 0 ?
+ reinterpret_cast<pointer>(::operator new(n))
+ : 0;
+ #endif
+ }
+
+ void deallocate(pointer p, size_type n)
+ {
+ #ifdef BOOST_HAVE_SGI_ALLOCATOR
+ assert( (p == 0) == (n == 0) );
+ if (p != 0)
+ alloc_type::deallocate((void*)p, n);
+ #else
+ assert( (p == 0) == (n == 0) );
+ if (p != 0)
+ ::operator delete((void*)p);
+ #endif
+ }
+};
+
+template <class T, class Base>
+class allocator_adapter : public Base
+{
+public:
+
+ typedef T value_type;
+ typedef value_type * pointer;
+ typedef const T* const_pointer;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef Base base_type;
+
+ allocator_adapter(){}
+ allocator_adapter(const base_type& x) : Base(x){}
+ allocator_adapter& operator=(const base_type& x)
+ {
+ *(static_cast<base_type*>(this)) = x;
+ return *this;
+ }
+
+ ~allocator_adapter(){}
+
+ pointer address(reference x) { return &x; }
+
+ const_pointer address(const_reference x) const { return &x; }
+
+ pointer allocate(size_type n, const void* = 0)
+ {
+ return n != 0 ?
+ reinterpret_cast<pointer>(base_type::allocate(n * sizeof(value_type)))
+ : 0;
+ }
+
+ void deallocate(pointer p, size_type n)
+ {
+ assert( (p == 0) == (n == 0) );
+ if (p != 0)
+ static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
+ }
+
+ size_type max_size() const
+ { return size_t(-1) / sizeof(value_type); }
+
+ void construct(pointer p, const T& val) const
+ { allocator_construct(p, val); }
+
+ void destroy(pointer p) const
+ { allocator_destroy(p); }
+};
+
+template <class T, class A>
+struct rebind_allocator
+{
+ typedef allocator_adapter<T, typename A::base_type> type;
+};
+
+} // namespace detail
+} // namespace boost
+
+#endif
+
+#endif // include guard
#include <cwctype>
#include <boost/config.hpp>
+#if defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
+// apparently this is required for the RW STL on Linux:
+#undef iswalnum
+#undef iswalpha
+#undef iswblank
+#undef iswcntrl
+#undef iswdigit
+#undef iswgraph
+#undef iswlower
+#undef iswprint
+#undef iswprint
+#undef iswpunct
+#undef iswspace
+#undef iswupper
+#undef iswxdigit
+#undef iswctype
+#undef towlower
+#undef towupper
+#undef towctrans
+#undef wctrans
+#undef wctype
+#endif
+
namespace std{
#ifndef BOOST_NO_STDC_NAMESPACE
+++ /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
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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 :-) */
- unsigned int 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 :-) */
- unsigned int 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_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS,
- 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;
-
-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)
- match_all = match_stop << 1, // must find the whole of input even if match_any is set
- match_max = match_all
-};
-
-typedef unsigned long match_flag_type;
-
-#ifdef __cplusplus
-} // extern "C"
-} // namespace
-#endif
-
-
-#ifdef __BORLANDC__
- #if __BORLANDC__ > 0x520
- #pragma option pop
- #endif
-#endif
-
-
-//
-// C++ high level wrapper goes here:
-//
-#if defined(__cplusplus)
-#include <string>
-#include <vector>
-namespace boost{
-
-#ifdef __BORLANDC__
- #if __BORLANDC__ == 0x530
- #pragma option push -a4 -b
- #elif __BORLANDC__ > 0x530
- #pragma option push -a8 -b
- #endif
-#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__)
-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 Line()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 __BORLANDC__
- #pragma option pop
-#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 __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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 __BORLANDC__
- #if __BORLANDC__ > 0x520
- #pragma option pop
- #endif
-#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 __BORLANDC__
- #if __BORLANDC__ == 0x530
- #pragma option push -a4 -b
- #elif __BORLANDC__ > 0x530
- #pragma option push -a8 -b
- #endif
-#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 position)
- {
- file = f;
- node = f->_first + position / mapfile::buf_size;
- offset = 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 __BORLANDC__
- #pragma option pop
-#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:
-//
-
-#ifdef __BORLANDC__
-
-#pragma option push -a8 -b -Vx -Ve -pc
-
-# ifndef BOOST_REGEX_INSTANTIATE
-# pragma option push -Jgx
-# endif
-
-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*>;
-template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>;
-template class BOOST_REGEX_DECL match_results<BOOST_REGEX_CHAR_T const*>;
-template class BOOST_REGEX_DECL match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>;
-
-
-# ifndef BOOST_REGEX_INSTANTIATE
-# pragma option pop
-# endif
-
-#pragma option pop
-
-#elif defined(BOOST_MSVC)
-
-# ifndef BOOST_REGEX_INSTANTIATE
-# define template extern template
-# endif
-
-#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660)
-
-//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) >;
-
-
-#pragma warning(pop)
-
-# ifdef template
-# undef template
-# endif
-
-#elif !defined(BOOST_REGEX_HAS_DLL_RUNTIME)
-
-//
-// for each [member] function declare a full specialisation of that
-// [member] function, then instantiate it in one translation unit.
-// This is not guarenteed to work according to the standard, but in
-// practice it should work for all compilers (unless they use a realy
-// perverse name mangling convention). Unfortunately this approach
-// does *not* work for Win32 style import/export, because that can
-// alter the class layout.
-//
-
-# ifndef BOOST_REGEX_INSTANTIATE
-# define template template<>
-# endif
-
-template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)&);
-template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const BOOST_REGEX_CHAR_T* p, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f, const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)& a);
-template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const BOOST_REGEX_CHAR_T* p, size_type len, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f, const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)&);
-template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const reg_expression<BOOST_REGEX_CHAR_T>&);
-template reg_expression<BOOST_REGEX_CHAR_T>::~reg_expression();
-template reg_expression<BOOST_REGEX_CHAR_T>& BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::operator=(const reg_expression&);
-template BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::get_allocator()const;
-template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::operator==(const reg_expression<BOOST_REGEX_CHAR_T>&)const;
-template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::operator<(const reg_expression<BOOST_REGEX_CHAR_T>&)const;
-template BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::allocator()const;
-template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::set_expression(const BOOST_REGEX_CHAR_T* p, const BOOST_REGEX_CHAR_T* end, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f);
-template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_maps();
-template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const;
-template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::probe_start(re_detail::re_syntax_base* node, BOOST_REGEX_CHAR_T c, re_detail::re_syntax_base* terminal)const;
-template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const;
-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_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);
-template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::add_literal(re_detail::re_syntax_base* dat, BOOST_REGEX_CHAR_T c);
-template BOOST_REGEX_CHAR_T BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::parse_escape(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
-template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::parse_range(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, unsigned& min, unsigned& max);
-template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::skip_space(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
-template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::probe_restart(re_detail::re_syntax_base* dat);
-template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end);
-template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::fail(unsigned int err);
-
-namespace re_detail{
-
-#define iterator const BOOST_REGEX_CHAR_T*
-#define Allocator match_results_base<iterator>::alloc_type
-#define size_type match_results_base<iterator>::size_type
-
-template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i);
-template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i, std::size_t pos);
-template match_results_base<iterator, Allocator>::match_results_base(const Allocator& a);
-template Allocator BOOST_REGEX_CALL match_results_base<iterator, Allocator>::allocator()const;
-template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::m_free();
-template bool match_results_base<iterator, Allocator>::operator==(const match_results_base<iterator, Allocator>& that)const;
-template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n);
-template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n, iterator i, iterator j);
-template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::cow();
-
-#undef iterator
-#undef Allocator
-#undef size_type
-
-} // namespace re_detail
-
-# ifdef template
-# undef template
-# endif
-
-#endif
-
-} // namespace boost
-
-#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-
-
-
-
+++ /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.
- */
-
-
-/* start with C compatibility API */
-
-#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/v3/regex_stack.hpp>
-#endif
-#ifndef BOOST_REGEX_RAW_BUFFER_HPP
-#include <boost/regex/v3/regex_raw_buffer.hpp>
-#endif
-#ifndef BOOST_REGEX_KMP_HPP
-#include <boost/regex/v3/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/type_traits/remove_cv.hpp>
-#include <boost/scoped_array.hpp>
-
-
-namespace boost{
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc -w-8027
-#endif
-
-namespace re_detail{
-
-struct re_set_long;
-struct re_syntax_base;
-
-} // namespace re_detail
-
-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 re_detail{
-
-enum mask_type
-{
- mask_take = 1,
- mask_skip = 2,
- mask_any = mask_skip | mask_take,
- mask_all = mask_any
-};
-
-struct _narrow_type{};
-struct _wide_type{};
-
-template <class charT>
-class is_byte;
-
-template<>
-class is_byte<char>
-{
-public:
- typedef _narrow_type width_type;
-};
-
-template<>
-class is_byte<unsigned char>
-{
-public:
- typedef _narrow_type width_type;
-};
-
-template<>
-class is_byte<signed char>
-{
-public:
- typedef _narrow_type width_type;
-};
-
-template <class charT>
-class is_byte
-{
-public:
- typedef _wide_type width_type;
-};
-
-
-//
-// compiled structures
-//
-// the following defs describe the format of the compiled string
-//
-
-//
-// enum syntax_element_type
-// describes the type of a record
-enum syntax_element_type
-{
- syntax_element_startmark = 0,
- syntax_element_endmark = syntax_element_startmark + 1,
- syntax_element_literal = syntax_element_endmark + 1,
- syntax_element_start_line = syntax_element_literal + 1,
- syntax_element_end_line = syntax_element_start_line + 1,
- syntax_element_wild = syntax_element_end_line + 1,
- syntax_element_match = syntax_element_wild + 1,
- syntax_element_word_boundary = syntax_element_match + 1,
- syntax_element_within_word = syntax_element_word_boundary + 1,
- syntax_element_word_start = syntax_element_within_word + 1,
- syntax_element_word_end = syntax_element_word_start + 1,
- syntax_element_buffer_start = syntax_element_word_end + 1,
- syntax_element_buffer_end = syntax_element_buffer_start + 1,
- syntax_element_backref = syntax_element_buffer_end + 1,
- syntax_element_long_set = syntax_element_backref + 1,
- syntax_element_set = syntax_element_long_set + 1,
- syntax_element_jump = syntax_element_set + 1,
- syntax_element_alt = syntax_element_jump + 1,
- syntax_element_rep = syntax_element_alt + 1,
- syntax_element_combining = syntax_element_rep + 1,
- syntax_element_soft_buffer_end = syntax_element_combining + 1,
- syntax_element_restart_continue = syntax_element_soft_buffer_end + 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
-
-union offset_type
-{
- re_syntax_base* p;
- std::size_t i;
-};
-
-//
-// struct re_syntax_base
-// base class for all syntax types:
-struct re_syntax_base
-{
- syntax_element_type type;
- offset_type next;
- unsigned int can_be_null;
-};
-
-//
-// struct re_brace
-// marks start or end of (...)
-struct re_brace : public re_syntax_base
-{
- int index;
-};
-
-//
-// struct re_literal
-// marks a literal string and
-// is followed by an array of charT[length]:
-struct re_literal : public re_syntax_base
-{
- unsigned int length;
-};
-
-//
-// struct re_long_set
-// provides data for sets [...] containing
-// wide characters
-struct re_set_long : public re_syntax_base
-{
- unsigned int csingles, cranges, cequivalents;
- boost::uint_fast32_t cclasses;
- bool isnot;
-};
-
-//
-// struct re_set
-// provides a map of bools for sets containing
-// narrow, single byte characters.
-struct re_set : public re_syntax_base
-{
- unsigned char _map[256];
-};
-
-//
-// struct re_jump
-// provides alternative next destination
-struct re_jump : public re_syntax_base
-{
- offset_type alt;
- unsigned char _map[256];
-};
-
-//
-// struct re_repeat
-// provides repeat expressions
-struct re_repeat : public re_jump
-{
- unsigned min, max;
- int id;
- bool leading;
- bool greedy;
- bool singleton;
-};
-
-
-//
-// enum re_jump_size_type
-// provides compiled size of re_jump
-// allowing for trailing alignment
-// provide this so we know how many
-// bytes to insert
-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)
-};
-
-} // namespace re_detail
-
-//
-// class basic_regex
-// 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 = icase << 1, // don't use locale specific collation
-
- basic = char_classes | intervals | limited_ops | bk_braces | bk_parens | bk_refs,
- extended = char_classes | intervals | bk_refs,
- normal = 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
- };
- 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
- };
-
- flag_type BOOST_REGEX_CALL flags()const
- {
- return _flags;
- }
-
- regbase();
- regbase(const regbase& b);
-protected:
- flag_type _flags;
-};
-
-//
-// some forward declarations:
-namespace re_detail{
-template <class iterator, class Allocator>
-class _priv_match_data;
-
-#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
-
-template <class I>
-struct def_alloc_param_traits
-{
- typedef typename regex_iterator_traits<I>::value_type const_value_type;
- typedef typename remove_cv<const_value_type>::type type;
-};
-template <>
-struct def_alloc_param_traits<const char*>
-{
- typedef char type;
-};
-template <>
-struct def_alloc_param_traits<const wchar_t*>
-{
- typedef wchar_t type;
-};
-
-}
-
-template <class iterator, class Allocator =
-#if !(defined(BOOST_MSVC) && (BOOST_MSVC <= 1300))
-BOOST_DEFAULT_ALLOCATOR(typename re_detail::def_alloc_param_traits<iterator>::type) >
-#else
-BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<iterator>::type) >
-#endif
-class match_results;
-
-//
-// 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:
- typedef typename traits::size_type traits_size_type;
- typedef typename traits::uchar_type traits_uchar_type;
- typedef typename traits::string_type traits_string_type;
- // typedefs:
- typedef charT char_type;
- typedef traits traits_type;
-
- // locale_type
- // placeholder for actual locale type used by the
- // traits class to localise *this.
- typedef typename traits::locale_type locale_type;
- // value_type
- typedef charT value_type;
- // reference, const_reference
- typedef charT& reference;
- typedef const charT& const_reference;
- // iterator, const_iterator
- typedef const charT* const_iterator;
- typedef const_iterator iterator;
- // difference_type
- typedef typename Allocator::difference_type difference_type;
- // size_type
- typedef typename Allocator::size_type size_type;
- // allocator_type
- typedef Allocator allocator_type;
- typedef Allocator alloc_type;
- // flag_type
- typedef regbase::flag_type flag_type;
-
-public:
- explicit reg_expression(const Allocator& a = Allocator());
- explicit reg_expression(const charT* p, flag_type f = regbase::normal, const Allocator& a = Allocator());
- reg_expression(const charT* p1, const charT* p2, flag_type f = regbase::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, regbase::normal | regbase::use_except);
- return *this;
- }
-
- //
- // assign:
- reg_expression& assign(const reg_expression& that)
- { return *this = that; }
- reg_expression& assign(const charT* ptr, flag_type f = regbase::normal)
- {
- set_expression(ptr, f | regbase::use_except);
- return *this;
- }
-
- reg_expression& assign(const charT* first,
- const charT* last,
- flag_type f = regbase::normal)
- {
- set_expression(first, last, f | regbase::use_except);
- return *this;
- }
-#if !defined(BOOST_NO_MEMBER_TEMPLATES) && !(defined(__IBMCPP__) && (__IBMCPP__ <= 502))
-
- template <class ST, class SA>
- unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regbase::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 = regbase::normal, const Allocator& a = Allocator())
- : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regbase::use_except); }
-
- template <class I>
- reg_expression(I first, I last, flag_type f = regbase::normal, const Allocator& al = Allocator())
- : data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0)
- {
- size_type len = last-first;
- scoped_array<charT> a(new charT[len]);
- std::copy(first, last, a.get());
- set_expression(a.get(), a.get() + len, f | regbase::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(), regbase::normal | regbase::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 = regbase::normal)
- {
- set_expression(s.c_str(), s.c_str() + s.size(), f | regbase::use_except);
- return *this;
- }
-
- template <class fwd_iterator>
- reg_expression& BOOST_REGEX_CALL assign(fwd_iterator first,
- fwd_iterator last,
- flag_type f = regbase::normal)
- {
- size_type len = last-first;
- scoped_array<charT> a(new charT[len]);
- std::copy(first, last, a.get());
- set_expression(a.get(), a.get() + len, f | regbase::use_except);
- return *this;
- }
-#else
- unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string<charT>& p, flag_type f = regbase::normal)
- { return set_expression(p.data(), p.data() + p.size(), f | regbase::use_except); }
-
- reg_expression(const std::basic_string<charT>& p, flag_type f = regbase::normal, const Allocator& a = Allocator())
- : data(a), pkmp(0) { set_expression(p, f | regbase::use_except); }
-
- reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string<charT>& p)
- {
- set_expression(p.c_str(), p.c_str() + p.size(), regbase::normal | regbase::use_except);
- return *this;
- }
-
- reg_expression& BOOST_REGEX_CALL assign(
- const std::basic_string<charT>& s,
- flag_type f = regbase::normal)
- {
- set_expression(s.c_str(), s.c_str() + s.size(), f | regbase::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(); }
- //
- // flags:
- flag_type BOOST_REGEX_CALL getflags()const
- { return 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); }
- bool BOOST_REGEX_CALL operator==(const reg_expression&)const;
- bool BOOST_REGEX_CALL operator<(const reg_expression&)const;
- //
- // 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 = regbase::normal);
- unsigned int BOOST_REGEX_CALL set_expression(const charT* p, flag_type f = regbase::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;
- re_detail::raw_storage<Allocator> data;
- unsigned _restart_type;
- unsigned marks;
- int repeats;
- unsigned char* startmap;
- std::size_t _expression_len;
- std::size_t _leading_len;
- const charT* _leading_string;
- std::size_t _leading_string_len;
- re_detail::kmp_info<charT>* pkmp;
- unsigned error_code_;
- charT* _expression;
-
- 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&);
-};
-
-#ifdef BOOST_MSVC
-#pragma warning (pop)
-#endif
-
-template <class charT, class traits, class Allocator>
-inline void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::swap(reg_expression& that)throw()
-{
- // this is not as efficient as it should be,
- // however swapping traits classes is problematic
- // so just use 'brute force' method for now:
- reg_expression<charT, traits, Allocator> e(that);
- that = *this;
- *this = e;
-}
-
-
-//
-// class match_results and match_results_base
-// handles what matched where
-
-template <class iterator>
-struct sub_match
-{
- typedef typename re_detail::regex_iterator_traits<iterator>::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<iterator>::difference_type difference_type;
-#endif
- typedef iterator iterator_type;
-
- iterator first;
- iterator second;
- bool matched;
-
- operator std::basic_string<value_type> ()const
- {
- std::basic_string<value_type> result;
- std::size_t len = boost::re_detail::distance((iterator)first, (iterator)second);
- result.reserve(len);
- iterator i = first;
- while(i != second)
- {
- result.append(1, *i);
- ++i;
- }
- return result;
- }
- #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
- sub_match() { matched = false; }
- sub_match(iterator i) : first(i), second(i), matched(false) {}
-
- bool operator==(const sub_match& that)const
- {
- return (first == that.first) && (second == that.second) && (matched == that.matched);
- }
- bool BOOST_REGEX_CALL operator !=(const sub_match& that)const
- { return !(*this == that); }
-
- difference_type BOOST_REGEX_CALL length()const
- {
- difference_type n = boost::re_detail::distance((iterator)first, (iterator)second);
- return n;
- }
-};
-
-#ifdef BOOST_OLD_REGEX_H
-namespace re_detail{
-template <class iterator, class charT>
-int do_toi(iterator i, iterator j, char c, int radix)
-{
- std::string s(i, j);
- char* p;
- int result = std::strtol(s.c_str(), &p, radix);
-#ifndef BOOST_NO_EXCEPTIONS
- if(*p)throw bad_pattern("Bad sub-expression");
-#endif
- BOOST_REGEX_NOEH_ASSERT(0 == *p)
- 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 iterator>
-sub_match<iterator>::operator int()const
-{
- iterator i = first;
- iterator j = second;
-#ifndef BOOST_NO_EXCEPTIONS
- if(i == j)throw bad_pattern("Bad sub-expression");
-#endif
- BOOST_REGEX_NOEH_ASSERT(i != j)
- int neg = 1;
- if((i != j) && (*i == '-'))
- {
- neg = -1;
- ++i;
- }
- neg *= re_detail::do_toi(i, j, *i);
-#ifndef BOOST_NO_EXCEPTIONS
- if(i != j)throw bad_pattern("Bad sub-expression");
-#endif
- BOOST_REGEX_NOEH_ASSERT(i == j)
- return neg;
-}
-template <class iterator>
-sub_match<iterator>::operator unsigned int()const
-{
- iterator i = first;
- iterator j = second;
-#ifndef BOOST_NO_EXCEPTIONS
- if(i == j)
- throw bad_pattern("Bad sub-expression");
-#endif
- BOOST_REGEX_NOEH_ASSERT(i != j)
- return re_detail::do_toi(i, j, *first);
-}
-#endif
-
-namespace re_detail{
-
-template <class iterator, class Allocator = BOOST_DEFAULT_ALLOCATOR(typename def_alloc_param_traits<iterator>::type) >
-class match_results_base
-{
-public:
- typedef Allocator alloc_type;
- typedef typename boost::detail::rebind_allocator<iterator, Allocator>::type iterator_alloc;
- typedef typename iterator_alloc::size_type size_type;
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
- typedef typename std::iterator_traits<iterator>::difference_type difference_type;
- typedef typename std::iterator_traits<iterator>::value_type char_type;
-#else
- typedef std::ptrdiff_t difference_type;
- typedef typename re_detail::regex_iterator_traits<iterator>::value_type char_type;
-#endif
- typedef sub_match<iterator> value_type;
- typedef iterator iterator_type;
-
-protected:
- typedef typename boost::detail::rebind_allocator<char, Allocator>::type c_alloc;
-
- struct c_reference : public c_alloc
- {
- std::size_t cmatches;
- unsigned count;
- sub_match<iterator> head, tail, re_null;
- unsigned int lines;
- iterator line_pos, base;
- c_reference(const Allocator& a)
- : c_alloc(a), cmatches(0), count(0), lines(0) { }
-
- bool operator==(const c_reference& that)const
- {
- return (cmatches == that.cmatches) &&
- (count == that.count) &&
- (head == that.head) &&
- (tail == that.tail) &&
- (lines == that.lines) &&
- (base == that.base);
- }
- bool operator!=(const c_reference& that)const
- { return !(*this == that); }
- };
-
- c_reference* ref;
-
- void BOOST_REGEX_CALL cow();
-
- // protected contructor for derived class...
- match_results_base(bool){}
- void BOOST_REGEX_CALL m_free();
-
-public:
-
- match_results_base(const Allocator& a = Allocator());
-
- match_results_base(const match_results_base& m)
- {
- ref = m.ref;
- ++(ref->count);
- }
-
- match_results_base& BOOST_REGEX_CALL operator=(const match_results_base& m);
-
- ~match_results_base()
- {
- m_free();
- }
-
- size_type BOOST_REGEX_CALL size()const
- {
- //return (*this)[0].matched ? ref->cmatches : 0;
- return ref->cmatches;
- }
-
- const sub_match<iterator>& BOOST_REGEX_CALL operator[](int n) const
- {
- 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->re_null;
- }
-
- Allocator BOOST_REGEX_CALL allocator()const;
-
- difference_type BOOST_REGEX_CALL length(unsigned int sub = 0)const
- {
- jm_assert(ref->cmatches);
- const sub_match<iterator>& m = (*this)[sub];
- if(m.matched == false)
- return 0;
- difference_type n = boost::re_detail::distance((iterator)m.first, (iterator)m.second);
- return n;
- }
-
- std::basic_string<char_type> str(int i)const
- {
- return static_cast<std::basic_string<char_type> >((*this)[i]);
- }
-
- unsigned int BOOST_REGEX_CALL line()const
- {
- return ref->lines;
- }
-
- difference_type BOOST_REGEX_CALL position(unsigned int sub = 0)const
- {
- jm_assert(ref->cmatches);
- const sub_match<iterator>& s = (*this)[sub];
- if(s.matched == false)
- return -1;
- difference_type n = boost::re_detail::distance((iterator)(ref->base), (iterator)(s.first));
- return n;
- }
-
- iterator BOOST_REGEX_CALL line_start()const
- {
- return ref->line_pos;
- }
-
- void swap(match_results_base& that)
- {
- c_reference* t = that.ref;
- that.ref = ref;
- ref = t;
- }
-
- bool operator==(const match_results_base& that)const;
- bool operator<(const match_results_base& that)const
- { return position() < that.position(); }
-
- friend class match_results<iterator, Allocator>;
-
- void BOOST_REGEX_CALL set_size(size_type n);
- void BOOST_REGEX_CALL set_size(size_type n, iterator i, iterator j);
- void BOOST_REGEX_CALL maybe_assign(const match_results_base& m);
- void BOOST_REGEX_CALL init_fail(iterator i, iterator j);
-
- void BOOST_REGEX_CALL set_first(iterator i);
- void BOOST_REGEX_CALL set_first(iterator i, std::size_t pos);
-
- void BOOST_REGEX_CALL set_second(iterator i)
- {
- cow();
- ((sub_match<iterator>*)(ref+1))->second = i;
- ((sub_match<iterator>*)(ref+1))->matched = true;
- ref->tail.first = i;
- ref->tail.matched = (ref->tail.first == ref->tail.second) ? false : true;
- }
-
- void BOOST_REGEX_CALL set_second(iterator i, std::size_t pos, bool m = true)
- {
- cow();
- ((sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>) * pos))->second = i;
- ((sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>) * pos))->matched = m;
- if(pos == 0)
- {
- ref->tail.first = i;
- ref->tail.matched = (ref->tail.first == ref->tail.second) ? false : true;
- }
- }
-
- void BOOST_REGEX_CALL set_line(unsigned int i, iterator pos)
- {
- ref->lines = i;
- ref->line_pos = pos;
- }
-
- void BOOST_REGEX_CALL set_base(iterator pos)
- {
- ref->base = pos;
- }
-};
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i)
-{
- cow();
- ref->head.second = i;
- ref->head.matched = (ref->head.first == ref->head.second) ? false : true;
- sub_match<iterator>* p1 = (sub_match<iterator>*)(ref+1);
- sub_match<iterator>* p2 = p1 + ref->cmatches;
- p1->first = i;
- p1->matched = false;
- ++p1;
- while(p1 != p2)
- {
- p1->matched = false;
- p1->first = ref->tail.second;
- p1->second = ref->tail.second;
- ++p1;
- }
-}
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i, std::size_t pos)
-{
- cow();
- ((sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>) * pos))->first = i;
- if(pos == 0)
- {
- ref->head.second = i;
- ref->head.matched = (ref->head.first == ref->head.second) ? false : true;
- sub_match<iterator>* p1 = (sub_match<iterator>*)(ref+1);
- sub_match<iterator>* p2 = p1 + ref->cmatches;
- p1->first = i;
- p1->matched = false;
- ++p1;
- while(p1 != p2)
- {
- p1->matched = false;
- p1->first = ref->tail.second;
- p1->second = ref->tail.second;
- ++p1;
- }
- }
-}
-
-
-template <class iterator, class Allocator>
-match_results_base<iterator, Allocator>::match_results_base(const Allocator& a)
-{
- ref = (c_reference*)c_alloc(a).allocate(sizeof(sub_match<iterator>) + sizeof(c_reference));
- BOOST_REGEX_NOEH_ASSERT(ref)
-#ifndef BOOST_NO_EXCEPTIONS
- try
- {
-#endif
- new (ref) c_reference(a);
- ref->cmatches = 1;
- ref->count = 1;
- // construct the sub_match<iterator>:
-#ifndef BOOST_NO_EXCEPTIONS
- try
- {
-#endif
- new ((sub_match<iterator>*)(ref+1)) sub_match<iterator>();
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- ::boost::re_detail::pointer_destroy(ref);
- throw;
- }
- }
- catch(...)
- {
- c_alloc(a).deallocate((char*)(void*)ref, sizeof(sub_match<iterator>) + sizeof(c_reference));
- throw;
- }
-#endif
-}
-
-template <class iterator, class Allocator>
-Allocator BOOST_REGEX_CALL match_results_base<iterator, Allocator>::allocator()const
-{
- return *((c_alloc*)ref);
-}
-
-template <class iterator, class Allocator>
-inline match_results_base<iterator, Allocator>& BOOST_REGEX_CALL match_results_base<iterator, Allocator>::operator=(const match_results_base<iterator, Allocator>& m)
-{
- if(ref != m.ref)
- {
- m_free();
- ref = m.ref;
- ++(ref->count);
- }
- return *this;
-}
-
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::m_free()
-{
- if(--(ref->count) == 0)
- {
- c_alloc a(*ref);
- sub_match<iterator>* p1, *p2;
- p1 = (sub_match<iterator>*)(ref+1);
- p2 = p1 + ref->cmatches;
- while(p1 != p2)
- {
- ::boost::re_detail::pointer_destroy(p1);
- ++p1;
- }
- ::boost::re_detail::pointer_destroy(ref);
- a.deallocate((char*)(void*)ref, sizeof(sub_match<iterator>) * ref->cmatches + sizeof(c_reference));
- }
-}
-
-template <class iterator, class Allocator>
-bool match_results_base<iterator, Allocator>::operator==(const match_results_base<iterator, Allocator>& that)const
-{
- if(*ref != *(that.ref))
- return false;
- const sub_match<iterator>* p1 = (sub_match<iterator>*)(ref+1);
- const sub_match<iterator>* p2 = p1 + ref->cmatches;
- const sub_match<iterator>* p3 = (sub_match<iterator>*)(that.ref+1);
- while(p1 != p2)
- {
- if(*p1 != *p3)
- return false;
- ++p1;
- ++p3;
- }
- return true;
-}
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n)
-{
- if(ref->cmatches != n)
- {
- c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match<iterator>) * n + sizeof(c_reference));
- BOOST_REGEX_NOEH_ASSERT(newref)
-#ifndef BOOST_NO_EXCEPTIONS
- try
- {
-#endif
- new (newref) c_reference(*ref);
- newref->count = 1;
- newref->cmatches = n;
- sub_match<iterator>* p1, *p2;
- p1 = (sub_match<iterator>*)(newref+1);
- p2 = p1 + newref->cmatches;
-#ifndef BOOST_NO_EXCEPTIONS
- try
- {
-#endif
- while(p1 != p2)
- {
- new (p1) sub_match<iterator>();
- ++p1;
- }
- m_free();
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- p2 = (sub_match<iterator>*)(newref+1);
- while(p2 != p1)
- {
- ::boost::re_detail::pointer_destroy(p2);
- ++p2;
- }
- ::boost::re_detail::pointer_destroy(ref);
- throw;
- }
-#endif
- ref = newref;
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- ref->deallocate((char*)(void*)newref, sizeof(sub_match<iterator>) * n + sizeof(c_reference));
- throw;
- }
-#endif
- }
-}
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n, iterator i, iterator j)
-{
- if(ref->cmatches != n)
- {
- c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match<iterator>) * n + sizeof(c_reference));
- BOOST_REGEX_NOEH_ASSERT(newref)
-#ifndef BOOST_NO_EXCEPTIONS
- try{
-#endif
- new (newref) c_reference(*ref);
- newref->count = 1;
- newref->cmatches = n;
- sub_match<iterator>* p1 = (sub_match<iterator>*)(newref+1);
- sub_match<iterator>* p2 = p1 + newref->cmatches;
-#ifndef BOOST_NO_EXCEPTIONS
- try
- {
-#endif
- while(p1 != p2)
- {
- new (p1) sub_match<iterator>(j);
- ++p1;
- }
- m_free();
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- p2 = (sub_match<iterator>*)(newref+1);
- while(p2 != p1)
- {
- ::boost::re_detail::pointer_destroy(p2);
- ++p2;
- }
- ::boost::re_detail::pointer_destroy(ref);
- throw;
- }
-#endif
- ref = newref;
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- ref->deallocate((char*)(void*)newref, sizeof(sub_match<iterator>) * n + sizeof(c_reference));
- throw;
- }
-#endif
- }
- else
- {
- cow();
- // set iterators to be i, matched to false:
- sub_match<iterator>* p1, *p2;
- p1 = (sub_match<iterator>*)(ref+1);
- p2 = p1 + ref->cmatches;
- while(p1 != p2)
- {
- p1->first = j;
- p1->second = j;
- p1->matched = false;
- ++p1;
- }
- }
- ref->head.first = i;
- ref->tail.second = j;
- ref->head.matched = ref->tail.matched = true;
- ref->re_null.first = ref->re_null.second = j;
- ref->re_null.matched = false;
-}
-
-template <class iterator, class Allocator>
-inline void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::init_fail(iterator i, iterator j)
-{
- set_size(ref->cmatches, i, j);
-}
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::maybe_assign(const match_results_base<iterator, Allocator>& m)
-{
- sub_match<iterator>* p1, *p2;
- p1 = (sub_match<iterator>*)(ref+1);
- p2 = (sub_match<iterator>*)(m.ref+1);
- iterator 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 < ref->cmatches; ++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(p1->first, p1->second);
- len2 = boost::re_detail::distance(p2->first, p2->second);
- if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
- break;
- if((p1->matched == true) && (p2->matched == false))
- return;
- ++p1;
- ++p2;
- }
- if(i == ref->cmatches)
- return;
- if(base2 < base1)
- *this = m;
- else if((len2 > len1) || ((p1->matched == false) && (p2->matched == true)) )
- *this = m;
-}
-
-template <class iterator, class Allocator>
-void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::cow()
-{
- if(ref->count > 1)
- {
- c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match<iterator>) * ref->cmatches + sizeof(c_reference));
- BOOST_REGEX_NOEH_ASSERT(newref)
-#ifndef BOOST_NO_EXCEPTIONS
- try{
-#endif
- new (newref) c_reference(*ref);
- newref->count = 1;
- sub_match<iterator>* p1 = (sub_match<iterator>*)(newref+1);
- sub_match<iterator>* p2 = p1 + newref->cmatches;
- sub_match<iterator>* p3 = (sub_match<iterator>*)(ref+1);
-#ifndef BOOST_NO_EXCEPTIONS
- try{
-#endif
- while(p1 != p2)
- {
- new (p1) sub_match<iterator>(*p3);
- ++p1;
- ++p3;
- }
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- p2 = (sub_match<iterator>*)(newref+1);
- while(p2 != p1)
- {
- ::boost::re_detail::pointer_destroy(p2);
- ++p2;
- }
- ::boost::re_detail::pointer_destroy(ref);
- throw;
- }
-#endif
- --(ref->count);
- ref = newref;
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- ref->deallocate((char*)(void*)newref, sizeof(sub_match<iterator>) * ref->cmatches + sizeof(c_reference));
- throw;
- }
-#endif
- }
-}
-
-} // namespace re_detail
-
-//
-// class match_results
-// encapsulates match_results_base, does a deep copy rather than
-// reference counting to ensure thread safety when copying
-// other match_results instances
-
-template <class iterator, class Allocator>
-class match_results : public re_detail::match_results_base<iterator, Allocator>
-{
- typedef re_detail::match_results_base<iterator, Allocator> base_type;
-public:
-
- typedef typename base_type::alloc_type alloc_type;
- typedef typename base_type::size_type size_type;
- typedef typename base_type::char_type char_type;
- typedef typename base_type::value_type value_type;
- typedef typename base_type::difference_type difference_type;
- typedef typename base_type::iterator_type iterator_type;
-
- explicit match_results(const Allocator& a = Allocator())
- : re_detail::match_results_base<iterator, Allocator>(a){}
-
- match_results(const re_detail::match_results_base<iterator, Allocator>& m)
- : re_detail::match_results_base<iterator, Allocator>(m){}
-
- match_results& operator=(const re_detail::match_results_base<iterator, Allocator>& m)
- {
- // shallow copy
- base_type::operator=(m);
- return *this;
- }
-
- match_results(const match_results& m);
- match_results& operator=(const match_results& m);
- //
- // the following function definitions should *not* be required, except
- // when this class is used as a template inside another template definition,
- // in which members of the base class are not visible to the calling code.
- // As a workaround we define simple forwarding functions:
- //
- size_type size()const
- { return static_cast<const base_type*>(this)->size(); }
-
- const sub_match<iterator>& operator[](int n) const
- { return (*static_cast<const base_type*>(this))[n]; }
-
- Allocator allocator()const
- { return static_cast<const base_type*>(this)->allocator(); }
-
- difference_type length(int sub = 0)const
- { return static_cast<const base_type*>(this)->length(sub); }
-
- difference_type position(unsigned int sub = 0)const
- { return static_cast<const base_type*>(this)->position(sub); }
-
- unsigned int line()const
- { return static_cast<const base_type*>(this)->line(); }
-
- iterator line_start()const
- { return static_cast<const base_type*>(this)->line_start(); }
-
- std::basic_string<char_type> str(int sub = 0)const
- { return static_cast<const base_type*>(this)->str(sub); }
-
- void swap(match_results& that)
- { static_cast<base_type*>(this)->swap(that); }
-
- bool operator==(const match_results& that)const
- { return static_cast<const base_type&>(*this) == static_cast<const base_type&>(that); }
-
- bool operator<(const match_results& that) const
- { return position() < that.position(); }
-};
-
-template <class iterator, class Allocator>
-match_results<iterator, Allocator>::match_results(const match_results<iterator, Allocator>& m)
- : re_detail::match_results_base<iterator, Allocator>(false)
-{
- this->ref =
- reinterpret_cast<typename re_detail::match_results_base<iterator, Allocator>::c_reference *>
- (m.ref->allocate(sizeof(sub_match<iterator>) * m.ref->cmatches +
- sizeof(typename re_detail::match_results_base<iterator, Allocator>::c_reference)));
- BOOST_REGEX_NOEH_ASSERT(this->ref)
-#ifndef BOOST_NO_EXCEPTIONS
- try{
-#endif
- new (this->ref) typename re_detail::match_results_base<iterator, Allocator>::c_reference(*m.ref);
- this->ref->count = 1;
- sub_match<iterator>* p1 = (sub_match<iterator>*)(this->ref+1);
- sub_match<iterator>* p2 = p1 + this->ref->cmatches;
- sub_match<iterator>* p3 = (sub_match<iterator>*)(m.ref+1);
-#ifndef BOOST_NO_EXCEPTIONS
- try{
-#endif
- while(p1 != p2)
- {
- new (p1) sub_match<iterator>(*p3);
- ++p1;
- ++p3;
- }
-#ifndef BOOST_NO_EXCEPTIONS
- }
- catch(...)
- {
- p2 = (sub_match<iterator>*)(this->ref+1);
- while(p2 != p1)
- {
- re_detail::pointer_destroy(p2);
- ++p2;
- }
- re_detail::pointer_destroy(this->ref);
- throw;
- }
- }
- catch(...)
- {
- m.ref->deallocate((char*)(void*)this->ref, sizeof(sub_match<iterator>) * m.ref->cmatches + sizeof(typename re_detail::match_results_base<iterator, Allocator>::c_reference));
- throw;
- }
-#endif
-}
-
-template <class iterator, class Allocator>
-match_results<iterator, Allocator>& match_results<iterator, Allocator>::operator=(const match_results<iterator, Allocator>& m)
-{
- match_results<iterator, Allocator> t(m);
- this->swap(t);
- return *this;
-}
-
-namespace re_detail{
-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);
-} // namepsace re_detail
-
-#ifdef __BORLANDC__
- #pragma option pop
-#endif
-
-} // namespace boost
-
-#ifndef BOOST_REGEX_COMPILE_HPP
-#include <boost/regex/v3/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/v3/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 wchar_t
-#ifdef BOOST_REGEX_WIDE_INSTANTIATE
-# define BOOST_REGEX_INSTANTIATE
-#endif
-#include <boost/regex/v3/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/v3/regex_match.hpp>
-#endif
-#ifndef BOOST_REGEX_FORMAT_HPP
-#include <boost/regex/v3/regex_format.hpp>
-#endif
-#ifndef BOOST_REGEX_SPLIT_HPP
-#include <boost/regex/v3/regex_split.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 __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc -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() & regbase::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 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((traits_size_type)(traits_uchar_type)c >= 256)
- 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 | regbase::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 | regbase::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 | regbase::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() | regbase::use_except);
- }
- else
- {
- _flags = e.flags() & ~(regbase::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() | regbase::use_except);
- return *this;
-}
-
-template <class charT, class traits, class Allocator>
-inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator==(const reg_expression<charT, traits, Allocator>& e)const
-{
- return (_flags == e.flags())
- && (_expression_len == e._expression_len)
- && (std::memcmp(_expression, e._expression, _expression_len * sizeof(charT)) == 0);
-}
-
-template <class charT, class traits, class Allocator>
-bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator<(const reg_expression<charT, traits, Allocator>& e)const
-{
- //
- // we can't offer a diffinitive ordering, but we can be consistant:
- if(_flags != e.flags()) return _flags < e.flags();
- if(_expression_len != e._expression_len) return _expression_len < e._expression_len;
- return std::memcmp(expression(), e.expression(), _expression_len);
-}
-
-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*& first, const charT* last)
-{
- //
- // we have an inner [...] construct
- //
- jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set);
- const charT* base = first;
- while( (first != last)
- && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) != traits_type::syntax_close_set) )
- ++first;
- if(first == last)
- return 0;
- ++first;
- if((first-base) < 5)
- return 0;
- if(*(base+1) != *(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) && ((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*& first, const charT* last)
-{
- //
- // returns true if we get to last:
- //
- while((first != last) && (traits_inst.is_class(*first, traits_type::char_class_space) == true))
- {
- ++first;
- }
- return first == last;
-}
-
-template <class charT, class traits, class Allocator>
-void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* 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, 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, end, 10);
- if(skip_space(ptr, 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, 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, end, 10);
- else
- max = (unsigned)-1;
- }
- else
- max = min;
-
- // validate input:
- if(skip_space(ptr, 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 == 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*& first, const charT* last)
-{
- charT c(*first);
- traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*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';
- ++first;
- break;
- case traits_type::syntax_f:
- c = '\f';
- ++first;
- break;
- case traits_type::syntax_n:
- c = '\n';
- ++first;
- break;
- case traits_type::syntax_r:
- c = '\r';
- ++first;
- break;
- case traits_type::syntax_t:
- c = '\t';
- ++first;
- break;
- case traits_type::syntax_v:
- c = '\v';
- ++first;
- break;
- case traits_type::syntax_x:
- ++first;
- if(first == last)
- {
- fail(REG_EESCAPE);
- break;
- }
- // maybe have \x{ddd}
- if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) == traits_type::syntax_open_brace)
- {
- ++first;
- if(first == last)
- {
- fail(REG_EESCAPE);
- break;
- }
- if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false)
- {
- fail(REG_BADBR);
- break;
- }
- c = (charT)traits_inst.toi(first, last, -16);
- if((first == last) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) != traits_type::syntax_close_brace))
- {
- fail(REG_BADBR);
- }
- ++first;
- break;
- }
- else
- {
- if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false)
- {
- fail(REG_BADBR);
- break;
- }
- c = (charT)traits_inst.toi(first, last, -16);
- }
- break;
- case traits_type::syntax_c:
- ++first;
- if(first == last)
- {
- fail(REG_EESCAPE);
- break;
- }
- if(((traits_uchar_type)(*first) < (traits_uchar_type)'@')
- || ((traits_uchar_type)(*first) > (traits_uchar_type)127) )
- {
- fail(REG_EESCAPE);
- return (charT)0;
- }
- c = (charT)((traits_uchar_type)(*first) - (traits_uchar_type)'@');
- ++first;
- break;
- case traits_type::syntax_e:
- c = (charT)27;
- ++first;
- break;
- case traits_type::syntax_digit:
- c = (charT)traits_inst.toi(first, last, -8);
- break;
- default:
- //c = *first;
- ++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)
- {
- rep->singleton = true;
- }
- else
- rep->singleton = false;
- }
- }
- 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);
- }
- // fall through:
- case re_detail::syntax_element_endmark:
- 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 & regbase::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 & regbase::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 & regbase::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 & regbase::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 & regbase::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 & regbase::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:
- // 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 & regbase::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_startmark:
- case re_detail::syntax_element_endmark:
- 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 size)
-{
-# ifdef BOOST_MSVC
-# pragma warning(push)
-# pragma warning(disable: 4127)
-#endif
- // move all offsets starting with j->link forward by 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 += size;
- j->next.i += size;
- break;
- case re_detail::syntax_element_jump:
- case re_detail::syntax_element_alt:
- static_cast<re_detail::re_jump*>(j)->alt.i += size;
- j->next.i += size;
- break;
- default:
- j->next.i += size;
- break;
- }
- if(j->next.i == 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*& first, const charT* 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)*first) == traits_type::syntax_open_set);
- ++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((first != last) && !done)
- {
- traits_size_type c = (traits_size_type)(traits_uchar_type)*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 = 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(first, 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, first-2);
- if(_flags & regbase::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, first-2))
- {
- --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, first-2))
- {
- std::size_t len = s.size();
- if(len)
- {
- unsigned i = 0;
- while(i < len)
- {
- s[i] = traits_inst.translate(s[i], (_flags & regbase::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)*first) == traits_type::syntax_close_set))
- {
- ++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)*first) == traits_type::syntax_close_set))
- {
- ++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))
- {
- first = base;
- s = (charT)c;
- goto char_set_literal;
- }
- }
- fail(REG_EBRACK);
- return 0;
- }
- if(first == 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;
- }
- ++first;
- if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set)
- {
- --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 & regbase::escape_in_lists)
- {
- ++first;
- if(first == last)
- continue;
- traits_size_type c = (traits_size_type)(traits_uchar_type)*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_w:
- if(l == last_dash)
- {
- fail(REG_ERANGE);
- return 0;
- }
- classes.push(traits_type::char_class_word);
- started = true;
- l = last_none;
- ++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;
- ++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;
- ++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;
- ++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;
- ++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(first, last);
- --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 & regbase::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;
- }
- }
- ++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 & regbase::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() & regbase::nocollate;
-
- while(singles.empty() == false)
- {
- ++csingles;
- const traits_string_type& s = singles.peek();
- std::size_t len = (s.size() + 1) * sizeof(charT);
- 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 &= ~regbase::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;
- 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() & regbase::nocollate)
- c1 = ranges.peek();
- else
- traits_inst.transform(c1, ranges.peek());
- ranges.pop();
- if(flags() & regbase::nocollate)
- 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 &= ~regbase::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() & regbase::nocollate)
- 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 flags = 0;
- while(classes.empty() == false)
- {
- flags |= classes.peek();
- classes.pop();
- }
- if(flags)
- {
- for(unsigned int i = 0; i < 256; ++i)
- {
- if(traits_inst.is_class(charT(i), flags))
- dat->_map[(traits_uchar_type)traits_inst.translate((charT)i, (_flags & regbase::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* p, const charT* end, flag_type f)
-{
-# ifdef BOOST_MSVC
-# pragma warning(push)
-# pragma warning(disable: 4127)
-#endif
-#ifdef __OpenBSD__
- // strxfrm not working on OpenBSD??
- f |= regbase::nocollate;
-#endif
-
- if(p == expression())
- {
- traits_string_type s(p, end);
- 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 = p;
- data.clear();
- _flags = f;
- fail(REG_NOERROR); // clear any error
-
- if(p >= end)
- {
- fail(REG_EMPTY);
- return error_code();
- }
-
- const charT* ptr = p;
- 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 & regbase::literal)
- {
- while(ptr != end)
- {
- dat = add_literal(dat, traits_inst.translate(*ptr, (_flags & regbase::icase)));
- ++ptr;
- }
- }
-
- while (ptr < end)
- {
- 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));
- 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) == 0) && (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 syntax = traits_inst.syntax_type(c);
- switch(syntax)
- {
- 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_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 end 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 == end)
- {
- 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 syntax = traits_inst.syntax_type(c);
- switch(syntax)
- {
- 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, end, 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, end, -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 == end)
- {
- 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 != end) && (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, end);
- 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 != end) && (_flags & (limited_ops | bk_plus_qm | bk_braces)) == 0)
- {
- 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, end);
- if(dat == 0)
- {
- if((_flags & regbase::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* base = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + offset);
- offset = base->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, end, 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 end 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 + ((end - base + 1) * sizeof(charT))));
- //
- // and copy the expression we just compiled:
- _expression = reinterpret_cast<charT*>(reinterpret_cast<char*>(startmap) + 256);
- _expression_len = end - 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 & regbase::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®base::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 size)
-{
- if(dat)
- {
- data.align();
- dat->next.i = data.size();
- }
- if(size < sizeof(re_detail::re_syntax_base))
- size = sizeof(re_detail::re_syntax_base);
- dat = static_cast<re_detail::re_syntax_base*>(data.extend(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 & regbase::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 & regbase::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* end)
-{
- unsigned int len = 0;
- bool leading_lit = end ? false : true;
- while(dat != 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®base::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:
- const charT* p = reinterpret_cast<const charT*>(reinterpret_cast<const char*>(dat) + sizeof(re_detail::re_set_long));
- unsigned int csingles = static_cast<re_detail::re_set_long*>(dat)->csingles;
- for(unsigned int i = 0; i < csingles; ++i)
- {
- if(re_detail::re_strlen(p) > 1)
- return 0;
- while(*p)++p;
- ++p;
- }
- ++len;
- leading_lit = false;
- break;
- }
- case re_detail::syntax_element_set:
- ++len;
- leading_lit = false;
- break;
- case re_detail::syntax_element_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 |= regbase::failbit;
-#ifndef BOOST_NO_EXCEPTIONS
- if(_flags & regbase::use_except)
- {
- throw bad_expression(traits_inst.error_string(err));
- }
-#endif
- }
- else
- _flags &= ~regbase::failbit;
-}
-
-
-#ifdef __BORLANDC__
- #pragma option pop
-#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{
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#endif
-
-//
-// 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;
-}
-
-#ifdef __BORLANDC__
- #pragma option pop
-#endif
-
-} // 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{
-
-enum format_flags_t{
- format_all = 0, // enable all extentions to sytax
- format_sed = match_max << 1, // sed style replacement.
- format_perl = format_sed << 1, // perl style replacement.
- format_no_copy = format_perl << 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.
-};
-
-namespace re_detail{
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc -w-8037
-#endif
-
-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,
- unsigned flags, const traits_type& traits_inst)
-{
- 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);
- 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(flags & (format_sed|format_perl))
- {
- *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(flags & (format_sed|format_perl))
- {
- *out = *fmt;
- ++out;
- ++fmt;
- continue;
- }
- else
- {
- ++fmt; // return from recursion
- return out;
- }
- case traits_type::syntax_colon:
- if(flags & format_is_if)
- {
- ++fmt;
- return out;
- }
- *out = *fmt;
- ++out;
- ++fmt;
- continue;
- case traits_type::syntax_question:
- {
- if(flags & (format_sed|format_perl))
- {
- *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 | 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 | 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;
-}
-
-#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;
- unsigned flags;
- const traits_type* pt;
-
-public:
- merge_out_predicate(OutputIterator& o, Iterator& pi, const charT* f, unsigned 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, Allocator>& 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,
- unsigned flags = 0
- )
-{
- 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,
- unsigned flags = 0
- )
-{
- 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, unsigned flags = 0)
-{
- 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, unsigned flags = 0)
-{
- 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;
-}
-
-template <class OutputIterator, class Iterator, class traits, class Allocator, class charT>
-OutputIterator regex_merge(OutputIterator out,
- Iterator first,
- Iterator last,
- const reg_expression<charT, traits, Allocator>& e,
- const charT* fmt,
- unsigned int 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_merge(OutputIterator out,
- Iterator first,
- Iterator last,
- const reg_expression<charT, traits, Allocator>& e,
- const std::basic_string<charT>& fmt,
- unsigned int flags = match_default)
-{
- return regex_merge(out, first, last, e, fmt.c_str(), flags);
-}
-
-template <class traits, class Allocator, class charT>
-std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
- const reg_expression<charT, traits, Allocator>& e,
- const charT* fmt,
- unsigned int flags = match_default)
-{
- std::basic_string<charT> result;
- re_detail::string_out_iterator<std::basic_string<charT> > i(result);
- regex_merge(i, s.begin(), s.end(), e, fmt, flags);
- return result;
-}
-
-template <class traits, class Allocator, class charT>
-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,
- unsigned int flags = match_default)
-{
- std::basic_string<charT> result;
- re_detail::string_out_iterator<std::basic_string<charT> > i(result);
- regex_merge(i, s.begin(), s.end(), e, fmt.c_str(), flags);
- return result;
-}
-
-#ifdef __BORLANDC__
- #pragma option pop
-#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;
-
-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
-
-} // 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_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 __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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 __BORLANDC__
- #pragma option pop
-#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_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_NAME
- + "_"
- + BOOST_LIB_TOOLSET
- + "_"
- + BOOST_LIB_THREAD_OPT
- + BOOST_LIB_RT_OPT
- + BOOST_LIB_LINK_OPT
- + BOOST_LIB_DEBUG_OPT
-
-These are defined as:
-
-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_LINK_OPT: "s" for static link,
- "i" for dynamic link.
-
-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)
-
- // vc7:
-# define BOOST_LIB_TOOLSET "vc7"
-
-#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(_DLL) || defined(_RTLDLL)) && !defined(BOOST_REGEX_STATIC_LINK)
-# define BOOST_LIB_LINK_OPT "i"
-#else
-# define BOOST_LIB_LINK_OPT "s"
-#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_TOOLSET) \
- && defined(BOOST_LIB_THREAD_OPT) \
- && defined(BOOST_LIB_RT_OPT) \
- && defined(BOOST_LIB_LINK_OPT) \
- && defined(BOOST_LIB_DEBUG_OPT)
-
-# pragma comment(lib, BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_LINK_OPT BOOST_LIB_DEBUG_OPT ".lib")
-
-#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
-
-
-
-
-
-
-
+++ /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>
-
-
-namespace boost{
- namespace re_detail{
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc -w-8026 -w-8027
-#endif
-
-//
-// 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() & regbase::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() & regbase::nocollate)
- 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 iterator, class Allocator>
-class _priv_match_data
-{
-public:
- typedef typename boost::detail::rebind_allocator<int, Allocator>::type i_alloc;
- typedef typename boost::detail::rebind_allocator<iterator, Allocator>::type it_alloc;
- typedef typename regex_iterator_traits<iterator>::difference_type difference_type;
-
- match_results_base<iterator, Allocator> temp_match;
- // failure stacks:
- jstack<match_results_base<iterator, Allocator>, Allocator> matches;
- jstack<iterator, Allocator> prev_pos;
- jstack<const re_syntax_base*, Allocator> prev_record;
- jstack<int, Allocator> prev_acc;
- int* accumulators;
- unsigned int caccumulators;
- difference_type state_count;
- difference_type max_state_count;
- iterator* loop_starts;
-
- _priv_match_data(const match_results_base<iterator, Allocator>&, iterator, iterator, std::size_t);
-
- ~_priv_match_data()
- {
- m_free();
- }
- void m_free();
- void set_accumulator_size(unsigned int size);
- int* get_accumulators()
- {
- return accumulators;
- }
- iterator* get_loop_starts()
- {
- return loop_starts;
- }
- void estimate_max_state_count(iterator a, iterator b, std::size_t states, std::random_access_iterator_tag*)
- {
- 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))
- max_state_count = lim;
- else
- max_state_count = 1000 + states * dist;
- }
- void estimate_max_state_count(iterator a, iterator b, std::size_t states, void*)
- {
- // we don't know how long the sequence is:
- max_state_count = BOOST_REGEX_MAX_STATE_COUNT;
- }
-};
-
-template <class iterator, class Allocator>
-_priv_match_data<iterator, Allocator>::_priv_match_data(const match_results_base<iterator, Allocator>& m, iterator a, iterator b, std::size_t states)
- : temp_match(m), matches(64, m.allocator()), prev_pos(64, m.allocator()), prev_record(64, m.allocator())
-{
- typedef typename regex_iterator_traits<iterator>::iterator_category category;
-
- accumulators = 0;
- caccumulators = 0;
- loop_starts = 0;
- state_count = 0;
- estimate_max_state_count(a, b, states, static_cast<category*>(0));
-}
-
-template <class iterator, class Allocator>
-void _priv_match_data<iterator, Allocator>::set_accumulator_size(unsigned int size)
-{
- if(size > caccumulators)
- {
- m_free();
- caccumulators = size;
- accumulators = i_alloc(temp_match.allocator()).allocate(caccumulators);
- BOOST_REGEX_NOEH_ASSERT(accumulators)
- loop_starts = it_alloc(temp_match.allocator()).allocate(caccumulators);
- BOOST_REGEX_NOEH_ASSERT(loop_starts)
- for(unsigned i = 0; i < caccumulators; ++i)
- new (loop_starts + i) iterator();
- }
-}
-
-template <class iterator, class Allocator>
-void _priv_match_data<iterator, Allocator>::m_free()
-{
- if(caccumulators)
- {
- i_alloc temp1(temp_match.allocator());
- temp1.deallocate(accumulators, caccumulators);
- for(unsigned i = 0; i < caccumulators; ++i)
- ::boost::re_detail::pointer_destroy(loop_starts + i);
- it_alloc temp2(temp_match.allocator());
- temp2.deallocate(loop_starts, caccumulators);
- }
-}
-
-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());
- }
-};
-
-
-#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
-
-template <class iterator, class Allocator, class charT, class traits, class Allocator2>
-bool query_match_aux(iterator first,
- iterator last,
- match_results<iterator, Allocator>& m,
- const reg_expression<charT, traits, Allocator2>& e,
- unsigned flags,
- _priv_match_data<iterator, Allocator>& pd,
- iterator* restart)
-{
- typedef access_t<charT, traits, Allocator2> access;
-
- if(e.flags() & regbase::failbit)
- return false;
-
- typedef typename traits::size_type traits_size_type;
- typedef typename traits::uchar_type traits_uchar_type;
- typedef typename is_byte<charT>::width_type width_type;
- typedef typename re_detail::regex_iterator_traits<iterator>::difference_type difference_type;
-
- // declare some local aliases to reduce pointer loads
- // good optimising compilers should make this unnecessary!!
- jstack<match_results_base<iterator, Allocator>, Allocator>& matches = pd.matches;
- jstack<iterator, Allocator>& prev_pos = pd.prev_pos;
- jstack<const re_syntax_base*, Allocator>& prev_record = pd.prev_record;
- jstack<int, Allocator>& prev_acc = pd.prev_acc;
- match_results_base<iterator, Allocator>& temp_match = pd.temp_match;
- temp_match.set_first(first);
- difference_type& state_count = pd.state_count;
-
- const re_syntax_base* ptr = access::first(e);
- bool match_found = false;
- bool have_partial_match = false;
- bool unwind_stack = false;
- bool need_push_match = (e.mark_count() > 1);
- int cur_acc = -1; // no active accumulator
- pd.set_accumulator_size(access::repeat_count(e));
- int* accumulators = pd.get_accumulators();
- iterator* start_loop = pd.get_loop_starts();
- int k; // for loops
- bool icase = e.flags() & regbase::icase;
- *restart = first;
- iterator base = first;
- const traits& traits_inst = e.get_traits();
- // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
- // referenced
- (void)traits_inst;
-
- // prepare m for failure:
- /*
- if((flags & match_init) == 0)
- {
- m.init_fail(first, last);
- } */
-
- retry:
-
- while(first != last)
- {
- jm_assert(ptr);
- ++state_count;
- switch(ptr->type)
- {
- case syntax_element_match:
- match_jump:
- {
- // match found, save then fallback in case we missed a
- // longer one.
- if((flags & match_not_null) && (first == temp_match[0].first))
- goto failure;
- if((flags & match_all) && (first != last))
- goto failure;
- temp_match.set_second(first);
- m.maybe_assign(temp_match);
- match_found = true;
- if(((flags & match_any) && ((first == last) || !(flags & match_all))) || ((first == last) && (need_push_match == false)))
- {
- // either we don't care what we match or we've matched
- // the whole string and can't match anything longer.
- while(matches.empty() == false)
- matches.pop();
- while(prev_pos.empty() == false)
- prev_pos.pop();
- while(prev_record.empty() == false)
- prev_record.pop();
- while(prev_acc.empty() == false)
- prev_acc.pop();
- return true;
- }
- }
- goto failure;
- case syntax_element_startmark:
- start_mark_jump:
- if(static_cast<const re_brace*>(ptr)->index > 0)
- {
- temp_match.set_first(first, static_cast<const re_brace*>(ptr)->index);
- }
- else if(
- (static_cast<const re_brace*>(ptr)->index == -1)
- || (static_cast<const re_brace*>(ptr)->index == -2)
- )
- {
- matches.push(temp_match);
- for(k = 0; k <= cur_acc; ++k)
- prev_pos.push(start_loop[k]);
- prev_pos.push(first);
- prev_record.push(ptr);
- for(k = 0; k <= cur_acc; ++k)
- prev_acc.push(accumulators[k]);
- prev_acc.push(cur_acc);
- prev_acc.push(match_found);
- match_found = false;
- // skip next jump and fall through:
- ptr = ptr->next.p;
- }
- ptr = ptr->next.p;
- break;
- case syntax_element_endmark:
- end_mark_jump:
- if(static_cast<const re_brace*>(ptr)->index > 0)
- {
- temp_match.set_second(first, static_cast<const re_brace*>(ptr)->index);
- }
- else if(
- (static_cast<const re_brace*>(ptr)->index == -1)
- || (static_cast<const re_brace*>(ptr)->index == -2)
- )
- {
- match_found = true;
- unwind_stack = true;
- goto failure;
- }
- ptr = ptr->next.p;
- break;
- case syntax_element_literal:
- {
- unsigned int len = static_cast<const re_literal*>(ptr)->length;
- const charT* what = reinterpret_cast<const charT*>(static_cast<const re_literal*>(ptr) + 1);
- //
- // compare string with what we stored in
- // our records:
- for(unsigned int i = 0; i < len; ++i, ++first)
- {
- if((first == last) || (traits_inst.translate(*first, icase) != what[i]))
- goto failure;
- }
- ptr = ptr->next.p;
- break;
- }
- case syntax_element_start_line:
- outer_line_check:
- if(first == temp_match[0].first)
- {
- // we're at the start of the buffer
- if(flags & match_prev_avail)
- {
- inner_line_check:
- // check the previous value even though its before
- // the start of our "buffer".
- iterator t(first);
- --t;
- if(traits::is_separator(*t) && !((*t == '\r') && (*first == '\n')) )
- {
- ptr = ptr->next.p;
- continue;
- }
- goto failure;
- }
- if((flags & match_not_bol) == 0)
- {
- ptr = ptr->next.p;
- continue;
- }
- goto failure;
- }
- // we're in the middle of the string
- goto inner_line_check;
- case syntax_element_end_line:
- // we're not yet at the end so *first is always valid:
- if(traits::is_separator(*first))
- {
- if((first != base) || (flags & match_prev_avail))
- {
- // check that we're not in the middle of \r\n sequence
- iterator t(first);
- --t;
- if((*t == '\r') && (*first == '\n'))
- {
- goto failure;
- }
- }
- ptr = ptr->next.p;
- continue;
- }
- goto failure;
- case syntax_element_wild:
- // anything except possibly NULL or \n:
- if(traits::is_separator(*first))
- {
- if(flags & match_not_dot_newline)
- goto failure;
- ptr = ptr->next.p;
- ++first;
- continue;
- }
- if(*first == charT(0))
- {
- if(flags & match_not_dot_null)
- goto failure;
- ptr = ptr->next.p;
- ++first;
- continue;
- }
- ptr = ptr->next.p;
- ++first;
- break;
- case syntax_element_word_boundary:
- {
- // prev and this character must be opposites:
-#if defined(BOOST_REGEX_USE_C_LOCALE) && defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
- bool b = traits::is_class(*first, traits::char_class_word);
-#else
- bool b = traits_inst.is_class(*first, traits::char_class_word);
-#endif
- if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
- {
- if(flags & match_not_bow)
- b ^= true;
- else
- b ^= false;
- }
- else
- {
- --first;
- b ^= traits_inst.is_class(*first, traits::char_class_word);
- ++first;
- }
- if(b)
- {
- ptr = ptr->next.p;
- continue;
- }
- goto failure;
- }
- case syntax_element_within_word:
- // both prev and this character must be traits::char_class_word:
- if(traits_inst.is_class(*first, traits::char_class_word))
- {
- bool b;
- if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
- b = false;
- else
- {
- --first;
- b = traits_inst.is_class(*first, traits::char_class_word);
- ++first;
- }
- if(b)
- {
- ptr = ptr->next.p;
- continue;
- }
- }
- goto failure;
- case syntax_element_word_start:
- if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
- {
- // start of buffer:
- if(flags & match_not_bow)
- goto failure;
- if(traits_inst.is_class(*first, traits::char_class_word))
- {
- ptr = ptr->next.p;
- continue;
- }
- goto failure;
- }
- // otherwise inside buffer:
- if(traits_inst.is_class(*first, traits::char_class_word))
- {
- iterator t(first);
- --t;
- if(traits_inst.is_class(*t, traits::char_class_word) == false)
- {
- ptr = ptr->next.p;
- continue;
- }
- }
- goto failure; // if we fall through to here then we've failed
- case syntax_element_word_end:
- if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
- goto failure; // start of buffer can't be end of word
-
- // otherwise inside buffer:
- if(traits_inst.is_class(*first, traits::char_class_word) == false)
- {
- iterator t(first);
- --t;
- if(traits_inst.is_class(*t, traits::char_class_word))
- {
- ptr = ptr->next.p;
- continue;
- }
- }
- goto failure; // if we fall through to here then we've failed
- case syntax_element_buffer_start:
- if((first != temp_match[0].first) || (flags & match_not_bob))
- goto failure;
- // OK match:
- ptr = ptr->next.p;
- break;
- case syntax_element_buffer_end:
- if((first != last) || (flags & match_not_eob))
- goto failure;
- // OK match:
- ptr = ptr->next.p;
- break;
- case syntax_element_backref:
- {
- // compare with what we previously matched:
- iterator i = temp_match[static_cast<const re_brace*>(ptr)->index].first;
- iterator j = temp_match[static_cast<const re_brace*>(ptr)->index].second;
- while(i != j)
- {
- if((first == last) || (traits_inst.translate(*first, icase) != traits_inst.translate(*i, icase)))
- goto failure;
- ++i;
- ++first;
- }
- ptr = ptr->next.p;
- break;
- }
- case syntax_element_long_set:
- {
- // let the traits class do the work:
- iterator t = re_is_set_member(first, last, static_cast<const re_set_long*>(ptr), e);
- if(t != first)
- {
- ptr = ptr->next.p;
- first = t;
- continue;
- }
- goto failure;
- }
- case syntax_element_set:
- // lookup character in table:
- if(static_cast<const re_set*>(ptr)->_map[(traits_uchar_type)traits_inst.translate(*first, icase)])
- {
- ptr = ptr->next.p;
- ++first;
- continue;
- }
- goto failure;
- case syntax_element_jump:
- ptr = static_cast<const re_jump*>(ptr)->alt.p;
- continue;
- case syntax_element_alt:
- {
- // alt_jump:
- if(access::can_start(*first, static_cast<const re_jump*>(ptr)->_map, (unsigned char)mask_take))
- {
- // we can take the first alternative,
- // see if we need to push next alternative:
- if(access::can_start(*first, static_cast<const re_jump*>(ptr)->_map, mask_skip))
- {
- if(need_push_match)
- matches.push(temp_match);
- for(k = 0; k <= cur_acc; ++k)
- prev_pos.push(start_loop[k]);
- prev_pos.push(first);
- prev_record.push(ptr);
- for(k = 0; k <= cur_acc; ++k)
- prev_acc.push(accumulators[k]);
- prev_acc.push(cur_acc);
- }
- ptr = ptr->next.p;
- continue;
- }
- if(access::can_start(*first, static_cast<const re_jump*>(ptr)->_map, mask_skip))
- {
- ptr = static_cast<const re_jump*>(ptr)->alt.p;
- continue;
- }
- goto failure; // neither option is possible
- }
- case syntax_element_rep:
- {
- // repeater_jump:
- // if we're moving to a higher id (nested repeats etc)
- // zero out our accumualtors:
- if(cur_acc < static_cast<const re_repeat*>(ptr)->id)
- {
- cur_acc = static_cast<const re_repeat*>(ptr)->id;
- accumulators[cur_acc] = 0;
- start_loop[cur_acc] = first;
- }
-
- cur_acc = static_cast<const re_repeat*>(ptr)->id;
-
- if(static_cast<const re_repeat*>(ptr)->leading)
- *restart = first;
-
- //charT c = traits_inst.translate(*first);
-
- // first of all test for special case where this is last element,
- // if that is the case then repeat as many times as possible,
- // as long as the repeat is greedy:
-
- if((static_cast<const re_repeat*>(ptr)->alt.p->type == syntax_element_match)
- && (static_cast<const re_repeat*>(ptr)->greedy == true))
- {
- // see if we can take the repeat:
- if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
- && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_take))
- {
- // push terminating match as fallback:
- if((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
- {
- if((prev_record.empty() == false) && (prev_record.peek() == static_cast<const re_repeat*>(ptr)->alt.p))
- {
- // we already have the required fallback
- // don't add any more, just update this one:
- if(need_push_match)
- matches.peek() = temp_match;
- prev_pos.peek() = first;
- }
- else
- {
- if(need_push_match)
- matches.push(temp_match);
- prev_pos.push(first);
- prev_record.push(static_cast<const re_repeat*>(ptr)->alt.p);
- }
- }
- // move to next item in list:
- if((first != start_loop[cur_acc]) || !accumulators[cur_acc])
- {
- ++accumulators[cur_acc];
- ptr = ptr->next.p;
- start_loop[cur_acc] = first;
- continue;
- }
- else if((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->min)
- {
- // the repeat was null, and we haven't gone round min times yet,
- // since all subsequent repeats will be null as well, just update
- // our repeat count and skip out.
- accumulators[cur_acc] = static_cast<const re_repeat*>(ptr)->min;
- ptr = static_cast<const re_repeat*>(ptr)->alt.p;
- continue;
- }
- goto failure;
- }
- // see if we can skip the repeat:
- if(((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
- && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_skip))
- {
- ptr = static_cast<const re_repeat*>(ptr)->alt.p;
- continue;
- }
- // otherwise fail:
- goto failure;
- }
-
- // OK if we get to here then the repeat is either non-terminal or non-greedy,
- // see if we can skip the repeat:
- if(((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
- && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_skip))
- {
- // see if we can push failure info:
- if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
- && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_take))
- {
- // check to see if the last loop matched a NULL string
- // if so then we really don't want to loop again:
- if(((unsigned int)accumulators[cur_acc] == static_cast<const re_repeat*>(ptr)->min)
- || (first != start_loop[cur_acc]))
- {
- if(need_push_match)
- matches.push(temp_match);
- prev_pos.push(first);
- prev_record.push(ptr);
- for(k = 0; k <= cur_acc; ++k)
- prev_acc.push(accumulators[k]);
- // for non-greedy repeats save whether we have a match already:
- if(static_cast<const re_repeat*>(ptr)->greedy == false)
- {
- prev_acc.push(match_found);
- match_found = false;
- }
- }
- }
- ptr = static_cast<const re_repeat*>(ptr)->alt.p;
- continue;
- }
-
- // otherwise see if we can take the repeat:
- if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
- && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_take) &&
- ((first != start_loop[cur_acc]) || !accumulators[cur_acc]))
- {
- // move to next item in list:
- ++accumulators[cur_acc];
- ptr = ptr->next.p;
- start_loop[cur_acc] = first;
- continue;
- }
- else if((first == start_loop[cur_acc]) && accumulators[cur_acc] && ((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->min))
- {
- // the repeat was null, and we haven't gone round min times yet,
- // since all subsequent repeats will be null as well, just update
- // our repeat count and skip out.
- accumulators[cur_acc] = static_cast<const re_repeat*>(ptr)->min;
- ptr = static_cast<const re_repeat*>(ptr)->alt.p;
- continue;
- }
-
- // if we get here then neither option is allowed so fail:
- goto failure;
-
- }
- case syntax_element_combining:
- if(traits_inst.is_combining(traits_inst.translate(*first, icase)))
- goto failure;
- ++first;
- while((first != last) && traits_inst.is_combining(traits_inst.translate(*first, icase)))++first;
- ptr = ptr->next.p;
- continue;
- case syntax_element_soft_buffer_end:
- {
- if(flags & match_not_eob)
- goto failure;
- iterator p(first);
- while((p != last) && traits_inst.is_separator(traits_inst.translate(*p, icase)))++p;
- if(p != last)
- goto failure;
- ptr = ptr->next.p;
- continue;
- }
- case syntax_element_restart_continue:
- if(first != temp_match[-1].first)
- goto failure;
- ptr = ptr->next.p;
- continue;
- default:
- jm_assert(0); // should never get to here!!
- return false;
- }
- }
-
- //
- // if we get to here then we've run out of characters to match against,
- // we could however still have non-character regex items left
- if((ptr->can_be_null == 0) && ((flags & match_partial) == 0))
- goto failure;
- while(true)
- {
- jm_assert(ptr);
- ++state_count;
- switch(ptr->type)
- {
- case syntax_element_match:
- goto match_jump;
- case syntax_element_startmark:
- goto start_mark_jump;
- case syntax_element_endmark:
- goto end_mark_jump;
- case syntax_element_start_line:
- goto outer_line_check;
- case syntax_element_end_line:
- // we're at the end so *first is never valid:
- if((flags & match_not_eol) == 0)
- {
- ptr = ptr->next.p;
- continue;
- }
- goto failure;
- case syntax_element_word_boundary:
- case syntax_element_word_end:
- if(((flags & match_not_eow) == 0) && (first != temp_match[0].first))
- {
- iterator t(first);
- --t;
- if(traits_inst.is_class(*t, traits::char_class_word))
- {
- ptr = ptr->next.p;
- continue;
- }
- }
- goto failure;
- case syntax_element_buffer_end:
- case syntax_element_soft_buffer_end:
- if(flags & match_not_eob)
- goto failure;
- // OK match:
- ptr = ptr->next.p;
- break;
- case syntax_element_jump:
- ptr = static_cast<const re_jump*>(ptr)->alt.p;
- continue;
- case syntax_element_alt:
- if(ptr->can_be_null & mask_take)
- {
- // we can test the first alternative,
- // see if we need to push next alternative:
- if(ptr->can_be_null & mask_skip)
- {
- if(need_push_match)
- matches.push(temp_match);
- for(k = 0; k <= cur_acc; ++k)
- prev_pos.push(start_loop[k]);
- prev_pos.push(first);
- prev_record.push(ptr);
- for(k = 0; k <= cur_acc; ++k)
- prev_acc.push(accumulators[k]);
- prev_acc.push(cur_acc);
- }
- ptr = ptr->next.p;
- continue;
- }
- if(ptr->can_be_null & mask_skip)
- {
- ptr = static_cast<const re_jump*>(ptr)->alt.p;
- continue;
- }
- goto failure; // neither option is possible
- case syntax_element_rep:
- // if we're moving to a higher id (nested repeats etc)
- // zero out our accumualtors:
- if(cur_acc < static_cast<const re_repeat*>(ptr)->id)
- {
- cur_acc = static_cast<const re_repeat*>(ptr)->id;
- accumulators[cur_acc] = 0;
- start_loop[cur_acc] = first;
- }
-
- cur_acc = static_cast<const re_repeat*>(ptr)->id;
-
- // see if we can skip the repeat:
- if(((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
- && ((ptr->can_be_null & mask_skip) || (flags & match_partial)))
- {
- // don't push failure info, there's no point:
- ptr = static_cast<const re_repeat*>(ptr)->alt.p;
- continue;
- }
-
- // otherwise see if we can take the repeat:
- if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
- && (((ptr->can_be_null & (mask_take | mask_skip)) == (mask_take | mask_skip))) || (flags & match_partial))
- {
- // move to next item in list:
- ++accumulators[cur_acc];
- ptr = ptr->next.p;
- start_loop[cur_acc] = first;
- continue;
- }
-
- // if we get here then neither option is allowed so fail:
- goto failure;
- case syntax_element_restart_continue:
- if(first != temp_match[-1].first)
- goto failure;
- ptr = ptr->next.p;
- continue;
- case syntax_element_backref:
- if(temp_match[static_cast<const re_brace*>(ptr)->index].first
- != temp_match[static_cast<const re_brace*>(ptr)->index].second)
- goto failure;
- ptr = ptr->next.p;
- continue;
- default:
- goto failure;
- }
- }
-
- failure:
-
- //
- // check to see if we've been searching too many states:
- //
- if(state_count >= pd.max_state_count)
- {
-#ifndef BOOST_NO_EXCEPTIONS
- throw std::runtime_error("Max regex search depth exceeded.");
-#else
- while(matches.empty() == false)
- matches.pop();
- while(prev_pos.empty() == false)
- prev_pos.pop();
- while(prev_record.empty() == false)
- prev_record.pop();
- while(prev_acc.empty() == false)
- prev_acc.pop();
- return false;
-#endif
- }
-
- //
- // check for possible partial match:
- //
- if((flags & match_partial)
- && !match_found // no full match already
- && (base != first) // some charcters have been consumed
- && (first == last)) // end of input has been reached
- {
- have_partial_match = true;
- temp_match.set_second(first, 0, false);
- m.maybe_assign(temp_match);
- }
-
- if(prev_record.empty() == false)
- {
- ptr = prev_record.peek();
- switch(ptr->type)
- {
- case syntax_element_alt:
- // get next alternative:
- ptr = static_cast<const re_jump*>(ptr)->alt.p;
- if(need_push_match)
- matches.pop(temp_match);
- prev_acc.pop(cur_acc);
- for(k = cur_acc; k >= 0; --k)
- prev_acc.pop(accumulators[k]);
- prev_pos.pop(first);
- for(k = cur_acc; k >= 0; --k)
- prev_pos.pop(start_loop[k]);
- prev_record.pop();
- if(unwind_stack) goto failure; // unwinding forward assert
- goto retry;
- case syntax_element_rep:
- {
- // we're doing least number of repeats first,
- // increment count and repeat again:
- bool saved_matched = match_found;
- if(need_push_match)
- matches.pop(temp_match);
- prev_pos.pop(first);
- cur_acc = static_cast<const re_repeat*>(ptr)->id;
- if(static_cast<const re_repeat*>(ptr)->greedy == false)
- {
- saved_matched = prev_acc.peek();
- prev_acc.pop();
- }
- for(k = cur_acc; k >= 0; --k)
- prev_acc.pop(accumulators[k]);
- prev_record.pop();
- if(unwind_stack) goto failure; // unwinding forward assert
- if((unsigned int)++accumulators[cur_acc] > static_cast<const re_repeat*>(ptr)->max)
- goto failure; // repetions exhausted.
- //
- // if the repeat is non-greedy, and we found a match then fail again:
- if((static_cast<const re_repeat*>(ptr)->greedy == false) && (match_found == true))
- {
- goto failure;
- }
- else if (match_found == false)
- match_found = saved_matched;
- ptr = ptr->next.p;
- start_loop[cur_acc] = first;
- goto retry;
- }
- case syntax_element_startmark:
- {
- bool saved_matched = match_found;
- matches.pop(temp_match);
- match_found = prev_acc.peek();
- prev_acc.pop();
- prev_acc.pop(cur_acc);
- for(k = cur_acc; k >= 0; --k)
- prev_acc.pop(accumulators[k]);
- prev_pos.pop(first);
- for(k = cur_acc; k >= 0; --k)
- prev_pos.pop(start_loop[k]);
- prev_record.pop();
- unwind_stack = false;
- if(static_cast<const re_brace*>(ptr)->index == -1)
- {
- if (saved_matched == false)
- goto failure;
- ptr = static_cast<const re_jump*>(ptr->next.p)->alt.p->next.p;
- goto retry;
- }
- if(static_cast<const re_brace*>(ptr)->index == -2)
- {
- if (saved_matched == true)
- goto failure;
- ptr = static_cast<const re_jump*>(ptr->next.p)->alt.p->next.p;
- goto retry;
- }
- else goto failure;
- }
- case syntax_element_match:
- if(need_push_match)
- matches.pop(temp_match);
- prev_pos.pop(first);
- prev_record.pop();
- if(unwind_stack) goto failure; // unwinding forward assert
- goto retry;
- default:
- jm_assert(0);
- // mustn't get here!!
- }
- }
-
- if(match_found || have_partial_match)
- {
- pd.state_count = 0;
- return true;
- }
-
- // if we get to here then everything has failed
- // and no match was found:
- return false;
-}
-#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
-} // namespace
-#endif
-
-
-template <class iterator>
-void _skip_and_inc(unsigned int& clines, iterator& last_line, iterator& first, const iterator last)
-{
- while(first != last)
- {
- if(*first == '\n')
- {
- last_line = ++first;
- ++clines;
- }
- else
- ++first;
- }
-}
-
-template <class iterator>
-void _skip_and_dec(unsigned int& clines, iterator& last_line, iterator& first, iterator base, std::size_t len)
-{
- bool need_line = false;
- for(std::size_t i = 0; i < len; ++i)
- {
- --first;
- if(*first == '\n')
- {
- need_line = true;
- --clines;
- }
- }
-
- if(need_line)
- {
- last_line = first;
-
- if(last_line != base)
- --last_line;
- else
- return;
-
- while((last_line != base) && (*last_line != '\n'))
- --last_line;
- if(*last_line == '\n')
- ++last_line;
- }
-}
-
-template <class iterator>
-inline void _inc_one(unsigned int& clines, iterator& last_line, iterator& first)
-{
- if(*first == '\n')
- {
- last_line = ++first;
- ++clines;
- }
- else
- ++first;
-}
-
-template <class iterator, class Allocator>
-struct grep_search_predicate
-{
- match_results<iterator, Allocator>* pm;
- grep_search_predicate(match_results<iterator, Allocator>* p) : pm(p) {}
- bool operator()(const match_results<iterator, Allocator>& m)
- {
- *pm = static_cast<const match_results_base<iterator, Allocator>&>(m);
- return false;
- }
-};
-
-#if !defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
-
-template <class iterator, class Allocator>
-inline const match_results_base<iterator, Allocator>& grep_out_type(const grep_search_predicate<iterator, Allocator>& o, const Allocator&)
-{
- return *(o.pm);
-}
-
-#endif
-
-template <class T, class Allocator>
-inline const Allocator& grep_out_type(const T&, const Allocator& a)
-{
- return a;
-}
-
-#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
-
-//
-// reg_grep2:
-// find all non-overlapping matches within the sequence first last:
-//
-template <class Predicate, class I, class charT, class traits, class A, class A2>
-unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<charT, traits, A>& e, unsigned flags, A2 a)
-{
- typedef access_t<charT, traits, A> access;
-
- if(e.flags() & regbase::failbit)
- return 0;
-
- typedef typename traits::size_type traits_size_type;
- typedef typename traits::uchar_type traits_uchar_type;
- typedef typename is_byte<charT>::width_type width_type;
-
- match_results<I, A2> m(grep_out_type(foo, a));
- I restart;
- m.set_size(e.mark_count(), first, last);
- m.set_line(1, first);
- m.set_base(first);
-
- unsigned int clines = 1;
- unsigned int cmatches = 0;
- I last_line = first;
- I next_base;
- I base = first;
- bool need_init;
- bool leading_match = false;
- const traits& traits_inst = e.get_traits();
- // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
- // referenced
- (void)traits_inst;
-
- flags |= match_init;
-
- _priv_match_data<I, A2> pd(m, first, last, e.size());
-
- const unsigned char* _map = access::get_map(e);
- unsigned int type;
-
- if(first == last)
- {
- // special case, only test if can_be_null,
- // don't dereference any pointers!!
- if(access::first(e)->can_be_null)
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
- foo(m);
- ++cmatches;
- }
- }
- return cmatches;
- }
-
- // try one time whatever:
- if( access::can_start(*first, _map, (unsigned char)mask_any) )
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
- ++cmatches;
- leading_match = true;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- // update to end of what matched
- // trying to match again with match_not_null set if this
- // is a null match...
- need_init = true;
- if(first == m[0].second)
- {
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
- {
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- }
- else
- {
- need_init = false;
- leading_match = false;
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- if(need_init)
- {
- _skip_and_inc(clines, last_line, first, m[0].second);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- }
- }
- else
- {
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- else
- _inc_one(clines, last_line, first);
- flags |= match_prev_avail | match_not_bob;
-
-
- // depending on what the first record is we may be able to
- // optimise the search:
- type = (flags & match_continuous) ?
- static_cast<unsigned int>(regbase::restart_continue)
- : static_cast<unsigned int>(access::restart_type(e));
-
- if(type == regbase::restart_buf)
- return cmatches;
-
- switch(type)
- {
- case regbase::restart_lit:
- case regbase::restart_fixed_lit:
- {
- const kmp_info<charT>* info = access::get_kmp(e);
- int len = info->len;
- const charT* x = info->pstr;
- int j = 0;
- bool icase = e.flags() & regbase::icase;
- while (first != last)
- {
- while((j > -1) && (x[j] != traits_inst.translate(*first, icase)))
- j = info->kmp_next[j];
- _inc_one(clines, last_line, first);
- ++j;
- if(j >= len)
- {
- if(type == regbase::restart_fixed_lit)
- {
- _skip_and_dec(clines, last_line, first, base, j);
- restart = first;
- std::advance(restart, len);
- m.set_first(first);
- m.set_second(restart);
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- _skip_and_inc(clines, last_line, first, restart);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- j = 0;
- }
- else
- {
- restart = first;
- _skip_and_dec(clines, last_line, first, base, j);
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
-
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- // update to end of what matched
- _skip_and_inc(clines, last_line, first, m[0].second);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- j = 0;
- }
- else
- {
- for(int k = 0; (restart != first) && (k < j); ++k, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- j = 0; //we could do better than this...
- }
- }
- }
- }
- break;
- }
- case regbase::restart_any:
- {
- while(first != last)
- {
- if( access::can_start(*first, _map, (unsigned char)mask_any) )
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
-
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- // update to end of what matched
- // trying to match again with match_not_null set if this
- // is a null match...
- need_init = true;
- if(first == m[0].second)
- {
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- }
- else
- {
- need_init = false;
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- if(need_init)
- {
- _skip_and_inc(clines, last_line, first, m[0].second);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- }
- continue;
- }
- else
- {
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- else
- _inc_one(clines, last_line, first);
- }
- }
- break;
- case regbase::restart_word:
- {
- // do search optimised for word starts:
- while(first != last)
- {
- --first;
- if(*first == '\n')
- --clines;
- // skip the word characters:
- while((first != last) && traits_inst.is_class(*first, traits::char_class_word))
- ++first;
- // now skip the white space:
- while((first != last) && (traits_inst.is_class(*first, traits::char_class_word) == false))
- {
- #ifdef __GNUC__
- //
- // hack to work around gcc optimisation bug
- // just expand the contents of _inc_one here:
- if(*first == '\n')
- {
- last_line = ++first;
- ++clines;
- }
- else
- ++first;
- #else
- _inc_one(clines, last_line, first);
- #endif
- }
- if(first == last)
- break;
-
- if( access::can_start(*first, _map, (unsigned char)mask_any) )
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- // update to end of what matched
- // trying to match again with match_not_null set if this
- // is a null match...
- need_init = true;
- if(first == m[0].second)
- {
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- }
- else
- {
- need_init = false;
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- if(need_init)
- {
- _skip_and_inc(clines, last_line, first, m[0].second);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- }
- }
- else
- {
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- else
- _inc_one(clines, last_line, first);
- }
- }
- break;
- case regbase::restart_line:
- {
- // do search optimised for line starts:
- while(first != last)
- {
- // find first charcter after a line break:
- --first;
- if(*first == '\n')
- --clines;
- while((first != last) && (*first != '\n'))
- ++first;
- if(first == last)
- break;
- ++first;
- if(first == last)
- break;
-
- ++clines;
- last_line = first;
-
- if( access::can_start(*first, _map, (unsigned char)mask_any) )
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- // update to end of what matched
- // trying to match again with match_not_null set if this
- // is a null match...
- need_init = true;
- if(first == m[0].second)
- {
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- }
- else
- {
- need_init = false;
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- if(need_init)
- {
- _skip_and_inc(clines, last_line, first, m[0].second);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- }
- }
- else
- {
- for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
- {} // dwa 10/20/2000 - warning suppression for MWCW
- if(restart != last)
- ++restart;
- _skip_and_inc(clines, last_line, first, restart);
- }
- }
- else
- _inc_one(clines, last_line, first);
- }
- }
- break;
- case regbase::restart_continue:
- {
- if(!leading_match)
- return cmatches;
- while(first != last)
- {
- if( access::can_start(*first, _map, (unsigned char)mask_any) )
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- if(m[0].second == last)
- return cmatches;
- // update to end of what matched
- // trying to match again with match_not_null set if this
- // is a null match...
- if(first == m[0].second)
- {
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- }
- else
- return cmatches; // can't continue from null match
- }
- _skip_and_inc(clines, last_line, first, m[0].second);
- next_base = m[0].second;
- pd.temp_match.init_fail(next_base, last);
- m.init_fail(next_base, last);
- continue;
- }
- }
- return cmatches;
- }
- }
- break;
- }
-
-
- // finally check trailing null string:
- if(access::first(e)->can_be_null)
- {
- if(query_match_aux(first, last, m, e, flags, pd, &restart))
- {
- m.set_line(clines, last_line);
- ++cmatches;
- if(foo(m) == false)
- return cmatches;
- }
- }
-
- return cmatches;
-}
-#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
-} // namespace {anon}
-#endif
-
-} // namespace re_detail
-
-//
-// proc regex_match
-// returns true if the specified regular expression matches
-// the whole of the input. Fills in what matched in m.
-//
-template <class iterator, class Allocator, class charT, class traits, class Allocator2>
-bool regex_match(iterator first, iterator last, match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
-{
- // prepare m for failure:
- if((flags & match_init) == 0)
- {
- m.set_size(e.mark_count(), first, last);
- m.set_base(first);
- m.set_line(1, first);
- }
- flags |= match_all; // must match all of input.
- re_detail::_priv_match_data<iterator, Allocator> pd(m, first, last, e.size());
- iterator restart;
- bool result = re_detail::query_match_aux(first, last, m, e, flags, pd, &restart);
- return result;
-}
-template <class iterator, class charT, class traits, class Allocator2>
-bool regex_match(iterator first, iterator last, const reg_expression<charT, traits, Allocator2>& e, unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- match_results<std::string::const_iterator, regex::allocator_type>& m,
- const regex& e,
- unsigned flags = match_default)
-{
- return regex_match(s.begin(), s.end(), m, e, flags);
-}
-inline bool regex_match(const std::string& s,
- const regex& e,
- unsigned 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,
- unsigned 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,
- unsigned 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
-
-template <class iterator, class Allocator, class charT, class traits, class Allocator2>
-bool regex_search(iterator first, iterator last, match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
-{
- if(e.flags() & regbase::failbit)
- return false;
-
- typedef typename traits::size_type traits_size_type;
- typedef typename traits::uchar_type traits_uchar_type;
-
- return re_detail::reg_grep2(re_detail::grep_search_predicate<iterator, Allocator>(&m), first, last, e, flags, m.allocator());
-}
-
-//
-// 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- match_results<std::string::const_iterator, regex::allocator_type>& m,
- const regex& e,
- unsigned 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,
- match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>& m,
- const wregex& e,
- unsigned flags = match_default)
-{
- return regex_search(s.begin(), s.end(), m, e, flags);
-}
-#endif
-
-#endif
-
-
-//
-// regex_grep:
-// find all non-overlapping matches within the sequence first last:
-//
-template <class Predicate, class iterator, class charT, class traits, class Allocator>
-inline unsigned int regex_grep(Predicate foo, iterator first, iterator last, const reg_expression<charT, traits, Allocator>& e, unsigned flags = match_default)
-{
- return re_detail::reg_grep2(foo, first, last, e, flags, e.allocator());
-}
-
-//
-// 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,
- unsigned 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,
- unsigned 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,
- unsigned 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,
- unsigned 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, regex::allocator_type>&), const std::string& s,
- const regex& e,
- unsigned 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, wregex::allocator_type>&),
- const std::basic_string<wchar_t>& s,
- const wregex& e,
- unsigned flags = match_default)
-{
- return regex_grep(foo, s.begin(), s.end(), e, flags);
-}
-#endif
-
-#endif
-
-
-#ifdef __BORLANDC__
- #pragma option pop
-#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_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 __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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;
-};
-
-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 __BORLANDC__
- #pragma option pop
-#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_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 __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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,
- unsigned flags,
- std::size_t max_split)
-{
- typedef typename std::basic_string<charT, Traits1, Alloc1>::const_iterator ci_t;
- ci_t last = s.begin();
- std::size_t init_size = max_split;
- re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2> 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,
- unsigned 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 __BORLANDC__
- #pragma option pop
-#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/v3/regex_raw_buffer.hpp>
-#endif
-
-namespace boost{
- namespace re_detail{
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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
-{
-private:
- typedef typename boost::detail::rebind_allocator<unsigned char, Allocator>::type allocator_type;
- 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 __BORLANDC__
- #pragma option pop
-#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 __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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 __BORLANDC__
- #pragma option pop
-#endif
-
-} // namespace re_detail
-} // namespace boost
-
-#endif // 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 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/v3/regex_cstring.hpp>
-#endif
-
-namespace boost{
-
-#ifdef __BORLANDC__
- #pragma option push -a8 -b -Vx -Ve -pc
-#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 wchar_t wide_lower_case_map[];
-extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[];
-BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t 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<wchar_t>;
-#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(); }
-
- 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<wchar_t> : public re_detail::c_traits_base
-{
- typedef re_detail::c_traits_base base_type;
-public:
- typedef wchar_t char_type;
- typedef unsigned short uchar_type;
- typedef unsigned int size_type;
- typedef std::basic_string<wchar_t> string_type;
- typedef int locale_type;
- static std::size_t BOOST_REGEX_CALL length(const char_type* p)
- {
- return std::wcslen(p);
- }
- static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
- static wchar_t BOOST_REGEX_CALL translate(wchar_t 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<wchar_t>& out, const std::basic_string<wchar_t>& in);
-
- static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
-
- static bool BOOST_REGEX_CALL is_separator(wchar_t c)
- {
- return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
- }
-
- static bool BOOST_REGEX_CALL is_combining(wchar_t c)
- { return re_detail::is_combining(c); }
-
- static bool BOOST_REGEX_CALL is_class(wchar_t 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(wchar_t c);
- static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
-
- static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
-
- static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
-
- static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
- locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
- c_regex_traits<wchar_t>()
- { init(); }
- ~c_regex_traits<wchar_t>()
- { m_free(); }
- struct sentry
- {
- sentry(const c_regex_traits<wchar_t>&)
- { c_regex_traits<wchar_t>::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 wchar_t *s2);
- static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
-private:
- static bool BOOST_REGEX_CALL do_iswclass(wchar_t 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<wchar_t>& out, const wchar_t* first, const wchar_t* last);
- static c_regex_traits<wchar_t> init_;
-
- static unsigned sort_type;
- static wchar_t sort_delim;
-};
-#endif
-
-#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();
- 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<wchar_t> : public re_detail::w32_traits_base
-{
- typedef re_detail::w32_traits_base base_type;
-public:
- typedef wchar_t char_type;
- typedef unsigned short uchar_type;
- typedef unsigned int size_type;
- typedef std::basic_string<wchar_t> string_type;
- typedef int locale_type;
- static std::size_t BOOST_REGEX_CALL length(const char_type* p)
- {
- return std::wcslen(p);
- }
- static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
- static wchar_t BOOST_REGEX_CALL translate(wchar_t 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<wchar_t>& out, const std::basic_string<wchar_t>& in);
-
- static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
-
- static bool BOOST_REGEX_CALL is_separator(wchar_t c)
- {
- return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
- }
-
- static bool BOOST_REGEX_CALL is_combining(wchar_t c)
- { return re_detail::is_combining(c); }
-
- static bool BOOST_REGEX_CALL is_class(wchar_t 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(wchar_t c);
- static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
-
- static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
-
- static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* 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<wchar_t>&)
- { w32_regex_traits<wchar_t>::update(); }
- ~sentry(){}
- operator void*() { return this; }
- };
- static void BOOST_REGEX_CALL update();
- w32_regex_traits();
- ~w32_regex_traits();
- static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
- static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
-
-private:
- static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
- static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
- static w32_regex_traits<wchar_t> init_;
- static wchar_t BOOST_REGEX_CALL wtolower(wchar_t c);
- static unsigned short wide_unicode_classes[];
-};
-#endif // Wide strings
-#endif // Win32
-
-#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
-
-} // namspace boost
-
-#ifdef __BORLANDC__
- #pragma option pop
-#endif
-#include <locale>
-#ifdef __BORLANDC__
- #pragma option push -a4 -b -Ve -pc
-#endif
-
-namespace boost{
-
-namespace re_detail
-{
-
-template <class charT>
-struct message_data;
-
-template <>
-struct message_data<char>;
-
-template <>
-struct message_data<wchar_t>;
-
-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();
-
- void swap(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; }
-
- struct sentry
- {
- sentry(const cpp_regex_traits<char>&){}
- operator void*() { return this; }
- };
-};
-
-#ifndef BOOST_NO_WREGEX
-template<>
-class BOOST_REGEX_DECL cpp_regex_traits<wchar_t> : public re_detail::cpp_regex_traits_base
-{
- typedef re_detail::cpp_regex_traits_base base_type;
-public:
- typedef wchar_t char_type;
- typedef unsigned short uchar_type;
- typedef unsigned int size_type;
- typedef std::basic_string<wchar_t> string_type;
- typedef std::locale locale_type;
-
-private:
- re_detail::message_data<wchar_t>* pmd;
- const unsigned char* psyntax;
- wchar_t* lower_map;
- const std::ctype<wchar_t>* pctype;
- const std::collate<wchar_t>* pcollate;
- const std::codecvt<wchar_t, char, std::mbstate_t>* pcdv;
- std::locale locale_inst;
- unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const;
- unsigned sort_type;
- wchar_t sort_delim;
-
- cpp_regex_traits(const cpp_regex_traits&);
- cpp_regex_traits& operator=(const cpp_regex_traits&);
-
-public:
-
- static std::size_t BOOST_REGEX_CALL length(const char_type* p)
- {
- return std::wcslen(p);
- }
- unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
- {
- return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
- }
- wchar_t BOOST_REGEX_CALL translate(wchar_t 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<wchar_t>& out, const std::basic_string<wchar_t>& in)const
- {
- out = pcollate->transform(in.c_str(), in.c_str() + in.size());
- }
-
- void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const;
-
- static bool BOOST_REGEX_CALL is_separator(wchar_t c)
- {
- return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
- }
-
- static bool BOOST_REGEX_CALL is_combining(wchar_t c)
- { return re_detail::is_combining(c); }
-
- bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)const
- {
- if(pctype->is((std::ctype<wchar_t>::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(wchar_t c)const;
- int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const;
-
- boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const;
- bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last)const;
-
- std::string BOOST_REGEX_CALL error_string(unsigned id)const;
- 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(wchar_t *s1, std::size_t len, const char *s2)const;
- void swap(cpp_regex_traits&);
-
- struct sentry
- {
- sentry(const cpp_regex_traits<wchar_t>&){}
- operator void*() { return this; }
- };
-};
-#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 __BORLANDC__
- #pragma option pop
-#endif
-
-} // namespace boost
-
-#endif // include
-
-
-
-
-
-
-
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)
+ bool operator != (const reg_expression& e)
{ return compare(e) != 0; }
bool BOOST_REGEX_CALL operator<(const reg_expression& e)const
{ return compare(e) < 0; }
} // namespace
#endif
+#if defined(__cplusplus)
//
// C++ high level wrapper goes here:
//
-#if defined(__cplusplus)
#include <string>
#include <vector>
namespace boost{
std::string What(int i = 0)const;
std::string operator[](int i)const { return What(i); }
- static const unsigned int npos;
-
+#ifdef __MINGW32__
+ static const std::size_t npos = ~0u;
+#else
+ static const std::size_t npos;
+#endif
friend struct re_detail::pred1;
friend struct re_detail::pred2;
friend struct re_detail::pred3;
#endif
-#endif // include guard
+#endif /* include guard */
# include BOOST_ABI_SUFFIX
#endif
-#elif defined(BOOST_MSVC) || defined(__GNUC__)
+#elif (defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)) || defined(__GNUC__)
# ifndef BOOST_REGEX_INSTANTIATE
# define template extern template
# include <boost/cstdint.hpp>
#endif
-#include <boost/detail/workaround.hpp>
#ifdef __cplusplus
+#include <boost/detail/workaround.hpp>
namespace boost{
namespace regex_constants{
+#else
+#define BOOST_WORKAROUND(x, y) 1
#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_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.
+ 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))
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) || defined(__SUNPRO_CC)
typedef unsigned long match_flag_type;
#else
typedef match_flags match_flag_type;
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; }
+{ m1 = static_cast<match_flags>(m1&m2); return m1; }
inline match_flags& operator|=(match_flags& m1, match_flags m2)
-{ m1 = m1|m2; return m1; }
+{ m1 = static_cast<match_flags>(m1|m2); return m1; }
inline match_flags& operator^=(match_flags& m1, match_flags m2)
-{ m1 = m1^m2; return m1; }
+{ m1 = static_cast<match_flags>(m1^m2); return m1; }
#endif
#endif
//using regex_constants::format_is_if;
} // namespace boost
-#endif // __cplusplus
-#endif // include guard
+#endif /* __cplusplus */
+#endif /* include guard */
// size:
size_type size() const
- { return m_subs.size() - 2; }
+ { return (m_subs.size() >= 2) ? m_subs.size() - 2 : 0; }
size_type max_size() const
{ return m_subs.max_size(); }
bool empty() const
}
const_iterator begin() const
{
- return (m_subs.size() > 2) ? (m_subs.begin() + 2) : m_subs.end();
+ return (m_subs.size() >= 2) ? (m_subs.begin() + 2) : m_subs.end();
}
const_iterator end() const
{
size_type len = m_subs.size();
if(len > n + 2)
{
- m_subs.erase(m_subs.begin()+n+2);
+ m_subs.erase(m_subs.begin()+n+2, m_subs.end());
std::fill(m_subs.begin(), m_subs.end(), v);
}
else
estimate_max_state_count(static_cast<category*>(0));
if(!(m_match_flags & (match_perl|match_posix)))
{
- if(re.flags() & regex_constants::perlex)
+ if((re.flags() & regex_constants::perlex) || (re.flags() & regex_constants::literal))
m_match_flags |= match_perl;
else
m_match_flags |= match_posix;
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;
+ difference_type lim = (std::numeric_limits<difference_type>::max)() - 100000 - states;
if(dist > (difference_type)(lim / states))
max_state_count = lim;
else
- max_state_count = 1000 + states * dist;
+ max_state_count = 100000 + states * dist;
}
template <class BidiIterator, class Allocator, class traits, class Allocator2>
void perl_matcher<BidiIterator, Allocator, traits, Allocator2>::estimate_max_state_count(void*)
else
{
// start again:
- search_base = position = (*m_presult)[0].second;
+ search_base = position = m_result[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(((m_match_flags & match_not_null) == 0) && (m_result.length() == 0))
{
if(position == last)
return false;
struct saved_state
{
- unsigned int id;
+ union{
+ unsigned int id;
+ // these ensure that this struct gets the same alignment as derived structs:
+ void* padding1;
+ std::size_t padding2;
+ std::ptrdiff_t padding3;
+ };
saved_state(unsigned i) : id(i) {}
};
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));
+ 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(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ std::advance(end, (std::min)((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position);
while((position != end) && (traits_inst.translate(*position, icase) == what))
{
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ 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)])
{
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ 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)))
{
const re_repeat* rep = pmp->rep;
unsigned count = pmp->count;
- assert(rep->next.p);
- assert(rep->alt.p);
+ assert(rep->next.p != 0);
+ assert(rep->alt.p != 0);
count -= rep->min;
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 != 0);
+ assert(rep->alt.p != 0);
assert(rep->next.p->type == syntax_element_wild);
assert(count < rep->max);
position = pmp->last_position;
assert(rep->type == syntax_element_char_rep);
- assert(rep->next.p);
- assert(rep->alt.p);
+ assert(rep->next.p != 0);
+ assert(rep->alt.p != 0);
assert(rep->next.p->type == syntax_element_literal);
assert(count < rep->max);
position = pmp->last_position;
assert(rep->type == syntax_element_short_set_rep);
- assert(rep->next.p);
- assert(rep->alt.p);
+ assert(rep->next.p != 0);
+ assert(rep->alt.p != 0);
assert(rep->next.p->type == syntax_element_set);
assert(count < rep->max);
position = pmp->last_position;
assert(rep->type == syntax_element_long_set_rep);
- assert(rep->next.p);
- assert(rep->alt.p);
+ assert(rep->next.p != 0);
+ assert(rep->alt.p != 0);
assert(rep->next.p->type == syntax_element_long_set);
assert(position != last);
assert(count < rep->max);
// 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));
+ 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(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ std::advance(end, (std::min)((unsigned)re_detail::distance(position, last), desired));
BidiIterator origin(position);
while((position != end) && (traits_inst.translate(*position, icase) == what))
{
return false;
if(position == last)
return false;
- position = ++save_pos;
- ++count;
+ position = save_pos;
+ if(traits_inst.translate(*position, icase) == what)
+ {
+ ++position;
+ ++count;
+ }
+ else
+ {
+ return false;
+ }
}while(true);
#ifdef __BORLANDC__
#pragma option pop
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ 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)])
{
return false;
if(position == last)
return false;
- position = ++save_pos;
- ++count;
+ position = save_pos;
+ if(map[(traits_uchar_type)traits_inst.translate(*position, icase)])
+ {
+ ++position;
+ ++count;
+ }
+ else
+ {
+ return false;
+ }
}while(true);
#ifdef __BORLANDC__
#pragma option pop
if(::boost::is_random_access_iterator<BidiIterator>::value)
{
BidiIterator end = position;
- std::advance(end, std::min((unsigned)re_detail::distance(position, last), desired));
+ 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)))
{
return false;
if(position == last)
return false;
- position = ++save_pos;
- ++count;
+ position = save_pos;
+ if(position != re_is_set_member(position, last, set, re))
+ {
+ ++position;
+ ++count;
+ }
+ else
+ {
+ return false;
+ }
}while(true);
#ifdef __BORLANDC__
#pragma option pop
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());
+ if(_flags & regbase::icase)
+ {
+ if((cls == traits_type::char_class_upper) || (cls == traits_type::char_class_lower))
+ {
+ cls = traits_type::char_class_alpha;
+ }
+ }
classes.push(cls);
if(dat)
{
++csingles;
const traits_string_type& s = singles.peek();
std::size_t len = (s.size() + 1) * sizeof(charT);
- if(len > sizeof(charT))
+ if(len > sizeof(charT) * 2)
singleton = false;
std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
singles.pop();
data.clear();
_flags = f;
fail(REG_NOERROR); // clear any error
+ _leading_len = 0; // set this to non-zero if there are any backrefs, we'll refer to it later...
if(arg_first >= arg_last)
{
{
case traits_type::syntax_colon:
static_cast<re_detail::re_brace*>(dat)->index = 0;
- --marks;
+ if((_flags & nosubs) == 0)
+ --marks;
markid.pop();
markid.push(0);
++ptr;
markid.pop();
markid.push(-1);
common_forward_assert:
- --marks;
+ if((_flags & nosubs) == 0)
+ --marks;
++ptr;
// extend:
dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
case traits_type::syntax_hash:
// comment just skip it:
static_cast<re_detail::re_brace*>(dat)->index = 0;
- --marks;
+ if((_flags & nosubs) == 0)
+ --marks;
markid.pop();
mark.pop();
do{
dat = add_simple(dat, re_detail::syntax_element_backref, sizeof(re_detail::re_brace));
static_cast<re_detail::re_brace*>(dat)->index = i;
++ptr;
+ _leading_len = 1;
continue;
}
break;
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;
+ if((_restart_type >= restart_word) || (_restart_type <= restart_continue))
+ return 0;
bool leading_lit = arg_end ? false : true;
while(dat != arg_end)
{
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) ))
+ if((len == 0) && (_leading_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;
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Use, modification and distribution are subject to the
- * Boost Software License, Version 1.0. (See accompanying file
+ * 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)
*
*/
namespace re_detail{
-template <class O, class I>
-O BOOST_REGEX_CALL re_copy_out(O out, I first, I last)
+// make_upper and make_lower should ideally be implemented in regex_traits
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+
+//
+// VC6 needs to link to user32.lib, as do all compilers that
+// claim to be VC6/7 compatible:
+//
+#if defined(_MSC_VER) && !defined(__BORLANDC__)
+#pragma comment(lib, "user32.lib")
+#endif
+
+inline wchar_t make_upper(wchar_t c)
+{
+ return LOWORD(::CharUpperW(reinterpret_cast<wchar_t*>(static_cast<unsigned short>(c))));
+}
+
+inline char make_upper(char c)
+{
+ return static_cast<char>(LOWORD(::CharUpperA(reinterpret_cast<char*>(static_cast<unsigned short>(c)))));
+}
+
+inline wchar_t make_lower(wchar_t c)
+{
+ return LOWORD(::CharLowerW(reinterpret_cast<wchar_t*>(static_cast<unsigned short>(c))));
+}
+
+inline char make_lower(char c)
+{
+ return static_cast<char>(LOWORD(::CharLowerA(reinterpret_cast<char*>(static_cast<unsigned short>(c)))));
+}
+
+#else
+
+// TODO: make this traits class sensitive:
+#ifndef BOOST_NO_WREGEX
+inline wchar_t make_upper(wchar_t c)
+{
+ return (std::towupper)(c);
+}
+
+inline wchar_t make_lower(wchar_t c)
+{
+ return (std::towlower)(c);
+}
+#endif
+inline char make_upper(char c)
+{
+ return static_cast<char>((std::toupper)(c));
+}
+
+inline char make_lower(char c)
+{
+ return static_cast<char>((std::tolower)(c));
+}
+
+#endif //defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+
+typedef enum {
+ case_nochange,
+ case_oneupper,
+ case_onelower,
+ case_allupper,
+ case_alllower
+} case_flags_type;
+
+// traits_type is unused, but provided to make it possible to use it for case conversion
+template <class O, class charT, class traits_type>
+void BOOST_REGEX_CALL output_char(O& out, charT c, traits_type& /*t*/, case_flags_type& f)
+{
+ switch (f) {
+ case case_oneupper:
+ f = case_nochange;
+ // drop through
+ case case_allupper:
+ *out = make_upper(c);
+ break;
+ case case_onelower:
+ f = case_nochange;
+ // drop through
+ case case_alllower:
+ *out = make_lower(c);
+ break;
+ default:
+ *out = c;
+ break;
+ }
+}
+
+template <class O, class I, class traits_type>
+O BOOST_REGEX_CALL re_copy_out(O out, I first, I last, traits_type& t, case_flags_type& f)
{
while(first != last)
{
- *out = *first;
+ if (f != case_nochange)
+ output_char(out, *first, t, f);
+ else
+ *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)
{
// _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,
+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)
+ match_flag_type flags, const traits_type& traits_inst,
+ case_flags_type& case_flags)
{
#ifdef __BORLANDC__
#pragma option push -w-8037
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)));
+ oi_assign(&out, re_copy_out(out, Iterator(m[-1].first), Iterator(m[-1].second),
+ traits_inst, case_flags));
++fmt;
continue;
case traits_type::syntax_end_buffer:
- oi_assign(&out, re_copy_out(out, Iterator(m[-2].first), Iterator(m[-2].second)));
+ oi_assign(&out, re_copy_out(out, Iterator(m[-2].first), Iterator(m[-2].second),
+ traits_inst, case_flags));
++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)));
+ oi_assign(&out, re_copy_out(out, Iterator(m[index].first), Iterator(m[index].second),
+ traits_inst, case_flags));
continue;
}
}
// anything else:
if(*fmt == '&')
{
- oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second)));
+ oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second),
+ traits_inst, case_flags));
++fmt;
}
else
else
c = (charT)traits_inst.toi(fmt, fmt_end, -8);
break;
+
+ case traits_type::syntax_u:
+ ++fmt;
+ if(flags & format_sed) break;
+ case_flags = case_oneupper;
+ continue;
+ case traits_type::syntax_l:
+ ++fmt;
+ if(flags & format_sed) break;
+ case_flags = case_onelower;
+ continue;
+ case traits_type::syntax_U:
+ ++fmt;
+ if(flags & format_sed) break;
+ case_flags = case_allupper;
+ continue;
+ case traits_type::syntax_L:
+ ++fmt;
+ if(flags & format_sed) break;
+ case_flags = case_alllower;
+ continue;
+ case traits_type::syntax_E:
+ ++fmt;
+ if(flags & format_sed) break;
+ case_flags = case_nochange;
+ continue;
default:
//c = *fmt;
++fmt;
else
{
++fmt; // recurse
- oi_assign(&out, _reg_format_aux(out, m, fmt, flags, traits_inst));
+ oi_assign(&out, _reg_format_aux(out, m, fmt, flags, traits_inst, case_flags));
continue;
}
case traits_type::syntax_close_bracket:
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));
+ oi_assign(&out, _reg_format_aux(out, m, fmt, flags | regex_constants::format_is_if, traits_inst, case_flags));
if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon)
re_skip_format(fmt, traits_inst);
}
{
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));
+ oi_assign(&out, _reg_format_aux(out, m, fmt, flags | regex_constants::format_is_if, traits_inst, case_flags));
}
return out;
}
default_opt:
if((flags & format_sed) && (*fmt == '&'))
{
- oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second)));
+ oi_assign(&out, re_copy_out(out, Iterator(m[0].first), Iterator(m[0].second),
+ traits_inst, case_flags));
++fmt;
continue;
}
- *out = *fmt;
+
+ output_char(out, *fmt, traits_inst, case_flags);
++out;
++fmt;
}
{
S* out;
public:
+ typedef typename S::difference_type difference_type;
+ typedef typename S::value_type value_type;
+ typedef typename S::pointer pointer;
+ typedef typename S::reference reference;
+ typedef std::output_iterator_tag iterator_category;
+
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;
+ string_out_iterator& operator=(typename S::value_type v)
+ {
+ out->append(1, v);
+ return *this;
}
};
bool BOOST_REGEX_CALL operator()(const boost::match_results<Iterator, alloc_type>& m)
{
const charT* f = fmt;
+ case_flags_type cf = case_nochange;
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));
+ {
+ oi_assign(out, re_copy_out(
+ *out,
+ Iterator(m[-1].first),
+ Iterator(m[-1].second),
+ *pt,
+ cf));
+ }
+ oi_assign(out, _reg_format_aux(*out, m, f, flags, *pt, cf));
*last = m[-2].first;
return flags & format_first_only ? false : true;
}
)
{
regex_traits<charT> t;
- return re_detail::_reg_format_aux(out, m, fmt, flags, t);
+
+ re_detail::case_flags_type cf = re_detail::case_nochange;
+ return re_detail::_reg_format_aux(out, m, fmt, flags, t, cf);
}
template <class OutputIterator, class Iterator, class Allocator, class charT>
{
regex_traits<charT> t;
const charT* start = fmt.c_str();
- return re_detail::_reg_format_aux(out, m, start, flags, t);
-}
+
+ re_detail::case_flags_type cf = re_detail::case_nochange;
+ return re_detail::_reg_format_aux(out, m, start, flags, t, cf);
+}
template <class Iterator, class Allocator, class charT>
-std::basic_string<charT> regex_format(const match_results<Iterator, Allocator>& m,
- const charT* fmt,
+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;
}
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,
+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;
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/config.hpp>
#endif
-#include <boost/detail/allocator.hpp>
+#include <boost/regex/config/allocator.hpp>
//
// define BOOST_REGEX_NO_FWD if this
return count; // we've reached the end, don't try and find an extra null match.
if(m.length() == 0)
{
+ if(m[0].second == last)
+ return count;
// 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;
+ match_results<BidiIterator, match_allocator_type> m2(m);
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);
+ m = m2;
}
matcher.unsetf((match_not_null | match_continuous) & ~flags);
}
class traits = regex_traits<charT>,
class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
class regex_iterator
+#ifndef BOOST_NO_STD_ITERATOR
+ : public std::iterator<
+ std::forward_iterator_tag,
+ match_results<BidirectionalIterator>,
+ typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
+ const match_results<BidirectionalIterator>*,
+ const match_results<BidirectionalIterator>& >
+#endif
{
private:
typedef regex_iterator_implementation<BidirectionalIterator, charT, traits, Allocator> impl;
const regex& e,
match_flag_type flags = match_default)
{
- match_results<std::string::const_iterator, regex::allocator_type> m;
+ match_results<std::string::const_iterator> 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,
+ wsmatch& m,
const wregex& e,
match_flag_type flags = match_default)
{
const wregex& e,
match_flag_type flags = match_default)
{
- match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type> m;
+ match_results<std::basic_string<wchar_t>::const_iterator> m;
return regex_match(s.begin(), s.end(), m, e, flags);
}
#endif
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);
+ return (flags & format_no_copy) ? out : std::copy(l, last, out);
}
template <class OutputIterator, class Iterator, class traits, class Allocator, class charT>
#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))
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
+ || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(55500))
//
// Borland C++ Builder 6, and Visual C++ 6,
// can't cope with the array template constructor
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
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){}
+ : end(last), pre(p), flags(f), subs(v){}
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
- || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
+ || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(55500))
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)
class traits = regex_traits<charT>,
class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
class regex_token_iterator
+#ifndef BOOST_NO_STD_ITERATOR
+ : public std::iterator<
+ std::forward_iterator_tag,
+ sub_match<BidirectionalIterator>,
+ typename re_detail::regex_iterator_traits<BidirectionalIterator>::difference_type,
+ const sub_match<BidirectionalIterator>*,
+ const sub_match<BidirectionalIterator>& >
+#endif
{
private:
typedef regex_token_iterator_implementation<BidirectionalIterator, charT, traits, Allocator> impl;
}
#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\
|| BOOST_WORKAROUND(BOOST_MSVC, < 1300) \
- || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
+ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \
+ || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(55500))
template <class T>
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
const T& submatches, match_flag_type m = match_default)
typedef typename re_detail::regex_iterator_traits<BidiIterator>::difference_type difference_type;
#endif
typedef BidiIterator iterator_type;
+ typedef BidiIterator iterator;
+ typedef BidiIterator const_iterator;
bool matched;
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/smart_ptr/scoped_array.htm
//
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/smart_ptr/scoped_ptr.htm
//
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
//
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001, 2002, 2003 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
//
// enable_shared_from_this support
-template<class T, class Y> void sp_enable_shared_from_this(boost::enable_shared_from_this<T> * pe, Y * px, shared_count const & pn)
+template<class T, class Y> void sp_enable_shared_from_this( shared_count const & pn, boost::enable_shared_from_this<T> const * pe, Y const * px )
{
- if(pe != 0) pe->_internal_weak_this._internal_assign(px, pn);
+ if(pe != 0) pe->_internal_weak_this._internal_assign(const_cast<Y*>(px), pn);
}
-inline void sp_enable_shared_from_this(void const volatile *, void const volatile *, shared_count const &)
+inline void sp_enable_shared_from_this( shared_count const & /*pn*/, ... )
{
}
template<class Y>
explicit shared_ptr(Y * p): px(p), pn(p, checked_deleter<Y>()) // Y must be complete
{
- detail::sp_enable_shared_from_this(p, p, pn);
+ detail::sp_enable_shared_from_this( pn, p, p );
}
//
template<class Y, class D> shared_ptr(Y * p, D d): px(p), pn(p, d)
{
- detail::sp_enable_shared_from_this(p, p, pn);
+ detail::sp_enable_shared_from_this( pn, p, p );
}
// generated copy constructor, assignment, destructor are fine...
{
Y * tmp = r.get();
pn = detail::shared_count(r);
- detail::sp_enable_shared_from_this(tmp, tmp, pn);
+ detail::sp_enable_shared_from_this( pn, tmp, tmp );
}
#endif
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
{ return obj == other.obj && data == other.data; }
bool operator<(const bound_object& other) const
{ return obj < other.obj; }
+
+ // To support intel 80 compiler, 2004/03/18 (Mark Rodgers)
+ bool operator!=(const bound_object& other) const
+ { return !(*this==other); }
+ bool operator>(const bound_object& other) const
+ { return !(*this < other); }
};
// Describes the connection between a signal and the objects that are
bool connected() const { return con.get() && con->signal_disconnect; }
// Comparison of connections
- inline bool operator==(const connection& other) const;
- inline bool operator<(const connection& other) const;
+ bool operator==(const connection& other) const;
+ bool operator<(const connection& other) const;
// Connection assignment
connection& operator=(const connection& other) ;
// Swap connections
- inline void swap(connection& other);
+ void swap(connection& other);
public: // TBD: CHANGE THIS
// Set whether this connection object is controlling or not
- void set_controlling() { controlling_connection = true; }
+ void set_controlling(bool control = true)
+ { controlling_connection = control; }
+
+ shared_ptr<BOOST_SIGNALS_NAMESPACE::detail::basic_connection>
+ get_connection() const
+ { return con; }
private:
friend class detail::signal_base_impl;
bool released;
};
- inline connection::connection(const connection& other) :
- con(other.con), controlling_connection(other.controlling_connection)
- {
- }
-
- inline connection::~connection()
- {
- if (controlling_connection) {
- disconnect();
- }
- }
-
- inline void
- connection::reset(BOOST_SIGNALS_NAMESPACE::detail::basic_connection* new_con)
- {
- con.reset(new_con);
- }
-
- inline bool connection::operator==(const connection& other) const
- {
- return con.get() == other.con.get();
- }
-
- 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 void connection::swap(connection& other)
- {
- this->con.swap(other.con);
- std::swap(this->controlling_connection, other.controlling_connection);
- }
-
- inline void swap(connection& c1, connection& c2)
- {
- c1.swap(c2);
- }
-
- inline scoped_connection::scoped_connection(const connection& other) :
- connection(other),
- released(false)
- {
- }
-
- inline
- scoped_connection::scoped_connection(const scoped_connection& other) :
- connection(other),
- released(other.released)
- {
- }
-
- inline scoped_connection::~scoped_connection()
- {
- if (!released) {
- this->disconnect();
- }
- }
-
- inline connection scoped_connection::release()
- {
- released = true;
- return *this;
- }
-
- inline void scoped_connection::swap(scoped_connection& other)
- {
- this->connection::swap(other);
- bool other_released = other.released;
- other.released = this->released;
- this->released = other_released;
- }
-
- inline void swap(scoped_connection& c1, scoped_connection& c2)
- {
- c1.swap(c2);
- }
-
- inline scoped_connection&
- scoped_connection::operator=(const connection& other)
- {
- scoped_connection(other).swap(*this);
- return *this;
- }
-
- inline scoped_connection&
- scoped_connection::operator=(const scoped_connection& other)
- {
- scoped_connection(other).swap(*this);
- return *this;
- }
-
namespace detail {
struct connection_slot_pair {
connection first;
// Determines if the underlying connection is disconnected
struct is_disconnected {
- typedef std::pair<const any, connection_slot_pair> argument_type;
+ typedef connection_slot_pair argument_type;
typedef bool result_type;
inline bool operator()(const argument_type& c) const
{
- return !c.second.first.connected();
+ return !c.first.connected();
}
};
* Copyright (c) 1998-2002
* Dr John Maddock
*
- * Copyright (c) 2003
- * Doug Gregor
+ * Copyright (c) 2003-2004
+ * Douglas 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.
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
*
*/
#ifndef BOOST_SIGNALS_CONFIG_HPP
#define BOOST_SIGNALS_CONFIG_HPP
+#include <boost/config.hpp>
+
#ifdef BOOST_HAS_DECLSPEC
# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_SIGNALS_DYN_LINK)
# ifdef BOOST_SIGNALS_SOURCE
#
# Boost.Signals library
-# Copyright Doug Gregor 2001-2003. Use, modification and
+# Copyright Douglas 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)
--- /dev/null
+// Boost.Signals library
+
+// Copyright Douglas Gregor 2001-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)
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_NAMED_SLOT_MAP_HPP
+#define BOOST_SIGNALS_NAMED_SLOT_MAP_HPP
+
+#include <boost/signals/detail/config.hpp>
+#include <boost/signals/detail/signals_common.hpp>
+#include <boost/signals/connection.hpp>
+#include <boost/smart_ptr.hpp>
+#include <boost/any.hpp>
+#include <boost/utility.hpp>
+#include <boost/function/function2.hpp>
+#include <boost/iterator/iterator_facade.hpp>
+#include <memory>
+#include <utility>
+
+namespace boost { namespace BOOST_SIGNALS_NAMESPACE {
+
+enum connect_position { at_back, at_front };
+
+namespace detail {
+
+typedef function2<bool, any, any> compare_type;
+
+// Used to delimit the front and back of the list for O(1) insertion.
+struct front_type {};
+struct back_type {};
+
+// This function object bridges from a pair of any objects that hold
+// values of type Key to the underlying function object that compares
+// values of type Key.
+template<typename Compare, typename Key>
+class any_bridge_compare {
+public:
+ typedef bool result_type;
+ typedef const any& first_argument_type;
+ typedef const any& second_argument_type;
+
+ any_bridge_compare(const Compare& c) : comp(c) {}
+
+ bool operator()(const any& k1, const any& k2) const
+ {
+ if (k1.type() == typeid(front_type))
+ return !(k2.type() == typeid(front_type));
+ if (k1.type() == typeid(back_type))
+ return false;
+ if (k2.type() == typeid(front_type))
+ return false;
+ if (k2.type() == typeid(back_type))
+ return true;
+
+ // Neither is empty, so compare their values to order them
+ // The strange */& is so that we will get a reference to the
+ // value stored in the any object instead of a copy
+ return comp(*any_cast<Key>(&k1), *any_cast<Key>(&k2));
+ }
+
+private:
+ Compare comp;
+};
+
+class BOOST_SIGNALS_DECL named_slot_map_iterator :
+ public iterator_facade<named_slot_map_iterator,
+ connection_slot_pair,
+ forward_traversal_tag>
+{
+ class impl;
+
+ typedef iterator_facade<named_slot_map_iterator,
+ connection_slot_pair,
+ forward_traversal_tag> inherited;
+public:
+ named_slot_map_iterator();
+ named_slot_map_iterator(const named_slot_map_iterator& other);
+ ~named_slot_map_iterator();
+ named_slot_map_iterator& operator=(const named_slot_map_iterator& other);
+
+ connection_slot_pair& dereference() const;
+ void increment();
+ bool equal(const named_slot_map_iterator& other) const;
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 0x1701)
+ void decrement();
+ void advance(difference_type);
+#endif
+
+private:
+ named_slot_map_iterator(std::auto_ptr<impl>);
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ shared_ptr<impl> impl_;
+#else
+ scoped_ptr<impl> impl_;
+#endif
+
+ friend class named_slot_map;
+};
+
+class BOOST_SIGNALS_DECL named_slot_map
+{
+public:
+ typedef named_slot_map_iterator iterator;
+
+ named_slot_map(const compare_type& compare);
+ ~named_slot_map();
+
+ void clear();
+ iterator begin();
+ iterator end();
+ iterator insert(const any& name, const connection& con, const any& slot,
+ connect_position at);
+ void disconnect(const any& name);
+ void erase(iterator pos);
+ void remove_disconnected_slots();
+
+private:
+ class impl;
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ shared_ptr<impl> impl_;
+#else
+ scoped_ptr<impl> impl_;
+#endif
+};
+
+} } }
+
+#endif // BOOST_SIGNALS_NAMED_SLOT_MAP_HPP
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
#include <boost/signals/detail/config.hpp>
#include <boost/signals/detail/signals_common.hpp>
+#include <boost/signals/detail/named_slot_map.hpp>
#include <boost/signals/connection.hpp>
#include <boost/signals/trackable.hpp>
+#include <boost/signals/slot.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/any.hpp>
#include <boost/utility.hpp>
#include <boost/function/function2.hpp>
-#include <map>
#include <utility>
#include <vector>
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
- // Forward declaration for the mapping from slot names to connections
- class named_slot_map;
-
- // This function object bridges from a pair of any objects that hold
- // values of type Key to the underlying function object that compares
- // values of type Key.
- template<typename Compare, typename Key>
- class any_bridge_compare {
- public:
- typedef bool result_type;
- typedef const any& first_argument_type;
- typedef const any& second_argument_type;
-
- any_bridge_compare(const Compare& c) : comp(c) {}
-
- bool operator()(const any& k1, const any& k2) const
- {
- // if k1 is empty, then it precedes nothing
- if (k1.empty())
- return false;
-
- // if k2 is empty, then k1 must precede it
- if (k2.empty())
- return true;
-
- // Neither is empty, so compare their values to order them
- // The strange */& is so that we will get a reference to the
- // value stored in the any object instead of a copy
- return comp(*any_cast<Key>(&k1), *any_cast<Key>(&k2));
- }
-
- private:
- Compare comp;
- };
-
// Must be constructed before calling the slots, because it safely
// manages call depth
class BOOST_SIGNALS_DECL call_notification {
friend class temporarily_set_clearing;
- signal_base_impl(const compare_type&);
+ signal_base_impl(const compare_type&, const any&);
~signal_base_impl();
// Disconnect all slots connected to this signal
connection connect_slot(const any& slot,
const any& name,
- const std::vector<const trackable*>&);
+ shared_ptr<slot_base::data_t> data,
+ connect_position at);
private:
// Remove all of the slots that have been marked "disconnected"
} flags;
// Slots
- typedef std::multimap<any, connection_slot_pair, compare_type>
- slot_container_type;
- typedef slot_container_type::iterator slot_iterator;
- typedef slot_container_type::value_type stored_slot_type;
- mutable slot_container_type slots_;
+ mutable named_slot_map slots_;
+ any combiner_;
+
+ // Types
+ typedef named_slot_map::iterator iterator;
};
class BOOST_SIGNALS_DECL signal_base : public noncopyable {
friend class call_notification;
- signal_base(const compare_type& comp);
+ signal_base(const compare_type& comp, const any& combiner);
~signal_base();
public:
protected:
connection connect_slot(const any& slot,
const any& name,
- const std::vector<const trackable*>& bound)
+ shared_ptr<slot_base::data_t> data,
+ connect_position at)
{
- return impl->connect_slot(slot, name, bound);
+ return impl->connect_slot(slot, name, data, at);
}
- typedef signal_base_impl::slot_iterator slot_iterator;
- typedef signal_base_impl::stored_slot_type stored_slot_type;
+ typedef named_slot_map::iterator iterator;
shared_ptr<signal_base_impl> impl;
};
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
# include <boost/last_value.hpp>
# include <boost/signals/detail/signal_base.hpp>
# include <boost/signals/detail/slot_call_iterator.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/type_traits/is_convertible.hpp>
# include <cassert>
# include <functional>
# include <memory>
-# include <string>
#endif // !BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
#ifdef BOOST_HAS_ABI_HEADERS
template<typename Pair>
R operator()(const Pair& slot) const
{
- F* target = const_cast<F*>(any_cast<F>(&slot.second.second));
+ F* target = const_cast<F*>(any_cast<F>(&slot.second));
return (*target)(BOOST_SIGNALS_BOUND_ARGS);
}
};
template<typename Pair>
unusable operator()(const Pair& slot) const
{
- F* target = const_cast<F*>(any_cast<F>(&slot.second.second));
+ F* target = const_cast<F*>(any_cast<F>(&slot.second));
(*target)(BOOST_SIGNALS_BOUND_ARGS);
return unusable();
}
typedef GroupCompare group_compare_type;
typedef BOOST_SIGNALS_NAMESPACE::detail::slot_call_iterator<
- call_bound_slot, slot_iterator> slot_call_iterator;
+ call_bound_slot, iterator> slot_call_iterator;
explicit
BOOST_SIGNALS_SIGNAL(const Combiner& c = Combiner(),
const GroupCompare& comp = GroupCompare()) :
- BOOST_SIGNALS_NAMESPACE::detail::signal_base(real_group_compare_type(comp)),
- combiner(c)
+ BOOST_SIGNALS_NAMESPACE::detail::signal_base(real_group_compare_type(comp),
+ c)
{
}
// Connect a slot to this signal
- BOOST_SIGNALS_NAMESPACE::connection connect(const slot_type&);
- BOOST_SIGNALS_NAMESPACE::connection connect(const group_type&, const slot_type&);
+ BOOST_SIGNALS_NAMESPACE::connection
+ connect(const slot_type&,
+ BOOST_SIGNALS_NAMESPACE::connect_position at
+ = BOOST_SIGNALS_NAMESPACE::at_back);
- // Disconnect a named slot
+
+ BOOST_SIGNALS_NAMESPACE::connection
+ connect(const group_type&, const slot_type&,
+ BOOST_SIGNALS_NAMESPACE::connect_position at
+ = BOOST_SIGNALS_NAMESPACE::at_back);
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 0x1700)
+ // MSVC 6.0 and 7.0 don't handle the is_convertible test well
void disconnect(const group_type& group)
{
impl->disconnect(group);
}
+#else
+ template<typename T>
+ void disconnect(const T& t)
+ {
+ typedef mpl::bool_<(is_convertible<T, group_type>::value)> is_group;
+ this->do_disconnect(t, is_group());
+ }
+
+ private:
+ // Disconnect a named slot
+ void do_disconnect(const group_type& group, mpl::bool_<true>)
+ {
+ impl->disconnect(group);
+ }
+
+ template<typename Function>
+ void do_disconnect(const Function& f, mpl::bool_<false>)
+ {
+ // Notify the slot handling code that we are iterating through the slots
+ BOOST_SIGNALS_NAMESPACE::detail::call_notification notification(this->impl);
+
+ for (iterator i = impl->slots_.begin(); i != impl->slots_.end(); ++i) {
+ slot_function_type& s = *any_cast<slot_function_type>(&i->second);
+ if (s == f) i->first.disconnect();
+ }
+ }
+#endif
+
+ public:
// Emit the signal
result_type operator()(BOOST_SIGNALS_PARMS);
result_type operator()(BOOST_SIGNALS_PARMS) const;
- private:
- Combiner combiner;
+ Combiner& combiner()
+ { return *any_cast<Combiner>(&impl->combiner_); }
+
+ const Combiner& combiner() const
+ { return *any_cast<const Combiner>(&impl->combiner_); }
};
template<
R, BOOST_SIGNALS_TEMPLATE_ARGS
BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction
- >::connect(const slot_type& in_slot)
+ >::connect(const slot_type& in_slot,
+ BOOST_SIGNALS_NAMESPACE::connect_position at)
{
// If the slot has been disconnected, just return a disconnected
// connection
return BOOST_SIGNALS_NAMESPACE::connection();
}
- return impl->connect_slot(in_slot.get_slot_function(),
- any(),
- in_slot.get_bound_objects());
+ return impl->connect_slot(in_slot.get_slot_function(), any(),
+ in_slot.get_data(), at);
}
template<
BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
Combiner, Group, GroupCompare, SlotFunction
>::connect(const group_type& group,
- const slot_type& in_slot)
+ const slot_type& in_slot,
+ BOOST_SIGNALS_NAMESPACE::connect_position at)
{
- return impl->connect_slot(in_slot.get_slot_function(),
- group,
- in_slot.get_bound_objects());
+ // If the slot has been disconnected, just return a disconnected
+ // connection
+ if (!in_slot.is_active()) {
+ return BOOST_SIGNALS_NAMESPACE::connection();
+ }
+
+ return impl->connect_slot(in_slot.get_slot_function(), group,
+ in_slot.get_data(), at);
}
template<
call_bound_slot f(&args);
// Let the combiner call the slots via a pair of input iterators
- return combiner(slot_call_iterator(notification.impl->slots_.begin(),
- impl->slots_.end(), f),
- 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<
call_bound_slot f(&args);
// Let the combiner call the slots via a pair of input iterators
- return combiner(slot_call_iterator(notification.impl->slots_.begin(),
- impl->slots_.end(), f),
- 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
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
#include <boost/signals/connection.hpp>
#include <boost/signals/trackable.hpp>
#include <boost/visit_each.hpp>
+#include <boost/shared_ptr.hpp>
#include <cassert>
#ifdef BOOST_HAS_ABI_HEADERS
// friends to make this private (as it otherwise should be). We can't
// name all of them because we don't know how many there are.
public:
+ struct data_t {
+ std::vector<const trackable*> bound_objects;
+ connection watch_bound_objects;
+ };
+ shared_ptr<data_t> get_data() const { return data; }
+
// Get the set of bound objects
std::vector<const trackable*>& get_bound_objects() const
- { return bound_objects; }
+ { return data->bound_objects; }
// Determine if this slot is still "active", i.e., all of the bound
// objects still exist
- bool is_active() const { return watch_bound_objects.connected(); }
+ bool is_active() const
+ { return data->watch_bound_objects.connected(); }
protected:
// Create a connection for this slot
void create_connection();
- mutable std::vector<const trackable*> bound_objects;
- connection watch_bound_objects;
+ shared_ptr<data_t> data;
private:
static void bound_object_destructed(void*, void*) {}
template<typename SlotFunction>
class slot : public BOOST_SIGNALS_NAMESPACE::detail::slot_base {
+ typedef BOOST_SIGNALS_NAMESPACE::detail::slot_base inherited;
+ typedef typename inherited::data_t data_t;
+
public:
template<typename F>
slot(const F& f) : slot_function(BOOST_SIGNALS_NAMESPACE::get_invocable_slot(f, BOOST_SIGNALS_NAMESPACE::tag_type(f)))
{
+ this->data.reset(new data_t);
+
// Visit each of the bound objects and store them for later use
// An exception thrown here will allow the basic_connection to be
// destroyed when this goes out of scope, and no other connections
// have been made.
- BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor do_bind(bound_objects);
- visit_each(do_bind, BOOST_SIGNALS_NAMESPACE::get_inspectable_slot(f, BOOST_SIGNALS_NAMESPACE::tag_type(f)));
-
+ BOOST_SIGNALS_NAMESPACE::detail::bound_objects_visitor
+ do_bind(this->data->bound_objects);
+ visit_each(do_bind,
+ BOOST_SIGNALS_NAMESPACE::get_inspectable_slot
+ (f, BOOST_SIGNALS_NAMESPACE::tag_type(f)));
create_connection();
}
template<typename F>
slot(F* f) : slot_function(f)
{
+ this->data.reset(new data_t);
create_connection();
}
#endif // __BORLANDC__
// Get the slot function to call the actual slot
const SlotFunction& get_slot_function() const { return slot_function; }
+ void release() const { data->watch_bound_objects.set_controlling(false); }
+
private:
slot(); // no default constructor
slot& operator=(const slot&); // no assignment operator
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
} // end namespace boost
#ifdef BOOST_HAS_ABI_HEADERS
-# include BOOST_ABI_PREFIX
+# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_SIGNALS_TRACKABLE_HPP
// 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Copyright (c) 2003 Peter Dimov Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/smart_ptr/smart_ptr.htm
//
#define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS
#endif
+#if defined(__GNUC__) && (__GNUC__ == 3) && ((__GNUC_MINOR__ == 3) || (__GNUC_MINOR__ == 4))
+// gcc 3.3 and 3.4 don't produce good error messages with the default version:
+# define BOOST_SA_GCC_WORKAROUND
+#endif
+
namespace boost{
// HP aCC cannot deal with missing names for template value parameters
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)
+#elif defined(BOOST_INTEL_CXX_VERSION) || defined(BOOST_SA_GCC_WORKAROUND)
// 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 ) \
// (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)
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/test for the library home page.
//
// File : $RCSfile: nullstream.hpp,v $
//
-// Version : $Revision: 1.7 $
+// Version : $Revision: 1.9 $
//
// Description : simulate /dev/null stream
// ***************************************************************************
-#ifndef BOOST_NULLSTREAM_HPP
-#define BOOST_NULLSTREAM_HPP
+#ifndef BOOST_NULLSTREAM_HPP_071894GER
+#define BOOST_NULLSTREAM_HPP_071894GER
#include <ostream> // for std::basic_ostream
#include <streambuf> // for std::basic_streambuf
// Revision History :
//
// $Log: nullstream.hpp,v $
+// Revision 1.9 2004/07/19 12:21:08 rogeeff
+// guard rename
+//
+// Revision 1.8 2004/05/21 06:19:35 rogeeff
+// licence update
+//
// Revision 1.7 2003/12/01 00:41:56 rogeeff
// prerelease cleaning
//
-
// ***************************************************************************
-#endif // BOOST_NULLSTREAM_HPP
+#endif // BOOST_NULLSTREAM_HPP_071894GER
//
// Copyright (c) 2002 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.
-// This software is provided "as is" without express or implied
-// warranty, and with no claim as to its suitability for any purpose.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// http://www.boost.org/libs/utility/throw_exception.html
//
#else
-template<class E> void throw_exception(E const & e)
+template<class E> inline void throw_exception(E const & e)
{
throw e;
}
// boost timer.hpp header file ---------------------------------------------//
-// Copyright Beman Dawes 1994-99.
-// See accompanying license for terms and conditions of use.
+// Copyright Beman Dawes 1994-99. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/timer for documentation.
// Portability warning: elapsed_max() may return too high a value on systems
// where std::clock_t overflows or resets at surprising values.
{
- return (double(std::numeric_limits<std::clock_t>::max())
+ return (double((std::numeric_limits<std::clock_t>::max)())
- double(_start_time)) / double(CLOCKS_PER_SEC);
}
// Copyright John R. Bandela 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/tokenizer for documentation.
// Revision History:
-
+// 01 Oct 2004 Joaquín M López Muñoz
+// Workaround for a problem with string::assign in msvc-stlport
+// 06 Apr 2004 John Bandela
+// Fixed a bug involving using char_delimiter with a true input iterator
+// 28 Nov 2003 Robert Zeh and John Bandela
+// Converted into "fast" functions that avoid using += when
+// the supplied iterator isn't an input_iterator; based on
+// some work done at Archelon and a version that was checked into
+// the boost CVS for a short period of time.
// 20 Feb 2002 John Maddock
// Removed using namespace std declarations and added
// workaround for BOOST_NO_STDC_NAMESPACE (the library
// Removed tabs and a little cleanup.
-#ifndef BOOST_TOKEN_FUNCTIONS_JRB051801_HPP_
-#define BOOST_TOKEN_FUNCTIONS_JRB051801_HPP_
+#ifndef BOOST_TOKEN_FUNCTIONS_JRB120303_HPP_
+#define BOOST_TOKEN_FUNCTIONS_JRB120303_HPP_
#include <vector>
#include <stdexcept>
#include <string>
#include <cctype>
#include <algorithm> // for find_if
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+#include <boost/mpl/if.hpp>
//
// the following must not be macros if we are to prefix them
}
};
+ //===========================================================================
+ // The classes here are used by offset_separator and char_separator to implement
+ // faster assigning of tokens using assign instead of +=
+
+ namespace tokenizer_detail {
+
+ // The assign_or_plus_equal struct contains functions that implement
+ // assign, +=, and clearing based on the iterator type. The
+ // generic case does nothing for plus_equal and clearing, while
+ // passing through the call for assign.
+ //
+ // When an input iterator is being used, the situation is reversed.
+ // The assign method does nothing, plus_equal invokes operator +=,
+ // and the clearing method sets the supplied token to the default
+ // token constructor's result.
+ //
+
+ template<class IteratorTag>
+ struct assign_or_plus_equal {
+ template<class Iterator, class Token>
+ static void assign(Iterator b, Iterator e, Token &t) {
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200) &&\
+ BOOST_WORKAROUND(__SGI_STL_PORT, < 0x500) &&\
+ defined(_STLP_DEBUG) &&\
+ (defined(_STLP_USE_DYNAMIC_LIB) || defined(_DLL))
+ // Problem with string::assign for msvc-stlport in debug mode: the
+ // linker tries to import the templatized version of this memfun,
+ // which is obviously not exported.
+ // See http://www.stlport.com/dcforum/DCForumID6/1763.html for details.
+
+ t = Token();
+ while(b != e) t += *b++;
+#else
+ t.assign(b, e);
+#endif
+
+ }
+
+ template<class Token, class Value>
+ static void plus_equal(Token &, const Value &) {
+
+ }
+
+ // If we are doing an assign, there is no need for the
+ // the clear.
+ //
+ template<class Token>
+ static void clear(Token &) {
+
+ }
+ };
+
+ template <>
+ struct assign_or_plus_equal<std::input_iterator_tag> {
+ template<class Iterator, class Token>
+ static void assign(Iterator b, Iterator e, Token &t) {
+
+ }
+ template<class Token, class Value>
+ static void plus_equal(Token &t, const Value &v) {
+ t += v;
+ }
+ template<class Token>
+ static void clear(Token &t) {
+ t = Token();
+ }
+ };
+
+
+ template<class Iterator>
+ struct pointer_iterator_category{
+ typedef std::random_access_iterator_tag type;
+ };
+
+
+ template<class Iterator>
+ struct class_iterator_category{
+ typedef typename Iterator::iterator_category type;
+ };
+
+
+
+ // This portably gets the iterator_tag without partial template specialization
+ template<class Iterator>
+ struct get_iterator_category{
+ typedef typename mpl::if_<is_pointer<Iterator>,
+ pointer_iterator_category<Iterator>,
+ class_iterator_category<Iterator>
+ >::type cat;
+
+ typedef typename cat::type iterator_category;
+ };
+
+
+}
+
//===========================================================================
// The offset_separator class, which is a model of TokenizerFunction.
template <typename InputIterator, typename Token>
bool operator()(InputIterator& next, InputIterator end, Token& tok)
{
+ typedef tokenizer_detail::assign_or_plus_equal<
+#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
+ typename
+#endif
+ tokenizer_detail::get_iterator_category<
+ InputIterator>::iterator_category> assigner;
+
+
assert(!offsets_.empty());
- tok = Token();
+ assigner::clear(tok);
+ InputIterator start(next);
if (next == end)
return false;
int i = 0;
for (; i < c; ++i) {
if (next == end)break;
- tok+=*next++;
+ assigner::plus_equal(tok,*next++);
}
+ assigner::assign(start,next,tok);
if (!return_partial_last_)
if (i < (c-1) )
template <typename InputIterator, typename Token>
bool operator()(InputIterator& next, InputIterator end, Token& tok)
{
- tok = Token();
+ typedef tokenizer_detail::assign_or_plus_equal<
+#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
+ typename
+#endif
+ tokenizer_detail::get_iterator_category<
+ InputIterator>::iterator_category> assigner;
+
+ assigner::clear(tok);
// skip past all dropped_delims
if (m_empty_tokens == drop_empty_tokens)
for (; next != end && is_dropped(*next); ++next)
{ }
+ InputIterator start(next);
+
if (m_empty_tokens == drop_empty_tokens) {
if (next == end)
return false;
+
// if we are on a kept_delims move past it and stop
if (is_kept(*next)) {
- tok += *next;
+ assigner::plus_equal(tok,*next);
++next;
} else
// append all the non delim characters
for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next)
- tok += *next;
+ assigner::plus_equal(tok,*next);
}
else { // m_empty_tokens == keep_empty_tokens
if (next == end)
if (m_output_done == false) {
m_output_done = true;
+ assigner::assign(start,next,tok);
return true;
} else
return false;
-
+
if (is_kept(*next)) {
if (m_output_done == false)
m_output_done = true;
else {
- tok += *next;
+ assigner::plus_equal(tok,*next);
++next;
m_output_done = false;
}
}
else {
if (is_dropped(*next))
- ++next;
+ start=++next;
for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next)
- tok += *next;
+ assigner::plus_equal(tok,*next);
m_output_done = true;
}
}
+ assigner::assign(start,next,tok);
return true;
}
// Boost token_iterator.hpp -------------------------------------------------//
// Copyright John R. Bandela 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/tokenizer for documentation.
// © Copyright Jeremy Siek and John R. Bandela 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/tokenizer for documenation
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org
// Fixed return types for get_head/get_tail
// ( and other bugs ) per suggestion of Jens Maurer
// simplified element type accessors + bug fix (Jeremy Siek)
-// Several changes/additions according to suggestions by Doug Gregor,
+// Several changes/additions according to suggestions by Douglas Gregor,
// William Kempf, Vesa Karvonen, John Max Skaller, Ed Brey, Beman Dawes,
// David Abrahams.
#include "boost/type_traits/cv_traits.hpp"
#include "boost/type_traits/function_traits.hpp"
+#include "boost/detail/workaround.hpp" // needed for BOOST_WORKAROUND
+
namespace boost {
namespace tuples {
template<class RET, class HT, class TT >
inline static RET get(const cons<HT, TT>& t)
{
+#if BOOST_WORKAROUND(__IBMCPP__,==600)
+ // vacpp 6.0 is not very consistent regarding the member template keyword
+ // Here it generates an error when the template keyword is used.
+ return get_class<N-1>::get<RET>(t.tail);
+#else
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
+#endif
}
template<class RET, class HT, class TT >
inline static RET get(cons<HT, TT>& t)
{
+#if BOOST_WORKAROUND(__IBMCPP__,==600)
+ return get_class<N-1>::get<RET>(t.tail);
+#else
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
+#endif
}
};
// Nth element ot T, first element is at index 0
// -------------------------------------------------------
+#ifndef BOOST_NO_CV_SPECIALIZATIONS
+
template<int N, class T>
struct element
{
typedef typename T::tail_type Next;
typedef typename element<N-1, Next>::type unqualified_type;
public:
+#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
+ typedef const unqualified_type type;
+#else
typedef typename boost::add_const<unqualified_type>::type type;
+#endif
+
};
template<class T>
struct element<0,const T>
{
+#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
+ typedef const typename T::head_type type;
+#else
typedef typename boost::add_const<typename T::head_type>::type type;
+#endif
+};
+
+#else // def BOOST_NO_CV_SPECIALIZATIONS
+
+namespace detail {
+
+template<int N, class T, bool IsConst>
+struct element_impl
+{
+private:
+ typedef typename T::tail_type Next;
+public:
+ typedef typename element_impl<N-1, Next, IsConst>::type type;
+};
+
+template<int N, class T>
+struct element_impl<N, T, true /* IsConst */>
+{
+private:
+ typedef typename T::tail_type Next;
+public:
+ typedef const typename element_impl<N-1, Next, true>::type type;
+};
+
+template<class T>
+struct element_impl<0, T, false /* IsConst */>
+{
+ typedef typename T::head_type type;
+};
+
+template<class T>
+struct element_impl<0, T, true /* IsConst */>
+{
+ typedef const typename T::head_type type;
};
+} // end of namespace detail
+
+
+template<int N, class T>
+struct element:
+ public detail::element_impl<N, T, ::boost::is_const<T>::value>
+{
+};
+
+#endif
+
+
// -get function templates -----------------------------------------------
// Usage: get<N>(aTuple)
typename element<N, cons<HT, TT> >::type
>::non_const_type
get(cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
+#if BOOST_WORKAROUND(__IBMCPP__,==600 )
+ return detail::get_class<N>::
+#else
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
+#endif
get<
typename access_traits<
typename element<N, cons<HT, TT> >::type
- >::non_const_type>(c);
+ >::non_const_type,
+ HT,TT
+ >(c);
}
// get function for const cons-lists, returns a const reference to
typename element<N, cons<HT, TT> >::type
>::const_type
get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
+#if BOOST_WORKAROUND(__IBMCPP__,==600)
+ return detail::get_class<N>::
+#else
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
+#endif
get<
typename access_traits<
typename element<N, cons<HT, TT> >::type
- >::const_type>(c);
+ >::const_type,
+ HT,TT
+ >(c);
}
// -- the cons template --------------------------------------------------
// - tuple_basic_no_partial_spec.hpp -----------------------------------------
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
-// Copyright (C) 2001 Doug Gregor (gregod@rpi.edu)
+// Copyright (C) 2001 Douglas Gregor (gregod@rpi.edu)
// 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.
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org or http://lambda.cs.utu.fi
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org
// Copyright (C) 2001 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
// 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.
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// For more information, see http://www.boost.org
//
// Copyright (C) 2001 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
// 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.
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org
// ----------------------------------------------------------------------------
-// (C) Copyright David Abrahams 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 David Abrahams 2001.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TYPE_DWA20010120_HPP
# define BOOST_TYPE_DWA20010120_HPP
#include "boost/type_traits/has_trivial_constructor.hpp"
#include "boost/type_traits/has_trivial_copy.hpp"
#include "boost/type_traits/has_trivial_destructor.hpp"
+#include "boost/type_traits/is_abstract.hpp"
#include "boost/type_traits/is_arithmetic.hpp"
#include "boost/type_traits/is_array.hpp"
#include "boost/type_traits/is_base_and_derived.hpp"
-// Copyright (c) 2001-2003 Aleksey Gurtovoy.
+// Copyright 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).
# define BOOST_TT_DECL /**/
#endif
-# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || (defined(BOOST_MSVC) && (BOOST_MSVC > 1301)) || defined(__EDG_VERSION__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(BOOST_NO_COMPILER_CONFIG)
+# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || (defined(BOOST_MSVC) && (BOOST_MSVC > 1301)) || defined(__EDG_VERSION__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__DMC__) || defined(BOOST_NO_COMPILER_CONFIG)
# define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
#endif
-// 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)
+// Copyright 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright 2000 Jeremy Siek (jsiek@lsc.nd.edu)
+// Copyright 1999, 2000 Jaakko J\84rvi (jaakko.jarvi@cs.utu.fi)
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/bool_trait_def.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// Aleksey Gurtovoy
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// 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).
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/type_traits/detail/bool_trait_def.hpp,v $
+// $Date: 2004/09/02 15:41:27 $
+// $Revision: 1.16 $
-#include "boost/type_traits/detail/template_arity_spec.hpp"
-#include "boost/mpl/bool.hpp"
-#include "boost/mpl/aux_/lambda_support.hpp"
-#include "boost/config.hpp"
+#include <boost/type_traits/detail/template_arity_spec.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
+#include <boost/config.hpp>
#if defined(__SUNPRO_CC)
# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- typedef mpl::bool_< C > type; \
+ typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::bool_< C > type; \
enum { value = type::value }; \
/**/
# define BOOST_TT_AUX_BOOL_C_BASE(C)
#elif defined(BOOST_MSVC) && BOOST_MSVC <= 1200
# define BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
- typedef mpl::bool_< C > base_; \
+ typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::bool_< C > base_; \
using base_::value; \
/**/
#endif
#ifndef BOOST_TT_AUX_BOOL_C_BASE
-# define BOOST_TT_AUX_BOOL_C_BASE(C) : mpl::bool_< C >
+# define BOOST_TT_AUX_BOOL_C_BASE(C) : BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::bool_< C >
#endif
template <class T, T val>
struct integral_constant
-: public mpl::integral_c<T,val> {};
+: public BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::integral_c<T,val> {};
template<> struct integral_constant< bool, true > \
};
namespace pending {
-typedef mpl::true_ true_type;
-typedef mpl::false_ false_type;
+typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::true_ true_type;
+typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::false_ false_type;
}
}
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/bool_trait_undef.hpp header file
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// 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).
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/type_traits/detail/bool_trait_undef.hpp,v $
+// $Date: 2004/09/02 15:41:27 $
+// $Revision: 1.6 $
#undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL
#undef BOOST_TT_AUX_BOOL_C_BASE
-// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
-// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
+// Copyright 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
struct is_mem_fun_pointer_impl<R (T::*)(BOOST_PP_ENUM_PARAMS(i,T)) > { BOOST_STATIC_CONSTANT(bool, value = true); };
// Metrowerks and Visual Age think this creates ambiguities
-//: #if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600))
+/// #if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600))
template <class R, class T BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T)>
struct is_mem_fun_pointer_impl<R (T::*)(BOOST_PP_ENUM_PARAMS(i,T)) const > { BOOST_STATIC_CONSTANT(bool, value = true); };
template <class R, class T BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T)>
struct is_mem_fun_pointer_impl<R (T::*)(BOOST_PP_ENUM_PARAMS(i,T)) const volatile > { BOOST_STATIC_CONSTANT(bool, value = true); };
-//: #endif
+/// #endif
#undef i
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/size_t_trait_def.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// Aleksey Gurtovoy
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// 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).
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/type_traits/detail/size_t_trait_def.hpp,v $
+// $Date: 2004/09/02 15:41:27 $
+// $Revision: 1.7 $
-#include "boost/type_traits/detail/template_arity_spec.hpp"
-#include "boost/mpl/size_t.hpp"
-#include "boost/mpl/aux_/lambda_support.hpp"
+#include <boost/type_traits/detail/template_arity_spec.hpp>
+#include <boost/mpl/size_t.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
#include <cstddef>
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/size_t_trait_undef.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// Aleksey Gurtovoy
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// 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).
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/type_traits/detail/size_t_trait_undef.hpp,v $
+// $Date: 2004/09/02 15:41:27 $
+// $Revision: 1.4 $
#undef BOOST_TT_AUX_SIZE_T_TRAIT_DEF1
#undef BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/template_arity_spec.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// 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).
-// no include guards, the header is intended for multiple inclusion!
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-#include "boost/mpl/aux_/template_arity_fwd.hpp"
-#include "boost/mpl/aux_/preprocessor/params.hpp"
-#include "boost/mpl/aux_/lambda_support.hpp"
-#include "boost/mpl/aux_/config/overload_resolution.hpp"
-#include "boost/config.hpp"
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/aux_/template_arity_fwd.hpp>
+#include <boost/mpl/aux_/preprocessor/params.hpp>
+#include <boost/mpl/aux_/config/lambda.hpp>
+#include <boost/mpl/aux_/config/overload_resolution.hpp>
-#if defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) && \
- defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION)
+#if defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) \
+ && defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION)
# define BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(i, name) \
namespace mpl { namespace aux { \
template< BOOST_MPL_PP_PARAMS(i, typename T) > \
struct template_arity< \
- name< BOOST_MPL_PP_PARAMS(i, T) > \
- > \
+ name< BOOST_MPL_PP_PARAMS(i, T) > \
+ > \
+ : int_<i> \
{ \
- BOOST_STATIC_CONSTANT(int, value = i ); \
}; \
}} \
/**/
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/type_trait_def.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// Aleksey Gurtovoy
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// 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).
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/type_traits/detail/type_trait_def.hpp,v $
+// $Date: 2004/09/02 15:41:27 $
+// $Revision: 1.7 $
-#include "boost/type_traits/detail/template_arity_spec.hpp"
-#include "boost/mpl/aux_/lambda_support.hpp"
+#include <boost/type_traits/detail/template_arity_spec.hpp>
+#include <boost/mpl/aux_/lambda_support.hpp>
#define BOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \
template< typename T > struct trait \
-//-----------------------------------------------------------------------------
-// boost/type_traits/detail/type_trait_undef.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2002
-// Aleksey Gurtovoy
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2002-2004
//
-// 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).
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
-// no include guards, the header is intended for multiple inclusion!
+// $Source: /cvsroot/boost/boost/boost/type_traits/detail/type_trait_undef.hpp,v $
+// $Date: 2004/09/02 15:41:27 $
+// $Revision: 1.6 $
#undef BOOST_TT_AUX_TYPE_TRAIT_DEF1
#undef BOOST_TT_AUX_TYPE_TRAIT_SPEC1
-// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright 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).
--- /dev/null
+#ifndef BOOST_TT_IS_ABSTRACT_CLASS_HPP
+#define BOOST_TT_IS_ABSTRACT_CLASS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
+// is_abstract_class.hpp:
+//
+// (C) Copyright 2002 Rani Sharoni (rani_sharoni@hotmail.com) and Robert Ramey
+// 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 for updates, documentation, and revision history.
+//
+
+// Compile type discovery whether given type is abstract class or not.
+//
+// Requires DR 337 to be supported by compiler
+// (http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#337).
+//
+//
+// Believed (Jan 2004) to work on:
+// - GCC 3.4
+// - VC++ 7.1
+// - compilers with new EDG frontend (Intel C++ 7, Comeau 4.3.2)
+//
+// Doesn't work on:
+// - VC++6, VC++7.0 and less
+// - GCC 3.3.X and less
+// - Borland C++ 6 and less
+//
+//
+// History:
+// - Originally written by Rani Sharoni, see
+// http://groups.google.com/groups?selm=df893da6.0207110613.75b2fe90%40posting.google.com
+// At this time supported by EDG (Intel C++ 7, Comeau 4.3.2) and VC7.1.
+// - Adapted and added into Boost.Serialization library by Robert Ramey
+// (starting with submission #10).
+// - Jan 2004: GCC 3.4 fixed to suport DR337 (Giovanni Bajo).
+// - Jan 2004: modified to be part of Boost.TypeTraits (Pavel Vozenilek).
+//
+
+#include <boost/type_traits/detail/yes_no_type.hpp>
+#include <boost/type_traits/is_class.hpp>
+#include "boost/type_traits/detail/ice_and.hpp"
+// should be the last #include
+#include "boost/type_traits/detail/bool_trait_def.hpp"
+
+
+namespace boost {
+namespace detail{
+
+template<class T>
+struct is_abstract_imp
+{
+ // Deduction fails if T is void, function type,
+ // reference type (14.8.2/2)or an abstract class type
+ // according to review status issue #337
+ //
+ template<class U>
+ static type_traits::no_type check_sig(U (*)[1]);
+ template<class U>
+ static type_traits::yes_type check_sig(...);
+
+ // GCC2 won't even parse this template if we embed the computation
+ // of s1 in the computation of value.
+#ifdef __GNUC__
+ BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(is_abstract_imp<T>::template check_sig<T>(0)));
+#else
+ BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig<T>(0)));
+#endif
+
+ BOOST_STATIC_CONSTANT(bool, value =
+ (::boost::type_traits::ice_and<
+ ::boost::is_class<T>::value,
+ (s1 == sizeof(type_traits::yes_type))
+ >::value));
+};
+
+}
+
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_abstract,T,::boost::detail::is_abstract_imp<T>::value)
+
+} // namespace boost
+
+#include "boost/type_traits/detail/bool_trait_undef.hpp"
+
+#endif //BOOST_TT_IS_ABSTRACT_CLASS_HPP
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))
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
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)
#if !BOOST_WORKAROUND(__BORLANDC__, <= 0x570) \
&& !BOOST_WORKAROUND(__SUNPRO_CC , BOOST_TESTED_AT(0x540)) \
- && !BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \
+ && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
+
// The EDG version number is a lower estimate.
// It is not currently known which EDG version
// exactly fixes the problem.
A user-defined conversion sequence consists of an SC, followed by an UDC,
followed by another SC. Either SC may be the identity conversion.
-When passing the default-constructed Host object to the overloaded check()
+When passing the default-constructed Host object to the overloaded check_sig()
functions (initialization 8.5/14/4/3), we have several viable implicit
conversion sequences:
-For "static no_type check(B const volatile *, int)" we have the conversion
+For "static no_type check_sig(B const volatile *, int)" we have the conversion
sequences:
C -> C const (SC - Qualification Adjustment) -> B const volatile* (UDC)
C -> D const volatile* (UDC) -> B1 const volatile* / B2 const volatile* ->
B const volatile* (SC - Conversion)
-For "static yes_type check(D const volatile *, T)" we have the conversion
+For "static yes_type check_sig(D const volatile *, T)" we have the conversion
sequence:
C -> D const volatile* (UDC)
If D is not derived from B, it has to choose between C -> C const -> B const
volatile* for the first function, and C -> D const volatile* for the second
function, which are just as good (both requires a UDC, 13.3.3.2), had it not
-been for the fact that "static no_type check(B const volatile *, int)" is
+been for the fact that "static no_type check_sig(B const volatile *, int)" is
not templated, which makes C -> C const -> B const volatile* the best choice
(13.3.3/1/4), resulting in "no".
Also, if Host::operator B const volatile* hadn't been const, the two
-conversion sequences for "static no_type check(B const volatile *, int)", in
+conversion sequences for "static no_type check_sig(B const volatile *, int)", in
the case where D is derived from B, would have been ambiguous.
See also
struct bd_helper
{
template <typename T>
- static type_traits::yes_type check(D const volatile *, T);
- static type_traits::no_type check(B const volatile *, int);
+ static type_traits::yes_type check_sig(D const volatile *, T);
+ static type_traits::no_type check_sig(B const volatile *, int);
};
template<typename B, typename D>
};
BOOST_STATIC_CONSTANT(bool, value =
- sizeof(bd_helper<B,D>::check(Host(), 0)) == sizeof(type_traits::yes_type));
+ sizeof(bd_helper<B,D>::check_sig(Host(), 0)) == sizeof(type_traits::yes_type));
};
#else
-// 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)
+// Copyright 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright 2000 Jeremy Siek (jsiek@lsc.nd.edu)
+// Copyright 1999, 2000 Jaakko J\84rvi (jaakko.jarvi@cs.utu.fi)
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
);
};
+#elif defined(__DMC__)
+
+struct any_conversion
+{
+ template <typename T> any_conversion(const volatile T&);
+ // we need this constructor to catch references to functions
+ // (which can not be cv-qualified):
+ template <typename T> any_conversion(T&);
+};
+
+template <typename From, typename To>
+struct is_convertible_basic_impl
+{
+ // Using '...' doesn't always work on Digital Mars. This version seems to.
+ template <class T>
+ static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(any_conversion, float, T);
+ static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To, int, int);
+ static From _m_from;
+
+ // Static constants sometime cause the conversion of _m_from to To to be
+ // called. This doesn't happen with an enum.
+ enum { value =
+ sizeof( _m_check(_m_from, 0, 0) ) == sizeof(::boost::type_traits::yes_type)
+ };
+};
+
#else
//
#endif // is_convertible_impl
-#if !defined(__BORLANDC__) || __BORLANDC__ > 0x551
+#if defined(__DMC__)
+// As before, a static constant sometimes causes errors on Digital Mars.
+template <typename From, typename To>
+struct is_convertible_impl
+{
+ typedef typename add_reference<From>::type ref_type;
+ enum { value =
+ ::boost::type_traits::ice_and<
+ ::boost::detail::is_convertible_basic_impl<ref_type, To>::value,
+ ::boost::type_traits::ice_not<
+ ::boost::is_array<To>::value
+ >::value,
+ >::value };
+};
+#elif !defined(__BORLANDC__) || __BORLANDC__ > 0x551
template <typename From, typename To>
struct is_convertible_impl
{
TT_AUX_IS_CONVERTIBLE_SPEC_2(F,short) \
TT_AUX_IS_CONVERTIBLE_SPEC_2(F,int) \
TT_AUX_IS_CONVERTIBLE_SPEC_2(F,long) \
- TT_AUX_IS_CONVERTIBLE_SPEC_2(F,long long) \
+ TT_AUX_IS_CONVERTIBLE_SPEC(F,::boost::long_long_type) \
+ TT_AUX_IS_CONVERTIBLE_SPEC(F,::boost::ulong_long_type) \
/**/
# define TT_AUX_IS_CONVERTIBLE_FROM_FLOAT_CV_SPEC(F) \
-// Copyright (C) 2000 John Maddock (john@johnmaddock.co.uk)
-// Copyright (C) 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
+// Copyright 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright 2002 Aleksey Gurtovoy (agurtovoy@meta-comm.com)
//
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char,true)
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+// If the following line fails to compile and you're using the Intel
+// compiler, see http://lists.boost.org/MailArchives/boost-users/msg06567.php,
+// and define BOOST_NO_INTRINSIC_WCHAR_T on the command line.
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,wchar_t,true)
#endif
#endif
# if defined(BOOST_HAS_LONG_LONG)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned long long,true)
-BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,long long,true)
+BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::ulong_long_type,true)
+BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true)
#elif defined(BOOST_HAS_MS_INT64)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true)
// 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*);
+ virtual void unique_name_to_boost5487629(unique*);
# endif
char padding[256];
};
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))
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840))
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)
-// Copyright (c) 2001 Aleksey Gurtovoy.
+// Copyright 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).
#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 \
+ char, short, int, long, ::boost::long_long_type, float, double, long double \
, void*, function_ptr, member_ptr, member_function_ptr))
#else
#define BOOST_TT_ALIGNMENT_BASE_TYPES BOOST_PP_TUPLE_TO_LIST( \
, 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_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, \
#undef BOOST_TT_CHOOSE_MIN_ALIGNMENT
#undef BOOST_TT_CHOOSE_T
-template<int TAlign, int Align>
+template<std::size_t TAlign, std::size_t Align>
struct is_aligned
{
BOOST_STATIC_CONSTANT(bool,
// This alignment method originally due to Brian Parker, implemented by David
// Abrahams, and then ported here by Doug Gregor.
-template <int Align>
+template <std::size_t Align>
class type_with_alignment
{
typedef detail::lower_alignment<Align> t1;
// Boost utility.hpp header file -------------------------------------------//
-// Copyright 1999-2003 Boost.org. Use, modification, and distribution are
+// Copyright 1999-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 a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
#include <boost/utility/addressof.hpp>
#include <boost/utility/base_from_member.hpp>
+#include <boost/utility/enable_if.hpp>
#include <boost/checked_delete.hpp>
#include <boost/next_prior.hpp>
#include <boost/noncopyable.hpp>
// Copyright (C) 2002 Brad King (brad.king@kitware.com)
-// Doug Gregor (gregod@cs.rpi.edu)
+// Douglas Gregor (gregod@cs.rpi.edu)
// Peter Dimov
//
-// 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
// For more information, see http://www.boost.org
// boost utility/base_from_member.hpp header file --------------------------//
-// 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>.)
+// Copyright 2001, 2003, 2004 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/utility/> for the library's home page.
#ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
#define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
-#include <boost/utility_fwd.hpp> // required for parameter defaults
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+
+
+// Base-from-member arity configuration macro ------------------------------//
+
+// The following macro determines how many arguments will be in the largest
+// constructor template of base_from_member. Constructor templates will be
+// generated from one argument to this maximum. Code from other files can read
+// this number if they need to always match the exact maximum base_from_member
+// uses. The maximum constructor length can be changed by overriding the
+// #defined constant. Make sure to apply the override, if any, for all source
+// files during project compiling for consistency.
+
+// Contributed by Jonathan Turkanis
+
+#ifndef BOOST_BASE_FROM_MEMBER_MAX_ARITY
+#define BOOST_BASE_FROM_MEMBER_MAX_ARITY 10
+#endif
+
+
+// An iteration of a constructor template for base_from_member -------------//
+
+// A macro that should expand to:
+// template < typename T1, ..., typename Tn >
+// base_from_member( T1 x1, ..., Tn xn )
+// : member( x1, ..., xn )
+// {}
+// This macro should only persist within this file.
+
+#define BOOST_PRIVATE_CTR_DEF( z, n, data ) \
+ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \
+ explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \
+ : member( BOOST_PP_ENUM_PARAMS(n, x) ) \
+ {} \
+ /**/
namespace boost
// Contributed by Daryle Walker
-template < typename MemberType, int UniqueID >
+template < typename MemberType, int UniqueID = 0 >
class base_from_member
{
protected:
: member()
{}
- template< typename T1 >
- explicit base_from_member( T1 x1 )
- : member( x1 )
- {}
-
- template< typename T1, typename T2 >
- base_from_member( T1 x1, T2 x2 )
- : member( x1, x2 )
- {}
-
- template< typename T1, typename T2, typename T3 >
- base_from_member( T1 x1, T2 x2, T3 x3 )
- : 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_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY),
+ BOOST_PRIVATE_CTR_DEF, _ )
}; // boost::base_from_member
} // namespace boost
+// Undo any private macros
+#undef BOOST_PRIVATE_CTR_DEF
+
+
#endif // BOOST_UTILITY_BASE_FROM_MEMBER_HPP
+++ /dev/null
-// Boost utility_fwd.hpp header file ---------------------------------------//
-
-// 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 the library's home page.
-
-#ifndef BOOST_UTILITY_FWD_HPP
-#define BOOST_UTILITY_FWD_HPP
-
-
-namespace boost
-{
-
-
-// From <boost/utility/base_from_member.hpp> -------------------------------//
-
-template < typename MemberType, int UniqueID = 0 >
- class base_from_member;
-
-
-// From <boost/noncopyable.hpp> --------------------------------------------//
-
-class noncopyable;
-
-// Also has a few function templates
-
-
-} // namespace boost
-
-
-#endif // BOOST_UTILITY_FWD_HPP
// Boost version.hpp configuration header file ------------------------------//
-// (C) Copyright Boost.org 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.
+// (C) Copyright John maddock 1999. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for documentation
// BOOST_VERSION / 100 % 1000 is the minor version
// BOOST_VERSION / 100000 is the major version
-#define BOOST_VERSION 103100
+#define BOOST_VERSION 103200
//
// BOOST_LIB_VERSION must be defined to be the same as BOOST_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"
+#define BOOST_LIB_VERSION "1_32"
#endif
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas 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)
//
// Copyright (c) 2001, 2002, 2003 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.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/weak_ptr.htm for documentation.
//
#define BOOST_FILESYSTEM_SOURCE
#include <boost/filesystem/convenience.hpp>
+#include <boost/filesystem/exception.hpp>
+#include <boost/throw_exception.hpp>
#include <boost/config/abi_prefix.hpp> // must be the last header
// create_directories (contributed by Vladimir Prus) -----------------------//
- BOOST_FILESYSTEM_DECL void create_directories(const path& ph)
+ BOOST_FILESYSTEM_DECL bool create_directories(const path& ph)
{
- if (ph.empty() || exists(ph)) return;
+ if (ph.empty() || exists(ph))
+ {
+ if ( !ph.empty() && !is_directory(ph) )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::create_directories",
+ ph, "path exists and is not a directory",
+ not_directory_error ) );
+ return false;
+ }
// First create branch, by calling ourself recursively
create_directories(ph.branch_path());
// Now that parent's path exists, create the directory
create_directory(ph);
+ return true;
}
BOOST_FILESYSTEM_DECL std::string extension(const path& ph)
namespace filesystem
{
// filesystem_error m_imp class --------------------------------------------//
-// see www.boost.org/more/error_handling.html for implemenation rationale
+// see www.boost.org/more/error_handling.html for implementation rationale
class filesystem_error::m_imp
{
filesystem_error::filesystem_error(
const std::string & who,
const path & path1,
- const std::string & message )
- : m_sys_err(0), m_err(other_error)
+ const std::string & message,
+ error_code ec )
+ : m_sys_err(0), m_err(ec)
{
try
{
// forms are actually macros, so can misfire if the user has various
// other macros defined. There was a bug report of this happening.)
-# else
+# else // BOOST_POSIX
+# define _USE_FILE_OFFSET_BITS 64 // at worst,
+# define __USE_FILE_OFFSET64 // these defines may do nothing,
+ // but that won't matter on 64-bit systems or on 32-bit systems which
+ // don't have files larger than can be represented by a traditional
+ // POSIX/UNIX off_t type. OTOH, defining them should kick
+ // in 64-bit off_t's (and thus st_size) on 32-bit systems that support
+ // the Large File Support (LFS) interface, such as Linux, Solaris, and IRIX.
+
+# include <sys/types.h>
# include "dirent.h"
# include "unistd.h"
# include "fcntl.h"
# include "utime.h"
# endif
-#include <sys/stat.h> // last_write_time() uses stat()
+#include <sys/stat.h> // even on Windows some functions use stat()
#include <string>
#include <cstdio> // for remove, rename
#include <cerrno>
{
# ifdef BOOST_POSIX
struct stat path_stat;
- return ::stat( ph.string().c_str(), &path_stat ) == 0;
+ if(::stat( ph.string().c_str(), &path_stat ) != 0)
+ {
+ if((errno == ENOENT) || (errno == ENOTDIR))
+ return false; // stat failed because the path does not exist
+ // for any other error we assume the file does exist and fall through,
+ // this may not be the best policy though... (JM 20040330)
+ }
+ return true;
+# else
+ if(::GetFileAttributesA( ph.string().c_str() ) == 0xFFFFFFFF)
+ {
+ UINT err = ::GetLastError();
+ if((err == ERROR_FILE_NOT_FOUND) || (err == ERROR_INVALID_PARAMETER) || (err == ERROR_PATH_NOT_FOUND) || (err == ERROR_INVALID_NAME))
+ return false; // GetFileAttributes failed because the path does not exist
+ // for any other error we assume the file does exist and fall through,
+ // this may not be the best policy though... (JM 20040330)
+ return true;
+ }
+ return true;
+# endif
+ }
+
+ BOOST_FILESYSTEM_DECL bool possible_large_file_size_support()
+ {
+# ifdef BOOST_POSIX
+ struct stat lcl_stat;
+ return sizeof( lcl_stat.st_size ) > 4;
# else
- return ::GetFileAttributesA( ph.string().c_str() ) != 0xFFFFFFFF;
+ return true;
# endif
}
# endif
}
+# ifdef BOOST_WINDOWS
+ // Thanks to Jeremy Maitin-Shepard for much help and for permission to
+ // base the implementation on portions of his file-equivalence-win32.cpp
+ // experimental code.
+ struct handle_wrapper
+ {
+ BOOST_HANDLE handle;
+ handle_wrapper( BOOST_HANDLE h )
+ : handle(h) {}
+ ~handle_wrapper()
+ {
+ if ( handle != BOOST_INVALID_HANDLE_VALUE )
+ ::CloseHandle(handle);
+ }
+ };
+# endif
+
+ BOOST_FILESYSTEM_DECL bool equivalent( const path & ph1, const path & ph2 )
+ {
+# ifdef BOOST_POSIX
+ struct stat s1;
+ int s1_result = ::stat( ph1.string().c_str(), &s1 );
+ // save error code in case we have to throw
+ int error1 = (s1_result != 0 ? fs::detail::system_error_code() : 0);
+ struct stat s2;
+ int s2_result = ::stat( ph2.string().c_str(), &s2 );
+ if ( s1_result != 0
+ || s2_result != 0 )
+ {
+ if ( s1_result == 0 || s2_result == 0 ) return false;
+ assert( s1_result != 0 && s2_result != 0 );
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::equivalent",
+ ph1, error1 ) );
+ }
+ // at this point, both stats are known to be valid
+ return s1.st_dev == s2.st_dev
+ && s1.st_ino == s2.st_ino
+ // According to the POSIX stat specs, "The st_ino and st_dev fields
+ // taken together uniquely identify the file within the system."
+ // Just to be sure, size and mod time are also checked.
+ && s1.st_size == s2.st_size
+ && s1.st_mtime == s2.st_mtime;
+# else
+ // Note well: Physical location on external media is part of the
+ // equivalence criteria. If there are no open handles, physical location
+ // can change due to defragmentation or other relocations. Thus handles
+ // must be held open until location information for both paths has
+ // been retrieved.
+ handle_wrapper p1(
+ ::CreateFileA(
+ ph1.string().c_str(),
+ 0,
+ FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+ 0,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS,
+ 0 ) );
+ int error1; // save error code in case we have to throw
+ if ( p1.handle == BOOST_INVALID_HANDLE_VALUE )
+ error1 = fs::detail::system_error_code();
+ handle_wrapper p2(
+ ::CreateFileA(
+ ph2.string().c_str(),
+ 0,
+ FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+ 0,
+ OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS,
+ 0 ) );
+ if ( p1.handle == BOOST_INVALID_HANDLE_VALUE
+ || p2.handle == BOOST_INVALID_HANDLE_VALUE )
+ {
+ if ( p1.handle != BOOST_INVALID_HANDLE_VALUE
+ || p2.handle != BOOST_INVALID_HANDLE_VALUE ) return false;
+ assert( p1.handle == BOOST_INVALID_HANDLE_VALUE
+ && p2.handle == BOOST_INVALID_HANDLE_VALUE );
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::equivalent",
+ ph1, error1 ) );
+ }
+ // at this point, both handles are known to be valid
+ BY_HANDLE_FILE_INFORMATION info1, info2;
+ if ( !::GetFileInformationByHandle( p1.handle, &info1 ) )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::equivalent",
+ ph1, fs::detail::system_error_code() ) );
+ if ( !::GetFileInformationByHandle( p2.handle, &info2 ) )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::equivalent",
+ ph2, fs::detail::system_error_code() ) );
+ // In theory, volume serial numbers are sufficient to distinguish between
+ // devices, but in practice VSN's are sometimes duplicated, so device id
+ // is also checked. Device id's alone aren't sufficient because network
+ // share devices on different machines will have the same id. Furthermore,
+ // cheap floppy disks often have 0 VSN's and are mounted on the same
+ // lettered drive across networks, so last write time and file size is
+ // checked to distinguish that case as far as is possible.
+ if ( info1.dwVolumeSerialNumber != info2.dwVolumeSerialNumber
+ || info1.nFileIndexHigh != info2.nFileIndexHigh
+ || info1.nFileIndexLow != info2.nFileIndexLow
+ || info1.nFileSizeHigh != info2.nFileSizeHigh
+ || info1.nFileSizeLow != info2.nFileSizeLow ) return false;
+ struct stat s1;
+ if ( ::stat( ph1.string().c_str(), &s1 ) != 0 )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::equivalent",
+ ph1, fs::detail::system_error_code() ) );
+ struct stat s2;
+ if ( ::stat( ph2.string().c_str(), &s2 ) != 0 )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::equivalent",
+ ph2, fs::detail::system_error_code() ) );
+ return s1.st_dev == s2.st_dev;
+# endif
+ }
+
+
+ BOOST_FILESYSTEM_DECL boost::intmax_t file_size( const path & ph )
+ {
+# ifdef BOOST_POSIX
+ struct stat path_stat;
+ if ( ::stat( ph.string().c_str(), &path_stat ) != 0 )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::file_size",
+ ph, fs::detail::system_error_code() ) );
+ if ( S_ISDIR( path_stat.st_mode ) )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::file_size",
+ ph, "invalid: is a directory",
+ is_directory_error ) );
+ return static_cast<boost::intmax_t>(path_stat.st_size);
+# else
+ // by now, intmax_t is 64-bits on all Windows compilers
+ WIN32_FILE_ATTRIBUTE_DATA fad;
+ if ( !::GetFileAttributesExA( ph.string().c_str(),
+ ::GetFileExInfoStandard, &fad ) )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::file_size",
+ ph, fs::detail::system_error_code() ) );
+ if ( (fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) !=0 )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::file_size",
+ ph, "invalid: is a directory",
+ is_directory_error ) );
+ return (static_cast<boost::intmax_t>(fad.nFileSizeHigh)
+ << (sizeof(fad.nFileSizeLow)*8))
+ + fad.nFileSizeLow;
+# endif
+ }
+
BOOST_FILESYSTEM_DECL std::time_t last_write_time( const path & ph )
{
// Works for both Windows and POSIX
BOOST_FILESYSTEM_DECL void last_write_time( const path & ph, const std::time_t new_time )
{
// 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() ) );
::utimbuf buf;
- buf.actime = std::time_t();
+ buf.actime = path_stat.st_atime; // utime() updates access time too:-(
buf.modtime = new_time;
- if ( ::utime( ph.string().c_str(),
- new_time == std::time_t() ? 0 : &buf ) != 0 )
+ if ( ::utime( ph.string().c_str(), &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 )
+ BOOST_FILESYSTEM_DECL bool create_directory( const path & dir_path )
{
# ifdef BOOST_POSIX
if ( ::mkdir( dir_path.native_directory_string().c_str(),
- S_IRWXU|S_IRWXG|S_IRWXO ) != 0 )
+ S_IRWXU|S_IRWXG|S_IRWXO ) == 0 ) return true;
+ if ( errno != EEXIST )
# else
- if ( !::CreateDirectoryA( dir_path.native_directory_string().c_str(), 0 ) )
+ if ( ::CreateDirectoryA( dir_path.native_directory_string().c_str(), 0 ) )
+ return true;
+ if ( ::GetLastError() != ERROR_ALREADY_EXISTS )
# endif
boost::throw_exception( filesystem_error(
"boost::filesystem::create_directory",
dir_path, fs::detail::system_error_code() ) );
+ if ( !is_directory( dir_path ) )
+ boost::throw_exception( filesystem_error(
+ "boost::filesystem::create_directory",
+ dir_path, "path exists and is not a directory", not_directory_error ) );
+ return false;
}
BOOST_FILESYSTEM_DECL bool remove( const path & ph )
{
- if ( exists( ph ) )
- {
+ if ( exists( ph )
# ifdef BOOST_POSIX
+ || symbolic_link_exists( ph ) ) // handle dangling symbolic links
+ {
+ // note that the POSIX behavior for symbolic links is what we want;
+ // the link rather than what it points to is deleted
if ( std::remove( ph.string().c_str() ) != 0 )
{
int error = fs::detail::system_error_code();
"boost::filesystem::remove", ph, error ) );
}
# else
+ )
+ {
if ( is_directory( ph ) )
{
if ( !::RemoveDirectoryA( ph.string().c_str() ) )
BOOST_FILESYSTEM_DECL path current_path()
{
# ifdef BOOST_POSIX
- long path_max = ::pathconf( ".", _PC_PATH_MAX );
- if ( path_max < 1 )
- boost::throw_exception(
- filesystem_error( "boost::filesystem::current_path",
- "_PC_PATH_MAX < 1" ) );
- boost::scoped_array<char>
- buf( new char[static_cast<std::size_t>(path_max)] );
- if ( ::getcwd( buf.get(), static_cast<std::size_t>(path_max) ) == 0 )
+ for ( long path_max = 32;; path_max *=2 ) // loop 'til buffer large enough
+ {
+ boost::scoped_array<char>
+ buf( new char[static_cast<std::size_t>(path_max)] );
+ if ( ::getcwd( buf.get(), static_cast<std::size_t>(path_max) ) == 0 )
+ {
+ if ( errno != ERANGE )
+ boost::throw_exception(
+ filesystem_error( "boost::filesystem::current_path", path(),
+ fs::detail::system_error_code() ) );
+ }
+ else return path( buf.get(), native );
+ }
+ BOOST_UNREACHABLE_RETURN(0)
# else
DWORD sz;
if ( (sz = ::GetCurrentDirectoryA( 0, static_cast<char*>(0) )) == 0 )
"size is 0" ) );
boost::scoped_array<char> buf( new char[sz] );
if ( ::GetCurrentDirectoryA( sz, buf.get() ) == 0 )
-# endif
boost::throw_exception(
filesystem_error( "boost::filesystem::current_path", path(),
fs::detail::system_error_code() ) );
return path( buf.get(), native );
+# endif
}
BOOST_FILESYSTEM_DECL const path & initial_path()
// the library is being built (possibly exporting rather than importing code)
#define BOOST_FILESYSTEM_SOURCE
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/exception.hpp>
+
// 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__)
# endif
# endif
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/exception.hpp>
namespace fs = boost::filesystem;
#include <boost/throw_exception.hpp>
#include <cstring> // SGI MIPSpro compilers need this
#include <vector>
+#include <algorithm> // for lexicographical_compare
#include <cassert>
#include <boost/config/abi_prefix.hpp> // must be the last header
if ( m_path == "." ) m_path = "";
// directory-placeholder
- if ( *itr == '.' && ((itr+1) == src.end() || *(itr+1) == '/') )
+ if ( *itr == '.' && ((itr+1) == src.end() || *(itr+1) == '/'
+# ifdef BOOST_WINDOWS
+ || *(itr+1) == '\\'
+# endif
+ ) )
{
if ( empty() ) m_path += '.';
++itr;
{
// append '/' if needed
if ( !empty()
- && *(m_path.end()-1) != ':' && *(m_path.end()-1) != '/' )
+# ifdef BOOST_WINDOWS
+ && *(m_path.end()-1) != ':'
+# endif
+ && *(m_path.end()-1) != '/' )
m_path += '/';
// parent-directory
if ( *itr == '.'
&& (itr+1) != src.end() && *(itr+1) == '.'
- && ((itr+2) == src.end() || *(itr+2) == '/') )
+ && ((itr+2) == src.end() || *(itr+2) == '/'
+# ifdef BOOST_WINDOWS
+ || *(itr+2) == '\\'
+# endif
+ ) )
{
m_path += "..";
++itr;
return default_check;
}
+ // path operator< ------------------------------------------------------//
+ bool path::operator<( const path & that ) const
+ {
+ return std::lexicographical_compare(
+ begin(), end(), that.begin(), that.end() );
+ }
+
+
// path::iterator implementation --------------------------------------------//
void path::iterator::increment()
unsigned int message_count = 0;
std::string* mess_locale;
-BOOST_REGEX_DECL char* re_custom_error_messages[] = {
+char* re_custom_error_messages[] = {
0,
0,
0,
#ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL boost::regex_wchar_type re_zero_w;
-BOOST_REGEX_DECL boost::regex_wchar_type re_ten_w;
+boost::regex_wchar_type re_zero_w;
+boost::regex_wchar_type re_ten_w;
unsigned int nlsw_count = 0;
std::string* wlocale_name = 0;
#include <cstdio>
#include <list>
#include <cctype>
+#include <ios>
#include <iostream>
#include <map>
#include <boost/regex/regex_traits.hpp>
int BOOST_REGEX_CALL cpp_regex_traits<char>::toi(const char*& first, const char* last, int radix)const
{
- pmd->sbuf.pubsetbuf(const_cast<char*>(first), static_cast<std::streamsize>(last-first));
+ pmd->sbuf.pubsetbuf(const_cast<char*>(static_cast<const char*>(first)), static_cast<std::streamsize>(last-first));
pmd->is.clear();
if(std::abs(radix) == 16) pmd->is >> std::hex;
else if(std::abs(radix) == 8) pmd->is >> std::oct;
#include <boost/cregex.hpp>
#include <boost/regex.hpp>
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+# include <boost/integer_traits.hpp>
+#endif
#if !defined(BOOST_NO_STD_STRING)
#include <map>
#include <list>
for(unsigned int i = 0; i < m.size(); ++i)
{
if(m[i].matched) strings[i] = std::string(m[i].first, m[i].second);
- positions[i] = m[i].matched ? m[i].first - pbase : -1;
+ positions[i] = m[i].matched ? m[i].first - pbase : RegEx::npos;
}
}
#ifndef BOOST_REGEX_NO_FILEITER
for(unsigned int i = 0; i < fm.size(); ++i)
{
if(fm[i].matched) strings[i] = to_string(fm[i].first, fm[i].second);
- positions[i] = fm[i].matched ? fm[i].first - fbase : -1;
+ positions[i] = fm[i].matched ? fm[i].first - fbase : RegEx::npos;
}
}
#endif
return result;
}
-const unsigned int RegEx::npos = ~0u;
-
+#ifndef __MINGW32__
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+const std::size_t RegEx::npos = ::boost::integer_traits<std::size_t>::const_max;
+#elif defined(BOOST_HAS_LONG_LONG)
+const std::size_t RegEx::npos = ~0ULL;
+#else
+const std::size_t RegEx::npos = ~0UL;
+#endif
+#endif
} // namespace boost
HINSTANCE hresmod = 0;
-BOOST_REGEX_DECL char* re_custom_error_messages[] = {
+char* re_custom_error_messages[] = {
0,
0,
0,
#ifndef BOOST_NO_WREGEX
-BOOST_REGEX_DECL boost::regex_wchar_type re_zero_w;
-BOOST_REGEX_DECL boost::regex_wchar_type re_ten_w;
+boost::regex_wchar_type re_zero_w;
+boost::regex_wchar_type re_ten_w;
bool isPlatformNT = false;
libboostsignals_la_SOURCES = \
connection.cpp \
+ named_slot_map.cpp \
signal_base.cpp \
slot.cpp \
trackable.cpp
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
+ connection::connection(const connection& other) :
+ con(other.con), controlling_connection(other.controlling_connection)
+ {
+ }
+
+ connection::~connection()
+ {
+ if (controlling_connection) {
+ disconnect();
+ }
+ }
+
+ void
+ connection::reset(BOOST_SIGNALS_NAMESPACE::detail::basic_connection* new_con)
+ {
+ con.reset(new_con);
+ }
+
+ bool connection::operator==(const connection& other) const
+ {
+ return con.get() == other.con.get();
+ }
+
+ bool connection::operator<(const connection& other) const
+ {
+ return con.get() < other.con.get();
+ }
+
+ connection& connection::operator=(const connection& other)
+ {
+ connection(other).swap(*this);
+ return *this;
+ }
+
+ void connection::swap(connection& other)
+ {
+ this->con.swap(other.con);
+ std::swap(this->controlling_connection, other.controlling_connection);
+ }
+
+ void swap(connection& c1, connection& c2)
+ {
+ c1.swap(c2);
+ }
+
+ scoped_connection::scoped_connection(const connection& other) :
+ connection(other),
+ released(false)
+ {
+ }
+
+ scoped_connection::scoped_connection(const scoped_connection& other) :
+ connection(other),
+ released(other.released)
+ {
+ }
+
+ scoped_connection::~scoped_connection()
+ {
+ if (!released) {
+ this->disconnect();
+ }
+ }
+
+ connection scoped_connection::release()
+ {
+ released = true;
+ return *this;
+ }
+
+ void scoped_connection::swap(scoped_connection& other)
+ {
+ this->connection::swap(other);
+ bool other_released = other.released;
+ other.released = this->released;
+ this->released = other_released;
+ }
+
+ void swap(scoped_connection& c1, scoped_connection& c2)
+ {
+ c1.swap(c2);
+ }
+
+ scoped_connection&
+ scoped_connection::operator=(const connection& other)
+ {
+ scoped_connection(other).swap(*this);
+ return *this;
+ }
+
+ scoped_connection&
+ scoped_connection::operator=(const scoped_connection& other)
+ {
+ scoped_connection(other).swap(*this);
+ return *this;
+ }
+
void
connection::add_bound_object(const BOOST_SIGNALS_NAMESPACE::detail::bound_object& b)
{
--- /dev/null
+// Boost.Signals library
+
+// Copyright Douglas Gregor 2001-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)
+
+// For more information, see http://www.boost.org
+
+#define BOOST_SIGNALS_SOURCE
+
+#include <boost/signals/detail/named_slot_map.hpp>
+#include <cassert>
+#include <map>
+#include <list>
+#include <typeinfo>
+
+namespace boost { namespace BOOST_SIGNALS_NAMESPACE { namespace detail {
+
+typedef std::list<connection_slot_pair> group_list;
+typedef group_list::iterator slot_pair_iterator;
+typedef std::map<any, group_list, compare_type> slot_container_type;
+typedef slot_container_type::iterator group_iterator;
+typedef slot_container_type::const_iterator const_group_iterator;
+
+class named_slot_map::impl
+{
+public:
+ impl(const compare_type& compare) : groups(compare)
+ {
+ clear();
+ }
+
+ void clear()
+ {
+ groups.clear();
+ groups[front_type()];
+ groups[back_type()];
+ back = groups.end();
+ --back;
+ }
+
+ slot_container_type groups;
+ group_iterator back;
+
+ bool empty(const_group_iterator group) const
+ {
+ return (group->second.empty() && group != groups.begin() && group != back);
+ }
+};
+
+class named_slot_map_iterator::impl
+{
+public:
+ impl() : slot_assigned(false) {}
+
+ impl(group_iterator group, group_iterator last_group)
+ : group(group), last_group(last_group), slot_assigned(false)
+ { init_next_group(); }
+
+ impl(group_iterator group, group_iterator last_group,
+ slot_pair_iterator slot_)
+ : group(group), last_group(last_group), slot_(slot_), slot_assigned(true)
+ { }
+
+ impl(const impl& other)
+ : group(other.group), last_group(other.last_group),
+ slot_assigned(other.slot_assigned)
+ {
+ if (slot_assigned) slot_ = other.slot_;
+ }
+
+ impl& operator=(const impl& other)
+ {
+ group = other.group;
+ last_group = other.last_group;
+ slot_assigned = other.slot_assigned;
+ if (slot_assigned) slot_ = other.slot_;
+ return *this;
+ }
+
+ void init_next_group()
+ {
+ while (group != last_group && group->second.empty()) ++group;
+ if (group != last_group) {
+ slot_ = group->second.begin();
+ slot_assigned = true;
+ }
+ }
+
+ group_iterator group;
+ group_iterator last_group;
+ slot_pair_iterator slot_;
+ bool slot_assigned;
+};
+
+named_slot_map_iterator::named_slot_map_iterator() {}
+
+named_slot_map_iterator::named_slot_map_iterator(std::auto_ptr<impl> impl_)
+ : impl_(impl_) {}
+
+named_slot_map_iterator
+ ::named_slot_map_iterator(const named_slot_map_iterator& other)
+{
+ impl_.reset(new impl(*other.impl_));
+}
+
+named_slot_map_iterator::~named_slot_map_iterator() {}
+
+named_slot_map_iterator&
+named_slot_map_iterator::operator=(const named_slot_map_iterator& other)
+{
+ if (impl_) *impl_ = *other.impl_;
+ else impl_.reset(new impl(*other.impl_));
+ return *this;
+}
+
+connection_slot_pair& named_slot_map_iterator::dereference() const
+{ return *impl_->slot_; }
+
+void named_slot_map_iterator::increment()
+{
+ ++impl_->slot_;
+ if (impl_->slot_ == impl_->group->second.end()) {
+ ++impl_->group;
+ impl_->init_next_group();
+ }
+}
+
+bool
+named_slot_map_iterator::equal(const named_slot_map_iterator& other) const
+{
+ return (impl_->group == other.impl_->group
+ && (impl_->group == impl_->last_group
+ || impl_->slot_ == other.impl_->slot_));
+}
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 0x1701)
+void named_slot_map_iterator::decrement() { assert(false); }
+void named_slot_map_iterator::advance(difference_type) { assert(false); }
+#endif
+
+named_slot_map::named_slot_map(const compare_type& compare)
+{
+ impl_.reset(new impl(compare));
+}
+
+named_slot_map::~named_slot_map() {}
+
+void named_slot_map::clear() { impl_->clear(); }
+
+named_slot_map::iterator named_slot_map::begin()
+{
+ typedef named_slot_map::iterator::impl iterator_impl;
+
+ std::auto_ptr<iterator_impl>
+ it(new iterator_impl(impl_->groups.begin(),
+ impl_->groups.end()));
+ return named_slot_map::iterator(it);
+}
+
+named_slot_map::iterator named_slot_map::end()
+{
+ typedef named_slot_map::iterator::impl iterator_impl;
+
+ std::auto_ptr<iterator_impl>
+ it(new iterator_impl(impl_->groups.end(),
+ impl_->groups.end()));
+ return named_slot_map::iterator(it);
+}
+
+named_slot_map::iterator
+named_slot_map::insert(const any& name, const connection& con, const any& slot,
+ connect_position at)
+{
+ group_iterator group;
+ if (name.empty()) {
+ switch (at) {
+ case at_front: group = impl_->groups.begin(); break;
+ case at_back: group = impl_->back; break;
+ }
+ } else {
+ group = impl_->groups.find(name);
+ if (group == impl_->groups.end()) {
+ slot_container_type::value_type v(name, group_list());
+ group = impl_->groups.insert(v).first;
+ }
+ }
+ typedef named_slot_map::iterator::impl iterator_impl;
+ std::auto_ptr<iterator_impl> it(new iterator_impl);
+ it->group = group;
+ it->last_group = impl_->groups.end();
+
+ switch (at) {
+ case at_back:
+ group->second.push_back(connection_slot_pair(con, slot));
+ it->slot_ = group->second.end();
+ it->slot_assigned = true;
+ --(it->slot_);
+ break;
+
+ case at_front:
+ group->second.push_front(connection_slot_pair(con, slot));
+ it->slot_ = group->second.begin();
+ it->slot_assigned = true;
+ break;
+ }
+ return iterator(it);
+}
+
+void named_slot_map::disconnect(const any& name)
+{
+ group_iterator group = impl_->groups.find(name);
+ if (group != impl_->groups.end()) {
+ slot_pair_iterator i = group->second.begin();
+ while (i != group->second.end()) {
+ slot_pair_iterator next = i;
+ ++next;
+ i->first.disconnect();
+ i = next;
+ }
+ impl_->groups.erase(group);
+ }
+}
+
+void named_slot_map::erase(iterator pos)
+{
+ // Erase the slot
+ pos.impl_->slot_->first.disconnect();
+ // pos.impl_->group->second.erase(pos.impl_->slot_); ?
+}
+
+void named_slot_map::remove_disconnected_slots()
+{
+ // Remove any disconnected slots
+ group_iterator g = impl_->groups.begin();
+ while (g != impl_->groups.end()) {
+ slot_pair_iterator s = g->second.begin();
+ while (s != g->second.end()) {
+ if (s->first.connected()) ++s;
+ else g->second.erase(s++);
+ }
+
+ // Clear out empty groups
+ if (impl_->empty(g)) impl_->groups.erase(g++);
+ else ++g;
+ }
+}
+
+
+} } }
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
namespace boost {
namespace BOOST_SIGNALS_NAMESPACE {
namespace detail {
- signal_base_impl::signal_base_impl(const compare_type& comp) :
- call_depth(0),
- slots_(comp)
+ signal_base_impl::signal_base_impl(const compare_type& comp,
+ const any& combiner)
+ : call_depth(0),
+ slots_(comp),
+ combiner_(combiner)
{
flags.delayed_disconnect = false;
flags.clearing = false;
// reach zero, the call list will be cleared.
flags.delayed_disconnect = true;
temporarily_set_clearing set_clearing(this);
- for (slot_iterator i = slots_.begin(); i != slots_.end(); ++i) {
- i->second.first.disconnect();
+ for (iterator i = slots_.begin(); i != slots_.end(); ++i) {
+ i->first.disconnect();
}
}
}
connection
signal_base_impl::
- connect_slot(const any& slot,
+ connect_slot(const any& slot_,
const any& name,
- const std::vector<const trackable*>& bound_objects)
+ shared_ptr<slot_base::data_t> data,
+ connect_position at)
{
- // Allocate storage for a new basic_connection object to represent the
- // connection
- basic_connection* con = new basic_connection();
-
- // Create a new connection handle object and place the basic_connection
- // object we just created under its control. Note that the "reset"
- // routine will delete con if allocation throws.
- connection slot_connection;
- slot_connection.reset(con);
+ // Transfer the burden of ownership to a local, scoped
+ // connection.
+ data->watch_bound_objects.set_controlling(false);
+ scoped_connection safe_connection(data->watch_bound_objects);
// Allocate storage for an iterator that will hold the point of
// insertion of the slot into the list. This is used to later remove
// the slot when it is disconnected.
- std::auto_ptr<slot_iterator> saved_iter(new slot_iterator());
+ std::auto_ptr<iterator> saved_iter(new iterator);
// Add the slot to the list.
-
- slot_iterator pos =
- slots_.insert(stored_slot_type(name,
- connection_slot_pair(slot_connection,
- slot)));
-
- // Make the copy of the connection in the list disconnect when it is
- // destroyed
- pos->second.first.set_controlling();
+ iterator pos =
+ slots_.insert(name, data->watch_bound_objects, slot_, at);
// The assignment operation here absolutely must not throw, which
// intuitively makes sense (because any container's insert method
// 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.
- scoped_connection safe_connection = slot_connection;
-
- // Connect each of the bound objects
- for(std::vector<const trackable*>::const_iterator i =
- bound_objects.begin();
- 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
- // should throw, the scoped connection safe_connection will
- // disconnect the connection completely.
- bound_object binding;
- (*i)->signal_connected(slot_connection, 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
- auto_disconnect_bound_object disconnector(binding);
-
- // Add the binding to the list of bindings for the connection.
- con->bound_objects.push_back(binding);
-
- // The connection object now knows about the bound object, so if an
- // exception is thrown later the connection object will notify the
- // bound object of the disconnection automatically
- disconnector.release();
- }
-
- // No exceptions will be thrown past this point, and we must not
- // disconnect the connection now
- safe_connection.release();
+ data->watch_bound_objects.get_connection()->signal = this;
+ data->watch_bound_objects.get_connection()->signal_data =
+ saved_iter.release();
+ data->watch_bound_objects.get_connection()->signal_disconnect =
+ &signal_base_impl::slot_disconnected;
- return slot_connection;
+ // Make the copy of the connection in the list disconnect when it is
+ // destroyed. The local, scoped connection is then released
+ // because ownership has been transferred.
+ pos->first.set_controlling();
+ return safe_connection.release();
}
bool signal_base_impl::empty() 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
- for (slot_iterator i = slots_.begin(); i != slots_.end(); ++i) {
- if (i->second.first.connected())
+ for (iterator i = slots_.begin(); i != slots_.end(); ++i) {
+ if (i->first.connected())
return false;
}
// 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())
+ for (iterator i = slots_.begin(); i != slots_.end(); ++i) {
+ if (i->first.connected())
++count;
}
return count;
}
void signal_base_impl::disconnect(const any& group)
- {
- 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;
- ++next;
-
- group_slots.first->second.first.disconnect();
- group_slots.first = next;
- }
- }
+ { slots_.disconnect(group); }
void signal_base_impl::slot_disconnected(void* obj, void* data)
{
signal_base_impl* self = reinterpret_cast<signal_base_impl*>(obj);
// We won't need the slot iterator after this
- std::auto_ptr<slot_iterator> slot(
- reinterpret_cast<slot_iterator*>(data));
+ std::auto_ptr<iterator> slot(reinterpret_cast<iterator*>(data));
// If we're flags.clearing, we don't bother updating the list of slots
if (!self->flags.clearing) {
}
void signal_base_impl::remove_disconnected_slots() const
- {
- // Remove any disconnected slots
- for (slot_iterator i = slots_.begin(); i != slots_.end(); /* none */) {
- if (!i->second.first.connected())
- slots_.erase(i++);
- else
- ++i;
- }
- }
+ { slots_.remove_disconnected_slots(); }
call_notification::
call_notification(const shared_ptr<signal_base_impl>& b) :
}
}
- signal_base::signal_base(const compare_type& comp) : impl()
+ signal_base::signal_base(const compare_type& comp, const any& combiner)
+ : impl()
{
- impl.reset(new signal_base_impl(comp));
+ impl.reset(new signal_base_impl(comp, combiner));
}
signal_base::~signal_base()
} // 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,
- boost::function2<bool, boost::any, boost::any> >;
-#endif
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)
// 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);
+ data->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
// already connected.
- scoped_connection safe_connection(watch_bound_objects);
+ scoped_connection safe_connection(data->watch_bound_objects);
// Now notify each of the bound objects that they are connected to this
// slot.
- for(std::vector<const trackable*>::iterator i = bound_objects.begin();
- i != bound_objects.end(); ++i) {
+ for(std::vector<const trackable*>::iterator i =
+ data->bound_objects.begin();
+ i != data->bound_objects.end(); ++i) {
// Notify the object that the slot is connecting to it
BOOST_SIGNALS_NAMESPACE::detail::bound_object binding;
- (*i)->signal_connected(watch_bound_objects, binding);
+ (*i)->signal_connected(data->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_NAMESPACE::detail::auto_disconnect_bound_object disconnector(binding);
+ BOOST_SIGNALS_NAMESPACE::detail::auto_disconnect_bound_object
+ disconnector(binding);
// Add the binding to the list of bindings for the connection
con->bound_objects.push_back(binding);
// No exceptions will be thrown past this point.
safe_connection.release();
+
+ data->watch_bound_objects.set_controlling(true);
}
} // end namespace detail
} // end namespace BOOST_SIGNALS_NAMESPACE
// Boost.Signals library
-// Copyright Doug Gregor 2001-2003. Use, modification and
+// Copyright Douglas Gregor 2001-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)