diff --git a/boost/ChangeLog b/boost/ChangeLog index 5386b41bd2..5937455900 100644 --- a/boost/ChangeLog +++ b/boost/ChangeLog @@ -1,3 +1,7 @@ +2004-11-20 Lars Gullik Bjonnes + + * update boost to version 1.32.0 + 2004-04-03 Lars Gullik Bjonnes * libs/filesystem/src/Makefile.am (AM_CXXFLAGS): define diff --git a/boost/LICENSE_1_0.txt b/boost/LICENSE_1_0.txt new file mode 100644 index 0000000000..36b7cd93cd --- /dev/null +++ b/boost/LICENSE_1_0.txt @@ -0,0 +1,23 @@ +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. diff --git a/boost/boost/any.hpp b/boost/boost/any.hpp index d837ce9d81..704479d9d7 100644 --- a/boost/boost/any.hpp +++ b/boost/boost/any.hpp @@ -180,10 +180,8 @@ namespace boost // 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 diff --git a/boost/boost/array.hpp b/boost/boost/array.hpp index bab704d1a2..ce9eda7b53 100644 --- a/boost/boost/array.hpp +++ b/boost/boost/array.hpp @@ -4,26 +4,29 @@ * 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 #include +#include // Handles broken standard libraries better than #include @@ -32,6 +35,7 @@ // FIXES for broken compilers #include + namespace boost { template @@ -81,18 +85,42 @@ namespace boost { } // 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; } @@ -105,9 +133,12 @@ namespace boost { 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 array& operator= (const array& rhs) { @@ -121,12 +152,11 @@ namespace boost { 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"); + } } }; @@ -166,10 +196,3 @@ namespace boost { } /* namespace boost */ #endif /*BOOST_ARRAY_HPP*/ - - - - - - - diff --git a/boost/boost/assert.hpp b/boost/boost/assert.hpp index 754ebb954b..3428efb7d5 100644 --- a/boost/boost/assert.hpp +++ b/boost/boost/assert.hpp @@ -3,10 +3,9 @@ // // 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. // diff --git a/boost/boost/bind.hpp b/boost/boost/bind.hpp index 0613a89693..a8308e9f4d 100644 --- a/boost/boost/bind.hpp +++ b/boost/boost/bind.hpp @@ -10,13 +10,12 @@ // // 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. // @@ -26,6 +25,7 @@ #include #include #include +#include // Borland-specific bug, visit_each() silently fails to produce code @@ -69,6 +69,18 @@ template struct result_traits< unspecified, reference_wrapper > #endif +// ref_compare + +template bool ref_compare(T const & a, T const & b, long) +{ + return a == b; +} + +template bool ref_compare(reference_wrapper const & a, reference_wrapper const & b, int) +{ + return a.get_pointer() == b.get_pointer(); +} + // bind_t forward declaration for listN template class bind_t; @@ -84,6 +96,11 @@ public: T & get() { return t_; } T const & get() const { return t_; } + bool operator==(value const & rhs) const + { + return t_ == rhs.t_; + } + private: T t_; @@ -95,38 +112,41 @@ template class type {}; // unwrap -template inline F & unwrap(F & f, long) +template inline F & unwrap(F * f, long) { - return f; + return *f; } -template inline F & unwrap(reference_wrapper & f, int) +template inline F & unwrap(reference_wrapper * f, int) { - return f; + return f->get(); } -template inline F & unwrap(reference_wrapper const & f, int) +template inline F & unwrap(reference_wrapper const * f, int) { - return f; + return f->get(); } -// listN +#if !( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, <= 0x3003) ) -#ifdef BOOST_NO_VOID_RETURNS +template inline _mfi::dm unwrap(R T::* * pm, int) +{ + return _mfi::dm(*pm); +} + +#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) +// IBM/VisualAge 6.0 is not able to handle this overload. +template inline _mfi::dm unwrap(R T::* const * pm, int) +{ + return _mfi::dm(*pm); +} +#endif -template struct evaluator0; -template struct evaluator1; -template struct evaluator2; -template struct evaluator3; -template struct evaluator4; -template struct evaluator5; -template struct evaluator6; -template struct evaluator7; -template struct evaluator8; -template struct evaluator9; #endif +// listN + class list0 { public: @@ -143,29 +163,34 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A &) + template R operator()(type, F & f, A &, long) { - return unwrap(f, 0)(); + return unwrap(&f, 0)(); } - template R operator()(type, F f, A &) const + template R operator()(type, F const & f, A &, long) const { - return unwrap(f, 0)(); + return unwrap(&f, 0)(); + } + + template void operator()(type, F & f, A &, int) + { + unwrap(&f, 0)(); + } + + template void operator()(type, F const & f, A &, int) const + { + unwrap(&f, 0)(); } template void accept(V &) const { } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list0 const &) const { - typedef evaluator0 type; - }; - -#endif - + return true; + } }; template class list1 @@ -188,14 +213,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, F & f, A & a, long) { - return unwrap(f, 0)(a[a1_]); + return unwrap(&f, 0)(a[a1_]); } - template R operator()(type, F f, A & a) const + template R operator()(type, F const & f, A & a, long) const { - return unwrap(f, 0)(a[a1_]); + return unwrap(&f, 0)(a[a1_]); + } + + template void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_]); } template void accept(V & v) const @@ -203,19 +238,13 @@ public: BOOST_BIND_VISIT_EACH(v, a1_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list1 const & rhs) const { - typedef evaluator1 type; - }; - -#else + return ref_compare(a1_, rhs.a1_, 0); + } private: -#endif - A1 a1_; }; @@ -241,14 +270,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, F & f, A & a, long) { - return unwrap(f, 0)(a[a1_], a[a2_]); + return unwrap(&f, 0)(a[a1_], a[a2_]); } - template R operator()(type, F f, A & a) const + template R operator()(type, F const & f, A & a, long) const { - return unwrap(f, 0)(a[a1_], a[a2_]); + return unwrap(&f, 0)(a[a1_], a[a2_]); + } + + template void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_], a[a2_]); } template void accept(V & v) const @@ -257,19 +296,13 @@ public: BOOST_BIND_VISIT_EACH(v, a2_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list2 const & rhs) const { - typedef evaluator2 type; - }; - -#else + return ref_compare(a1_, rhs.a1_, 0) && ref_compare(a2_, rhs.a2_, 0); + } private: -#endif - A1 a1_; A2 a2_; }; @@ -298,14 +331,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, 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 R operator()(type, F f, A & a) const + template R operator()(type, 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 void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_]); } template void accept(V & v) const @@ -315,19 +358,13 @@ public: BOOST_BIND_VISIT_EACH(v, a3_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list3 const & rhs) const { - typedef evaluator3 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_; @@ -359,14 +396,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, F & f, A & a, long) { - 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 R operator()(type, F f, A & a) const + template R operator()(type, 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 void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_]); } template void accept(V & v) const @@ -377,19 +424,15 @@ public: BOOST_BIND_VISIT_EACH(v, a4_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list4 const & rhs) const { - typedef evaluator4 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_; @@ -424,14 +467,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, 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 R operator()(type, F f, A & a) const + template R operator()(type, 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 void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]); } template void accept(V & v) const @@ -443,19 +496,15 @@ public: BOOST_BIND_VISIT_EACH(v, a5_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list5 const & rhs) const { - typedef evaluator5 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_; @@ -493,14 +542,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, 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 R operator()(type, F f, A & a) const + template R operator()(type, 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 void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]); } template void accept(V & v) const @@ -513,19 +572,15 @@ public: BOOST_BIND_VISIT_EACH(v, a6_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list6 const & rhs) const { - typedef evaluator6 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_; @@ -566,14 +621,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, F & f, A & a, long) { - return unwrap(f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); } - template R operator()(type, F f, A & a) const + template R operator()(type, 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_]); + return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + } + + template void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); + } + + template void operator()(type, F const & f, A & a, int) const + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]); } template void accept(V & v) const @@ -587,19 +652,16 @@ public: BOOST_BIND_VISIT_EACH(v, a7_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list7 const & rhs) const { - typedef evaluator7 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_; @@ -643,14 +705,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, 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 R operator()(type, F f, A & a) const + template R operator()(type, 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 void operator()(type, 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 void operator()(type, 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 void accept(V & v) const @@ -665,19 +737,16 @@ public: BOOST_BIND_VISIT_EACH(v, a8_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list8 const & rhs) const { - typedef evaluator8 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_; @@ -724,14 +793,24 @@ public: template typename result_traits::type operator[] (bind_t const & b) const { return b.eval(*this); } - template R operator()(type, F f, A & a) + template R operator()(type, 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_]); + return unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); } - template R operator()(type, F f, A & a) const + template R operator()(type, 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 void operator()(type, F & f, A & a, int) + { + unwrap(&f, 0)(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]); + } + + template void operator()(type, 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 void accept(V & v) const @@ -747,19 +826,16 @@ public: BOOST_BIND_VISIT_EACH(v, a9_, 0); } -#ifdef BOOST_NO_VOID_RETURNS - - template struct evaluator + bool operator==(list9 const & rhs) const { - typedef evaluator9 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_; @@ -771,190 +847,6 @@ private: A9 a9_; }; -#ifdef BOOST_NO_VOID_RETURNS - -template struct evaluator0 -{ - template - static R eval(L &, F f, A &) - { - return unwrap(f, 0)(); - } -}; - -template <> struct evaluator0 -{ - template - static void eval(L &, F f, A &) - { - unwrap(f, 0)(); - } -}; - -template struct evaluator1 -{ - template - static R eval(L & l, F f, A & a) - { - return unwrap(f, 0)(a[l.a1_]); - } -}; - -template <> struct evaluator1 -{ - template - static void eval(L & l, F f, A & a) - { - unwrap(f, 0)(a[l.a1_]); - } -}; - -template struct evaluator2 -{ - template - static R eval(L & l, F f, A & a) - { - return unwrap(f, 0)(a[l.a1_], a[l.a2_]); - } -}; - -template <> struct evaluator2 -{ - template - static void eval(L & l, F f, A & a) - { - unwrap(f, 0)(a[l.a1_], a[l.a2_]); - } -}; - -template struct evaluator3 -{ - template - 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 -{ - template - static void eval(L & l, F f, A & a) - { - unwrap(f, 0)(a[l.a1_], a[l.a2_], a[l.a3_]); - } -}; - -template struct evaluator4 -{ - template - 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 -{ - template - 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 struct evaluator5 -{ - template - 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 -{ - template - 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 struct evaluator6 -{ - template - 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 -{ - template - 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 struct evaluator7 -{ - template - 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 -{ - template - 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 struct evaluator8 -{ - template - 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 -{ - template - 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 struct evaluator9 -{ - template - 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 -{ - template - 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 @@ -963,11 +855,13 @@ template class bind_t { public: + typedef bind_t this_type; + bind_t(F f, L const & l): f_(f), l_(l) {} -#define BOOST_BIND_EVALUATE return l_(type(), f_, a) +#define BOOST_BIND_RETURN return #include -#undef BOOST_BIND_EVALUATE +#undef BOOST_BIND_RETURN }; @@ -980,11 +874,13 @@ template class implementation { 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::type::eval(l_, f_, a); +#define BOOST_BIND_RETURN return #include -#undef BOOST_BIND_EVALUATE +#undef BOOST_BIND_RETURN }; @@ -1001,11 +897,13 @@ private: public: + typedef implementation this_type; + implementation(F f, L const & l): f_(f), l_(l) {} -#define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator::type::eval(l_, f_, a); +#define BOOST_BIND_RETURN #include -#undef BOOST_BIND_EVALUATE +#undef BOOST_BIND_RETURN }; @@ -1021,6 +919,18 @@ public: #endif +// bind_t::operator== + +template bool operator==(bind_t const & a, bind_t const & b) +{ + return a.compare(b); +} + +template bool operator!=(bind_t const & a, bind_t const & b) +{ + return !a.compare(b); +} + // add_value #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530) @@ -1186,18 +1096,6 @@ template type; }; -// g++ 2.95 specific helper; used by the data member overload - -template struct add_cref -{ - typedef T const & type; -}; - -template<> struct add_cref -{ - typedef void type; -}; - } // namespace _bi // visit_each @@ -1550,8 +1448,30 @@ template struct add_cref +{ + typedef T const & type; +}; + +template struct add_cref< T & > +{ + typedef T const & type; +}; + +template<> struct add_cref +{ + typedef void type; +}; + +} // namespace _bi + template _bi::bind_t< typename _bi::add_cref::type, _mfi::dm, typename _bi::list_av_1::type > BOOST_BIND(R T::*f, A1 a1) @@ -1574,6 +1494,17 @@ _bi::bind_t< R const &, _mfi::dm, typename _bi::list_av_1::type > #endif +*/ + +template +_bi::bind_t< R, _mfi::dm, typename _bi::list_av_1::type > + BOOST_BIND(R T::*f, A1 a1) +{ + typedef _mfi::dm F; + typedef typename _bi::list_av_1::type list_type; + return _bi::bind_t( F(f), list_type(a1) ); +} + } // namespace boost #ifndef BOOST_BIND_NO_PLACEHOLDERS diff --git a/boost/boost/bind/apply.hpp b/boost/boost/bind/apply.hpp index 6c38d617b2..6a43a89ac8 100644 --- a/boost/boost/bind/apply.hpp +++ b/boost/boost/bind/apply.hpp @@ -6,10 +6,9 @@ // // 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 diff --git a/boost/boost/bind/arg.hpp b/boost/boost/bind/arg.hpp index a31615d43c..90e966e5f4 100644 --- a/boost/boost/bind/arg.hpp +++ b/boost/boost/bind/arg.hpp @@ -12,10 +12,9 @@ // // 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. // @@ -27,6 +26,11 @@ template class arg { }; +template bool operator==(arg const &, arg const &) +{ + return true; +} + } // namespace boost #endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED diff --git a/boost/boost/bind/bind_cc.hpp b/boost/boost/bind/bind_cc.hpp index a192dec4ea..35f8eceb9e 100644 --- a/boost/boost/bind/bind_cc.hpp +++ b/boost/boost/bind/bind_cc.hpp @@ -5,10 +5,9 @@ // // 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. // diff --git a/boost/boost/bind/bind_mf_cc.hpp b/boost/boost/bind/bind_mf_cc.hpp index 71b1e1c079..88be8222f3 100644 --- a/boost/boost/bind/bind_mf_cc.hpp +++ b/boost/boost/bind/bind_mf_cc.hpp @@ -5,10 +5,9 @@ // // 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. // diff --git a/boost/boost/bind/bind_template.hpp b/boost/boost/bind/bind_template.hpp index d6e5a3b2fd..60d78b31bb 100644 --- a/boost/boost/bind/bind_template.hpp +++ b/boost/boost/bind/bind_template.hpp @@ -3,12 +3,11 @@ // // 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. // @@ -18,131 +17,131 @@ result_type operator()() { list0 a; - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } result_type operator()() const { list0 a; - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1) { list1 a(a1); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1) const { list1 a(a1); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2) { list2 a(a1, a2); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2) const { list2 a(a1, a2); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3) { list3 a(a1, a2, a3); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3) const { list3 a(a1, a2, a3); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) { list4 a(a1, a2, a3, a4); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const { list4 a(a1, a2, a3, a4); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) { list5 a(a1, a2, a3, a4, a5); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const { list5 a(a1, a2, a3, a4, a5); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) { list6 a(a1, a2, a3, a4, a5, a6); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const { list6 a(a1, a2, a3, a4, a5, a6); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) { list7 a(a1, a2, a3, a4, a5, a6, a7); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const { list7 a(a1, a2, a3, a4, a5, a6, a7); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) { list8 a(a1, a2, a3, a4, a5, a6, a7, a8); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const { list8 a(a1, a2, a3, a4, a5, a6, a7, a8); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) { list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const { list9 a(a1, a2, a3, a4, a5, a6, a7, a8, a9); - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type eval(A & a) { - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template result_type eval(A & a) const { - BOOST_BIND_EVALUATE; + BOOST_BIND_RETURN l_(type(), f_, a, 0); } template void accept(V & v) const @@ -151,6 +150,11 @@ l_.accept(v); } + bool compare(this_type const & rhs) const + { + return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_; + } + private: F f_; diff --git a/boost/boost/bind/make_adaptable.hpp b/boost/boost/bind/make_adaptable.hpp index 01a1d4da3b..b9f083e307 100644 --- a/boost/boost/bind/make_adaptable.hpp +++ b/boost/boost/bind/make_adaptable.hpp @@ -6,10 +6,9 @@ // // 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 @@ -18,10 +17,6 @@ namespace boost namespace _bi { -template void instantiate(F) -{ -} - template class af0 { public: @@ -37,6 +32,11 @@ public: return f_(); } + result_type operator()() const + { + return f_(); + } + private: F f_; @@ -59,6 +59,11 @@ public: return f_(a1); } + result_type operator()(A1 a1) const + { + return f_(a1); + } + private: F f_; @@ -83,6 +88,11 @@ public: return f_(a1, a2); } + result_type operator()(A1 a1, A2 a2) const + { + return f_(a1, a2); + } + private: F f_; @@ -106,6 +116,11 @@ public: return f_(a1, a2, a3); } + result_type operator()(A1 a1, A2 a2, A3 a3) const + { + return f_(a1, a2, a3); + } + private: F f_; @@ -130,6 +145,11 @@ public: 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_; @@ -139,31 +159,26 @@ private: template _bi::af0 make_adaptable(F f) { - _bi::instantiate( &_bi::af0::operator() ); // for early error detection return _bi::af0(f); } template _bi::af1 make_adaptable(F f) { - instantiate( &_bi::af1::operator() ); return _bi::af1(f); } template _bi::af2 make_adaptable(F f) { - instantiate( &_bi::af2::operator() ); return _bi::af2(f); } template _bi::af3 make_adaptable(F f) { - instantiate( &_bi::af3::operator() ); return _bi::af3(f); } template _bi::af4 make_adaptable(F f) { - instantiate( &_bi::af4::operator() ); return _bi::af4(f); } diff --git a/boost/boost/bind/mem_fn_cc.hpp b/boost/boost/bind/mem_fn_cc.hpp index a89a2eedfb..8b6ea0ba13 100644 --- a/boost/boost/bind/mem_fn_cc.hpp +++ b/boost/boost/bind/mem_fn_cc.hpp @@ -5,10 +5,9 @@ // // 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. // diff --git a/boost/boost/bind/mem_fn_template.hpp b/boost/boost/bind/mem_fn_template.hpp index ac260b8e66..6368bf25c2 100644 --- a/boost/boost/bind/mem_fn_template.hpp +++ b/boost/boost/bind/mem_fn_template.hpp @@ -5,10 +5,9 @@ // // 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. // @@ -55,6 +54,16 @@ public: { 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 @@ -94,6 +103,16 @@ public: { 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 @@ -139,6 +158,16 @@ public: { 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 @@ -179,6 +208,16 @@ public: { 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 @@ -222,6 +261,16 @@ public: { 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 @@ -260,6 +309,16 @@ public: { 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 @@ -303,6 +362,16 @@ public: { 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 @@ -341,6 +410,16 @@ public: { 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 @@ -384,6 +463,16 @@ public: { 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 @@ -422,6 +511,16 @@ public: { 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 @@ -465,6 +564,16 @@ public: { 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 @@ -503,6 +612,16 @@ public: { 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 @@ -546,6 +665,16 @@ public: { 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 @@ -584,6 +713,16 @@ public: { 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 @@ -627,6 +766,16 @@ public: { 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 @@ -665,6 +814,16 @@ public: { 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 @@ -708,6 +867,16 @@ public: { 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 @@ -751,5 +920,15 @@ public: { 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_; + } }; diff --git a/boost/boost/bind/mem_fn_vw.hpp b/boost/boost/bind/mem_fn_vw.hpp index 6e9f78e9cb..f3fc58db04 100644 --- a/boost/boost/bind/mem_fn_vw.hpp +++ b/boost/boost/bind/mem_fn_vw.hpp @@ -5,10 +5,9 @@ // // 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. // diff --git a/boost/boost/bind/placeholders.hpp b/boost/boost/bind/placeholders.hpp index cf40c7809f..8feed58905 100644 --- a/boost/boost/bind/placeholders.hpp +++ b/boost/boost/bind/placeholders.hpp @@ -12,10 +12,9 @@ // // 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. // @@ -38,7 +37,7 @@ static inline boost::arg<7> _7() { return boost::arg<7>(); } 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; diff --git a/boost/boost/bind/protect.hpp b/boost/boost/bind/protect.hpp index 73b6dce28b..b1ff2a2a8e 100644 --- a/boost/boost/bind/protect.hpp +++ b/boost/boost/bind/protect.hpp @@ -6,10 +6,9 @@ // // 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 diff --git a/boost/boost/cast.hpp b/boost/boost/cast.hpp index 21322f4dce..267b9d0305 100644 --- a/boost/boost/cast.hpp +++ b/boost/boost/cast.hpp @@ -1,10 +1,9 @@ // 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. @@ -129,12 +128,12 @@ namespace boost template struct signed_numeric_limits : std::numeric_limits { - static inline T min() + static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION () { - return std::numeric_limits::min() >= 0 + return (std::numeric_limits::min)() >= 0 // unary minus causes integral promotion, thus the static_cast<> - ? static_cast(-std::numeric_limits::max()) - : std::numeric_limits::min(); + ? static_cast(-(std::numeric_limits::max)()) + : (std::numeric_limits::min)(); }; }; @@ -157,11 +156,11 @@ namespace boost // long / unsigned long long. Not intended to be full // numeric_limits replacements, but good enough for numeric_cast<> template <> - struct fixed_numeric_limits_base + 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; @@ -170,7 +169,7 @@ namespace boost # endif } - static long long min() + static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { # ifdef LONGLONG_MIN return LONGLONG_MIN; @@ -181,11 +180,11 @@ namespace boost }; template <> - struct fixed_numeric_limits_base + 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; @@ -194,7 +193,7 @@ namespace boost # endif } - static unsigned long long min() { return 0; } + static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } }; # endif } // namespace detail @@ -314,10 +313,10 @@ namespace boost template struct fixed_numeric_limits : public std::numeric_limits { - static inline T min() + static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION () { - return std::numeric_limits::is_signed && std::numeric_limits::min() >= 0 - ? T(-std::numeric_limits::max()) : std::numeric_limits::min(); + return std::numeric_limits::is_signed && (std::numeric_limits::min)() >= 0 + ? T(-(std::numeric_limits::max)()) : (std::numeric_limits::min)(); } }; @@ -351,8 +350,8 @@ namespace boost const bool result_is_signed = result_traits::is_signed; const bool same_sign = arg_is_signed == result_is_signed; - if (less_than_type_min::check(arg, result_traits::min()) - || greater_than_type_max::check(arg, result_traits::max()) + if (less_than_type_min::check(arg, (result_traits::min)()) + || greater_than_type_max::check(arg, (result_traits::max)()) ) #else // We need to use #pragma hacks if available @@ -364,8 +363,8 @@ namespace boost #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__) diff --git a/boost/boost/checked_delete.hpp b/boost/boost/checked_delete.hpp index d7f52122de..9bb84e8e1b 100644 --- a/boost/boost/checked_delete.hpp +++ b/boost/boost/checked_delete.hpp @@ -10,15 +10,13 @@ // // 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. // diff --git a/boost/boost/concept_archetype.hpp b/boost/boost/concept_archetype.hpp index 9981ebfab6..f21c817384 100644 --- a/boost/boost/concept_archetype.hpp +++ b/boost/boost/concept_archetype.hpp @@ -1,9 +1,8 @@ // -// (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: // @@ -409,7 +408,7 @@ namespace boost { //=========================================================================== // Iterator Archetype Classes - template + template class input_iterator_archetype { private: @@ -418,7 +417,7 @@ namespace boost { typedef std::input_iterator_tag iterator_category; typedef T value_type; struct reference { - operator value_type() const { return static_object::get(); } + operator const value_type&() const { return static_object::get(); } }; typedef const T* pointer; typedef std::ptrdiff_t difference_type; diff --git a/boost/boost/concept_check.hpp b/boost/boost/concept_check.hpp index 4914351fb6..4ac5ee63e3 100644 --- a/boost/boost/concept_check.hpp +++ b/boost/boost/concept_check.hpp @@ -1,9 +1,8 @@ // -// (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) @@ -180,7 +179,7 @@ struct require_same { typedef T type; }; template <> struct SignedIntegerConcept { void constraints() {} }; template <> struct SignedIntegerConcept { void constraints() {} }; # if defined(BOOST_HAS_LONG_LONG) - template <> struct SignedIntegerConcept { void constraints() {} }; + template <> struct SignedIntegerConcept< ::boost::long_long_type> { void constraints() {} }; # endif // etc. #endif diff --git a/boost/boost/config/auto_link.hpp b/boost/boost/config/auto_link.hpp index fc2e3b8136..b4e580ffa3 100644 --- a/boost/boost/config/auto_link.hpp +++ b/boost/boost/config/auto_link.hpp @@ -81,7 +81,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. // // 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)) @@ -115,11 +115,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. // 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: diff --git a/boost/boost/config/compiler/borland.hpp b/boost/boost/config/compiler/borland.hpp index 66cb1f3f97..531691eff7 100644 --- a/boost/boost/config/compiler/borland.hpp +++ b/boost/boost/config/compiler/borland.hpp @@ -25,6 +25,15 @@ # 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 +#include +#ifndef WCHAR_MAX +# define WCHAR_MAX 0xffff +#endif +#ifndef WCHAR_MIN +# define WCHAR_MIN 0 +#endif #endif #if (__BORLANDC__ <= 0x564) @@ -40,6 +49,7 @@ # 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 diff --git a/boost/boost/config/compiler/comeau.hpp b/boost/boost/config/compiler/comeau.hpp index 9f6ed76b4b..16a1b93cb6 100644 --- a/boost/boost/config/compiler/comeau.hpp +++ b/boost/boost/config/compiler/comeau.hpp @@ -14,14 +14,11 @@ #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 diff --git a/boost/boost/config/compiler/compaq_cxx.hpp b/boost/boost/config/compiler/compaq_cxx.hpp index a52e66a29c..3c0c6b7ff9 100644 --- a/boost/boost/config/compiler/compaq_cxx.hpp +++ b/boost/boost/config/compiler/compaq_cxx.hpp @@ -15,5 +15,6 @@ // versions check: // Nothing to do here? +# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL diff --git a/boost/boost/config/compiler/hp_acc.hpp b/boost/boost/config/compiler/hp_acc.hpp index d6cc9fff19..b5c587ab71 100644 --- a/boost/boost/config/compiler/hp_acc.hpp +++ b/boost/boost/config/compiler/hp_acc.hpp @@ -42,10 +42,12 @@ # 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) // diff --git a/boost/boost/config/compiler/intel.hpp b/boost/boost/config/compiler/intel.hpp index 22890ca7cd..060338bcf1 100644 --- a/boost/boost/config/compiler/intel.hpp +++ b/boost/boost/config/compiler/intel.hpp @@ -29,12 +29,18 @@ #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) @@ -61,17 +67,48 @@ #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 +template< typename T > struct assert_no_intrinsic_wchar_t; +template<> struct assert_no_intrinsic_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::type assert_no_intrinsic_wchar_t_; +#else +template< typename T > struct assert_intrinsic_wchar_t; +template<> struct assert_intrinsic_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 {}; +#endif + + #if (BOOST_INTEL_CXX_VERSION <= 800) || !defined(BOOST_STRICT_CONFIG) # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #endif @@ -100,7 +137,7 @@ #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) diff --git a/boost/boost/config/compiler/metrowerks.hpp b/boost/boost/config/compiler/metrowerks.hpp index b334cee727..a74cadef18 100644 --- a/boost/boost/config/compiler/metrowerks.hpp +++ b/boost/boost/config/compiler/metrowerks.hpp @@ -3,6 +3,7 @@ // (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) @@ -36,7 +37,7 @@ # define BOOST_NO_SFINAE # endif -# if(__MWERKS__ <= 0x3202) // 9.2 +# if(__MWERKS__ <= 0x3204) // 9.3 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # endif @@ -63,6 +64,8 @@ # 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 @@ -80,7 +83,7 @@ #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 diff --git a/boost/boost/config/compiler/vacpp.hpp b/boost/boost/config/compiler/vacpp.hpp index 89d5e7f69c..4cf0de7c19 100644 --- a/boost/boost/config/compiler/vacpp.hpp +++ b/boost/boost/config/compiler/vacpp.hpp @@ -26,6 +26,8 @@ #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 // diff --git a/boost/boost/config/compiler/visualc.hpp b/boost/boost/config/compiler/visualc.hpp index aca7dfea44..3235326039 100644 --- a/boost/boost/config/compiler/visualc.hpp +++ b/boost/boost/config/compiler/visualc.hpp @@ -17,7 +17,7 @@ // 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 @@ -54,6 +54,7 @@ # 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 @@ -64,7 +65,7 @@ # define BOOST_NO_SWPRINTF #endif -#if _MSC_VER <= 1310 +#if _MSC_VER <= 1400 // 1400 == VC++ 8.0 # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #endif @@ -72,6 +73,11 @@ # 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 @@ -115,6 +121,8 @@ # 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 @@ -129,18 +137,10 @@ #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 - - - - - - - - diff --git a/boost/boost/config/platform/bsd.hpp b/boost/boost/config/platform/bsd.hpp index e83b6433e6..4f04ed2a03 100644 --- a/boost/boost/config/platform/bsd.hpp +++ b/boost/boost/config/platform/bsd.hpp @@ -46,7 +46,9 @@ // // The BSD 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: diff --git a/boost/boost/config/platform/macos.hpp b/boost/boost/config/platform/macos.hpp index edaf1a751c..3a5f41303f 100644 --- a/boost/boost/config/platform/macos.hpp +++ b/boost/boost/config/platform/macos.hpp @@ -15,8 +15,6 @@ // 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 diff --git a/boost/boost/config/platform/win32.hpp b/boost/boost/config/platform/win32.hpp index a637dc3772..548bff280b 100644 --- a/boost/boost/config/platform/win32.hpp +++ b/boost/boost/config/platform/win32.hpp @@ -33,6 +33,11 @@ // 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 @@ -40,47 +45,6 @@ #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 // 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 - - diff --git a/boost/boost/config/posix_features.hpp b/boost/boost/config/posix_features.hpp index f405aeddbd..4afb476b7f 100644 --- a/boost/boost/config/posix_features.hpp +++ b/boost/boost/config/posix_features.hpp @@ -76,7 +76,7 @@ // 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 diff --git a/boost/boost/config/select_stdlib_config.hpp b/boost/boost/config/select_stdlib_config.hpp index 111bd93242..b7bf591434 100644 --- a/boost/boost/config/select_stdlib_config.hpp +++ b/boost/boost/config/select_stdlib_config.hpp @@ -33,7 +33,7 @@ // 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" diff --git a/boost/boost/config/stdlib/dinkumware.hpp b/boost/boost/config/stdlib/dinkumware.hpp index d3fc190bcf..aa214fc1b0 100644 --- a/boost/boost/config/stdlib/dinkumware.hpp +++ b/boost/boost/config/stdlib/dinkumware.hpp @@ -29,7 +29,7 @@ # 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 @@ -61,6 +61,15 @@ # 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 @@ -69,7 +78,7 @@ # 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 // this may be an overly restrictive define, but regex fails without it: # define BOOST_NO_STD_LOCALE @@ -94,3 +103,4 @@ + diff --git a/boost/boost/config/stdlib/libcomo.hpp b/boost/boost/config/stdlib/libcomo.hpp index 3ec438db97..b2c8e44002 100644 --- a/boost/boost/config/stdlib/libcomo.hpp +++ b/boost/boost/config/stdlib/libcomo.hpp @@ -24,6 +24,15 @@ # 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 diff --git a/boost/boost/config/stdlib/libstdcpp3.hpp b/boost/boost/config/stdlib/libstdcpp3.hpp index ccaf83acdf..9774e8761d 100644 --- a/boost/boost/config/stdlib/libstdcpp3.hpp +++ b/boost/boost/config/stdlib/libstdcpp3.hpp @@ -9,19 +9,43 @@ // 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 - - diff --git a/boost/boost/config/stdlib/msl.hpp b/boost/boost/config/stdlib/msl.hpp index 4c6bad4a9c..f8ad3d9adb 100644 --- a/boost/boost/config/stdlib/msl.hpp +++ b/boost/boost/config/stdlib/msl.hpp @@ -30,7 +30,9 @@ #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 #endif diff --git a/boost/boost/config/stdlib/roguewave.hpp b/boost/boost/config/stdlib/roguewave.hpp index 886c30eb30..ec3d881b58 100644 --- a/boost/boost/config/stdlib/roguewave.hpp +++ b/boost/boost/config/stdlib/roguewave.hpp @@ -41,7 +41,9 @@ # 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 diff --git a/boost/boost/config/stdlib/stlport.hpp b/boost/boost/config/stdlib/stlport.hpp index 94d705bb0d..4843ea59bc 100644 --- a/boost/boost/config/stdlib/stlport.hpp +++ b/boost/boost/config/stdlib/stlport.hpp @@ -82,6 +82,19 @@ # 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: // @@ -149,6 +162,16 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; # 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: @@ -157,6 +180,15 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy; # 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 // 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) diff --git a/boost/boost/config/stdlib/vacpp.hpp b/boost/boost/config/stdlib/vacpp.hpp index 9579039eeb..8321ee0ccf 100644 --- a/boost/boost/config/stdlib/vacpp.hpp +++ b/boost/boost/config/stdlib/vacpp.hpp @@ -10,6 +10,7 @@ #endif #define BOOST_HAS_MACRO_USE_FACET +#define BOOST_NO_STD_MESSAGES #define BOOST_STDLIB "Visual Age default standard library" diff --git a/boost/boost/config/suffix.hpp b/boost/boost/config/suffix.hpp index 84d9a11749..77d9decac1 100644 --- a/boost/boost/config/suffix.hpp +++ b/boost/boost/config/suffix.hpp @@ -285,17 +285,29 @@ 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 - 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 - 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; } } @@ -314,27 +326,33 @@ namespace std { # 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(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(0)) +# define BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast(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(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 ------------------------------------------// @@ -381,6 +399,23 @@ namespace std { # 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 diff --git a/boost/boost/crc.hpp b/boost/boost/crc.hpp index bfa81b18ed..640b3cf45f 100644 --- a/boost/boost/crc.hpp +++ b/boost/boost/crc.hpp @@ -1,6 +1,6 @@ // 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 .) @@ -527,6 +527,30 @@ namespace detail 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::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::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 > @@ -555,7 +579,9 @@ namespace detail // 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 ) @@ -578,7 +604,7 @@ namespace detail // 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 ^ remainderCHAR_BIT)>::align_msb( rem ); } // Shift out the remainder's highest byte static value_type shift( value_type rem ) diff --git a/boost/boost/cregex.hpp b/boost/boost/cregex.hpp index b591115efb..661a5ca25f 100644 --- a/boost/boost/cregex.hpp +++ b/boost/boost/cregex.hpp @@ -30,7 +30,7 @@ #include #endif -#endif // include guard +#endif /* include guard */ diff --git a/boost/boost/cstdint.hpp b/boost/boost/cstdint.hpp index 5dc83b4a2f..40ad844351 100644 --- a/boost/boost/cstdint.hpp +++ b/boost/boost/cstdint.hpp @@ -1,10 +1,11 @@ // 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. @@ -81,8 +82,8 @@ namespace boost } // namespace boost -#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) -// FreeBSD has an that contains much of what we need +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) +// FreeBSD and Tru64 have an that contains much of what we need. # include namespace boost { @@ -222,14 +223,14 @@ 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 diff --git a/boost/boost/cstdlib.hpp b/boost/boost/cstdlib.hpp index 2ce9027afc..6322146354 100644 --- a/boost/boost/cstdlib.hpp +++ b/boost/boost/cstdlib.hpp @@ -1,7 +1,8 @@ // 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. diff --git a/boost/boost/current_function.hpp b/boost/boost/current_function.hpp index 4aea5efe39..40e3abdca2 100644 --- a/boost/boost/current_function.hpp +++ b/boost/boost/current_function.hpp @@ -12,10 +12,9 @@ // // 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 // diff --git a/boost/boost/detail/atomic_count.hpp b/boost/boost/detail/atomic_count.hpp index da4fc69e16..3ad92b1c32 100644 --- a/boost/boost/detail/atomic_count.hpp +++ b/boost/boost/detail/atomic_count.hpp @@ -12,10 +12,9 @@ // // 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 boost::detail::atomic_count; // diff --git a/boost/boost/detail/atomic_count_gcc.hpp b/boost/boost/detail/atomic_count_gcc.hpp index c3d29a8736..9fa661f3c4 100644 --- a/boost/boost/detail/atomic_count_gcc.hpp +++ b/boost/boost/detail/atomic_count_gcc.hpp @@ -11,10 +11,9 @@ // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Lars Gullik Bjřnnes // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in 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 @@ -38,7 +37,7 @@ public: long operator--() { - return !__exchange_and_add(&value_, -1); + return __exchange_and_add(&value_, -1) - 1; } operator long() const @@ -51,7 +50,7 @@ private: atomic_count(atomic_count const &); atomic_count & operator=(atomic_count const &); - _Atomic_word value_; + mutable _Atomic_word value_; }; } // namespace detail diff --git a/boost/boost/detail/atomic_count_linux.hpp b/boost/boost/detail/atomic_count_linux.hpp index 1a69cec6cb..e0b0dda36b 100644 --- a/boost/boost/detail/atomic_count_linux.hpp +++ b/boost/boost/detail/atomic_count_linux.hpp @@ -6,10 +6,9 @@ // // 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) // // diff --git a/boost/boost/detail/atomic_count_pthreads.hpp b/boost/boost/detail/atomic_count_pthreads.hpp index 0f8c66368b..7ed055f7d6 100644 --- a/boost/boost/detail/atomic_count_pthreads.hpp +++ b/boost/boost/detail/atomic_count_pthreads.hpp @@ -6,10 +6,9 @@ // // 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 diff --git a/boost/boost/detail/atomic_count_win32.hpp b/boost/boost/detail/atomic_count_win32.hpp index c8a4681481..0dfa3f3ba7 100644 --- a/boost/boost/detail/atomic_count_win32.hpp +++ b/boost/boost/detail/atomic_count_win32.hpp @@ -12,10 +12,9 @@ // // 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 diff --git a/boost/boost/detail/binary_search.hpp b/boost/boost/detail/binary_search.hpp index c19763e1b0..3dca9b6509 100644 --- a/boost/boost/detail/binary_search.hpp +++ b/boost/boost/detail/binary_search.hpp @@ -1,8 +1,7 @@ -// 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 diff --git a/boost/boost/detail/catch_exceptions.hpp b/boost/boost/detail/catch_exceptions.hpp index 065b351df2..b1a3c76b2a 100644 --- a/boost/boost/detail/catch_exceptions.hpp +++ b/boost/boost/detail/catch_exceptions.hpp @@ -1,7 +1,8 @@ // 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. diff --git a/boost/boost/python/detail/indirect_traits.hpp b/boost/boost/detail/indirect_traits.hpp old mode 100644 new mode 100755 similarity index 94% rename from boost/boost/python/detail/indirect_traits.hpp rename to boost/boost/detail/indirect_traits.hpp index 752cd7d268..57f5af6b47 --- a/boost/boost/python/detail/indirect_traits.hpp +++ b/boost/boost/detail/indirect_traits.hpp @@ -1,8 +1,7 @@ -// 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 INDIRECT_TRAITS_DWA2002131_HPP # define INDIRECT_TRAITS_DWA2002131_HPP # include @@ -17,11 +16,7 @@ # include # include - # include -# if 0 && BOOST_WORKAROUND(__MWERKS__, <= 0x2407) -# include -# endif # include # include @@ -30,10 +25,12 @@ # include # ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -# include +# include # endif -namespace boost { namespace python { namespace detail { +namespace boost { namespace detail { + +namespace indirect_traits { # ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template @@ -202,6 +199,8 @@ struct is_pointer_to_class # 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]; @@ -467,6 +466,10 @@ struct is_pointer_to_class }; # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -}}} // namespace boost::python::detail +} + +using namespace indirect_traits; + +}} // namespace boost::python::detail #endif // INDIRECT_TRAITS_DWA2002131_HPP diff --git a/boost/boost/detail/is_incrementable.hpp b/boost/boost/detail/is_incrementable.hpp index 3054ced159..110d16e671 100755 --- a/boost/boost/detail/is_incrementable.hpp +++ b/boost/boost/detail/is_incrementable.hpp @@ -19,14 +19,28 @@ namespace boost { namespace detail { // 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 any(T const&); }; - tag operator++(any 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]; @@ -35,36 +49,41 @@ namespace is_incrementable_ template - struct -# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) - impl -# else - is_incrementable -# endif + struct impl { static typename remove_cv::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:: -# endif - value)> type; + template + struct postfix_impl + { + static typename remove_cv::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 -struct is_incrementable : is_incrementable_::impl +struct is_incrementable + : mpl::bool_< ::boost::detail::is_incrementable_::impl::value> +{ +}; + +template +struct is_postfix_incrementable + : mpl::bool_< ::boost::detail::is_incrementable_::postfix_impl::value> { }; -# else -using is_incrementable_::is_incrementable; -# endif }} // namespace boost::detail diff --git a/boost/boost/detail/iterator.hpp b/boost/boost/detail/iterator.hpp index 5a692ee4b7..5bb9c6269c 100644 --- a/boost/boost/detail/iterator.hpp +++ b/boost/boost/detail/iterator.hpp @@ -1,8 +1,7 @@ -// (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 // @@ -145,7 +144,7 @@ struct iterator_traits # endif # include -# include +# include # include // should be the last #include @@ -267,7 +266,7 @@ template struct pointer_iterator_traits; template struct pointer_iterator_traits { - typedef remove_const::type value_type; + typedef typename remove_const::type value_type; typedef T* pointer; typedef T& reference; typedef std::random_access_iterator_tag iterator_category; @@ -335,8 +334,8 @@ struct msvc_stdlib_mutable_traits : std::iterator_traits { typedef typename std::iterator_traits::distance_type difference_type; - typedef value_type* pointer; - typedef value_type& reference; + typedef typename std::iterator_traits::value_type* pointer; + typedef typename std::iterator_traits::value_type& reference; }; template @@ -344,8 +343,8 @@ struct msvc_stdlib_const_traits : std::iterator_traits { typedef typename std::iterator_traits::distance_type difference_type; - typedef const value_type* pointer; - typedef const value_type& reference; + typedef const typename std::iterator_traits::value_type* pointer; + typedef const typename std::iterator_traits::value_type& reference; }; # ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION diff --git a/boost/boost/detail/lightweight_mutex.hpp b/boost/boost/detail/lightweight_mutex.hpp index 9155940738..22e0f54085 100644 --- a/boost/boost/detail/lightweight_mutex.hpp +++ b/boost/boost/detail/lightweight_mutex.hpp @@ -12,10 +12,9 @@ // // 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 boost::detail::lightweight_mutex; // diff --git a/boost/boost/detail/limits.hpp b/boost/boost/detail/limits.hpp index 5f478e3ece..035244037d 100644 --- a/boost/boost/detail/limits.hpp +++ b/boost/boost/detail/limits.hpp @@ -94,23 +94,14 @@ enum float_denorm_style { 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 _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); @@ -164,8 +155,8 @@ class _Integer_limits : public _Numeric_limits_base<_Int> 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, @@ -388,9 +379,9 @@ template<> class numeric_limits 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. }; @@ -416,9 +407,9 @@ template<> class numeric_limits 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. }; @@ -444,9 +435,9 @@ template<> class numeric_limits 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. }; diff --git a/boost/boost/detail/lwm_gcc.hpp b/boost/boost/detail/lwm_gcc.hpp index bf8a09a361..e64ef7d7b2 100644 --- a/boost/boost/detail/lwm_gcc.hpp +++ b/boost/boost/detail/lwm_gcc.hpp @@ -11,10 +11,9 @@ // Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Lars Gullik Bjřnnes // -// Permission to copy, use, modify, sell and distribute this software -// is granted provided this copyright notice appears in 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 @@ -37,7 +36,7 @@ private: public: - lightweight_mutex(): a_(1) + lightweight_mutex(): a_(0) { } @@ -57,16 +56,16 @@ public: 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); } }; }; diff --git a/boost/boost/detail/lwm_irix.hpp b/boost/boost/detail/lwm_irix.hpp index 6e5e57f143..cfc304b74a 100644 --- a/boost/boost/detail/lwm_irix.hpp +++ b/boost/boost/detail/lwm_irix.hpp @@ -7,10 +7,9 @@ // 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 diff --git a/boost/boost/detail/lwm_linux.hpp b/boost/boost/detail/lwm_linux.hpp index e4c23c331a..f0cfb7fb86 100644 --- a/boost/boost/detail/lwm_linux.hpp +++ b/boost/boost/detail/lwm_linux.hpp @@ -6,10 +6,9 @@ // // 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) // // diff --git a/boost/boost/detail/lwm_nop.hpp b/boost/boost/detail/lwm_nop.hpp index fdc0a3d9ee..c73ab68f5e 100644 --- a/boost/boost/detail/lwm_nop.hpp +++ b/boost/boost/detail/lwm_nop.hpp @@ -12,10 +12,9 @@ // // 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 diff --git a/boost/boost/detail/lwm_pthreads.hpp b/boost/boost/detail/lwm_pthreads.hpp index 79ea5a7d59..a5bf75bde7 100644 --- a/boost/boost/detail/lwm_pthreads.hpp +++ b/boost/boost/detail/lwm_pthreads.hpp @@ -12,10 +12,9 @@ // // 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 diff --git a/boost/boost/detail/lwm_win32.hpp b/boost/boost/detail/lwm_win32.hpp index 22282314fb..8496ed8dc5 100644 --- a/boost/boost/detail/lwm_win32.hpp +++ b/boost/boost/detail/lwm_win32.hpp @@ -12,10 +12,9 @@ // // 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 diff --git a/boost/boost/detail/lwm_win32_cs.hpp b/boost/boost/detail/lwm_win32_cs.hpp index c4547de84e..4ee0a71ca2 100644 --- a/boost/boost/detail/lwm_win32_cs.hpp +++ b/boost/boost/detail/lwm_win32_cs.hpp @@ -12,10 +12,9 @@ // // 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 diff --git a/boost/boost/detail/named_template_params.hpp b/boost/boost/detail/named_template_params.hpp index 2af39ccf53..e7cb079433 100644 --- a/boost/boost/detail/named_template_params.hpp +++ b/boost/boost/detail/named_template_params.hpp @@ -1,8 +1,7 @@ -// (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: diff --git a/boost/boost/detail/numeric_traits.hpp b/boost/boost/detail/numeric_traits.hpp index f8cbf36d43..6325d70cb0 100644 --- a/boost/boost/detail/numeric_traits.hpp +++ b/boost/boost/detail/numeric_traits.hpp @@ -1,15 +1,8 @@ -// (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 -- // diff --git a/boost/boost/detail/reference_content.hpp b/boost/boost/detail/reference_content.hpp index 382e491526..daf56a8b19 100644 --- a/boost/boost/detail/reference_content.hpp +++ b/boost/boost/detail/reference_content.hpp @@ -6,13 +6,9 @@ // 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 diff --git a/boost/boost/detail/select_type.hpp b/boost/boost/detail/select_type.hpp index 3d15a97e35..c13946f338 100644 --- a/boost/boost/detail/select_type.hpp +++ b/boost/boost/detail/select_type.hpp @@ -1,8 +1,7 @@ -// (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. diff --git a/boost/boost/detail/shared_array_nmt.hpp b/boost/boost/detail/shared_array_nmt.hpp index 8e9b727aa0..13ca6aca15 100644 --- a/boost/boost/detail/shared_array_nmt.hpp +++ b/boost/boost/detail/shared_array_nmt.hpp @@ -7,10 +7,9 @@ // (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. // diff --git a/boost/boost/detail/shared_count.hpp b/boost/boost/detail/shared_count.hpp index 2d14179ff3..86d8e4b7c5 100644 --- a/boost/boost/detail/shared_count.hpp +++ b/boost/boost/detail/shared_count.hpp @@ -12,10 +12,9 @@ // // 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 @@ -395,9 +394,13 @@ public: 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; } diff --git a/boost/boost/detail/shared_ptr_nmt.hpp b/boost/boost/detail/shared_ptr_nmt.hpp index 14fbe6522b..0780e305b5 100644 --- a/boost/boost/detail/shared_ptr_nmt.hpp +++ b/boost/boost/detail/shared_ptr_nmt.hpp @@ -7,10 +7,9 @@ // (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. // diff --git a/boost/boost/detail/workaround.hpp b/boost/boost/detail/workaround.hpp index 0d5a2b2bcb..b5ecad7744 100644 --- a/boost/boost/detail/workaround.hpp +++ b/boost/boost/detail/workaround.hpp @@ -1,8 +1,7 @@ -// 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 diff --git a/boost/boost/enable_shared_from_this.hpp b/boost/boost/enable_shared_from_this.hpp index d3f8ab80b8..0cf7854ccc 100644 --- a/boost/boost/enable_shared_from_this.hpp +++ b/boost/boost/enable_shared_from_this.hpp @@ -6,10 +6,9 @@ // // 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 // @@ -60,7 +59,7 @@ public: } 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 diff --git a/boost/boost/filesystem/convenience.hpp b/boost/boost/filesystem/convenience.hpp index 2f50c8751b..cae90c0c59 100644 --- a/boost/boost/filesystem/convenience.hpp +++ b/boost/boost/filesystem/convenience.hpp @@ -23,10 +23,7 @@ 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); diff --git a/boost/boost/filesystem/exception.hpp b/boost/boost/filesystem/exception.hpp index 884df03129..e07429e74e 100644 --- a/boost/boost/filesystem/exception.hpp +++ b/boost/boost/filesystem/exception.hpp @@ -67,7 +67,8 @@ namespace boost 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, diff --git a/boost/boost/filesystem/operations.hpp b/boost/boost/filesystem/operations.hpp index 739067d0fa..a9bff05bdf 100644 --- a/boost/boost/filesystem/operations.hpp +++ b/boost/boost/filesystem/operations.hpp @@ -18,6 +18,7 @@ #include // includes #include #include +#include #include #include @@ -52,12 +53,14 @@ namespace boost 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 ); @@ -74,6 +77,14 @@ namespace boost 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 diff --git a/boost/boost/filesystem/path.hpp b/boost/boost/filesystem/path.hpp index 8f8cca47ec..417574c416 100644 --- a/boost/boost/filesystem/path.hpp +++ b/boost/boost/filesystem/path.hpp @@ -82,7 +82,7 @@ namespace boost 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; @@ -116,6 +116,14 @@ namespace boost 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 diff --git a/boost/boost/format.hpp b/boost/boost/format.hpp index 3736181fd3..73464a819f 100644 --- a/boost/boost/format.hpp +++ b/boost/boost/format.hpp @@ -1,30 +1,31 @@ -// -*- 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. - - // ---------------------------------------------------------------------------- // format.hpp : primary header // ---------------------------------------------------------------------------- +// 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_HPP #define BOOST_FORMAT_HPP #include #include #include -#include +#include #ifndef BOOST_NO_STD_LOCALE #include #endif +// *** Compatibility framework +#include + #ifdef BOOST_NO_LOCALE_ISIDIGIT #include // we'll use the non-locale 's std::isdigit(int) #endif diff --git a/boost/boost/format/alt_sstream.hpp b/boost/boost/format/alt_sstream.hpp new file mode 100644 index 0000000000..d42755d55d --- /dev/null +++ b/boost/boost/format/alt_sstream.hpp @@ -0,0 +1,172 @@ +// ---------------------------------------------------------------------------- +// 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 +#include +#include +#include +#include + +namespace boost { + namespace io { + + template, + class Alloc=::std::allocator > + class basic_altstringbuf; + + template, + class Alloc=::std::allocator > + class basic_oaltstringstream; + + + template + class basic_altstringbuf + : public ::std::basic_streambuf + { + typedef ::std::basic_streambuf streambuf_t; + typedef typename CompatAlloc::compatible_type compat_allocator_type; + typedef typename CompatTraits::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 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( 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 basic_oaltstringstream + : private base_from_member< shared_ptr< basic_altstringbuf< Ch, Tr, Alloc> > >, + public ::std::basic_ostream + { + class No_Op { + // used as no-op deleter for (not-owner) shared_pointers + public: + template + const T & operator()(const T & arg) { return arg; } + }; + typedef ::std::basic_ostream stream_t; + typedef boost::base_from_member > > + pbase_type; + typedef ::std::basic_string string_type; + typedef basic_altstringbuf stringbuf_t; + public: + typedef Alloc allocator_type; + basic_oaltstringstream() + : pbase_type(new stringbuf_t), stream_t(rdbuf()) + { } + basic_oaltstringstream(::boost::shared_ptr 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 + +#endif // include guard + diff --git a/boost/boost/format/alt_sstream_impl.hpp b/boost/boost/format/alt_sstream_impl.hpp new file mode 100644 index 0000000000..9373ed9249 --- /dev/null +++ b/boost/boost/format/alt_sstream_impl.hpp @@ -0,0 +1,294 @@ +// ---------------------------------------------------------------------------- +// 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 + void basic_altstringbuf:: + 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 + void basic_altstringbuf:: + 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 + Ch* basic_altstringbuf:: + 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 + std::streamsize basic_altstringbuf:: + size () const { + if(mode_ & ::std::ios_base::out && pptr()) + return static_cast( pend() - pbase()); + else if(mode_ & ::std::ios_base::in && gptr()) + return static_cast( egptr() - eback()); + else + return 0; + } + + template + std::streamsize basic_altstringbuf:: + cur_size () const { + if(mode_ & ::std::ios_base::out && pptr()) + return static_cast( pptr() - pbase()); + else if(mode_ & ::std::ios_base::in && gptr()) + return static_cast( gptr() - eback()); + else + return 0; + } + + template + typename basic_altstringbuf::pos_type + basic_altstringbuf:: + 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 + typename basic_altstringbuf::pos_type + basic_altstringbuf:: + 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 + typename basic_altstringbuf::int_type + basic_altstringbuf:: + 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 + typename basic_altstringbuf::int_type + basic_altstringbuf:: + 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 + typename basic_altstringbuf::int_type + basic_altstringbuf:: + 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::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 + void basic_altstringbuf:: 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 + diff --git a/boost/boost/format/detail/compat_workarounds.hpp b/boost/boost/format/detail/compat_workarounds.hpp new file mode 100644 index 0000000000..8e51514f3e --- /dev/null +++ b/boost/boost/format/detail/compat_workarounds.hpp @@ -0,0 +1,86 @@ +// ---------------------------------------------------------------------------- +// 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 CompatTraits; + + // std::allocator 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 CompatAlloc; + } // N.S. io +}// N.S. boost + + +#include + // 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 +#endif + +#if !defined(BOOST_FORMAT_OSTREAM_DEFINED) +// workarounds-gcc-2.95 might already have included +#include +#endif + + + +namespace boost { + namespace io { + + // **** CompatTraits general definitions : ---------------------------- + template + class CompatTraits + { // general case : be transparent + public: + typedef Tr compatible_type; + }; + + // **** CompatAlloc general definitions : ----------------------------- + template + class CompatAlloc + { // general case : be transparent + public: + typedef Alloc compatible_type; + }; + + } //N.S. io +} // N.S. boost +#endif // include guard diff --git a/boost/boost/format/detail/config_macros.hpp b/boost/boost/format/detail/config_macros.hpp index c598fc131d..5813ad2b90 100644 --- a/boost/boost/format/detail/config_macros.hpp +++ b/boost/boost/format/detail/config_macros.hpp @@ -1,18 +1,18 @@ // -*- C++ -*- -// Boost general library 'format' --------------------------- -// See http://www.boost.org for updates, documentation, and revision history. - -// (C) Samuel Krempp 2001 -// Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -// ------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // config_macros.hpp : configuration macros for the format library -// only BOOST_IO_STD is absolutely needed. other are just used to trigger workaround -// codes here and there. -// ------------------------------------------------------------------------------ +// only BOOST_IO_STD is absolutely needed (it should be 'std::' in general) +// others are compiler-specific workaround macros used in #ifdef switches +// ---------------------------------------------------------------------------- + +// 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_CONFIG_MACROS_HPP #define BOOST_FORMAT_CONFIG_MACROS_HPP @@ -22,17 +22,19 @@ // 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 -#include // stlport workarounds +#include +#include #ifndef BOOST_IO_STD -# define BOOST_IO_STD std:: +# define BOOST_IO_STD ::std:: #endif #if defined(BOOST_NO_STD_LOCALE) || \ @@ -47,8 +49,8 @@ #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 @@ -58,18 +60,38 @@ 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 } -#endif + // -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 diff --git a/boost/boost/format/detail/msvc_disambiguater.hpp b/boost/boost/format/detail/msvc_disambiguater.hpp index 17d96bd080..d84ff63103 100644 --- a/boost/boost/format/detail/msvc_disambiguater.hpp +++ b/boost/boost/format/detail/msvc_disambiguater.hpp @@ -1,27 +1,21 @@ -// -*- 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 #include diff --git a/boost/boost/format/detail/unset_macros.hpp b/boost/boost/format/detail/unset_macros.hpp index 16929697cf..22ecbbd153 100644 --- a/boost/boost/format/detail/unset_macros.hpp +++ b/boost/boost/format/detail/unset_macros.hpp @@ -1,3 +1,15 @@ +// ---------------------------------------------------------------------------- +// 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 @@ -11,3 +23,12 @@ #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 diff --git a/boost/boost/format/detail/workarounds_gcc-2.95.hpp b/boost/boost/format/detail/workarounds_gcc-2.95.hpp deleted file mode 100644 index 8d588af0f5..0000000000 --- a/boost/boost/format/detail/workarounds_gcc-2.95.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// -*- 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 where gcc only supplies foo : -// - basic_ios from ios -// - basic_ostream from ostream -// - basic_srteambuf 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 // SGI STL doesnt have 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 char_traits : public string_char_traits { -}; -// only problem : gcc's 'string' is a typedef for basic_string >, -// so strings built using char_traits wont match the type 'string'. -// so it's better to use string_char_traits directly. - -template -class basic_ios; - -template -class basic_ios : 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 basic_ostream; - -template -class basic_ostream : public basic_ios { -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 basic_streambuf; - -template -class basic_streambuf : public streambuf { -}; - - -} // namespace std - - -#endif // include guard - -#endif // if workaround diff --git a/boost/boost/format/detail/workarounds_gcc-2_95.hpp b/boost/boost/format/detail/workarounds_gcc-2_95.hpp new file mode 100644 index 0000000000..8c49d42d02 --- /dev/null +++ b/boost/boost/format/detail/workarounds_gcc-2_95.hpp @@ -0,0 +1,162 @@ +// ---------------------------------------------------------------------------- +// 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 where gcc only supplies foo. +// i.e : +// - basic_ios from ios +// - basic_ostream from ostream +// - basic_srteambuf 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 and others, so we need iostream. +#include +#define BOOST_FORMAT_OSTREAM_DEFINED + +#include +#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 char_traits; // no definition here, we will just use it as a tag. + + template + class basic_streambuf; + + template + class basic_streambuf : public streambuf { + }; + + template > + class basic_ios; + + template + class basic_ios : 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 basic_ostream; + + template + class basic_ostream : public basic_ios + { + public: + basic_ostream(streambuf * p) : basic_ios (p) {} + }; + +} // namespace std + + +namespace boost { + namespace io { + + + // ** CompatTraits gcc2.95 specialisations ---------------------------- + template + class CompatTraits< ::std::string_char_traits > + : public ::std::string_char_traits + { + 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(meta); } + static int_type + to_int_type(const char_type& ch) { + return static_cast(static_cast(ch) );} + static bool + eq_int_type(const int_type& left, const int_type& right) { + return left == right; } + static int_type + eof() { + return static_cast(EOF); + } + static int_type + not_eof(const int_type& meta) { + return (meta == eof()) ? 0 : meta; + } + }; + + template + class CompatTraits< ::std::char_traits > { + public: + typedef CompatTraits< ::std::string_char_traits > compatible_type; + }; + + // ** CompatAlloc gcc-2.95 specialisations --------------------------- + template<> + class CompatAlloc< ::std::alloc> + { + public: + typedef ::std::allocator compatible_type; + }; + + } // N.S. io +} // N.S. boost + + + + + +#endif // include guard + +#endif // if workaround diff --git a/boost/boost/format/detail/workarounds_stlport.hpp b/boost/boost/format/detail/workarounds_stlport.hpp index 5cd4df872a..eb35dc1708 100644 --- a/boost/boost/format/detail/workarounds_stlport.hpp +++ b/boost/boost/format/detail/workarounds_stlport.hpp @@ -1,24 +1,24 @@ -// -*- 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 @@ -37,6 +37,6 @@ #endif -// ------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- #endif // BOOST_MACROS_STLPORT_HPP diff --git a/boost/boost/format/exceptions.hpp b/boost/boost/format/exceptions.hpp index 79e452449e..a0dd547090 100644 --- a/boost/boost/format/exceptions.hpp +++ b/boost/boost/format/exceptions.hpp @@ -1,21 +1,14 @@ -// -*- 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 @@ -26,69 +19,80 @@ 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 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 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 -{ -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_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 -{ -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 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 -{ -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."; - } -}; + 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 io } // namespace boost diff --git a/boost/boost/format/feed_args.hpp b/boost/boost/format/feed_args.hpp index 2a28237e64..3f1ce749ff 100644 --- a/boost/boost/format/feed_args.hpp +++ b/boost/boost/format/feed_args.hpp @@ -1,44 +1,33 @@ -// -*- 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 +#include +#include + #include #include - #include -#include namespace boost { namespace io { namespace detail { -namespace { - template - void clear_buffer(io::basic_outsstream & os) { - os.clear_buffer(); - } - - template - void mk_str( std::basic_string & res, + template + void mk_str( std::basic_string & res, const Ch * beg, std::streamsize size, std::streamsize w, @@ -46,8 +35,8 @@ namespace { 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; @@ -80,102 +69,103 @@ namespace { // 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& os, const T& x ) { + void put_head (BOOST_IO_STD basic_ostream & os, const T& x ) { disambiguater::put_head(os, x, 1L); } template< class Ch, class Tr, class T> inline - void put_last( BOOST_IO_STD basic_ostream& os, const T& x ) { + void put_last (BOOST_IO_STD basic_ostream & os, const T& x ) { disambiguater::put_last(os, x, 1L); } #else template< class Ch, class Tr, class T> inline - void put_head(BOOST_IO_STD basic_ostream& , const T& ) { + void put_head (BOOST_IO_STD basic_ostream &, const T& ) { } template< class Ch, class Tr, class T> inline - void put_head( BOOST_IO_STD basic_ostream& os, const group1& x ) { + void put_head( BOOST_IO_STD basic_ostream & os, const group1& 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& os, const T& x ) { + void put_last( BOOST_IO_STD basic_ostream & os, const T& x ) { os << x ; } template< class Ch, class Tr, class T> inline - void put_last( BOOST_IO_STD basic_ostream& os, const group1& x ) { + void put_last( BOOST_IO_STD basic_ostream & os, const group1& 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& , T& ) { + void put_head( BOOST_IO_STD basic_ostream &, T& ) { } template< class Ch, class Tr, class T> inline - void put_last( BOOST_IO_STD basic_ostream& os, T& x ) { + void put_last( BOOST_IO_STD basic_ostream & 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& specs, - std::basic_string & res, - io::basic_outsstream& oss_ ) + const format_item& specs, + typename basic_format::string_type& res, + typename basic_format::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 string_t; - typedef format_item format_item_t; - - specs.fmtstate_.apply_on(oss_); + typedef typename basic_format::string_type string_type; + typedef typename basic_format::format_item_t format_item_t; + typedef typename string_type::size_type size_type; + + basic_oaltstringstream 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(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(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 @@ -184,69 +174,73 @@ namespace { 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 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(specs.truncate_)); + // we now have the minimal-length output + const Ch * tmp_beg = buf.pbase(); + std::streamsize tmp_size = (std::min)(static_cast(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(tmp_size-prefix_space <= res.size() )); - std::streamsize sz = std::min(res_size+prefix_space, tmp_size); - for(; i=tmp_size) i=prefix_space; res.assign(tmp_beg, i); - if(d>0) res.append(static_cast( d ), oss_.fill()); + if(d>0) res.append(static_cast( 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& self, T x) { + template< class Ch, class Tr, class Alloc, class T> + void distribute (basic_format& 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 (x, self.items_[i], self.items_[i].res_, self.oss_ ); + put (x, self.items_[i], self.items_[i].res_, + self.buf_, boost::get_pointer(self.loc_) ); } } } - template - basic_format& feed(basic_format& self, T x) { + template + basic_format& + feed (basic_format& self, T x) { if(self.dumped_) self.clear(); - distribute (self, x); + distribute (self, x); ++self.cur_arg_; if(self.bound_.size() != 0) { while( self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_] ) diff --git a/boost/boost/format/format_class.hpp b/boost/boost/format/format_class.hpp index ef509f0f5c..563926556f 100644 --- a/boost/boost/format/format_class.hpp +++ b/boost/boost/format/format_class.hpp @@ -1,20 +1,14 @@ -// -*- 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 @@ -23,103 +17,124 @@ #include #include +#include // to store locale when needed + #include #include #include -#include +#include namespace boost { - template + template class basic_format { + typedef typename io::CompatTraits::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 string_t; - typedef typename std::basic_string::size_type size_type; - - typedef io::basic_outsstream internal_stream_t; + typedef Ch CharT; // borland fails in operator% if we use Ch and Tr directly + typedef std::basic_string string_type; + typedef typename string_type::size_type size_type; + typedef io::detail::format_item format_item_t; + typedef io::basic_altstringbuf 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) - 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 +#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; - // pass arguments through those operators : + 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_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 + + // ** arguments passing ** // template basic_format& operator%(const T& x) - { return io::detail::feed(*this,x); } + { return io::detail::feed(*this,x); } #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST template basic_format& operator%(T& x) - { return io::detail::feed(*this,x); } + { return io::detail::feed(*this,x); } #endif - // modifying a format object + + // ** object modifying **// template 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 basic_format& modify_item(int itemN, T manipulator) - { return io::detail::modify_item_body (*this, itemN, manipulator);} + { return io::detail::modify_item_body (*this, itemN, manipulator);} // Choosing which errors will throw exceptions : unsigned char exceptions() const; unsigned char exceptions(unsigned char newexcept); - // final output - size_type size() const; // sum of the current string pieces sizes - string_t str() const; - friend BOOST_IO_STD basic_ostream& -#if BOOST_WORKAROUND( BOOST_MSVC, <= 1300) - operator<< (BOOST_IO_STD basic_ostream& , const basic_format& ); -#else - operator<< (BOOST_IO_STD basic_ostream&, 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 friend basic_format& - io::detail::feed(basic_format&, T); - template friend - void io::detail::distribute(basic_format&, T); - template friend - basic_format& io::detail::modify_item_body(basic_format&, int, T); - template friend - basic_format& io::detail::bind_arg_body(basic_format&, int, const T&); + +#ifndef BOOST_NO_TEMPLATE_STD_STREAM + template + friend std::basic_ostream & + operator<<( std::basic_ostream & , + const basic_format& ); +#else + template + friend std::ostream & + operator<<( std::ostream & , + const basic_format& ); +#endif + + template + friend basic_format& + io::detail::feed (basic_format&, T); + + template friend + void io::detail::distribute (basic_format&, T); + + template friend + basic_format& + io::detail::modify_item_body (basic_format&, int, T); + + template friend + basic_format& + io::detail::bind_arg_body (basic_format&, int, const T&); private: #endif - typedef BOOST_IO_STD basic_ostream stream_t; typedef io::detail::stream_format_state stream_format_state; - typedef io::detail::format_item 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 items_; // each '%..' directive leads to a format_item std::vector 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 loc_; }; // class basic_format } // namespace boost diff --git a/boost/boost/format/format_fwd.hpp b/boost/boost/format/format_fwd.hpp index a5dbde6b04..be3228af3c 100644 --- a/boost/boost/format/format_fwd.hpp +++ b/boost/boost/format/format_fwd.hpp @@ -1,19 +1,14 @@ -// -*- 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 @@ -21,45 +16,33 @@ #include #include -#include +#include namespace boost { template > +#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, class Alloc = std::allocator > #else - class Tr = std::string_char_traits > + class Tr = std::string_char_traits, class Alloc = std::alloc > #endif class basic_format; typedef basic_format 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 wformat; #endif - template - std::basic_string str(const basic_format& ) ; - -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& - operator<<( BOOST_IO_STD basic_ostream&, const basic_format&); - + } // namespace io } // namespace boost diff --git a/boost/boost/format/format_implementation.hpp b/boost/boost/format/format_implementation.hpp index c23355879f..ccaa346c2f 100644 --- a/boost/boost/format/format_implementation.hpp +++ b/boost/boost/format/format_implementation.hpp @@ -1,25 +1,20 @@ -// -*- 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 #include #include #include @@ -27,9 +22,10 @@ namespace boost { -// -------- format:: ------------------------------------------- - template< class Ch, class Tr> - basic_format:: basic_format(const Ch* str) +// --- basic_format implementation -----------------------------------------// + + template< class Ch, class Tr, class Alloc> + basic_format:: basic_format(const Ch* str) : style_(0), cur_arg_(0), num_args_(0), dumped_(false), exceptions_(io::all_error_bits) { @@ -37,44 +33,56 @@ namespace boost { parse( str ); } -#ifndef BOOST_NO_STD_LOCALE - template< class Ch, class Tr> - basic_format:: basic_format(const Ch* str, const std::locale & loc) +#if !defined(BOOST_NO_STD_LOCALE) + template< class Ch, class Tr, class Alloc> + basic_format:: 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:: basic_format(const string_t& s, const std::locale & loc) + template< class Ch, class Tr, class Alloc> + basic_format:: 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:: + getloc() const { + return loc_ ? loc_.get() : io::detail::locale_t(); + } - template< class Ch, class Tr> - basic_format:: basic_format(const string_t& s) + template< class Ch, class Tr, class Alloc> + basic_format:: 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:: 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:: 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:: swap (basic_format & x) { + template< class Ch, class Tr, class Alloc> // just don't copy the buf_ member + basic_format& basic_format:: + operator= (const basic_format& x) { + if(this == &x) + return *this; + (basic_format(x)).swap(*this); + return *this; + } + template< class Ch, class Tr, class Alloc> + void basic_format:: + swap (basic_format & x) { std::swap(exceptions_, x.exceptions_); std::swap(style_, x.style_); std::swap(cur_arg_, x.cur_arg_); @@ -86,41 +94,40 @@ namespace boost { bound_.swap(x.bound_); } - template< class Ch, class Tr> - basic_format& basic_format:: operator= (const basic_format& x) { - if(this == &x) - return *this; - (basic_format(x)).swap(*this); - return *this; - } - - template< class Ch, class Tr> - unsigned char basic_format:: exceptions() const { + template< class Ch, class Tr, class Alloc> + unsigned char basic_format:: exceptions() const { return exceptions_; } - template< class Ch, class Tr> - unsigned char basic_format:: exceptions(unsigned char newexcept) { + template< class Ch, class Tr, class Alloc> + unsigned char basic_format:: exceptions(unsigned char newexcept) { unsigned char swp = exceptions_; exceptions_ = newexcept; return swp; } - template - void basic_format:: make_or_reuse_data(std::size_t nbitems) { - Ch fill = oss_.widen(' '); + template + void basic_format:: + make_or_reuse_data (std::size_t nbitems) { +#if !defined(BOOST_NO_STD_LOCALE) + Ch fill = ( BOOST_USE_FACET(std::ctype, 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& basic_format:: clear() { + template< class Ch, class Tr, class Alloc> + basic_format& basic_format:: + clear () { // empty the string buffers (except bound arguments) // and make the format object ready for formatting a new set of arguments @@ -128,32 +135,34 @@ namespace boost { for(unsigned long i=0; i - basic_format& basic_format:: clear_binds() { + template< class Ch, class Tr, class Alloc> + basic_format& basic_format:: + clear_binds () { // remove all binds, then clear() bound_.resize(0); clear(); return *this; } - template< class Ch, class Tr> - basic_format& basic_format:: clear_bind(int argN) { + template< class Ch, class Tr, class Alloc> + basic_format& basic_format:: + 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; @@ -161,18 +170,19 @@ namespace boost { return *this; } - - - template< class Ch, class Tr> - std::basic_string basic_format:: str() const { - dumped_=true; + template< class Ch, class Tr, class Alloc> + typename basic_format::string_type + basic_format:: + 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) { @@ -186,36 +196,38 @@ namespace boost { } res += item.appendix_; } + dumped_=true; return res; } - template< class Ch, class Tr> - typename basic_format::size_type basic_format:: + template< class Ch, class Tr, class Alloc> + typename basic_format::size_type basic_format:: 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 (sz); + return static_cast (sz); } namespace io { namespace detail { - template - basic_format& bind_arg_body( basic_format& self, - int argN, const T& val) { + template + basic_format& + bind_arg_body (basic_format& 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) @@ -242,14 +254,13 @@ namespace detail { return self; } - template - basic_format& modify_item_body( basic_format& self, - int itemN, T manipulator) { + template basic_format& + modify_item_body (basic_format& 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(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 ( manipulator ); diff --git a/boost/boost/format/free_funcs.hpp b/boost/boost/format/free_funcs.hpp index 5a7771d9a6..3a51545526 100644 --- a/boost/boost/format/free_funcs.hpp +++ b/boost/boost/format/free_funcs.hpp @@ -1,19 +1,14 @@ -// -*- 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 @@ -23,26 +18,36 @@ namespace boost { - template inline - std::basic_string str(const basic_format& f) { + template inline + std::basic_string str(const basic_format& 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& - operator<<( BOOST_IO_STD basic_ostream& os, - const boost::basic_format& f) - // effect: "return os << str(f);" but we can try to do it faster +#ifndef BOOST_NO_TEMPLATE_STD_STREAM + template + std::basic_ostream & + operator<<( std::basic_ostream & os, + const basic_format& f) +#else + template + std::ostream & + operator<<( std::ostream & os, + const basic_format& f) +#endif + // effect: "return os << str(f);" but we can do it faster { - typedef boost::basic_format format_t; + typedef boost::basic_format 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 { diff --git a/boost/boost/format/group.hpp b/boost/boost/format/group.hpp index 5545e57fa6..a1a2c5b0e3 100644 --- a/boost/boost/format/group.hpp +++ b/boost/boost/format/group.hpp @@ -1,28 +1,22 @@ -// -*- 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) - // ---------------------------------------------------------------------------- @@ -671,7 +665,7 @@ detail::group1< detail::group10 > } -#endif //end- #ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST +#endif // - BOOST_NO_OVERLOAD_FOR_NON_CONST } // namespace io diff --git a/boost/boost/format/internals.hpp b/boost/boost/format/internals.hpp index 7690373b7b..7c561cd0cb 100644 --- a/boost/boost/format/internals.hpp +++ b/boost/boost/format/internals.hpp @@ -1,39 +1,33 @@ -// -*- 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 - // ---------------------------------------------------------------------------- -// internals.hpp : internal structs. included by format.hpp -// stream_format_state, and format_item +// internals.hpp : internal structs : stream_format_state, format_item. +// included by format.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 + +// ---------------------------------------------------------------------------- #ifndef BOOST_FORMAT_INTERNALS_HPP #define BOOST_FORMAT_INTERNALS_HPP #include - #include -#include +#include #include +#include +#include // 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 @@ -42,11 +36,12 @@ namespace detail { typedef BOOST_IO_STD basic_ios 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 void apply_manip(T manipulator) //- modifies state by applying manipulator { apply_manip_body( *this, manipulator) ; } @@ -58,13 +53,14 @@ namespace detail { std::ios_base::fmtflags flags_; std::ios_base::iostate rdstate_; std::ios_base::iostate exceptions_; + boost::optional loc_; }; -//----- format_item ---------------------------------------------------------// +//---- format_item ---------------------------------------------------------// // stores all parameters that can be specified in format strings - template + template struct format_item { enum pad_values { zeropad = 1, spacepad =2, centered=4, tabulation = 8 }; @@ -75,9 +71,9 @@ namespace detail { argN_tabulation = -2, // tabulation directive. (no argument read) argN_ignored = -3 // ignored directive. (no argument read) }; - typedef BOOST_IO_STD basic_ios basic_ios; - typedef detail::stream_format_state stream_format_state; - typedef std::basic_string string_t; + typedef BOOST_IO_STD basic_ios basic_ios; + typedef detail::stream_format_state stream_format_state; + typedef ::std::basic_string string_type; format_item(Ch fill) :argN_(argN_no_posit), fmtstate_(fill), truncate_(max_streamsize()), pad_scheme_(0) {} @@ -85,28 +81,29 @@ namespace detail { void compute_states(); // sets states according to truncate and pad_scheme. static std::streamsize max_streamsize() { - return std::numeric_limits::max(); + return (std::numeric_limits::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 - void stream_format_state:: apply_on(basic_ios & os) const { + void stream_format_state:: 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_); @@ -117,6 +114,12 @@ namespace detail { 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 @@ -135,7 +138,7 @@ namespace detail { void apply_manip_body( stream_format_state& self, T manipulator) { // modify our params according to the manipulator - basic_outsstream ss; + basic_oaltstringstream ss; self.apply_on( ss ); ss << manipulator; self.set_by_stream( ss ); @@ -155,16 +158,17 @@ namespace detail { // --- format_item:: -------------------------------------------------------- - template - void format_item:: - reset(Ch fill) { + template + void format_item:: + reset (Ch fill) { argN_=argN_no_posit; truncate_ = max_streamsize(); pad_scheme_ =0; res_.resize(0); appendix_.resize(0); fmtstate_.reset(fill); } - template - void format_item:: compute_states() { + template + void format_item:: + compute_states() { // reflect pad_scheme_ on fmt_state_ // because some pad_schemes has complex consequences on several state params. if(pad_scheme_ & zeropad) { diff --git a/boost/boost/format/internals_fwd.hpp b/boost/boost/format/internals_fwd.hpp index da5ebf1d37..e44eb3c132 100644 --- a/boost/boost/format/internals_fwd.hpp +++ b/boost/boost/format/internals_fwd.hpp @@ -1,20 +1,14 @@ -// -*- C++ -*- -// Boost general library 'format' --------------------------- -// See http://www.boost.org for updates, documentation, and revision history. - -// (C) Samuel Krempp 2001 -// krempp@crans.ens-cachan.fr -// Permission to copy, use, modify, sell and -// distribute this software is granted provided this copyright notice appears -// in all copies. This software is provided "as is" without express or implied -// warranty, and with no claim as to its suitability for any purpose. - -// ideas taken from Rüdiger Loos's format class -// and Karl Nelson's ofstream (also took its parsing code as basis for printf parsing) - -// ------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- // internals_fwd.hpp : forward declarations, for internal headers -// ------------------------------------------------------------------------------ +// ---------------------------------------------------------------------------- + +// 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_INTERNAL_FWD_HPP #define BOOST_FORMAT_INTERNAL_FWD_HPP @@ -28,34 +22,34 @@ namespace io { namespace detail { template struct stream_format_state; - template struct format_item; -} + template 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 - basic_format& modify_item_body( basic_format& self, - int itemN, T manipulator); + template + basic_format& + modify_item_body (basic_format& self, + int itemN, T manipulator); - template - basic_format& bind_arg_body( basic_format& self, - int argN, const T& val); + template + basic_format& + bind_arg_body (basic_format& self, + int argN, const T& val); + // in internals.hpp : template - void apply_manip_body( stream_format_state& self, + void apply_manip_body (stream_format_state& self, T manipulator); - // argument feeding (defined in feed_args.hpp ) : - template - void distribute(basic_format& self, T x); + // argument feeding (defined in feed_args.hpp ) : + template + void distribute (basic_format& self, T x); - template - basic_format& feed(basic_format& self, T x); + template + basic_format& + feed (basic_format& self, T x); } // namespace detail diff --git a/boost/boost/format/outsstream.hpp b/boost/boost/format/outsstream.hpp deleted file mode 100644 index 60344be3a5..0000000000 --- a/boost/boost/format/outsstream.hpp +++ /dev/null @@ -1,146 +0,0 @@ -// -*- 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 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 -#include -#include - -#if !defined(BOOST_NO_STRINGSTREAM) && !defined(BOOST_FORMAT_IGNORE_STRINGSTREAM) -#include -#else -#include -#include -#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 steal_basic_stringbuf : public std::basic_stringbuf - { - typedef std::basic_stringbuf buff_t; - public: - typedef std::basic_string 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 basic_outsstream : boost::base_from_member >, - public BOOST_IO_STD basic_ostream - // use stringbuf with its stolen protected members, - // publicly derived from basic_ostream to make this class a stream. - { - public: - typedef std::basic_string string_type; - basic_outsstream() : pbase_type(), - std::basic_ostream( & 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 > pbase_type; - steal_basic_stringbuf & sb() { return pbase_type::member; } - steal_basic_stringbuf const& sb() const { return pbase_type::member; } - }; -#else // BOOST_NO_STRINGSTREAM - - - -//---- The strstream way ------------------------------------------------------ - - template > -#else - class Tr = std::string_char_traits > -#endif - class basic_outsstream; // we define only the specialisaton - - -// --- class basic_outsstream ----------------------------------------------- - template - class basic_outsstream : private BOOST_IO_STD strstreambuf, - public std::basic_ostream - { - public: - typedef char Ch; - typedef std::basic_string string_type; - typedef BOOST_IO_STD strstreambuf buff_t; - typedef std::basic_ostream 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 outsstream; - -} // namespace boost::io -} // namespace boost - - -#include // implementation - -#endif // BOOST_FORMAT_OUTSSTREAM_H include guard diff --git a/boost/boost/format/outsstream_impl.hpp b/boost/boost/format/outsstream_impl.hpp deleted file mode 100644 index 7e51f0a829..0000000000 --- a/boost/boost/format/outsstream_impl.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// -*- 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 inline -void steal_basic_stringbuf :: 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 inline -basic_outsstream ::basic_outsstream() : - buff_t(), - stream_t(this) -{ - stream_t::init(this); // the strem construction isnt enough with gcc-2.95 -} - - -template -std::basic_string -basic_outsstream ::str() { // ! physically copy chars : - string_type s(buff_t::str(), pcount()); - freeze(false); - return s; -} - -template inline -void -basic_outsstream:: 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 diff --git a/boost/boost/format/parsing.hpp b/boost/boost/format/parsing.hpp index cf54ccbbe5..bbbf9d4806 100644 --- a/boost/boost/format/parsing.hpp +++ b/boost/boost/format/parsing.hpp @@ -1,21 +1,15 @@ -// -*- 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 @@ -30,122 +24,145 @@ namespace boost { namespace io { namespace detail { - template 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 + T& const_or_not(const T& x) { + return const_cast (x); + } +#else + template + const T& const_or_not(const T& x) { + return x; + } +#endif + + template inline + char wrap_narrow(const Facet& fac, Ch c, char deflt) { + return const_or_not(fac).narrow(c, deflt); + } + + template 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::digit, c); # else using namespace std; return isdigit(c); #endif - } //end- wrap_isdigit(..) + } - template - Iter wrap_scan_notdigit(Iter beg, Iter end, const Stream & os) { + template + 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 - 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 + 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 - 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 + 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 + // 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 bool parse_printf_directive(Iter & start, const Iter& last, - detail::format_item * 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 * fpar, + const Facet& fac, + std::size_t offset, unsigned char exceptions) { - typedef format_item format_item_t; - //BOOST_ASSERT( pos_p != 0); + typedef typename basic_format::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; } @@ -161,7 +178,7 @@ namespace detail { // 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) @@ -196,29 +213,29 @@ namespace detail { } // 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 @@ -226,19 +243,20 @@ namespace detail { } // 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. @@ -275,14 +293,14 @@ namespace detail { 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; @@ -312,34 +330,36 @@ namespace detail { 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 - 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 + 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 "%%" @@ -348,13 +368,24 @@ namespace detail { ++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 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 @@ -363,41 +394,47 @@ namespace detail { // ----------------------------------------------- // format :: parse(..) - template - basic_format& basic_format:: parse(const string_t& buf) { + template + basic_format& basic_format:: + parse (const string_type& buf) { // parse the format-string using namespace std; +#if !defined(BOOST_NO_STD_LOCALE) + const std::ctype & fac = BOOST_USE_FACET( std::ctype, getloc()); +#else + io::basic_oaltstringstream fac; + //has widen and narrow even on compilers without locale +#endif - - const Ch arg_mark = oss_.widen('%'); + 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(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; @@ -418,14 +455,14 @@ namespace detail { // 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 : @@ -439,7 +476,7 @@ namespace detail { } // 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; diff --git a/boost/boost/function.hpp b/boost/boost/function.hpp index 9203ff9662..90336b1b6d 100644 --- a/boost/boost/function.hpp +++ b/boost/boost/function.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/detail/function_iterate.hpp b/boost/boost/function/detail/function_iterate.hpp index 7e116a62fa..5370b36aac 100644 --- a/boost/boost/function/detail/function_iterate.hpp +++ b/boost/boost/function/detail/function_iterate.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/detail/gen_maybe_include.pl b/boost/boost/function/detail/gen_maybe_include.pl index 4e8d4ca356..d0629205e1 100755 --- a/boost/boost/function/detail/gen_maybe_include.pl +++ b/boost/boost/function/detail/gen_maybe_include.pl @@ -2,7 +2,7 @@ # # 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. diff --git a/boost/boost/function/detail/maybe_include.hpp b/boost/boost/function/detail/maybe_include.hpp index df41437d66..92f71bb227 100644 --- a/boost/boost/function/detail/maybe_include.hpp +++ b/boost/boost/function/detail/maybe_include.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/detail/prologue.hpp b/boost/boost/function/detail/prologue.hpp index c748f6f659..1ef5f6e312 100644 --- a/boost/boost/function/detail/prologue.hpp +++ b/boost/boost/function/detail/prologue.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function0.hpp b/boost/boost/function/function0.hpp index 672d19ee26..65a02e5fac 100644 --- a/boost/boost/function/function0.hpp +++ b/boost/boost/function/function0.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function1.hpp b/boost/boost/function/function1.hpp index a8ba6cae10..9089715155 100644 --- a/boost/boost/function/function1.hpp +++ b/boost/boost/function/function1.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function10.hpp b/boost/boost/function/function10.hpp index e8a37122da..6562724849 100644 --- a/boost/boost/function/function10.hpp +++ b/boost/boost/function/function10.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function2.hpp b/boost/boost/function/function2.hpp index cde871121d..dc8bf97521 100644 --- a/boost/boost/function/function2.hpp +++ b/boost/boost/function/function2.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function3.hpp b/boost/boost/function/function3.hpp index 953fb167d9..19d1a49dd5 100644 --- a/boost/boost/function/function3.hpp +++ b/boost/boost/function/function3.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function4.hpp b/boost/boost/function/function4.hpp index d0376a304f..f3349e2dc9 100644 --- a/boost/boost/function/function4.hpp +++ b/boost/boost/function/function4.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function5.hpp b/boost/boost/function/function5.hpp index 1b92c02415..a1305eb5ce 100644 --- a/boost/boost/function/function5.hpp +++ b/boost/boost/function/function5.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function6.hpp b/boost/boost/function/function6.hpp index 3aab386d2c..1f60914919 100644 --- a/boost/boost/function/function6.hpp +++ b/boost/boost/function/function6.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function7.hpp b/boost/boost/function/function7.hpp index c314eb5037..68542ed46a 100644 --- a/boost/boost/function/function7.hpp +++ b/boost/boost/function/function7.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function8.hpp b/boost/boost/function/function8.hpp index e6bb6b46fd..cf2c37661f 100644 --- a/boost/boost/function/function8.hpp +++ b/boost/boost/function/function8.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function9.hpp b/boost/boost/function/function9.hpp index 6004085d87..590e0883d7 100644 --- a/boost/boost/function/function9.hpp +++ b/boost/boost/function/function9.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/function/function_base.hpp b/boost/boost/function/function_base.hpp index ad7bb99734..23f5f201c7 100644 --- a/boost/boost/function/function_base.hpp +++ b/boost/boost/function/function_base.hpp @@ -1,6 +1,6 @@ // 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) @@ -14,17 +14,32 @@ #include #include #include +#include #include #include -#include +#include #include #include #include #include #include - #ifndef BOOST_NO_SFINAE # include "boost/utility/enable_if.hpp" +#else +# include "boost/mpl/bool.hpp" +#endif +#include + +// 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 +# 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) @@ -48,6 +63,12 @@ namespace boost { namespace python { namespace objects { # 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::value)>::value), \ + Type>::type + + #if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) namespace boost { @@ -139,7 +160,8 @@ 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 @@ -172,14 +194,31 @@ namespace boost { // 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 + 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(0)); + + case check_functor_type_tag: + { + std::type_info* t = static_cast(f.obj_ptr); + return BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(F), *t)? + f + : make_any_pointer(reinterpret_cast(0)); + } + } + + // Clears up a warning with GCC 3.2.3 return make_any_pointer(reinterpret_cast(0)); - } + } + }; /** * The functor_manager class contains a static function "manage" which @@ -264,13 +303,81 @@ namespace boost { static any_pointer manage(any_pointer functor_ptr, functor_manager_operation_type op) { - typedef typename get_function_tag::type tag_type; - return manager(functor_ptr, op, tag_type()); + if (op == check_functor_type_tag) { + std::type_info* type = + static_cast(functor_ptr.obj_ptr); + return (BOOST_FUNCTION_COMPARE_TYPE_ID(typeid(Functor), *type)? + functor_ptr + : make_any_pointer(reinterpret_cast(0))); + } + else { + typedef typename get_function_tag::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_) or against zero (when the + // last parameter is mpl::bool_). They are only necessary + // for compilers that don't support SFINAE. + template + bool + compare_equal(const Function& f, const Functor&, int, mpl::bool_) + { return f.empty(); } + + template + bool + compare_not_equal(const Function& f, const Functor&, int, + mpl::bool_) + { return !f.empty(); } + + template + bool + compare_equal(const Function& f, const Functor& g, long, + mpl::bool_) + { + if (const Functor* fp = f.template target()) + return function_equal(*fp, g); + else return false; + } + + template + bool + compare_equal(const Function& f, const reference_wrapper& g, + int, mpl::bool_) + { + if (const Functor* fp = f.template target()) + return fp == g.get_pointer(); + else return false; + } + + template + bool + compare_not_equal(const Function& f, const Functor& g, long, + mpl::bool_) + { + if (const Functor* fp = f.template target()) + return !function_equal(*fp, g); + else return true; + } + + template + bool + compare_not_equal(const Function& f, + const reference_wrapper& g, int, + mpl::bool_) + { + if (const Functor* fp = f.template target()) + return fp != g.get_pointer(); + else return true; + } +#endif // BOOST_NO_SFINAE } // end namespace function } // end namespace detail @@ -291,11 +398,92 @@ public: // Is this function empty? bool empty() const { return !manager; } + template + 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::type tag; + return get_functor_pointer(tag(), 0); + } + } + + template + 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::type tag; + return get_functor_pointer(tag(), 0); + } + } + + template + bool contains(const F& f) const + { + if (const F* fp = this->template target()) { + 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 + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator==(Functor g) const + { + if (const Functor* fp = target()) + return function_equal(*fp, g); + else return false; + } + + template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator!=(Functor g) const + { + if (const Functor* fp = target()) + 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 + Functor* get_functor_pointer(detail::function::function_ptr_tag, int) + { return reinterpret_cast(&functor.func_ptr); } + + template + Functor* get_functor_pointer(Tag, long) + { return static_cast(functor.obj_ptr); } + + template + const Functor* + get_functor_pointer(detail::function::function_ptr_tag, int) const + { return reinterpret_cast(&functor.func_ptr); } + + template + const Functor* get_functor_pointer(Tag, long) const + { return static_cast(functor.const_obj_ptr); } }; /** @@ -308,16 +496,7 @@ public: 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 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*) { @@ -343,6 +522,116 @@ inline bool operator!=(detail::function::useless_clear_type*, } #endif +#ifdef BOOST_NO_SFINAE +// Comparisons between boost::function objects and arbitrary function objects +template + inline bool operator==(const function_base& f, Functor g) + { + typedef mpl::bool_<(is_integral::value)> integral; + return detail::function::compare_equal(f, g, 0, integral()); + } + +template + inline bool operator==(Functor g, const function_base& f) + { + typedef mpl::bool_<(is_integral::value)> integral; + return detail::function::compare_equal(f, g, 0, integral()); + } + +template + inline bool operator!=(const function_base& f, Functor g) + { + typedef mpl::bool_<(is_integral::value)> integral; + return detail::function::compare_not_equal(f, g, 0, integral()); + } + +template + inline bool operator!=(Functor g, const function_base& f) + { + typedef mpl::bool_<(is_integral::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 + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator==(const function_base& f, Functor g) + { + if (const Functor* fp = f.template target()) + return function_equal(*fp, g); + else return false; + } + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator==(Functor g, const function_base& f) + { + if (const Functor* fp = f.template target()) + return function_equal(g, *fp); + else return false; + } + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator!=(const function_base& f, Functor g) + { + if (const Functor* fp = f.template target()) + return !function_equal(*fp, g); + else return true; + } + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator!=(Functor g, const function_base& f) + { + if (const Functor* fp = f.template target()) + return !function_equal(g, *fp); + else return true; + } +# endif + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator==(const function_base& f, reference_wrapper g) + { + if (const Functor* fp = f.template target()) + return fp == g.get_pointer(); + else return false; + } + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator==(reference_wrapper g, const function_base& f) + { + if (const Functor* fp = f.template target()) + return g.get_pointer() == fp; + else return false; + } + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator!=(const function_base& f, reference_wrapper g) + { + if (const Functor* fp = f.template target()) + return fp != g.get_pointer(); + else return true; + } + +template + BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) + operator!=(reference_wrapper g, const function_base& f) + { + if (const Functor* fp = f.template target()) + 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) @@ -350,12 +639,22 @@ namespace detail { 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 diff --git a/boost/boost/function/function_template.hpp b/boost/boost/function/function_template.hpp index 9725dc515b..b00238b1a5 100644 --- a/boost/boost/function/function_template.hpp +++ b/boost/boost/function/function_template.hpp @@ -1,6 +1,6 @@ // 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) @@ -307,6 +307,9 @@ namespace boost { ~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()) @@ -322,6 +325,9 @@ namespace boost { 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 @@ -438,9 +444,9 @@ namespace boost { 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::manage; this->functor = @@ -471,16 +477,16 @@ namespace boost { 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::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); @@ -505,10 +511,10 @@ namespace boost { 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::get; this->functor = this->manager( detail::function::make_any_pointer( @@ -527,9 +533,9 @@ namespace boost { 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::get; this->functor = detail::function::make_any_pointer(this); } @@ -556,6 +562,54 @@ namespace boost { f1.swap(f2); } +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) + template + typename BOOST_FUNCTION_FUNCTION< + R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS, + Allocator>::result_type + BOOST_FUNCTION_FUNCTION + ::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); +# else + return result; +# endif // BOOST_NO_VOID_RETURNS + } +#endif + +// Poison comparisons between boost::function objects of the same type. +template + 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 + 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 diff --git a/boost/boost/function/gen_function_N.pl b/boost/boost/function/gen_function_N.pl index d456b5e129..d8f1249b07 100755 --- a/boost/boost/function/gen_function_N.pl +++ b/boost/boost/function/gen_function_N.pl @@ -2,7 +2,7 @@ # # 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) diff --git a/boost/boost/function_equal.hpp b/boost/boost/function_equal.hpp new file mode 100644 index 0000000000..8bd06a3bb7 --- /dev/null +++ b/boost/boost/function_equal.hpp @@ -0,0 +1,24 @@ +// 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 + bool function_equal_impl(const F& f, const G& g, long) + { return f == g; } +} // end namespace boost::function + +template + 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 diff --git a/boost/boost/function_output_iterator.hpp b/boost/boost/function_output_iterator.hpp index 764c118f1c..9720f3f3d1 100644 --- a/boost/boost/function_output_iterator.hpp +++ b/boost/boost/function_output_iterator.hpp @@ -1,8 +1,7 @@ -// (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: @@ -26,7 +25,9 @@ namespace boost { 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 { diff --git a/boost/boost/generator_iterator.hpp b/boost/boost/generator_iterator.hpp index bf8011fbda..ebf478b25b 100644 --- a/boost/boost/generator_iterator.hpp +++ b/boost/boost/generator_iterator.hpp @@ -1,8 +1,7 @@ -// (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: diff --git a/boost/boost/get_pointer.hpp b/boost/boost/get_pointer.hpp index 09091e4f87..17d11b8fef 100644 --- a/boost/boost/get_pointer.hpp +++ b/boost/boost/get_pointer.hpp @@ -1,8 +1,7 @@ -// 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 diff --git a/boost/boost/half_open_range.hpp b/boost/boost/half_open_range.hpp deleted file mode 100644 index c2818463be..0000000000 --- a/boost/boost/half_open_range.hpp +++ /dev/null @@ -1,426 +0,0 @@ -// (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 -# include -# include -# include -# include -# include -# include - -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 - const T& choose_finish(const T&, const T& finish, std::input_iterator_tag) - { - return finish; - } - - template - const T& choose_finish(const T&, const T& finish, std::output_iterator_tag) - { - return finish; - } - - template - const T& choose_finish(const T& start, const T& finish, std::random_access_iterator_tag) - { - return finish < start ? start : finish; - } -#else - template struct finish_chooser; - - template <> - struct finish_chooser - { - template - struct rebind - { - static T choose(const T&, const T& finish) - { return finish; } - }; - }; - - template <> - struct finish_chooser - { - template - struct rebind - { - static T choose(const T& start, const T& finish) - { return finish < start ? start : finish; } - }; - }; - - template - struct choose_finish - { - static const Incrementable choose(const Incrementable& start, const Incrementable& finish) - { - return finish_chooser<( - ::boost::is_convertible::value - )>::template rebind::choose(start, finish); - } - }; -#endif -} - -template -struct half_open_range -{ - typedef typename counting_iterator_generator::type iterator; - - private: // utility type definitions - // Using iter_t prevents compiler confusion with boost::iterator - typedef typename counting_iterator_generator::type iter_t; - - typedef std::less less_value; - typedef typename iter_t::iterator_category category; - typedef half_open_range 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::choose(start, finish) -#else - detail::choose_finish(start, finish, category()) -#endif - ) - {} - - // Implicit conversion from std::pair allows us - // to accept the results of std::equal_range(), for example. - half_open_range(const std::pair& x) - : m_start(x.first), - m_finish( -#ifndef __MWERKS__ - detail::choose_finish::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& x) - { - m_start = x.first; - m_finish = -#ifndef __MWERKS__ - detail::choose_finish::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::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::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::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::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::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::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 -half_open_range operator|( - half_open_range x, - const half_open_range& y) -{ - return x |= y; -} - -template -half_open_range operator&( - half_open_range x, - const half_open_range& y) -{ - return x &= y; -} - -template -inline bool operator==( - const half_open_range& x, - const half_open_range& y) -{ - const bool y_empty = y.empty(); - return x.empty() ? y_empty : !y_empty && x.start() == y.start() && x.finish() == y.finish(); -} - -template -inline bool operator!=( - const half_open_range& x, - const half_open_range& y) -{ - return !(x == y); -} - -template -inline half_open_range -make_half_open_range(Incrementable first, Incrementable last) -{ - return half_open_range(first, last); -} - -template -bool intersects( - const half_open_range& x, - const half_open_range& y) -{ - return x.intersects(y); -} - -template -bool contains( - const half_open_range& x, - const half_open_range& y) -{ - return x.contains(y); -} - -} // namespace boost - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -namespace std { -template struct less > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - less cmp; - return !y.empty() && ( - cmp(x.start(), y.start()) - || !cmp(y.start(), x.start()) - && cmp(x.finish(), y.finish())); - } -}; - -template struct less_equal > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - typedef boost::half_open_range range; - less cmp; - return !cmp(y,x); - } -}; -template struct greater > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - typedef boost::half_open_range range; - less cmp; - return cmp(y,x); - } -}; - -template struct greater_equal > - : binary_function< - boost::half_open_range, - boost::half_open_range,bool> -{ - bool operator()( - const boost::half_open_range& x, - const boost::half_open_range& y) const - { - typedef boost::half_open_range range; - less 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 -bool operator<(const half_open_range& x, - const half_open_range& y) -{ - return !y.empty() && ( - x.empty() || std::less()(x.start(), y.start()) - || !std::less()(y.start(), x.start()) - && std::less()(x.finish(), y.finish())); -} - -template -bool operator>(const half_open_range& x, - const half_open_range& y) -{ - return y < x; -} - -template -bool operator<=(const half_open_range& x, - const half_open_range& y) -{ - return !(y < x); -} - -template -bool operator>=(const half_open_range& x, - const half_open_range& y) -{ - return !(x < y); -} -} // namespace boost - -#endif - - -#endif // BOOST_HALF_OPEN_RANGE_HPP_ diff --git a/boost/boost/indirect_reference.hpp b/boost/boost/indirect_reference.hpp index 270cbbd913..2e993d9c05 100755 --- a/boost/boost/indirect_reference.hpp +++ b/boost/boost/indirect_reference.hpp @@ -10,7 +10,7 @@ # include # include # include -# include +# include # include namespace boost { @@ -26,7 +26,7 @@ namespace detail template struct indirect_reference - : mpl::apply_if< + : mpl::eval_if< detail::is_incrementable

, iterator_reference

, detail::smart_ptr_reference

diff --git a/boost/boost/integer.hpp b/boost/boost/integer.hpp index c655c92ca8..aa8b22c508 100644 --- a/boost/boost/integer.hpp +++ b/boost/boost/integer.hpp @@ -1,7 +1,8 @@ // 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. diff --git a/boost/boost/integer/integer_mask.hpp b/boost/boost/integer/integer_mask.hpp index 30f6340a6d..0a092d3850 100644 --- a/boost/boost/integer/integer_mask.hpp +++ b/boost/boost/integer/integer_mask.hpp @@ -1,9 +1,9 @@ // 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. diff --git a/boost/boost/integer/static_log2.hpp b/boost/boost/integer/static_log2.hpp index fed9d6cf14..19e048bd03 100644 --- a/boost/boost/integer/static_log2.hpp +++ b/boost/boost/integer/static_log2.hpp @@ -1,141 +1,132 @@ -// 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 // self include +#include "boost/config.hpp" // for BOOST_STATIC_CONSTANT -#include // for BOOST_STATIC_CONSTANT, etc. -#include // for std::numeric_limits +namespace boost { -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -#include // for boost::ct_if<> -#endif + namespace detail { + + namespace static_log2_impl { + + // 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). + + typedef unsigned long argument_type; + typedef int result_type; -namespace boost -{ + template + struct choose_initial_n { + + enum { c = (argument_type(1) << n << n) != 0 }; + BOOST_STATIC_CONSTANT( + result_type, + value = !c*n + choose_initial_n<2*c*n>::value + ); + + }; + + template <> + struct choose_initial_n<0> { + BOOST_STATIC_CONSTANT(result_type, value = 0); + }; -// Implementation details --------------------------------------------------// -namespace detail -{ + // 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::value; -// Forward declarations -template < unsigned long Val, int Place = 0, int Index - = std::numeric_limits::digits > - struct static_log2_helper_t; + // 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.) + // -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + template + struct static_log2_impl { -template < unsigned long Val, int Place > - struct static_log2_helper_t< Val, Place, 1 >; + 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; + template <> + struct static_log2_impl<1, 0> { + BOOST_STATIC_CONSTANT(result_type, value = 0); + }; -template < unsigned long Val, int Place = 0, int Index - = std::numeric_limits::digits > - struct static_log2_helper_nopts_t; - -#endif - -// 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 ); - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - typedef static_log2_helper_t next_step_type; -#else - typedef static_log2_helper_nopts_t next_step_type; -#endif - -public: - BOOST_STATIC_CONSTANT( int, value = next_step_type::value ); - -}; // boost::detail::static_log2_helper_t - -// Non-recursive case -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - -template < unsigned long Val, int Place > -struct static_log2_helper_t< Val, Place, 1 > -{ -public: - BOOST_STATIC_CONSTANT( int, value = Place ); - -}; // boost::detail::static_log2_helper_t - -#else - -template < int Place > -struct static_log2_helper_final_step -{ -public: - BOOST_STATIC_CONSTANT( int, value = Place ); - -}; // boost::detail::static_log2_helper_final_step - -template < unsigned long Val, int Place, int Index > -struct static_log2_helper_nopts_t -{ -private: - typedef static_log2_helper_t recursive_step_type; - typedef static_log2_helper_final_step 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 ); - -}; // boost::detail::static_log2_helper_nopts_t - -#endif - -} // namespace detail + } + } // detail -// 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 ); -}; + // -------------------------------------- + // static_log2 + // ---------------------------------------- -template < > -struct static_log2< 0ul > -{ - // The logarithm of zero is undefined. -}; + typedef detail::static_log2_impl::argument_type static_log2_argument_type; + typedef detail::static_log2_impl::result_type static_log2_result_type; -} // namespace boost + template + struct static_log2 { + + BOOST_STATIC_CONSTANT( + static_log2_result_type, + value = detail::static_log2_impl::static_log2_impl::value + ); + + }; -#endif // BOOST_INTEGER_STATIC_LOG2_HPP + template <> + struct static_log2<0> { }; + +} + + + +#endif // include guard diff --git a/boost/boost/integer/static_min_max.hpp b/boost/boost/integer/static_min_max.hpp index 216a3e3f6f..264603727f 100644 --- a/boost/boost/integer/static_min_max.hpp +++ b/boost/boost/integer/static_min_max.hpp @@ -1,10 +1,9 @@ // 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. diff --git a/boost/boost/integer_fwd.hpp b/boost/boost/integer_fwd.hpp index 3b36b35412..33cfc9986f 100644 --- a/boost/boost/integer_fwd.hpp +++ b/boost/boost/integer_fwd.hpp @@ -1,10 +1,8 @@ // 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. @@ -69,10 +67,10 @@ template < > #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 diff --git a/boost/boost/integer_traits.hpp b/boost/boost/integer_traits.hpp index 5510b1112d..36aa4dc0de 100644 --- a/boost/boost/integer_traits.hpp +++ b/boost/boost/integer_traits.hpp @@ -1,16 +1,11 @@ /* 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 */ @@ -159,53 +154,70 @@ class integer_traits #if defined(ULLONG_MAX) && defined(BOOST_HAS_LONG_LONG) template<> -class integer_traits - : public std::numeric_limits, - public detail::integer_traits_base +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 - : public std::numeric_limits, - public detail::integer_traits_base +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 : public std::numeric_limits, public detail::integer_traits_base{ }; +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 - : public std::numeric_limits, - public detail::integer_traits_base +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 - : public std::numeric_limits, - public detail::integer_traits_base +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 - : public std::numeric_limits, - public detail::integer_traits_base +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 - : public std::numeric_limits, - public detail::integer_traits_base +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 - : public std::numeric_limits, - public detail::integer_traits_base +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< ::boost::ulong_long_type> + : public std::numeric_limits< ::boost::ulong_long_type>, + public detail::integer_traits_base< ::boost::ulong_long_type, 0, ~0uLL> { }; #endif diff --git a/boost/boost/intrusive_ptr.hpp b/boost/boost/intrusive_ptr.hpp index 7db6dcf249..7efbadeea3 100644 --- a/boost/boost/intrusive_ptr.hpp +++ b/boost/boost/intrusive_ptr.hpp @@ -6,10 +6,9 @@ // // 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. // diff --git a/boost/boost/iterator.hpp b/boost/boost/iterator.hpp index 8b82097a00..d3844e71c0 100644 --- a/boost/boost/iterator.hpp +++ b/boost/boost/iterator.hpp @@ -1,9 +1,8 @@ // 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. diff --git a/boost/boost/iterator/detail/categories.hpp b/boost/boost/iterator/detail/categories.hpp deleted file mode 100644 index 841ac4c143..0000000000 --- a/boost/boost/iterator/detail/categories.hpp +++ /dev/null @@ -1 +0,0 @@ -#error obsolete diff --git a/boost/boost/iterator/detail/config_def.hpp b/boost/boost/iterator/detail/config_def.hpp index 0f6ba5bdf1..fcdb9d62b4 100644 --- a/boost/boost/iterator/detail/config_def.hpp +++ b/boost/boost/iterator/detail/config_def.hpp @@ -1,11 +1,9 @@ // (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 @@ -112,7 +110,7 @@ # 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 diff --git a/boost/boost/iterator/detail/config_undef.hpp b/boost/boost/iterator/detail/config_undef.hpp index df44f465b7..9dcd1d525f 100644 --- a/boost/boost/iterator/detail/config_undef.hpp +++ b/boost/boost/iterator/detail/config_undef.hpp @@ -1,9 +1,7 @@ // (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 diff --git a/boost/boost/iterator/detail/enable_if.hpp b/boost/boost/iterator/detail/enable_if.hpp index f0a7bc7fb4..45428a5bb2 100644 --- a/boost/boost/iterator/detail/enable_if.hpp +++ b/boost/boost/iterator/detail/enable_if.hpp @@ -1,11 +1,9 @@ // (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 diff --git a/boost/boost/iterator/detail/facade_iterator_category.hpp b/boost/boost/iterator/detail/facade_iterator_category.hpp index dd7de98dbb..67287007b5 100755 --- a/boost/boost/iterator/detail/facade_iterator_category.hpp +++ b/boost/boost/iterator/detail/facade_iterator_category.hpp @@ -11,7 +11,7 @@ # include // used in iterator_tag inheritance logic # include # include -# include +# include # include # include @@ -24,7 +24,7 @@ # include // try to keep this last # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY -# include +# include # endif // @@ -61,7 +61,7 @@ struct iterator_writability_disabled # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY // Adding Thomas' logic? : mpl::or_< is_const - , python::detail::is_reference_to_const + , boost::detail::indirect_traits::is_reference_to_const , is_const > # else @@ -86,12 +86,12 @@ struct iterator_writability_disabled // template struct iterator_facade_default_category - : mpl::apply_if< + : mpl::eval_if< mpl::and_< is_reference , is_convertible > - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity , mpl::if_< @@ -100,20 +100,15 @@ struct iterator_facade_default_category , std::forward_iterator_tag > > - , typename mpl::apply_if< + , typename mpl::eval_if< mpl::and_< is_convertible // check for readability , is_convertible > - , mpl::if_< - iterator_writability_disabled - , std::input_iterator_tag - , input_output_iterator_tag - > - - , mpl::identity + , mpl::identity + , mpl::identity > > { @@ -199,7 +194,7 @@ struct facade_iterator_category_impl // template struct facade_iterator_category - : mpl::apply_if< + : mpl::eval_if< is_iterator_category , mpl::identity // old-style categories are fine as-is , facade_iterator_category_impl diff --git a/boost/boost/iterator/detail/minimum_category.hpp b/boost/boost/iterator/detail/minimum_category.hpp index 89d79db3b8..74cef63f35 100755 --- a/boost/boost/iterator/detail/minimum_category.hpp +++ b/boost/boost/iterator/detail/minimum_category.hpp @@ -24,6 +24,10 @@ template struct minimum_category_impl # if BOOST_WORKAROUND(BOOST_MSVC, == 1200) { + template struct apply + { + typedef T2 type; + }; typedef void type; } # endif @@ -82,7 +86,7 @@ struct minimum_category || is_same::value # endif > outer; - + typedef typename outer::template apply inner; typedef typename inner::type type; @@ -95,8 +99,10 @@ struct minimum_category template struct apply : minimum_category {}; + + 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 @@ -104,7 +110,7 @@ struct minimum_category typedef int type; }; # endif - + }} // namespace boost::detail #endif // MINIMUM_CATEGORY_DWA20031119_HPP diff --git a/boost/boost/iterator/filter_iterator.hpp b/boost/boost/iterator/filter_iterator.hpp index fee0184771..0edede52ac 100644 --- a/boost/boost/iterator/filter_iterator.hpp +++ b/boost/boost/iterator/filter_iterator.hpp @@ -1,11 +1,9 @@ // (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 diff --git a/boost/boost/iterator/indirect_iterator.hpp b/boost/boost/iterator/indirect_iterator.hpp index 91c4283e3c..f181107121 100644 --- a/boost/boost/iterator/indirect_iterator.hpp +++ b/boost/boost/iterator/indirect_iterator.hpp @@ -1,11 +1,9 @@ // (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 @@ -16,18 +14,18 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include -#include +#include -#ifdef BOOST_MPL_NO_AUX_HAS_XXX +#ifdef BOOST_MPL_CFG_NO_HAS_XXX # include # include # include @@ -57,7 +55,7 @@ namespace boost , Category , typename ia_dflt_help< Reference - , mpl::apply_if< + , mpl::eval_if< is_same , indirect_reference , add_reference diff --git a/boost/boost/iterator/interoperable.hpp b/boost/boost/iterator/interoperable.hpp index b3262502a6..c13dd9b47b 100644 --- a/boost/boost/iterator/interoperable.hpp +++ b/boost/boost/iterator/interoperable.hpp @@ -1,11 +1,9 @@ // (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 diff --git a/boost/boost/iterator/iterator_adaptor.hpp b/boost/boost/iterator/iterator_adaptor.hpp index 77d9990aa8..eabacde25a 100644 --- a/boost/boost/iterator/iterator_adaptor.hpp +++ b/boost/boost/iterator/iterator_adaptor.hpp @@ -1,11 +1,9 @@ // (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 @@ -21,8 +19,6 @@ #include #include -#include - #include #include @@ -104,7 +100,22 @@ namespace boost // 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 + struct enable_if_convertible + { + typedef typename mpl::if_< + mpl::or_< + is_same + , is_convertible + > + , detail::enable_type + , int& + >::type type; + }; + +# elif defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE) template struct enable_if_convertible @@ -148,7 +159,7 @@ namespace boost // DefaultNullaryFn, otherwise return T. template struct ia_dflt_help - : mpl::apply_if< + : mpl::eval_if< is_same , DefaultNullaryFn , mpl::identity @@ -174,7 +185,7 @@ namespace boost # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY , typename detail::ia_dflt_help< Value - , mpl::apply_if< + , mpl::eval_if< is_same , iterator_value , remove_reference @@ -193,7 +204,7 @@ namespace boost , typename detail::ia_dflt_help< Reference - , mpl::apply_if< + , mpl::eval_if< is_same , iterator_reference , add_reference @@ -206,7 +217,13 @@ namespace boost > type; }; - template int static_assert_convertible_to(T); + + // workaround for aC++ CR JAGaf33512 + template + inline void iterator_adaptor_assert_traversal () + { + BOOST_STATIC_ASSERT((is_convertible::value)); + } } // @@ -249,10 +266,10 @@ namespace boost { friend class iterator_core_access; + protected: typedef typename detail::iterator_adaptor_base< Derived, Base, Value, Traversal, Reference, Difference >::type super_t; - public: iterator_adaptor() {} @@ -265,6 +282,9 @@ namespace boost { return m_iterator; } protected: + // for convenience in derived classes + typedef iterator_adaptor iterator_adaptor_; + // // lvalue access to the Base object for Derived // @@ -301,8 +321,7 @@ namespace boost >::type my_traversal; # define BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(cat) \ - typedef int assertion[sizeof(detail::static_assert_convertible_to(my_traversal()))]; -// BOOST_STATIC_ASSERT((is_convertible::value)); + detail::iterator_adaptor_assert_traversal(); void advance(typename super_t::difference_type n) { diff --git a/boost/boost/iterator/iterator_categories.hpp b/boost/boost/iterator/iterator_categories.hpp index 7b4f9ae69a..085936f7ab 100644 --- a/boost/boost/iterator/iterator_categories.hpp +++ b/boost/boost/iterator/iterator_categories.hpp @@ -1,8 +1,7 @@ -// (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 @@ -13,7 +12,7 @@ # include -# include +# include # include # include # include @@ -27,19 +26,43 @@ namespace boost { // // 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 { @@ -51,19 +74,19 @@ namespace detail // template struct old_category_to_traversal - : mpl::apply_if< + : mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity , void @@ -84,19 +107,19 @@ namespace detail template struct pure_traversal_tag - : mpl::apply_if< + : mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity - , mpl::apply_if< + , mpl::eval_if< is_convertible , mpl::identity , void @@ -124,7 +147,7 @@ namespace detail // template 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 , mpl::identity , detail::old_category_to_traversal @@ -139,7 +162,7 @@ struct iterator_traversal > {}; -# 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 diff --git a/boost/boost/iterator/iterator_facade.hpp b/boost/boost/iterator/iterator_facade.hpp index 0e10fc41d0..3b40db2319 100644 --- a/boost/boost/iterator/iterator_facade.hpp +++ b/boost/boost/iterator/iterator_facade.hpp @@ -1,11 +1,9 @@ // (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 @@ -22,18 +20,18 @@ #include #include #include +#include #include #include -#include +#include +#include #include #include +#include #include #include - -#if BOOST_WORKAROUND(BOOST_MSVC, == 1200) -# include -#endif +#include #include // this goes last @@ -56,7 +54,7 @@ namespace boost typedef bool type; }; }; - + // // enable if for use in operator implementation. // @@ -66,6 +64,18 @@ namespace boost , class Return > struct enable_if_interoperable +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + { + typedef typename mpl::if_< + mpl::or_< + is_convertible + , is_convertible + > + , Return + , int[3] + >::type type; + }; +#else : ::boost::iterators::enable_if< mpl::or_< is_convertible @@ -73,8 +83,8 @@ namespace boost > , Return > - { - }; + {}; +#endif // // Generates associated types for an iterator_facade with the @@ -94,7 +104,7 @@ namespace boost typedef typename remove_const::type value_type; - typedef typename mpl::apply_if< + typedef typename mpl::eval_if< detail::iterator_writability_disabled , add_pointer::type> , add_pointer @@ -118,12 +128,172 @@ namespace boost # 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 postfix_increment_proxy + { + typedef typename iterator_value::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 writable_postfix_increment_proxy + { + typedef typename iterator_value::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 + 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 + 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 + struct is_non_proxy_reference_impl + { + static Reference r; + + template + 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 + struct is_non_proxy_reference + : mpl::bool_< + is_non_proxy_reference_impl::value + > + {}; +# else + template + struct is_non_proxy_reference + : is_convertible< + typename remove_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 + struct postfix_increment_result + : mpl::eval_if< + mpl::and_< + // A proxy is only needed for readable iterators + is_convertible + + // No multipass iterator can have values that disappear + // before positions can be re-visited + , mpl::not_< + is_convertible< + typename iterator_category_to_traversal::type + , forward_traversal_tag + > + > + > + , mpl::if_< + is_non_proxy_reference + , postfix_increment_proxy + , writable_postfix_increment_proxy + > + , mpl::identity + > + {}; // 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 struct operator_arrow_proxy { @@ -138,7 +308,7 @@ namespace boost // A metafunction that gets the result type for operator->. Also // has a static function make() which builds the result from a // Reference - template + template struct operator_arrow_result { // CWPro8.3 won't accept "operator_arrow_result::type", and we @@ -147,7 +317,7 @@ namespace boost typedef typename mpl::if_< is_reference , Pointer - , operator_arrow_proxy + , operator_arrow_proxy >::type type; static type make(Reference x) @@ -165,13 +335,14 @@ namespace boost }; # 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 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; @@ -195,13 +366,17 @@ namespace boost Iterator m_iter; }; - template + // A metafunction that determines whether operator[] must return a + // proxy, or whether it can simply return a copy of the value_type. + template 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 - , iterator_writability_disabled + : 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 + , iterator_writability_disabled + > > {}; @@ -210,19 +385,19 @@ namespace boost { typedef typename mpl::if_< use_operator_brackets_proxy - , Value , operator_brackets_proxy + , Value >::type type; }; template - operator_brackets_proxy make_operator_brackets_result(Iterator const& iter, mpl::false_) + operator_brackets_proxy make_operator_brackets_result(Iterator const& iter, mpl::true_) { return operator_brackets_proxy(iter); } template - 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; } @@ -241,7 +416,7 @@ namespace boost , typename I2::difference_type > # else - mpl::apply_if< + mpl::eval_if< is_convertible , iterator_difference , iterator_difference @@ -385,6 +560,21 @@ namespace boost return f2.distance_to(f1); } + // + // Curiously Recurring Template interface. + // + template + static I& derived(iterator_facade& facade) + { + return *static_cast(&facade); + } + + template + static I const& derived(iterator_facade const& facade) + { + return *static_cast(&facade); + } + private: // objects of this class are useless iterator_core_access(); //undefined @@ -413,21 +603,23 @@ namespace boost // // Curiously Recurring Template interface. // - typedef Derived derived_t; - Derived& derived() { - return static_cast(*this); + return *static_cast(this); } Derived const& derived() const { - return static_cast(*this); + return *static_cast(this); } typedef detail::iterator_facade_types< Value, CategoryOrTraversal, Reference, Difference > associated_types; + + protected: + // For use by derived classes + typedef iterator_facade iterator_facade_; public: @@ -456,7 +648,7 @@ namespace boost >::make(*this->derived()); } - typename detail::operator_brackets_result::type + typename detail::operator_brackets_result::type operator[](difference_type n) const { typedef detail::use_operator_brackets_proxy use_proxy; @@ -473,13 +665,17 @@ namespace boost return this->derived(); } - Derived operator++(int) +# if BOOST_WORKAROUND(BOOST_MSVC, == 1200) + typename detail::postfix_increment_result::type + operator++(int) { - Derived tmp(this->derived()); + typename detail::postfix_increment_result::type + tmp(this->derived()); ++*this; return tmp; } - +# endif + Derived& operator--() { iterator_core_access::decrement(this->derived()); @@ -524,8 +720,26 @@ namespace boost # endif }; +# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) + template + typename detail::postfix_increment_result::type + operator++( + iterator_facade& i + , int + ) + { + typename detail::postfix_increment_result::type + tmp(*static_cast(&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. @@ -605,8 +819,8 @@ namespace boost is_interoperable< Derived1, Derived2 >::value \ )); \ return_prefix iterator_core_access::base_op( \ - static_cast(lhs) \ - , static_cast(rhs) \ + *static_cast(&lhs) \ + , *static_cast(&rhs) \ , BOOST_ITERATOR_CONVERTIBLE(Derived2,Derived1) \ ); \ } diff --git a/boost/boost/iterator/iterator_traits.hpp b/boost/boost/iterator/iterator_traits.hpp index 4f0d46f23c..93e282efb2 100644 --- a/boost/boost/iterator/iterator_traits.hpp +++ b/boost/boost/iterator/iterator_traits.hpp @@ -1,8 +1,7 @@ -// 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 diff --git a/boost/boost/iterator/transform_iterator.hpp b/boost/boost/iterator/transform_iterator.hpp index 20da1aba5f..d6375271e0 100644 --- a/boost/boost/iterator/transform_iterator.hpp +++ b/boost/boost/iterator/transform_iterator.hpp @@ -1,11 +1,9 @@ // (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 @@ -124,7 +122,7 @@ namespace boost transform_iterator( transform_iterator const& t , typename enable_if_convertible::type* = 0 -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +#if !BOOST_WORKAROUND(BOOST_MSVC, == 1310) , typename enable_if_convertible::type* = 0 #endif ) @@ -158,9 +156,16 @@ namespace boost // function pointer in the iterator be 0, leading to a runtime // crash. template +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + typename mpl::if_< +#else typename iterators::enable_if< +#endif is_class // We should probably find a cheaper test than is_class<> , transform_iterator +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + , int[3] +#endif >::type make_transform_iterator(Iterator it) { diff --git a/boost/boost/iterator_adaptors.hpp b/boost/boost/iterator_adaptors.hpp index 6d876e7bea..7058153be0 100644 --- a/boost/boost/iterator_adaptors.hpp +++ b/boost/boost/iterator_adaptors.hpp @@ -1,13 +1,10 @@ -// Permission to copy, use, modify, -// sell and distribute this software is granted provided this -// copyright notice appears in 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 -#endif // BOOST_ITERATOR_ADAPTOR_13062003HK_HPP +#endif // ITERATOR_ADAPTORS_DWA2004725_HPP diff --git a/boost/boost/last_value.hpp b/boost/boost/last_value.hpp index 9554e1b083..392e238564 100644 --- a/boost/boost/last_value.hpp +++ b/boost/boost/last_value.hpp @@ -1,6 +1,6 @@ // 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) diff --git a/boost/boost/lexical_cast.hpp b/boost/boost/lexical_cast.hpp index 135ef07895..079ca68b04 100644 --- a/boost/boost/lexical_cast.hpp +++ b/boost/boost/lexical_cast.hpp @@ -194,11 +194,9 @@ namespace boost // 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 diff --git a/boost/boost/limits.hpp b/boost/boost/limits.hpp index b9cd230241..f468dbce73 100644 --- a/boost/boost/limits.hpp +++ b/boost/boost/limits.hpp @@ -1,8 +1,8 @@ -// (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 @@ -24,8 +24,10 @@ // 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 @@ -37,17 +39,17 @@ 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); @@ -84,23 +86,23 @@ namespace std }; template<> - class numeric_limits + class numeric_limits { 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); @@ -108,8 +110,8 @@ namespace std 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); @@ -121,10 +123,10 @@ namespace std 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); diff --git a/boost/boost/mem_fn.hpp b/boost/boost/mem_fn.hpp index 1e5f606c16..dd46ef3f3e 100644 --- a/boost/boost/mem_fn.hpp +++ b/boost/boost/mem_fn.hpp @@ -13,10 +13,9 @@ // 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. // @@ -308,6 +307,16 @@ public: { 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 diff --git a/boost/boost/mpl/always.hpp b/boost/boost/mpl/always.hpp index 998b625829..f32cf9fd24 100644 --- a/boost/boost/mpl/always.hpp +++ b/boost/boost/mpl/always.hpp @@ -1,36 +1,30 @@ -//----------------------------------------------------------------------------- -// 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 +#include +#include + +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 { @@ -38,11 +32,8 @@ struct always }; }; +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 diff --git a/boost/boost/mpl/and.hpp b/boost/boost/mpl/and.hpp index a2cced8bb6..217c46c306 100644 --- a/boost/boost/mpl/and.hpp +++ b/boost/boost/mpl/and.hpp @@ -2,41 +2,55 @@ #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 $ -#if !defined(BOOST_MPL_NO_PREPROCESSED_HEADERS) \ - && !defined(BOOST_MPL_PREPROCESSING_MODE) +#include -# 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" +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# include +# include +# include +# include + +// agurt, 19/may/04: workaround a conflict with 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 + +#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 -#endif // BOOST_MPL_USE_PREPROCESSED_HEADERS +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS #endif // BOOST_MPL_AND_HPP_INCLUDED diff --git a/boost/boost/mpl/apply.hpp b/boost/boost/mpl/apply.hpp index bf6191acc1..f42cee3db1 100644 --- a/boost/boost/mpl/apply.hpp +++ b/boost/boost/mpl/apply.hpp @@ -1,18 +1,3 @@ -//----------------------------------------------------------------------------- -// 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) @@ -21,335 +6,220 @@ #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 +# include +# include +# include +# include +# include #endif -#include "boost/mpl/aux_/config/use_preprocessed.hpp" +#include -#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 #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 +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include -# include "boost/preprocessor/comma_if.hpp" -# include "boost/preprocessor/inc.hpp" -# include "boost/preprocessor/iterate.hpp" +# include +# include +# include +# include -# 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 { +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, )) #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 +} + 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 +# define i_ BOOST_PP_FRAME_ITERATION(1) -template< typename F > -struct apply0 : F +template< + typename F AUX778076_APPLY_N_COMMA_PARAMS(i_, typename T) + > +struct BOOST_PP_CAT(apply,i_) +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + : BOOST_PP_CAT(apply_wrap,i_)< + typename lambda::type + AUX778076_APPLY_N_COMMA_PARAMS(i_, T) + > { - BOOST_MPL_AUX_LAMBDA_SUPPORT(1, apply0, (F)) +#else +{ + typedef typename BOOST_PP_CAT(apply_wrap,i_)< + typename lambda::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 AUX778076_APPLY_N_COMMA_PARAMS(i_,T)) + ) }; -#if defined(BOOST_MPL_MSVC_ETI_BUG) -//: workaround for the ETI bug + +#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG) +/// workaround for ETI bug template<> -struct apply0 +struct BOOST_PP_CAT(apply,i_) { 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)::template result_< - AUX_APPLY_N_PARAMS(i, T) - >::type type; - - BOOST_MPL_AUX_LAMBDA_SUPPORT( - BOOST_PP_INC(i) - , BOOST_PP_CAT(apply,i) - , (F, AUX_APPLY_N_PARAMS(i,T)) - ) -}; - -# elif defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -// MWCW/Borland version - -namespace aux { -template< - int N, typename F, AUX_APPLY_N_PARAMS(i, typename T) - > -struct BOOST_PP_CAT(apply_impl,i); -} - -#define BOOST_PP_ITERATION_PARAMS_2 \ - (3,(0, BOOST_MPL_METAFUNCTION_MAX_ARITY - i, "boost/mpl/apply.hpp")) -#include BOOST_PP_ITERATE() - -template< - typename F, AUX_APPLY_N_PARAMS(i, typename T) - > -struct BOOST_PP_CAT(apply,i) - : BOOST_PP_CAT(aux::apply_impl,i)< - ::boost::mpl::aux::arity::value - , F - , AUX_APPLY_N_PARAMS(i, T) - >::type -{ - BOOST_MPL_AUX_LAMBDA_SUPPORT( - BOOST_PP_INC(i) - , BOOST_PP_CAT(apply,i) - , (F, AUX_APPLY_N_PARAMS(i,T)) - ) -}; - -# else -// ISO98 C++, with minor concession to vc7 - -template< - typename F, AUX_APPLY_N_PARAMS(i, typename T) - > -struct BOOST_PP_CAT(apply,i) -{ - // Metafunction forwarding confuses vc7 - typedef typename F::template apply< - AUX_APPLY_N_PARAMS(i, T) - >::type type; - - BOOST_MPL_AUX_LAMBDA_SUPPORT( - BOOST_PP_INC(i) - , BOOST_PP_CAT(apply,i) - , (F, AUX_APPLY_N_PARAMS(i,T)) - ) -}; - -# endif // workarounds - -#if defined(BOOST_MPL_MSVC_ETI_BUG) -//: workaround for ETI bug -template<> -struct BOOST_PP_CAT(apply,i) -{ - 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 +struct apply_chooser { 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 +# endif // BOOST_MPL_CFG_NO_APPLY_TEMPLATE -# undef i - -///// iteration, depth == 2 - -#elif BOOST_PP_ITERATION_DEPTH() == 2 - -# define j BOOST_PP_FRAME_ITERATION(2) - -namespace aux { - -template< - typename F, AUX_APPLY_N_PARAMS(i, typename T) - > -struct BOOST_PP_CAT(apply_impl,i)< - BOOST_MPL_PP_ADD(i, j) - , F - , AUX_APPLY_N_PARAMS(i, T) - > -{ - typedef typename F::template apply< - AUX_APPLY_N_PARAMS(i, T) - BOOST_PP_COMMA_IF(j) BOOST_MPL_PP_ENUM(j, void_) - > type; -}; - -} // namespace aux - -# undef j +# undef i_ #endif // BOOST_PP_IS_ITERATING diff --git a/boost/boost/mpl/apply_fwd.hpp b/boost/boost/mpl/apply_fwd.hpp new file mode 100644 index 0000000000..5b850d331c --- /dev/null +++ b/boost/boost/mpl/apply_fwd.hpp @@ -0,0 +1,107 @@ + +#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 +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER apply_fwd.hpp +# include + +#else + +# include +# include +# include +# include +# include + +# include +# include +# include + +// 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, )) +#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 diff --git a/boost/boost/mpl/apply_if.hpp b/boost/boost/mpl/apply_if.hpp deleted file mode 100644 index f2ab41aaee..0000000000 --- a/boost/boost/mpl/apply_if.hpp +++ /dev/null @@ -1,64 +0,0 @@ -//----------------------------------------------------------------------------- -// 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_::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::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 diff --git a/boost/boost/mpl/apply_wrap.hpp b/boost/boost/mpl/apply_wrap.hpp new file mode 100644 index 0000000000..ae58189bff --- /dev/null +++ b/boost/boost/mpl/apply_wrap.hpp @@ -0,0 +1,200 @@ + +#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 +# include +# include +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER apply_wrap.hpp +# include + +#else + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + + +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, )) +#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 + +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_)::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_, )) +#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::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::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::apply +{ +}; +#endif + +# endif // workarounds + +#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG) +/// workaround for ETI bug +template<> +struct BOOST_PP_CAT(apply_wrap,i_) +{ + 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 diff --git a/boost/boost/mpl/arg.hpp b/boost/boost/mpl/arg.hpp index 5638fa8cea..a96b86aad7 100644 --- a/boost/boost/mpl/arg.hpp +++ b/boost/boost/mpl/arg.hpp @@ -1,18 +1,3 @@ -//----------------------------------------------------------------------------- -// 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) @@ -21,96 +6,104 @@ #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 +# include +# include +# include +# include #endif -#include "boost/mpl/aux_/config/use_preprocessed.hpp" +#include +#include -#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 #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 +# include +# include +# include +# include +# include -namespace boost { -namespace mpl { +# include +# include +# include + +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, )) #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 +template<> struct arg { - BOOST_STATIC_CONSTANT(int, value = i); - typedef arg next; - BOOST_MPL_AUX_ARG_TYPEDEF(void_, tag) + BOOST_STATIC_CONSTANT(int, value = i_); + typedef arg 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_::value); - BOOST_STATIC_ASSERT(nv); -#endif + typedef BOOST_PP_CAT(U,i_) type; + BOOST_MPL_AUX_ASSERT_NOT_NA(type); }; }; @@ -119,23 +112,20 @@ template<> struct arg 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_::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 diff --git a/boost/boost/mpl/arg_fwd.hpp b/boost/boost/mpl/arg_fwd.hpp index ff6bda1409..4c9e3a1850 100644 --- a/boost/boost/mpl/arg_fwd.hpp +++ b/boost/boost/mpl/arg_fwd.hpp @@ -1,30 +1,28 @@ -//----------------------------------------------------------------------------- -// 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. -namespace boost { -namespace mpl { +// $Source: /cvsroot/boost/boost/boost/mpl/arg_fwd.hpp,v $ +// $Date: 2004/09/28 13:56:58 $ +// $Revision: 1.6 $ + +#include +#include + +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 diff --git a/boost/boost/mpl/assert.hpp b/boost/boost/mpl/assert.hpp new file mode 100644 index 0000000000..fa41292fbf --- /dev/null +++ b/boost/boost/mpl/assert.hpp @@ -0,0 +1,330 @@ + +#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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#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' 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 { typedef AUX778076_ASSERT_ARG(assert) type; }; + +template< bool C > +int assertion_failed( typename assert::type ); + +template< bool C > +struct assertion +{ + static int failed( assert ); +}; + +template<> +struct assertion +{ + 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 +#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 +#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 { 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

::type type; +}; + +template< typename Pred > +failed ************ (Pred::************ + assert_arg( void (*)(Pred), typename assert_arg_pred::type ) + ); + +template< typename Pred > +failed ************ (boost::mpl::not_::************ + assert_not_arg( void (*)(Pred), typename assert_arg_pred_not::type ) + ); + +template< typename Pred > +AUX778076_ASSERT_ARG(assert) +assert_arg( void (*)(Pred), typename assert_arg_pred_not::type ); + +template< typename Pred > +AUX778076_ASSERT_ARG(assert) +assert_not_arg( void (*)(Pred), typename assert_arg_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 +{ + typedef AUX778076_ASSERT_ARG(assert) 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::type +assert_arg(void (*)(Pred), int); + +template< typename Pred > +typename assert_arg_type< boost::mpl::not_ >::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 >::type +assert_rel_arg( assert_relation ); +# 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)) + +#define BOOST_MPL_ASSERT(pred) \ +enum { \ + BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \ + boost::mpl::assertion_failed( \ + boost::mpl::assert_arg( (void (*) pred)0, 1 ) \ + ) \ + ) \ +}\ +/**/ + +// BOOST_MPL_ASSERT_NOT((pred)) + +#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::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( \ + 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::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::value), USER_PROVIDED_MESSAGE, (types) ) + +#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 diff --git a/boost/boost/mpl/aux_/adl_barrier.hpp b/boost/boost/mpl/aux_/adl_barrier.hpp new file mode 100644 index 0000000000..3783dd022d --- /dev/null +++ b/boost/boost/mpl/aux_/adl_barrier.hpp @@ -0,0 +1,48 @@ + +#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 +#include +#include + +#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 diff --git a/boost/boost/mpl/aux_/algorithm_namespace.hpp b/boost/boost/mpl/aux_/algorithm_namespace.hpp deleted file mode 100644 index 420e1d6462..0000000000 --- a/boost/boost/mpl/aux_/algorithm_namespace.hpp +++ /dev/null @@ -1,34 +0,0 @@ -//----------------------------------------------------------------------------- -// 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 diff --git a/boost/boost/mpl/aux_/apply.hpp b/boost/boost/mpl/aux_/apply.hpp deleted file mode 100644 index 96e3f74cce..0000000000 --- a/boost/boost/mpl/aux_/apply.hpp +++ /dev/null @@ -1,72 +0,0 @@ -//----------------------------------------------------------------------------- -// 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 -# define BOOST_MPL_AUX_APPLY2(f,a1,a2) apply2 -# define BOOST_MPL_AUX_APPLY3(f,a1,a2,a3) apply3 -# define BOOST_MPL_AUX_APPLY4(f,a1,a2,a3,a4) apply4 -# define BOOST_MPL_AUX_APPLY5(f,a1,a2,a3,a4,a5) apply5 -# define BOOST_MPL_AUX_APPLY6(f,a1,a2,a3,a4,a5,a6) apply6 -# define BOOST_MPL_AUX_APPLY7(f,a1,a2,a3,a4,a5,a6,a7) apply7 -# define BOOST_MPL_AUX_APPLY8(f,a1,a2,a3,a4,a5,a6,a7,a8) apply8 -# define BOOST_MPL_AUX_APPLY9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) apply9 - -#else - -# define BOOST_MPL_AUX_APPLY0(f) f -# define BOOST_MPL_AUX_APPLY1(f,a1) f::template apply -# define BOOST_MPL_AUX_APPLY2(f,a1,a2) f::template apply -# define BOOST_MPL_AUX_APPLY3(f,a1,a2,a3) f::template apply -# define BOOST_MPL_AUX_APPLY4(f,a1,a2,a3,a4) f::template apply -# define BOOST_MPL_AUX_APPLY5(f,a1,a2,a3,a4,a5) f::template apply -# define BOOST_MPL_AUX_APPLY6(f,a1,a2,a3,a4,a5,a6) f::template apply -# define BOOST_MPL_AUX_APPLY7(f,a1,a2,a3,a4,a5,a6,a7) f::template apply -# define BOOST_MPL_AUX_APPLY8(f,a1,a2,a3,a4,a5,a6,a7,a8) f::template apply -# define BOOST_MPL_AUX_APPLY9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) f::template apply - -#endif - -#endif // BOOST_MPL_AUX_APPLY_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/arg_typedef.hpp b/boost/boost/mpl/aux_/arg_typedef.hpp index 19b6bc05ee..04b049173c 100644 --- a/boost/boost/mpl/aux_/arg_typedef.hpp +++ b/boost/boost/mpl/aux_/arg_typedef.hpp @@ -1,28 +1,31 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arg_typedef.hpp,v $ +// $Date: 2004/09/02 15:40:43 $ +// $Revision: 1.3 $ + +#include +#include + +#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 diff --git a/boost/boost/mpl/aux_/arity.hpp b/boost/boost/mpl/aux_/arity.hpp index 3a7d281597..fde07b2d5d 100644 --- a/boost/boost/mpl/aux_/arity.hpp +++ b/boost/boost/mpl/aux_/arity.hpp @@ -1,32 +1,27 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arity.hpp,v $ +// $Date: 2004/09/02 15:40:43 $ +// $Revision: 1.6 $ -# include "boost/config.hpp" +#include -namespace boost { -namespace mpl { -namespace aux { +#if defined(BOOST_MPL_CFG_BROKEN_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES) + +# include +# include + +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 @@ -37,10 +32,8 @@ struct arity 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 diff --git a/boost/boost/mpl/aux_/arity_spec.hpp b/boost/boost/mpl/aux_/arity_spec.hpp index d3939f7f4e..e20a0e578c 100644 --- a/boost/boost/mpl/aux_/arity_spec.hpp +++ b/boost/boost/mpl/aux_/arity_spec.hpp @@ -1,29 +1,30 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/arity_spec.hpp,v $ +// $Date: 2004/10/30 06:10:35 $ +// $Revision: 1.5.2.2 $ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#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) > \ @@ -33,7 +34,7 @@ struct arity< \ > \ { \ BOOST_STATIC_CONSTANT(int \ - , value = BOOST_MPL_METAFUNCTION_MAX_ARITY \ + , value = BOOST_MPL_LIMIT_METAFUNCTION_ARITY \ ); \ }; \ } \ @@ -46,4 +47,21 @@ struct 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 > \ + : int_ \ +{ \ +}; \ +} \ +/**/ +#else +# define BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(i, name) /**/ +#endif + + #endif // BOOST_MPL_AUX_ARITY_SPEC_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/common_name_wknd.hpp b/boost/boost/mpl/aux_/common_name_wknd.hpp new file mode 100644 index 0000000000..d7a254d607 --- /dev/null +++ b/boost/boost/mpl/aux_/common_name_wknd.hpp @@ -0,0 +1,34 @@ + +#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 + +#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 diff --git a/boost/boost/mpl/aux_/config/adl.hpp b/boost/boost/mpl/aux_/config/adl.hpp new file mode 100644 index 0000000000..3fdf43ac18 --- /dev/null +++ b/boost/boost/mpl/aux_/config/adl.hpp @@ -0,0 +1,40 @@ + +#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 +#include +#include +#include + +// 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 diff --git a/boost/boost/mpl/aux_/config/arrays.hpp b/boost/boost/mpl/aux_/config/arrays.hpp new file mode 100644 index 0000000000..d8a07ca6c2 --- /dev/null +++ b/boost/boost/mpl/aux_/config/arrays.hpp @@ -0,0 +1,30 @@ + +#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 +#include + +#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 diff --git a/boost/boost/mpl/aux_/config/bind.hpp b/boost/boost/mpl/aux_/config/bind.hpp new file mode 100644 index 0000000000..0739f7ce89 --- /dev/null +++ b/boost/boost/mpl/aux_/config/bind.hpp @@ -0,0 +1,33 @@ + +#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 +#include + +#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 diff --git a/boost/boost/mpl/aux_/config/compiler.hpp b/boost/boost/mpl/aux_/config/compiler.hpp index a7779d9638..cc184e3de1 100644 --- a/boost/boost/mpl/aux_/config/compiler.hpp +++ b/boost/boost/mpl/aux_/config/compiler.hpp @@ -1,57 +1,64 @@ -//----------------------------------------------------------------------------- -// 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 +# include +# include +# include +# include +# include + +# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +# define BOOST_MPL_CFG_COMPILER_DIR msvc60 + +# elif BOOST_WORKAROUND(BOOST_MSVC, == 1300) +# define BOOST_MPL_CFG_COMPILER_DIR msvc70 + +# elif BOOST_WORKAROUND(BOOST_MPL_CFG_GCC, BOOST_TESTED_AT(0x0304)) +# define BOOST_MPL_CFG_COMPILER_DIR gcc + +# 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 -#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 +# define BOOST_MPL_CFG_COMPILER_DIR plain # endif -#elif defined(__MWERKS__) -# if defined(BOOST_BROKEN_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES) -# define BOOST_MPL_COMPILER_DIR mwcw -# else -# define BOOST_MPL_COMPILER_DIR plain -# endif - -#elif defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -# define BOOST_MPL_COMPILER_DIR no_ctps - -#elif defined(BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS) -# define BOOST_MPL_COMPILER_DIR no_ttp - -#else -# define BOOST_MPL_COMPILER_DIR plain -#endif +#endif // BOOST_MPL_CFG_COMPILER_DIR #endif // BOOST_MPL_AUX_CONFIG_COMPILER_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/ctps.hpp b/boost/boost/mpl/aux_/config/ctps.hpp index c0adabb946..7c5aa7e5e6 100644 --- a/boost/boost/mpl/aux_/config/ctps.hpp +++ b/boost/boost/mpl/aux_/config/ctps.hpp @@ -1,32 +1,30 @@ -//----------------------------------------------------------------------------- -// 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. -#if !defined(BOOST_NO_NON_TYPE_TEMPLATE_PARTIAL_SPECIALIZATION) \ +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/ctps.hpp,v $ +// $Date: 2004/09/02 15:40:45 $ +// $Revision: 1.5 $ + +#include +#include + +#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 #endif // BOOST_MPL_AUX_CONFIG_CTPS_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/dtp.hpp b/boost/boost/mpl/aux_/config/dtp.hpp index cefacfc742..afd084a412 100644 --- a/boost/boost/mpl/aux_/config/dtp.hpp +++ b/boost/boost/mpl/aux_/config/dtp.hpp @@ -1,23 +1,20 @@ -//----------------------------------------------------------------------------- -// 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 // MWCW 7.x-8.0 "losts" default template parameters of nested class // templates when their owner classes are passed as arguments to other @@ -25,24 +22,24 @@ // 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 diff --git a/boost/boost/mpl/aux_/config/eti.hpp b/boost/boost/mpl/aux_/config/eti.hpp index 70006b5a46..6dbd274a71 100644 --- a/boost/boost/mpl/aux_/config/eti.hpp +++ b/boost/boost/mpl/aux_/config/eti.hpp @@ -1,30 +1,47 @@ -//----------------------------------------------------------------------------- -// 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 +#include // 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 diff --git a/boost/boost/mpl/aux_/config/gcc.hpp b/boost/boost/mpl/aux_/config/gcc.hpp new file mode 100644 index 0000000000..2fb9212b5c --- /dev/null +++ b/boost/boost/mpl/aux_/config/gcc.hpp @@ -0,0 +1,23 @@ + +#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 diff --git a/boost/boost/mpl/aux_/config/has_apply.hpp b/boost/boost/mpl/aux_/config/has_apply.hpp new file mode 100644 index 0000000000..a24867cba6 --- /dev/null +++ b/boost/boost/mpl/aux_/config/has_apply.hpp @@ -0,0 +1,32 @@ + +#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 +#include +#include + +#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 diff --git a/boost/boost/mpl/aux_/config/has_xxx.hpp b/boost/boost/mpl/aux_/config/has_xxx.hpp new file mode 100644 index 0000000000..7dc14ea5d7 --- /dev/null +++ b/boost/boost/mpl/aux_/config/has_xxx.hpp @@ -0,0 +1,33 @@ + +#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 +#include + +// 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 diff --git a/boost/boost/mpl/aux_/config/integral.hpp b/boost/boost/mpl/aux_/config/integral.hpp new file mode 100644 index 0000000000..49ea071a4e --- /dev/null +++ b/boost/boost/mpl/aux_/config/integral.hpp @@ -0,0 +1,38 @@ + +#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 +#include + +#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 diff --git a/boost/boost/mpl/aux_/config/intel.hpp b/boost/boost/mpl/aux_/config/intel.hpp new file mode 100644 index 0000000000..7787efd053 --- /dev/null +++ b/boost/boost/mpl/aux_/config/intel.hpp @@ -0,0 +1,21 @@ + +#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 + +#endif // BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/lambda.hpp b/boost/boost/mpl/aux_/config/lambda.hpp index 50630b0c55..ace8cbf2ff 100644 --- a/boost/boost/mpl/aux_/config/lambda.hpp +++ b/boost/boost/mpl/aux_/config/lambda.hpp @@ -1,35 +1,32 @@ -//----------------------------------------------------------------------------- -// 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 +#include // 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 +#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_CFG_NO_FULL_LAMBDA_SUPPORT + #endif -//#define BOOST_MPL_NO_UNNAMED_PLACEHOLDER_SUPPORT -//#define BOOST_MPL_NO_LAMBDA_HEURISTIC - #endif // BOOST_MPL_AUX_CONFIG_LAMBDA_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/msvc.hpp b/boost/boost/mpl/aux_/config/msvc.hpp index aa559ca475..43e1ab82ad 100644 --- a/boost/boost/mpl/aux_/config/msvc.hpp +++ b/boost/boost/mpl/aux_/config/msvc.hpp @@ -1,23 +1,21 @@ -//----------------------------------------------------------------------------- -// 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 #endif // BOOST_MPL_AUX_CONFIG_MSVC_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/msvc_typename.hpp b/boost/boost/mpl/aux_/config/msvc_typename.hpp index 0c154244a2..5707148722 100644 --- a/boost/boost/mpl/aux_/config/msvc_typename.hpp +++ b/boost/boost/mpl/aux_/config/msvc_typename.hpp @@ -1,25 +1,23 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/msvc_typename.hpp,v $ +// $Date: 2004/09/02 15:40:45 $ +// $Revision: 1.4 $ + +#include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) # define BOOST_MSVC_TYPENAME #else # define BOOST_MSVC_TYPENAME typename diff --git a/boost/boost/mpl/aux_/config/nttp.hpp b/boost/boost/mpl/aux_/config/nttp.hpp index 9f35c2a57f..6c79c9ecab 100644 --- a/boost/boost/mpl/aux_/config/nttp.hpp +++ b/boost/boost/mpl/aux_/config/nttp.hpp @@ -1,25 +1,24 @@ -//----------------------------------------------------------------------------- -// 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. -// MSVC 6.5 ICE-s on the code as simple as this: +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/nttp.hpp,v $ +// $Date: 2004/09/02 15:40:45 $ +// $Revision: 1.4 $ + +#include +#include + +// 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; @@ -30,27 +29,13 @@ // 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 +#if !defined(BOOST_MPL_CFG_NTTP_BUG) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) \ + && BOOST_WORKAROUND(BOOST_MSVC, < 1300) -#include "boost/preprocessor/cat.hpp" +# define BOOST_MPL_CFG_NTTP_BUG -#if !defined(BOOST_MPL_PREPROCESSING_MODE) -namespace boost { namespace mpl { -typedef int nttp_int; -typedef long nttp_long; -}} -#endif - -# define BOOST_MPL_AUX_NTTP_DECL(T, x) BOOST_PP_CAT(nttp_,T) x /**/ - -#else -# define BOOST_MPL_AUX_NTTP_DECL(T, x) T x /**/ #endif #endif // BOOST_MPL_AUX_CONFIG_NTTP_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/overload_resolution.hpp b/boost/boost/mpl/aux_/config/overload_resolution.hpp index 8e7ed0d3bc..b46603a93f 100644 --- a/boost/boost/mpl/aux_/config/overload_resolution.hpp +++ b/boost/boost/mpl/aux_/config/overload_resolution.hpp @@ -2,31 +2,27 @@ #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 $ -#if !defined(BOOST_MPL_BROKEN_OVERLOAD_RESOLUTION) \ +#include + +#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 diff --git a/boost/boost/mpl/aux_/config/preprocessor.hpp b/boost/boost/mpl/aux_/config/preprocessor.hpp index 798612aca4..dd1ef2b7e0 100644 --- a/boost/boost/mpl/aux_/config/preprocessor.hpp +++ b/boost/boost/mpl/aux_/config/preprocessor.hpp @@ -2,37 +2,38 @@ #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 -#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 diff --git a/boost/boost/mpl/aux_/config/static_constant.hpp b/boost/boost/mpl/aux_/config/static_constant.hpp index ae94fc63e9..42c142f8ca 100644 --- a/boost/boost/mpl/aux_/config/static_constant.hpp +++ b/boost/boost/mpl/aux_/config/static_constant.hpp @@ -1,25 +1,25 @@ -//----------------------------------------------------------------------------- -// 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 +#else +// undef the macro for the preprocessing mode +# undef BOOST_STATIC_CONSTANT #endif #endif // BOOST_MPL_AUX_CONFIG_STATIC_CONSTANT_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/config/ttp.hpp b/boost/boost/mpl/aux_/config/ttp.hpp index ba285efaba..d283bfdbde 100644 --- a/boost/boost/mpl/aux_/config/ttp.hpp +++ b/boost/boost/mpl/aux_/config/ttp.hpp @@ -1,40 +1,38 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_NO_TEMPLATE_TEMPLATES) \ - && ( !defined(BOOST_MSVC) || BOOST_MSVC < 1300 ) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/config/ttp.hpp,v $ +// $Date: 2004/09/02 15:40:45 $ +// $Revision: 1.7 $ -# define BOOST_NO_TEMPLATE_TEMPLATE_PARAMETERS +#include +#include +#include + +#if !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \ + && defined(BOOST_NO_TEMPLATE_TEMPLATES) + +# 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 diff --git a/boost/boost/mpl/aux_/config/use_preprocessed.hpp b/boost/boost/mpl/aux_/config/use_preprocessed.hpp index 8d3bdb32ec..6548ac6817 100644 --- a/boost/boost/mpl/aux_/config/use_preprocessed.hpp +++ b/boost/boost/mpl/aux_/config/use_preprocessed.hpp @@ -1,22 +1,19 @@ -//----------------------------------------------------------------------------- -// 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 diff --git a/boost/boost/mpl/aux_/config/workaround.hpp b/boost/boost/mpl/aux_/config/workaround.hpp index dd3445629b..89ed715d31 100644 --- a/boost/boost/mpl/aux_/config/workaround.hpp +++ b/boost/boost/mpl/aux_/config/workaround.hpp @@ -1,22 +1,19 @@ -//----------------------------------------------------------------------------- -// 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 #endif // BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/full_lambda.hpp b/boost/boost/mpl/aux_/full_lambda.hpp new file mode 100644 index 0000000000..88ba9e56f3 --- /dev/null +++ b/boost/boost/mpl/aux_/full_lambda.hpp @@ -0,0 +1,350 @@ + +#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 +# include +# include +# include +# include +# include +# include +# include +# include +# include +# if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) +# include +# endif +#endif + +#include +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER full_lambda.hpp +# include + +#else + +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +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::is_le +{ +}; + + +template< int N, typename Tag > +struct lambda< arg,Tag AUX778076_ARITY_PARAM(int_<-1>) > +{ + typedef true_ is_le; + typedef mpl::arg result_; // qualified for the sake of MIPSpro 7.41 + typedef mpl::protect type; +}; + + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, )) +#include BOOST_PP_ITERATE() + +/// special case for 'protect' +template< typename T, typename Tag > +struct lambda< mpl::protect,Tag AUX778076_ARITY_PARAM(int_<1>) > +{ + typedef false_ is_le; + typedef mpl::protect result_; + typedef result_ type; +}; + +/// specializations for the main 'bind' form +template< + typename F, AUX778076_BIND_PARAMS(typename T) + , typename Tag + > +struct lambda< + bind + , Tag + AUX778076_ARITY_PARAM(int_) + > +{ + typedef false_ is_le; + typedef bind 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 + , Tag2 + , int_<3> + > +{ + typedef lambda< F,Tag2 > l1; + typedef lambda< Tag1,Tag2 > l2; + + typedef typename l1::is_le is_le; + typedef bind1< quote1, typename l1::result_ > arity_; + typedef lambda< typename if_::type,Tag2 > l3; + + typedef aux::le_result3 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 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_) + , BOOST_MPL_PP_REPEAT(i_, AUX778076_RESULT, L) + > result_; + + typedef mpl::protect 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 + , Tag + AUX778076_ARITY_PARAM(int_) + > +{ + 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_) + , Tag + AUX778076_ARITY_PARAM(int_) + > +{ + 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 diff --git a/boost/boost/mpl/aux_/has_apply.hpp b/boost/boost/mpl/aux_/has_apply.hpp new file mode 100644 index 0000000000..8d0d0051be --- /dev/null +++ b/boost/boost/mpl/aux_/has_apply.hpp @@ -0,0 +1,32 @@ + +#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 +#include + +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 diff --git a/boost/boost/mpl/aux_/has_type.hpp b/boost/boost/mpl/aux_/has_type.hpp new file mode 100644 index 0000000000..b89311a4ff --- /dev/null +++ b/boost/boost/mpl/aux_/has_type.hpp @@ -0,0 +1,23 @@ + +#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 + +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 diff --git a/boost/boost/mpl/aux_/has_xxx.hpp b/boost/boost/mpl/aux_/has_xxx.hpp deleted file mode 100644 index 4e765be865..0000000000 --- a/boost/boost/mpl/aux_/has_xxx.hpp +++ /dev/null @@ -1,224 +0,0 @@ - -#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 const volatile* \ - , boost::mpl::aux::type_wrapper* = 0 \ - ); \ - \ -boost::mpl::aux::no_tag \ -trait##_helper(...); \ - \ -template< typename T > \ -struct trait \ -{ \ - typedef boost::mpl::aux::type_wrapper t_; \ - BOOST_STATIC_CONSTANT(bool, value = \ - sizeof((trait##_helper)(static_cast(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 const volatile* \ - , boost::mpl::aux::type_wrapper* = 0 \ - ); \ - \ - static boost::mpl::aux::no_tag \ - test(...); \ - }; \ - \ - typedef boost::mpl::aux::type_wrapper t_; \ - \ - BOOST_STATIC_CONSTANT( \ - bool, value = \ - sizeof(helpers::test(static_cast(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 - struct msvc_incomplete_array - { - typedef char (&type)[sizeof(U) + 1]; - }; -# endif - -template -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 - static typename msvc_incomplete_array::type tester(type_wrapper); -# else - template - static char (& tester(type_wrapper) )[sizeof(U)+1]; -# endif - - BOOST_STATIC_CONSTANT( - bool, value = sizeof(tester(type_wrapper())) == 1); -}; - -template<> -struct msvc_is_incomplete -{ - 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(0))) \ - != sizeof(boost::mpl::aux::no_tag) \ - ); \ -}; \ - \ -template< typename T > struct trait \ - : boost::mpl::if_c< \ - boost::mpl::aux::msvc_is_incomplete::value \ - , boost::mpl::bool_ \ - , BOOST_PP_CAT(trait,_impl) \ - >::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 \ -{ \ - 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 diff --git a/boost/boost/mpl/aux_/ice_cast.hpp b/boost/boost/mpl/aux_/ice_cast.hpp deleted file mode 100644 index e5faa2599b..0000000000 --- a/boost/boost/mpl/aux_/ice_cast.hpp +++ /dev/null @@ -1,31 +0,0 @@ -//----------------------------------------------------------------------------- -// 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(expr) -#endif - -#endif // BOOST_MPL_AUX_ICE_CAST_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/include_preprocessed.hpp b/boost/boost/mpl/aux_/include_preprocessed.hpp index ea95e107cc..fd33f3965b 100644 --- a/boost/boost/mpl/aux_/include_preprocessed.hpp +++ b/boost/boost/mpl/aux_/include_preprocessed.hpp @@ -1,30 +1,30 @@ -// 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 $ +// $Date: 2004/09/02 15:40:43 $ +// $Revision: 1.5 $ -// no include guards, the header is intended for multiple inclusion! - -#include "boost/mpl/aux_/config/compiler.hpp" -#include "boost/mpl/aux_/config/preprocessor.hpp" -#include "boost/preprocessor/cat.hpp" -#include "boost/preprocessor/stringize.hpp" +#include +#include +#include +#include #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 diff --git a/boost/boost/mpl/aux_/integral_wrapper.hpp b/boost/boost/mpl/aux_/integral_wrapper.hpp index 64ec3080c8..227a1ed9c1 100644 --- a/boost/boost/mpl/aux_/integral_wrapper.hpp +++ b/boost/boost/mpl/aux_/integral_wrapper.hpp @@ -1,28 +1,25 @@ -// + 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 $ -#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" +// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION! -#include "boost/preprocessor/cat.hpp" +#include +#include +#include +#include +#include + +#include #if !defined(AUX_WRAPPER_NAME) # define AUX_WRAPPER_NAME BOOST_PP_CAT(AUX_WRAPPER_VALUE_TYPE,_) @@ -36,11 +33,11 @@ # 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 @@ -54,6 +51,7 @@ 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 @@ -87,7 +85,7 @@ template< AUX_WRAPPER_PARAMS(N) > 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 diff --git a/boost/boost/mpl/aux_/is_msvc_eti_arg.hpp b/boost/boost/mpl/aux_/is_msvc_eti_arg.hpp index 002197e131..751aeaff9d 100644 --- a/boost/boost/mpl/aux_/is_msvc_eti_arg.hpp +++ b/boost/boost/mpl/aux_/is_msvc_eti_arg.hpp @@ -1,31 +1,28 @@ -//----------------------------------------------------------------------------- -// 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 +#include +#include 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 @@ -33,7 +30,7 @@ struct is_msvc_eti_arg BOOST_STATIC_CONSTANT(bool, value = false); }; -#else +#else // BOOST_MPL_CFG_MSVC_60_ETI_BUG struct eti_int_convertible { @@ -52,7 +49,7 @@ struct is_msvc_eti_arg ); }; -#endif // BOOST_MPL_MSVC_60_ETI_BUG +#endif template<> struct is_msvc_eti_arg @@ -60,8 +57,8 @@ struct is_msvc_eti_arg 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 diff --git a/boost/boost/mpl/aux_/lambda_arity_param.hpp b/boost/boost/mpl/aux_/lambda_arity_param.hpp index 926e3a3dc0..48ff9d602f 100644 --- a/boost/boost/mpl/aux_/lambda_arity_param.hpp +++ b/boost/boost/mpl/aux_/lambda_arity_param.hpp @@ -1,25 +1,22 @@ -//----------------------------------------------------------------------------- -// 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. -#if !defined(BOOST_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_arity_param.hpp,v $ +// $Date: 2004/09/02 15:40:43 $ +// $Revision: 1.5 $ + +#include + +#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 diff --git a/boost/boost/mpl/aux_/lambda_spec.hpp b/boost/boost/mpl/aux_/lambda_spec.hpp index cc8978a5bf..fe53da324d 100644 --- a/boost/boost/mpl/aux_/lambda_spec.hpp +++ b/boost/boost/mpl/aux_/lambda_spec.hpp @@ -1,30 +1,27 @@ -//----------------------------------------------------------------------------- -// 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. -#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_spec.hpp,v $ +// $Date: 2004/09/02 15:40:43 $ +// $Revision: 1.8 $ + +#include +#include +#include +#include +#include +#include + +#if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) # define BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(i, name) \ template< \ @@ -34,9 +31,10 @@ 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_) \ > \ { \ + typedef false_ is_le; \ typedef name< BOOST_MPL_PP_PARAMS(i, T) > type; \ }; \ /**/ diff --git a/boost/boost/mpl/aux_/lambda_support.hpp b/boost/boost/mpl/aux_/lambda_support.hpp index 0a174da45f..e1b9ee2b78 100644 --- a/boost/boost/mpl/aux_/lambda_support.hpp +++ b/boost/boost/mpl/aux_/lambda_support.hpp @@ -1,37 +1,40 @@ -//----------------------------------------------------------------------------- -// 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 + +#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 +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include # define BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC(R,typedef_,i,param) \ typedef_ param BOOST_PP_CAT(arg,BOOST_PP_INC(i)); \ @@ -41,7 +44,7 @@ #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_ arity; \ BOOST_PP_LIST_FOR_EACH_I_R( \ 1 \ , BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \ @@ -67,7 +70,7 @@ // 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_ arity; \ BOOST_PP_LIST_FOR_EACH_I_R( \ 1 \ , BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \ @@ -91,8 +94,12 @@ struct name::rebind \ #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_ arity; \ BOOST_PP_LIST_FOR_EACH_I_R( \ 1 \ , BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \ @@ -103,10 +110,35 @@ struct name::rebind \ 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 \ + , name* \ + ); \ +::boost::mpl::aux::no_tag operator|( \ + ::boost::mpl::aux::has_rebind_tag \ + , 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 \ + , ::boost::mpl::aux::has_rebind_tag< name >* \ + ); \ +/**/ +#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: \ @@ -119,6 +151,7 @@ class BOOST_PP_CAT(name,_rebind) \ # 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: \ @@ -131,6 +164,6 @@ class BOOST_PP_CAT(name,_rebind) \ #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 diff --git a/boost/boost/mpl/aux_/msvc_eti_base.hpp b/boost/boost/mpl/aux_/msvc_eti_base.hpp index 152dd16bf6..55b612a4dc 100644 --- a/boost/boost/mpl/aux_/msvc_eti_base.hpp +++ b/boost/boost/mpl/aux_/msvc_eti_base.hpp @@ -1,32 +1,32 @@ -//----------------------------------------------------------------------------- -// 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 +#include +#include +#include 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; }; @@ -37,6 +37,10 @@ template<> struct msvc_eti_base_impl template< typename T > struct result_ { typedef result_ type; + typedef result_ first; + typedef result_ second; + typedef result_ tag; + enum { value = 0 }; }; }; @@ -46,15 +50,28 @@ template< typename T > struct msvc_eti_base { }; -#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 -}}} // namespace boost::mpl::aux +template<> struct msvc_eti_base +{ + typedef msvc_eti_base type; + typedef msvc_eti_base first; + typedef msvc_eti_base second; + typedef msvc_eti_base tag; + enum { value = 0 }; +}; + +}}} #endif // BOOST_MPL_AUX_MSVC_ETI_BASE_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/msvc_never_true.hpp b/boost/boost/mpl/aux_/msvc_never_true.hpp index 88f67ed239..2418cdd51c 100644 --- a/boost/boost/mpl/aux_/msvc_never_true.hpp +++ b/boost/boost/mpl/aux_/msvc_never_true.hpp @@ -1,29 +1,25 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/msvc_never_true.hpp,v $ +// $Date: 2004/09/02 15:40:43 $ +// $Revision: 1.5 $ -namespace boost { -namespace mpl { -namespace aux { +#include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + +namespace boost { namespace mpl { namespace aux { template< typename T > struct msvc_never_true @@ -31,10 +27,8 @@ 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 diff --git a/boost/boost/mpl/aux_/na.hpp b/boost/boost/mpl/aux_/na.hpp new file mode 100644 index 0000000000..14a2533640 --- /dev/null +++ b/boost/boost/mpl/aux_/na.hpp @@ -0,0 +1,95 @@ + +#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 +#include +#include +#include + +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 + : 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 + : 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 +{ + typedef U type; +}; +#else +template< typename T > struct if_na_impl +{ + template< typename U > struct apply + { + typedef T type; + }; +}; + +template<> struct if_na_impl +{ + template< typename U > struct apply + { + typedef U type; + }; +}; + +template< typename T, typename U > struct if_na + : if_na_impl::template apply +{ +}; +#endif + +}} + +#endif // BOOST_MPL_AUX_NA_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/na_assert.hpp b/boost/boost/mpl/aux_/na_assert.hpp new file mode 100644 index 0000000000..de0964f17c --- /dev/null +++ b/boost/boost/mpl/aux_/na_assert.hpp @@ -0,0 +1,33 @@ + +#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 +#include +#include + +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) +# include +# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \ + BOOST_MPL_ASSERT_NOT((boost::mpl::is_na)) \ +/**/ +#else +# include +# define BOOST_MPL_AUX_ASSERT_NOT_NA(x) \ + BOOST_STATIC_ASSERT(!boost::mpl::is_na::value) \ +/**/ +#endif + +#endif // BOOST_MPL_AUX_NA_ASSERT_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/na_fwd.hpp b/boost/boost/mpl/aux_/na_fwd.hpp new file mode 100644 index 0000000000..0cdf21e8d1 --- /dev/null +++ b/boost/boost/mpl/aux_/na_fwd.hpp @@ -0,0 +1,31 @@ + +#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_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 diff --git a/boost/boost/mpl/aux_/na_spec.hpp b/boost/boost/mpl/aux_/na_spec.hpp new file mode 100644 index 0000000000..1c0a33bd08 --- /dev/null +++ b/boost/boost/mpl/aux_/na_spec.hpp @@ -0,0 +1,175 @@ + +#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 +# include +# include +# include +# include +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#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_ \ +{ \ +}; \ +\ +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 diff --git a/boost/boost/mpl/aux_/nested_type_wknd.hpp b/boost/boost/mpl/aux_/nested_type_wknd.hpp index 1058a20d8f..0b8c02e458 100644 --- a/boost/boost/mpl/aux_/nested_type_wknd.hpp +++ b/boost/boost/mpl/aux_/nested_type_wknd.hpp @@ -1,45 +1,48 @@ -//----------------------------------------------------------------------------- -// 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 $ + +#include +#include + +#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 +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 - +#if BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x840)) +# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) \ + aux::nested_type_wknd \ +/**/ #else +# define BOOST_MPL_AUX_NESTED_TYPE_WKND(T) \ + ::boost::mpl::aux::nested_type_wknd \ +/**/ +#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 diff --git a/boost/boost/mpl/aux_/nttp_decl.hpp b/boost/boost/mpl/aux_/nttp_decl.hpp new file mode 100644 index 0000000000..bb79ecbd4a --- /dev/null +++ b/boost/boost/mpl/aux_/nttp_decl.hpp @@ -0,0 +1,33 @@ + +#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 + +#if defined(BOOST_MPL_CFG_NTTP_BUG) + +typedef int _mpl_nttp_int; +typedef long _mpl_nttp_long; + +# include +# 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 diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/and.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/and.hpp index 9f6982a597..010ad1fc84 100644 --- a/boost/boost/mpl/aux_/preprocessed/gcc/and.hpp +++ b/boost/boost/mpl/aux_/preprocessed/gcc/and.hpp @@ -1,5 +1,13 @@ -// 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 { @@ -33,8 +41,8 @@ struct and_impl< } // 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_ @@ -48,15 +56,14 @@ 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 - +}} diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/apply.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/apply.hpp index 9dc3d5c8ba..e08eaccf03 100644 --- a/boost/boost/mpl/aux_/preprocessed/gcc/apply.hpp +++ b/boost/boost/mpl/aux_/preprocessed/gcc/apply.hpp @@ -1,24 +1,37 @@ -// 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::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 { }; @@ -27,16 +40,23 @@ template< typename F, typename T1 > struct apply1 - : F::template apply< - T1 + + : apply_wrap1< + typename lambda::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 > { }; @@ -45,16 +65,23 @@ template< typename F, typename T1, typename T2 > struct apply2 - : F::template apply< - T1, T2 + + : apply_wrap2< + typename lambda::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 > { }; @@ -63,16 +90,23 @@ template< typename F, typename T1, typename T2, typename T3 > struct apply3 - : F::template apply< - T1, T2, T3 + + : apply_wrap3< + typename lambda::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 > { }; @@ -81,16 +115,23 @@ template< typename F, typename T1, typename T2, typename T3, typename T4 > struct apply4 - : F::template apply< - T1, T2, T3, T4 + + : apply_wrap4< + typename lambda::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 > { }; @@ -100,13 +141,21 @@ template< , typename T5 > struct apply5 - : F::template apply< - T1, T2, T3, T4, T5 + + : apply_wrap5< + typename lambda::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 @@ -116,6 +165,5 @@ struct apply { }; -} // namespace mpl -} // namespace boost +}} diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp new file mode 100644 index 0000000000..b2ed5d5130 --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/apply_fwd.hpp @@ -0,0 +1,52 @@ + +// 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; + +}} + diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp new file mode 100644 index 0000000000..34d51a1a58 --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/apply_wrap.hpp @@ -0,0 +1,84 @@ + +// 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::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 +{ +}; + +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 > +{ +}; + +}} + diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/arg.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/arg.hpp index d7097f86cd..6f2f8a8070 100644 --- a/boost/boost/mpl/aux_/preprocessed/gcc/arg.hpp +++ b/boost/boost/mpl/aux_/preprocessed/gcc/arg.hpp @@ -1,136 +1,123 @@ -// 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_::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_::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_::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_::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_::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_::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 diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/bind.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/bind.hpp new file mode 100644 index 0000000000..0e9513a649 --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/bind.hpp @@ -0,0 +1,561 @@ + +// 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, U1, U2, U3, U4, U5 > +{ + typedef typename apply_wrap5, 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, U1, U2, U3, U4, U5 + > +{ + typedef bind0 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 +{ +}; + +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; + }; +}; + +}} + diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp new file mode 100644 index 0000000000..c4a5060ff8 --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/bind_fwd.hpp @@ -0,0 +1,52 @@ + +// 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; + +}} + diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp new file mode 100644 index 0000000000..e3eef71b1e --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp @@ -0,0 +1,558 @@ + +// 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::is_le +{ +}; + +template< int N, typename Tag > +struct lambda< arg,Tag, int_< -1 > > +{ + typedef true_ is_le; + typedef mpl::arg result_; // qualified for the sake of MIPSpro 7.41 + typedef mpl::protect type; +}; + +template< + typename F + , typename Tag + > +struct lambda< + bind0 + , 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 type; +}; + +} // namespace aux + +template< + template< typename P1 > class F + , typename T1 + , typename Tag + > +struct lambda< + F + , 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 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 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 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 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,Tag, int_<1> > +{ + typedef false_ is_le; + typedef mpl::protect 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, typename l1::result_ > arity_; + typedef lambda< typename if_< is_le,arity_,Arity >::type, Tag2 > l3; + typedef aux::le_result3 le_result_; + typedef typename le_result_::result_ result_; + typedef typename le_result_::type type; +}; + +BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda) + +}} + diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/or.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/or.hpp index 517fbdff83..31e1aaa4e6 100644 --- a/boost/boost/mpl/aux_/preprocessed/gcc/or.hpp +++ b/boost/boost/mpl/aux_/preprocessed/gcc/or.hpp @@ -1,5 +1,13 @@ -// 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 { @@ -33,8 +41,8 @@ struct or_impl< } // 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_ @@ -48,15 +56,14 @@ 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 - +}} diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp index 8c17ad30e5..ff97364b9b 100644 --- a/boost/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp +++ b/boost/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp @@ -1,54 +1,105 @@ -// 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 - +}} diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/quote.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/quote.hpp new file mode 100644 index 0000000000..d7d0420e4d --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/quote.hpp @@ -0,0 +1,123 @@ + +// 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 + , aux::has_type< F >::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 + > + + { + }; +}; + +}} + diff --git a/boost/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp b/boost/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp new file mode 100644 index 0000000000..3e7bfba1ea --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp @@ -0,0 +1,101 @@ + +// 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 >, 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(), arity_tag())) - 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_ type; +}; + +}}} diff --git a/boost/boost/mpl/aux_/preprocessor/def_params_tail.hpp b/boost/boost/mpl/aux_/preprocessor/def_params_tail.hpp index c8e564cbbc..85e9707873 100644 --- a/boost/boost/mpl/aux_/preprocessor/def_params_tail.hpp +++ b/boost/boost/mpl/aux_/preprocessor/def_params_tail.hpp @@ -1,44 +1,41 @@ -//----------------------------------------------------------------------------- -// 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): +#include +#include +#include -#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES) +#include +#include +#include +#include -# 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): + +#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES) + +# include +# include # 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 \ ) \ @@ -66,36 +63,36 @@ #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 +# include +# include +# include +# include +# include # 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)) \ /**/ diff --git a/boost/boost/mpl/aux_/preprocessor/default_params.hpp b/boost/boost/mpl/aux_/preprocessor/default_params.hpp new file mode 100644 index 0000000000..c904b27dd7 --- /dev/null +++ b/boost/boost/mpl/aux_/preprocessor/default_params.hpp @@ -0,0 +1,67 @@ + +#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_PP_DEFAULT_PARAMS(0,T,int): +// 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 + +# 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 +# include +# include +# include +# include + +# 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 diff --git a/boost/boost/mpl/aux_/preprocessor/enum.hpp b/boost/boost/mpl/aux_/preprocessor/enum.hpp index 829787574a..c452c1d176 100644 --- a/boost/boost/mpl/aux_/preprocessor/enum.hpp +++ b/boost/boost/mpl/aux_/preprocessor/enum.hpp @@ -1,32 +1,29 @@ -//----------------------------------------------------------------------------- -// 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_PP_ENUM(0,int): // 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 # define BOOST_MPL_PP_ENUM(n, param) \ BOOST_PP_CAT(BOOST_MPL_PP_ENUM_,n)(param) \ @@ -45,21 +42,21 @@ #else -# include "boost/preprocessor/comma_if.hpp" -# include "boost/preprocessor/repeat.hpp" +# include +# include # 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 diff --git a/boost/boost/mpl/aux_/preprocessor/filter_params.hpp b/boost/boost/mpl/aux_/preprocessor/filter_params.hpp index b6dc3f9eb9..80324638b8 100644 --- a/boost/boost/mpl/aux_/preprocessor/filter_params.hpp +++ b/boost/boost/mpl/aux_/preprocessor/filter_params.hpp @@ -1,22 +1,19 @@ -//----------------------------------------------------------------------------- -// 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 diff --git a/boost/boost/mpl/aux_/preprocessor/params.hpp b/boost/boost/mpl/aux_/preprocessor/params.hpp index baaac7d825..80e354baed 100644 --- a/boost/boost/mpl/aux_/preprocessor/params.hpp +++ b/boost/boost/mpl/aux_/preprocessor/params.hpp @@ -1,32 +1,29 @@ -//----------------------------------------------------------------------------- -// 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_PP_PARAMS(0,T): // 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 # define BOOST_MPL_PP_PARAMS(n,p) \ BOOST_PP_CAT(BOOST_MPL_PP_PARAMS_,n)(p) \ @@ -45,10 +42,10 @@ #else -# include "boost/preprocessor/comma_if.hpp" -# include "boost/preprocessor/repeat.hpp" -# include "boost/preprocessor/inc.hpp" -# include "boost/preprocessor/cat.hpp" +# include +# include +# include +# include # define BOOST_MPL_PP_AUX_PARAM_FUNC(unused, i, param) \ BOOST_PP_COMMA_IF(i) \ @@ -56,13 +53,13 @@ /**/ # 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 diff --git a/boost/boost/mpl/aux_/preprocessor/sub.hpp b/boost/boost/mpl/aux_/preprocessor/sub.hpp index e16ffda062..38b8887682 100644 --- a/boost/boost/mpl/aux_/preprocessor/sub.hpp +++ b/boost/boost/mpl/aux_/preprocessor/sub.hpp @@ -1,27 +1,27 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(BOOST_MPL_BROKEN_PP_MACRO_EXPANSION) -# include "boost/preprocessor/cat.hpp" +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/preprocessor/sub.hpp,v $ +// $Date: 2004/09/02 15:40:56 $ +// $Revision: 1.7 $ + +#include + +#if !defined(BOOST_MPL_CFG_NO_OWN_PP_PRIMITIVES) + +# include + +#if defined(BOOST_MPL_CFG_BROKEN_PP_MACRO_EXPANSION) +# include # define BOOST_MPL_PP_SUB(i,j) \ BOOST_MPL_PP_SUB_DELAY(i,j) \ @@ -38,18 +38,28 @@ # 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 +#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) +# 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 + +# define BOOST_MPL_PP_SUB(i,j) \ + BOOST_PP_SUB(i,j) \ + /**/ + +#endif #endif // BOOST_MPL_AUX_PREPROCESSOR_SUB_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/preprocessor/tuple.hpp b/boost/boost/mpl/aux_/preprocessor/tuple.hpp index a7198430fa..b2459e53bf 100644 --- a/boost/boost/mpl/aux_/preprocessor/tuple.hpp +++ b/boost/boost/mpl/aux_/preprocessor/tuple.hpp @@ -1,22 +1,19 @@ -//----------------------------------------------------------------------------- -// 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 diff --git a/boost/boost/mpl/aux_/static_cast.hpp b/boost/boost/mpl/aux_/static_cast.hpp index dcb5be8453..5a46a1e056 100644 --- a/boost/boost/mpl/aux_/static_cast.hpp +++ b/boost/boost/mpl/aux_/static_cast.hpp @@ -2,23 +2,19 @@ #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 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ || BOOST_WORKAROUND(__GNUC__, < 3) \ diff --git a/boost/boost/mpl/aux_/template_arity.hpp b/boost/boost/mpl/aux_/template_arity.hpp new file mode 100644 index 0000000000..cbabbe1e05 --- /dev/null +++ b/boost/boost/mpl/aux_/template_arity.hpp @@ -0,0 +1,189 @@ + +#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 +#include + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +# include +# if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) +# if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) +# include +# endif +# else +# include +# endif +#endif + +#include +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER template_arity.hpp +# include + +#else + +# if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT) +# if defined(BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING) + +# include +# include +# include +# include +# include + +# include +# include +# include +# include +# include + +# 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 +# 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(),arity_tag())) - 1 + ); +}; + +# define AUX778076_TEMPLATE_ARITY_IMPL_INVOCATION(unused, i_, F) \ + BOOST_PP_COMMA_IF(i_) template_arity_impl::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_ 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 + +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 +{ + template< typename F > struct result_ + : F::arity + { + }; +}; + +template< typename F > +struct template_arity + : template_arity_impl< ::boost::mpl::aux::has_rebind::value > + ::template result_ +{ +}; + +#if defined(BOOST_MPL_CFG_MSVC_ETI_BUG) +template<> +struct template_arity + : 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::type +arity_helper(type_wrapper< F >, arity_tag); + +#undef i_ +#endif // BOOST_PP_IS_ITERATING diff --git a/boost/boost/mpl/aux_/template_arity_fwd.hpp b/boost/boost/mpl/aux_/template_arity_fwd.hpp index 6cb409ec4a..faeeb03de0 100644 --- a/boost/boost/mpl/aux_/template_arity_fwd.hpp +++ b/boost/boost/mpl/aux_/template_arity_fwd.hpp @@ -1,30 +1,23 @@ -//----------------------------------------------------------------------------- -// 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 diff --git a/boost/boost/mpl/aux_/type_wrapper.hpp b/boost/boost/mpl/aux_/type_wrapper.hpp index f432fb122b..a92d0a3ab8 100644 --- a/boost/boost/mpl/aux_/type_wrapper.hpp +++ b/boost/boost/mpl/aux_/type_wrapper.hpp @@ -2,27 +2,22 @@ #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 $ -namespace boost { -namespace mpl { -namespace aux { +#include + +namespace boost { namespace mpl { namespace aux { template< typename T > struct type_wrapper { @@ -47,8 +42,6 @@ template< typename W > struct wrapped_type }; #endif -} // namespace aux -} // namespace mpl -} // namespace boost +}}} #endif // BOOST_MPL_AUX_TYPE_WRAPPER_HPP_INCLUDED diff --git a/boost/boost/mpl/aux_/value_wknd.hpp b/boost/boost/mpl/aux_/value_wknd.hpp index 06304ed0a0..77dc903d27 100644 --- a/boost/boost/mpl/aux_/value_wknd.hpp +++ b/boost/boost/mpl/aux_/value_wknd.hpp @@ -1,60 +1,72 @@ -//----------------------------------------------------------------------------- -// 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. -#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ - || defined(BOOST_MPL_MSVC_60_ETI_BUG) - -# include "boost/mpl/int.hpp" +// $Source: /cvsroot/boost/boost/boost/mpl/aux_/value_wknd.hpp,v $ +// $Date: 2004/09/28 13:56:59 $ +// $Revision: 1.13 $ + +#include +#include +#include +#include + +#if defined(BOOST_MPL_CFG_BCC_INTEGRAL_CONSTANTS) \ + || defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) + +# include namespace boost { namespace mpl { namespace aux { - -template< typename C_ > -struct value_wknd +template< typename C_ > struct value_wknd : C_ { }; -#if defined(BOOST_MPL_MSVC_60_ETI_BUG) -template<> -struct value_wknd +#if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG) +template<> struct value_wknd : 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 diff --git a/boost/boost/mpl/aux_/void_spec.hpp b/boost/boost/mpl/aux_/void_spec.hpp deleted file mode 100644 index be850f4cb7..0000000000 --- a/boost/boost/mpl/aux_/void_spec.hpp +++ /dev/null @@ -1,154 +0,0 @@ -//----------------------------------------------------------------------------- -// 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 diff --git a/boost/boost/mpl/aux_/yes_no.hpp b/boost/boost/mpl/aux_/yes_no.hpp index b9a1bceed4..c2c1e6aebf 100644 --- a/boost/boost/mpl/aux_/yes_no.hpp +++ b/boost/boost/mpl/aux_/yes_no.hpp @@ -2,20 +2,23 @@ #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 +#include +#include +#include -#include "boost/mpl/aux_/config/workaround.hpp" -#include "boost/mpl/aux_/config/msvc.hpp" namespace boost { namespace mpl { namespace aux { @@ -33,7 +36,7 @@ template<> struct yes_no_tag }; -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]; @@ -43,14 +46,13 @@ template< long n > struct weighted_tag #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 diff --git a/boost/boost/mpl/bind.hpp b/boost/boost/mpl/bind.hpp new file mode 100644 index 0000000000..5796a2fbb1 --- /dev/null +++ b/boost/boost/mpl/bind.hpp @@ -0,0 +1,547 @@ + +#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 +# include +# include +# include +# include +# include +# include +# include +# include +# include +# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +# include +# endif +#endif + +#include +#include +#include + +#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 + +#else + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# include +# include +# include +# include + +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,AUX778076_BIND_PARAMS(U) > +{ + typedef typename AUX778076_APPLY, 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,AUX778076_BIND_PARAMS(U) > +{ + typedef bind f_; + typedef typename AUX778076_APPLY::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 +{ + 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::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::type next; + typedef Arg type; + }; +}; + +template< typename T, typename Arg > +struct replace_unnamed_arg + : replace_unnamed_arg_impl::template result_ +{ +}; + +# 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*); + +// 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*); +#endif + +template< BOOST_MPL_AUX_NTTP_DECL(int, N) > +aux::yes_tag is_bind_helper(arg*); + +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 +{ + template< typename T > struct result_ + { + BOOST_STATIC_CONSTANT(bool, value = + sizeof(aux::is_bind_helper(static_cast(0))) + == sizeof(aux::yes_tag) + ); + }; +}; + +template< typename T > struct is_bind_template + : is_bind_template_impl< ::boost::detail::is_reference_impl::value > + ::template result_ +{ +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +} // namespace aux + + +#define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, )) +#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, )) +# 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, )) +# 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 +} + +// bind +template< + typename F, AUX778076_BIND_PARAMS(typename T) AUX778076_DMC_PARAM() + > +struct bind + : aux::bind_chooser< + aux::bind_count_args::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_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_, )) +# 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::type f_; + /// +# else + typedef typename aux::resolve_bind_arg::type f_; + +# endif // BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT + +# if i_ > 0 +# define BOOST_PP_ITERATION_PARAMS_2 (3,(1, i_, )) +# 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_),AUX778076_BIND_PARAMS(U) + > +{ + typedef BOOST_PP_CAT(bind,i_) f_; + typedef typename AUX778076_APPLY::type type; +}; + +#else + +template< + typename F AUX778076_BIND_N_PARAMS(i_, typename T) + > +aux::yes_tag +is_bind_helper(BOOST_PP_CAT(bind,i_)*); + +#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_) +{ +}; +#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_) +{ +}; +#endif + +# else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +namespace aux { + +template<> +struct bind_chooser +{ + 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(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 diff --git a/boost/boost/mpl/bind_fwd.hpp b/boost/boost/mpl/bind_fwd.hpp new file mode 100644 index 0000000000..dc2024bf19 --- /dev/null +++ b/boost/boost/mpl/bind_fwd.hpp @@ -0,0 +1,99 @@ + +#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 +#endif + +#include +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER bind_fwd.hpp +# include + +#else + +# include +# include +# include +# include + +# include +# include +# include + +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, )) +#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 diff --git a/boost/boost/mpl/bool.hpp b/boost/boost/mpl/bool.hpp index 5c3bab2841..d48c3da42f 100644 --- a/boost/boost/mpl/bool.hpp +++ b/boost/boost/mpl/bool.hpp @@ -2,30 +2,28 @@ #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 $ -namespace boost { namespace mpl { +#include +#include +#include + +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; } @@ -36,6 +34,6 @@ template< bool C_ > bool const bool_::value; #endif -}} // namespace boost::mpl +BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE #endif // BOOST_MPL_BOOL_HPP_INCLUDED diff --git a/boost/boost/mpl/bool_fwd.hpp b/boost/boost/mpl/bool_fwd.hpp index 851293715c..806fa7bc93 100644 --- a/boost/boost/mpl/bool_fwd.hpp +++ b/boost/boost/mpl/bool_fwd.hpp @@ -2,23 +2,21 @@ #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_NAMESPACE_OPEN template< bool C_ > struct bool_; @@ -26,6 +24,10 @@ template< bool C_ > struct bool_; typedef bool_ true_; typedef bool_ 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 diff --git a/boost/boost/mpl/eval_if.hpp b/boost/boost/mpl/eval_if.hpp new file mode 100755 index 0000000000..b5dd519b59 --- /dev/null +++ b/boost/boost/mpl/eval_if.hpp @@ -0,0 +1,71 @@ + +#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 +#include +#include +#include +#include +#include + +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_::type f_; + typedef typename f_::type type; +#else + : if_::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::type f_; + typedef typename f_::type type; +#else + : if_c::type +{ +#endif +}; + +BOOST_MPL_AUX_NA_SPEC(3, eval_if) + +}} + +#endif // BOOST_MPL_EVAL_IF_HPP_INCLUDED diff --git a/boost/boost/mpl/has_xxx.hpp b/boost/boost/mpl/has_xxx.hpp new file mode 100644 index 0000000000..4b5360adb3 --- /dev/null +++ b/boost/boost/mpl/has_xxx.hpp @@ -0,0 +1,221 @@ + +#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 +#include +#include +#include +#include +#include +#include +#include + +#include + +#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 +# include + +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::type tester(type_wrapper); +#else + template< typename U > + static char (& tester(type_wrapper) )[sizeof(U)+1]; +#endif + + BOOST_STATIC_CONSTANT(bool, value = + sizeof(tester(type_wrapper())) == 1 + ); +}; + +template<> +struct msvc_is_incomplete +{ + 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(0))) \ + != sizeof(boost::mpl::aux::no_tag) \ + ); \ + typedef boost::mpl::bool_ type; \ +}; \ +\ +template< typename T, typename fallback_ = boost::mpl::bool_ > \ +struct trait \ + : boost::mpl::if_c< \ + boost::mpl::aux::msvc_is_incomplete::value \ + , boost::mpl::bool_ \ + , BOOST_PP_CAT(trait,_impl) \ + >::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 \ +{ \ + BOOST_STATIC_CONSTANT(bool, value = false); \ + typedef boost::mpl::bool_ 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_) const volatile* \ + , BOOST_PP_CAT(trait,_wrapper_)* = 0 \ + ); \ +\ +boost::mpl::aux::no_tag BOOST_PP_CAT(trait,_helper_)(...); \ +\ +template< typename T, typename fallback_ = boost::mpl::bool_ > \ +struct trait \ +{ \ + typedef BOOST_PP_CAT(trait,_wrapper_) t_; \ + BOOST_STATIC_CONSTANT(bool, value = \ + sizeof((BOOST_PP_CAT(trait,_helper_))(static_cast(0))) \ + == sizeof(boost::mpl::aux::yes_tag) \ + ); \ + typedef boost::mpl::bool_ 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_ > \ +struct trait \ +{ \ + struct gcc_3_2_wknd \ + { \ + template< typename U > \ + static boost::mpl::aux::yes_tag test( \ + boost::mpl::aux::type_wrapper const volatile* \ + , boost::mpl::aux::type_wrapper* = 0 \ + ); \ + \ + static boost::mpl::aux::no_tag test(...); \ + }; \ + \ + typedef boost::mpl::aux::type_wrapper t_; \ + BOOST_STATIC_CONSTANT(bool, value = \ + sizeof(gcc_3_2_wknd::test(static_cast(0))) \ + == sizeof(boost::mpl::aux::yes_tag) \ + ); \ + typedef boost::mpl::bool_ 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_ > \ +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 diff --git a/boost/boost/mpl/identity.hpp b/boost/boost/mpl/identity.hpp index bebc291745..247b9d9bdc 100644 --- a/boost/boost/mpl/identity.hpp +++ b/boost/boost/mpl/identity.hpp @@ -1,50 +1,45 @@ -//----------------------------------------------------------------------------- -// 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. -namespace boost { -namespace mpl { +// $Source: /cvsroot/boost/boost/boost/mpl/identity.hpp,v $ +// $Date: 2004/09/02 15:40:41 $ +// $Revision: 1.4 $ + +#include +#include + +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 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 diff --git a/boost/boost/mpl/if.hpp b/boost/boost/mpl/if.hpp index c4f93151d9..03acd5bcf1 100644 --- a/boost/boost/mpl/if.hpp +++ b/boost/boost/mpl/if.hpp @@ -2,40 +2,30 @@ #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 +#include +#include +#include +#include +#include +#include -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 @@ -55,29 +45,31 @@ struct if_c 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 @@ -120,15 +112,15 @@ struct if_c // (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_::type type; BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C_,T1,T2)) @@ -136,102 +128,8 @@ struct if_ #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -BOOST_MPL_AUX_AGLORITHM_NAMESPACE_END +BOOST_MPL_AUX_NA_SPEC(3, if_) -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, 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::bind1, boost::mpl::arg<1> > -// , boost::mpl::arg<1> -// , boost::mpl::bind1, boost::mpl::arg<1> > -// >::apply<...> -// -// becomes: -// -// boost::mpl::bind< -// boost::mpl::quote3 -// >::bind< -// , boost::mpl::bind1, -// boost::mpl::arg<1> > -// >::bind< -// boost::mpl::arg<1> -// >::bind< -// boost::mpl::bind1, boost::mpl::arg<1> > -// >::apply<...> -// -// so that after the 2nd bind we have a different function depending -// on the result of is_reference. - -template struct bind3; -template