]> git.lyx.org Git - features.git/commitdiff
major boost update
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 21 May 2002 23:39:58 +0000 (23:39 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 21 May 2002 23:39:58 +0000 (23:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4179 a592a061-630c-0410-9148-cb99ea01b6c8

313 files changed:
boost/ChangeLog
boost/boost/any.hpp [new file with mode: 0644]
boost/boost/array.hpp
boost/boost/array_traits.hpp [new file with mode: 0644]
boost/boost/assert.hpp [new file with mode: 0644]
boost/boost/bind.hpp [new file with mode: 0644]
boost/boost/bind/apply.hpp [new file with mode: 0644]
boost/boost/bind/arg.hpp [new file with mode: 0644]
boost/boost/bind/bind_cc.hpp [new file with mode: 0644]
boost/boost/bind/bind_mf_cc.hpp [new file with mode: 0644]
boost/boost/bind/bind_template.hpp [new file with mode: 0644]
boost/boost/bind/make_adaptable.hpp [new file with mode: 0644]
boost/boost/bind/mem_fn_cc.hpp [new file with mode: 0644]
boost/boost/bind/mem_fn_template.hpp [new file with mode: 0644]
boost/boost/bind/mem_fn_vw.hpp [new file with mode: 0644]
boost/boost/bind/placeholders.hpp [new file with mode: 0644]
boost/boost/bind/protect.hpp [new file with mode: 0644]
boost/boost/call_traits.hpp [new file with mode: 0644]
boost/boost/cast.hpp [new file with mode: 0644]
boost/boost/checked_delete.hpp [new file with mode: 0644]
boost/boost/compose.hpp [new file with mode: 0644]
boost/boost/compressed_pair.hpp [new file with mode: 0644]
boost/boost/concept_archetype.hpp [new file with mode: 0644]
boost/boost/concept_check.hpp [new file with mode: 0644]
boost/boost/config.hpp
boost/boost/config/compiler/borland.hpp [new file with mode: 0644]
boost/boost/config/compiler/comeau.hpp [new file with mode: 0644]
boost/boost/config/compiler/common_edg.hpp [new file with mode: 0644]
boost/boost/config/compiler/compaq_cxx.hpp [new file with mode: 0644]
boost/boost/config/compiler/gcc.hpp [new file with mode: 0644]
boost/boost/config/compiler/greenhills.hpp [new file with mode: 0644]
boost/boost/config/compiler/hp_acc.hpp [new file with mode: 0644]
boost/boost/config/compiler/intel.hpp [new file with mode: 0644]
boost/boost/config/compiler/kai.hpp [new file with mode: 0644]
boost/boost/config/compiler/metrowerks.hpp [new file with mode: 0644]
boost/boost/config/compiler/mpw.hpp [new file with mode: 0644]
boost/boost/config/compiler/sgi_mipspro.hpp [new file with mode: 0644]
boost/boost/config/compiler/sunpro_cc.hpp [new file with mode: 0644]
boost/boost/config/compiler/vacpp.hpp [new file with mode: 0644]
boost/boost/config/compiler/visualc.hpp [new file with mode: 0644]
boost/boost/config/platform/aix.hpp [new file with mode: 0644]
boost/boost/config/platform/amigaos.hpp [new file with mode: 0644]
boost/boost/config/platform/beos.hpp [new file with mode: 0644]
boost/boost/config/platform/bsd.hpp [new file with mode: 0644]
boost/boost/config/platform/cygwin.hpp [new file with mode: 0644]
boost/boost/config/platform/hpux.hpp [new file with mode: 0644]
boost/boost/config/platform/irix.hpp [new file with mode: 0644]
boost/boost/config/platform/linux.hpp [new file with mode: 0644]
boost/boost/config/platform/macos.hpp [new file with mode: 0644]
boost/boost/config/platform/solaris.hpp [new file with mode: 0644]
boost/boost/config/platform/win32.hpp [new file with mode: 0644]
boost/boost/config/posix_features.hpp [new file with mode: 0644]
boost/boost/config/select_compiler_config.hpp [new file with mode: 0644]
boost/boost/config/select_platform_config.hpp [new file with mode: 0644]
boost/boost/config/select_stdlib_config.hpp [new file with mode: 0644]
boost/boost/config/stdlib/dinkumware.hpp [new file with mode: 0644]
boost/boost/config/stdlib/libstdcpp3.hpp [new file with mode: 0644]
boost/boost/config/stdlib/modena.hpp [new file with mode: 0644]
boost/boost/config/stdlib/msl.hpp [new file with mode: 0644]
boost/boost/config/stdlib/roguewave.hpp [new file with mode: 0644]
boost/boost/config/stdlib/sgi.hpp [new file with mode: 0644]
boost/boost/config/stdlib/stlport.hpp [new file with mode: 0644]
boost/boost/config/stdlib/vacpp.hpp [new file with mode: 0644]
boost/boost/config/suffix.hpp [new file with mode: 0644]
boost/boost/config/user.hpp [new file with mode: 0644]
boost/boost/counting_iterator.hpp [new file with mode: 0644]
boost/boost/crc.hpp
boost/boost/cregex.hpp [new file with mode: 0644]
boost/boost/cstdint.hpp [new file with mode: 0644]
boost/boost/cstdlib.hpp [new file with mode: 0644]
boost/boost/current_function.hpp [new file with mode: 0644]
boost/boost/detail/algorithm.hpp [new file with mode: 0644]
boost/boost/detail/allocator.hpp [new file with mode: 0644]
boost/boost/detail/atomic_count.hpp [new file with mode: 0644]
boost/boost/detail/atomic_count_gcc.hpp [new file with mode: 0644]
boost/boost/detail/atomic_count_linux.hpp [new file with mode: 0644]
boost/boost/detail/atomic_count_pthreads.hpp [new file with mode: 0644]
boost/boost/detail/atomic_count_win32.hpp [new file with mode: 0644]
boost/boost/detail/binary_search.hpp [new file with mode: 0644]
boost/boost/detail/call_traits.hpp [new file with mode: 0644]
boost/boost/detail/catch_exceptions.hpp [new file with mode: 0644]
boost/boost/detail/compressed_pair.hpp [new file with mode: 0644]
boost/boost/detail/iterator.hpp [new file with mode: 0644]
boost/boost/detail/lightweight_mutex.hpp [new file with mode: 0644]
boost/boost/detail/limits.hpp
boost/boost/detail/lwm_gcc.hpp [new file with mode: 0644]
boost/boost/detail/lwm_irix.hpp [new file with mode: 0644]
boost/boost/detail/lwm_linux.hpp [new file with mode: 0644]
boost/boost/detail/lwm_nop.hpp [new file with mode: 0644]
boost/boost/detail/lwm_pthreads.hpp [new file with mode: 0644]
boost/boost/detail/lwm_win32.hpp [new file with mode: 0644]
boost/boost/detail/lwm_win32_cs.hpp [new file with mode: 0644]
boost/boost/detail/named_template_params.hpp [new file with mode: 0644]
boost/boost/detail/numeric_traits.hpp [new file with mode: 0644]
boost/boost/detail/ob_call_traits.hpp [new file with mode: 0644]
boost/boost/detail/ob_compressed_pair.hpp [new file with mode: 0644]
boost/boost/detail/select_type.hpp [new file with mode: 0644]
boost/boost/detail/shared_array_nmt.hpp [new file with mode: 0644]
boost/boost/detail/shared_count.hpp [new file with mode: 0644]
boost/boost/detail/shared_ptr_nmt.hpp [new file with mode: 0644]
boost/boost/detail/winapi.hpp [new file with mode: 0644]
boost/boost/function.hpp [new file with mode: 0644]
boost/boost/function/function0.hpp [new file with mode: 0644]
boost/boost/function/function1.hpp [new file with mode: 0644]
boost/boost/function/function10.hpp [new file with mode: 0644]
boost/boost/function/function2.hpp [new file with mode: 0644]
boost/boost/function/function3.hpp [new file with mode: 0644]
boost/boost/function/function4.hpp [new file with mode: 0644]
boost/boost/function/function5.hpp [new file with mode: 0644]
boost/boost/function/function6.hpp [new file with mode: 0644]
boost/boost/function/function7.hpp [new file with mode: 0644]
boost/boost/function/function8.hpp [new file with mode: 0644]
boost/boost/function/function9.hpp [new file with mode: 0644]
boost/boost/function/function_base.hpp [new file with mode: 0644]
boost/boost/function/function_template.hpp [new file with mode: 0644]
boost/boost/function/gen_function_N.pl [new file with mode: 0755]
boost/boost/function_output_iterator.hpp [new file with mode: 0644]
boost/boost/functional.hpp [new file with mode: 0644]
boost/boost/generator_iterator.hpp [new file with mode: 0644]
boost/boost/half_open_range.hpp [new file with mode: 0644]
boost/boost/integer.hpp
boost/boost/integer/integer_mask.hpp [new file with mode: 0644]
boost/boost/integer/static_log2.hpp [new file with mode: 0644]
boost/boost/integer/static_min_max.hpp [new file with mode: 0644]
boost/boost/integer_fwd.hpp [new file with mode: 0644]
boost/boost/integer_traits.hpp [new file with mode: 0644]
boost/boost/intrusive_ptr.hpp [new file with mode: 0644]
boost/boost/iterator.hpp [new file with mode: 0644]
boost/boost/iterator_adaptors.hpp [new file with mode: 0644]
boost/boost/last_value.hpp [new file with mode: 0644]
boost/boost/lexical_cast.hpp [new file with mode: 0644]
boost/boost/mem_fn.hpp [new file with mode: 0644]
boost/boost/min_rand.hpp [new file with mode: 0644]
boost/boost/multi_array.hpp [new file with mode: 0644]
boost/boost/multi_array/algorithm.hpp [new file with mode: 0644]
boost/boost/multi_array/base.hpp [new file with mode: 0644]
boost/boost/multi_array/collection_concept.hpp [new file with mode: 0644]
boost/boost/multi_array/concept_checks.hpp [new file with mode: 0644]
boost/boost/multi_array/copy_array.hpp [new file with mode: 0644]
boost/boost/multi_array/extent_gen.hpp [new file with mode: 0644]
boost/boost/multi_array/extent_range.hpp [new file with mode: 0644]
boost/boost/multi_array/index_gen.hpp [new file with mode: 0644]
boost/boost/multi_array/index_range.hpp [new file with mode: 0644]
boost/boost/multi_array/iterator.hpp [new file with mode: 0644]
boost/boost/multi_array/iterator_adaptors.hpp [new file with mode: 0644]
boost/boost/multi_array/multi_array_ref.hpp [new file with mode: 0644]
boost/boost/multi_array/range_list.hpp [new file with mode: 0644]
boost/boost/multi_array/storage_order.hpp [new file with mode: 0644]
boost/boost/multi_array/subarray.hpp [new file with mode: 0644]
boost/boost/multi_array/types.hpp [new file with mode: 0644]
boost/boost/multi_array/view.hpp [new file with mode: 0644]
boost/boost/operators.hpp [new file with mode: 0644]
boost/boost/permutation_iterator.hpp [new file with mode: 0644]
boost/boost/preprocessor.hpp [new file with mode: 0644]
boost/boost/preprocessor/arithmetic.hpp [new file with mode: 0644]
boost/boost/preprocessor/arithmetic/add.hpp [new file with mode: 0644]
boost/boost/preprocessor/arithmetic/div.hpp [new file with mode: 0644]
boost/boost/preprocessor/arithmetic/mod.hpp [new file with mode: 0644]
boost/boost/preprocessor/arithmetic/mul.hpp [new file with mode: 0644]
boost/boost/preprocessor/arithmetic/sub.hpp [new file with mode: 0644]
boost/boost/preprocessor/assert_msg.hpp [new file with mode: 0644]
boost/boost/preprocessor/cat.hpp [new file with mode: 0644]
boost/boost/preprocessor/comma.hpp [new file with mode: 0644]
boost/boost/preprocessor/comma_if.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison/equal.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison/greater.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison/greater_equal.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison/less.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison/less_equal.hpp [new file with mode: 0644]
boost/boost/preprocessor/comparison/not_equal.hpp [new file with mode: 0644]
boost/boost/preprocessor/dec.hpp [new file with mode: 0644]
boost/boost/preprocessor/empty.hpp [new file with mode: 0644]
boost/boost/preprocessor/enum.hpp [new file with mode: 0644]
boost/boost/preprocessor/enum_params.hpp [new file with mode: 0644]
boost/boost/preprocessor/enum_params_with_a_default.hpp [new file with mode: 0644]
boost/boost/preprocessor/enum_params_with_defaults.hpp [new file with mode: 0644]
boost/boost/preprocessor/enum_shifted.hpp [new file with mode: 0644]
boost/boost/preprocessor/enum_shifted_params.hpp [new file with mode: 0644]
boost/boost/preprocessor/expand.hpp [new file with mode: 0644]
boost/boost/preprocessor/expr_if.hpp [new file with mode: 0644]
boost/boost/preprocessor/for.hpp [new file with mode: 0644]
boost/boost/preprocessor/identity.hpp [new file with mode: 0644]
boost/boost/preprocessor/if.hpp [new file with mode: 0644]
boost/boost/preprocessor/inc.hpp [new file with mode: 0644]
boost/boost/preprocessor/limits.hpp [new file with mode: 0644]
boost/boost/preprocessor/list.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/adt.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/append.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/at.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/cat.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/enum.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/filter.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/first_n.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/fold_left.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/fold_left_2nd.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/fold_right.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/fold_right_2nd.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/for_each.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/for_each_i.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/for_each_product.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/rest_n.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/reverse.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/size.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/to_tuple.hpp [new file with mode: 0644]
boost/boost/preprocessor/list/transform.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical/and.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical/bool.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical/nor.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical/not.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical/or.hpp [new file with mode: 0644]
boost/boost/preprocessor/logical/xor.hpp [new file with mode: 0644]
boost/boost/preprocessor/max.hpp [new file with mode: 0644]
boost/boost/preprocessor/min.hpp [new file with mode: 0644]
boost/boost/preprocessor/repeat.hpp [new file with mode: 0644]
boost/boost/preprocessor/repeat_2nd.hpp [new file with mode: 0644]
boost/boost/preprocessor/repeat_3rd.hpp [new file with mode: 0644]
boost/boost/preprocessor/repeat_from_to.hpp [new file with mode: 0644]
boost/boost/preprocessor/repeat_from_to_2nd.hpp [new file with mode: 0644]
boost/boost/preprocessor/repeat_from_to_3rd.hpp [new file with mode: 0644]
boost/boost/preprocessor/stringize.hpp [new file with mode: 0644]
boost/boost/preprocessor/tuple.hpp [new file with mode: 0644]
boost/boost/preprocessor/tuple/eat.hpp [new file with mode: 0644]
boost/boost/preprocessor/tuple/elem.hpp [new file with mode: 0644]
boost/boost/preprocessor/tuple/reverse.hpp [new file with mode: 0644]
boost/boost/preprocessor/tuple/to_list.hpp [new file with mode: 0644]
boost/boost/preprocessor/while.hpp [new file with mode: 0644]
boost/boost/progress.hpp [new file with mode: 0644]
boost/boost/property_map.hpp [new file with mode: 0644]
boost/boost/property_map_iterator.hpp [new file with mode: 0644]
boost/boost/rational.hpp [new file with mode: 0644]
boost/boost/ref.hpp [new file with mode: 0644]
boost/boost/regex.h [new file with mode: 0644]
boost/boost/regex.hpp [new file with mode: 0644]
boost/boost/regex/config.hpp [new file with mode: 0644]
boost/boost/regex/detail/fileiter.hpp [new file with mode: 0644]
boost/boost/regex/detail/instances.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_compile.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_cstring.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_format.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_kmp.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_library_include.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_match.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_raw_buffer.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_split.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_stack.hpp [new file with mode: 0644]
boost/boost/regex/detail/regex_synch.hpp [new file with mode: 0644]
boost/boost/regex/pattern_except.hpp [new file with mode: 0644]
boost/boost/regex/regex_traits.hpp [new file with mode: 0644]
boost/boost/regex/src.cpp [new file with mode: 0644]
boost/boost/regex/user.hpp [new file with mode: 0644]
boost/boost/regex_fwd.hpp [new file with mode: 0644]
boost/boost/scoped_array.hpp [new file with mode: 0644]
boost/boost/scoped_ptr.hpp [new file with mode: 0644]
boost/boost/shared_array.hpp [new file with mode: 0644]
boost/boost/shared_ptr.hpp [new file with mode: 0644]
boost/boost/signal.hpp [new file with mode: 0644]
boost/boost/signals/connection.hpp [new file with mode: 0644]
boost/boost/signals/detail/gen_signal_N.pl [new file with mode: 0755]
boost/boost/signals/detail/signal_base.hpp [new file with mode: 0644]
boost/boost/signals/detail/signals_common.hpp [new file with mode: 0644]
boost/boost/signals/detail/slot_call_iterator.hpp [new file with mode: 0644]
boost/boost/signals/signal0.hpp [new file with mode: 0644]
boost/boost/signals/signal1.hpp [new file with mode: 0644]
boost/boost/signals/signal10.hpp [new file with mode: 0644]
boost/boost/signals/signal2.hpp [new file with mode: 0644]
boost/boost/signals/signal3.hpp [new file with mode: 0644]
boost/boost/signals/signal4.hpp [new file with mode: 0644]
boost/boost/signals/signal5.hpp [new file with mode: 0644]
boost/boost/signals/signal6.hpp [new file with mode: 0644]
boost/boost/signals/signal7.hpp [new file with mode: 0644]
boost/boost/signals/signal8.hpp [new file with mode: 0644]
boost/boost/signals/signal9.hpp [new file with mode: 0644]
boost/boost/signals/signal_template.hpp [new file with mode: 0644]
boost/boost/signals/slot.hpp [new file with mode: 0644]
boost/boost/signals/trackable.hpp [new file with mode: 0644]
boost/boost/smart_ptr.hpp
boost/boost/static_assert.hpp
boost/boost/timer.hpp [new file with mode: 0644]
boost/boost/token_functions.hpp [new file with mode: 0644]
boost/boost/token_iterator.hpp [new file with mode: 0644]
boost/boost/tokenizer.hpp [new file with mode: 0644]
boost/boost/tuple/detail/tuple_basic.hpp
boost/boost/tuple/detail/tuple_basic_no_partial_spec.hpp
boost/boost/tuple/reference_wrappers.hpp [deleted file]
boost/boost/tuple/tuple.hpp
boost/boost/tuple/tuple_comparison.hpp
boost/boost/tuple/tuple_io.hpp
boost/boost/type.hpp [new file with mode: 0644]
boost/boost/type_traits.hpp [new file with mode: 0644]
boost/boost/type_traits/alignment_traits.hpp
boost/boost/type_traits/arithmetic_traits.hpp
boost/boost/type_traits/array_traits.hpp [new file with mode: 0644]
boost/boost/type_traits/composite_traits.hpp
boost/boost/type_traits/conversion_traits.hpp
boost/boost/type_traits/cv_traits.hpp
boost/boost/type_traits/function_traits.hpp
boost/boost/type_traits/fwd.hpp
boost/boost/type_traits/is_class.hpp [new file with mode: 0644]
boost/boost/type_traits/object_traits.hpp
boost/boost/type_traits/reference_traits.hpp [new file with mode: 0644]
boost/boost/type_traits/same_traits.hpp
boost/boost/type_traits/transform_traits.hpp
boost/boost/type_traits/type_traits_test.hpp
boost/boost/type_traits/utility.hpp [new file with mode: 0644]
boost/boost/utility.hpp
boost/boost/utility/addressof.hpp [new file with mode: 0644]
boost/boost/utility/base_from_member.hpp [new file with mode: 0644]
boost/boost/utility_fwd.hpp [new file with mode: 0644]
boost/boost/version.hpp [new file with mode: 0644]
boost/boost/visit_each.hpp [new file with mode: 0644]
boost/boost/weak_ptr.hpp [new file with mode: 0644]

index ab5d913d0ae26a915571993016ce5a21eae49e78..3e8628dcc720cda44a82bc7e630abba7e1a7eaf3 100644 (file)
@@ -1,3 +1,7 @@
+2002-05-22  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * major boost update. (a bit more is comming)
+
 2001-09-07  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * boost/crc.hpp (detail): re-apply the cxx patch from 2001-06-07.
@@ -20,7 +24,7 @@
 2001-06-01  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * boost/config.hpp (BOOST_NO_LIMITS): fix the hack mentionned
-       below. 
+       below.
 
 2001-06-01  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
@@ -92,4 +96,3 @@
 2001-02-20  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * .cvsignore: added various files
-
diff --git a/boost/boost/any.hpp b/boost/boost/any.hpp
new file mode 100644 (file)
index 0000000..5587aa6
--- /dev/null
@@ -0,0 +1,186 @@
+#ifndef BOOST_ANY_INCLUDED
+#define BOOST_ANY_INCLUDED
+
+// what:  variant type boost::any
+// who:   contributed by Kevlin Henney,
+//        with features contributed and bugs found by
+//        Ed Brey, Mark Rodgers, Peter Dimov, and James Curran
+// when:  July 2001
+// where: tested with BCC 5.5, MSVC 6.0, and g++ 2.95
+
+#include <algorithm>
+#include <typeinfo>
+
+#include "boost/config.hpp"
+
+namespace boost
+{
+    class any
+    {
+    public: // structors
+
+        any()
+          : content(0)
+        {
+        }
+
+        template<typename ValueType>
+        any(const ValueType & value)
+          : content(new holder<ValueType>(value))
+        {
+        }
+
+        any(const any & other)
+          : content(other.content ? other.content->clone() : 0)
+        {
+        }
+
+        ~any()
+        {
+            delete content;
+        }
+
+    public: // modifiers
+
+        any & swap(any & rhs)
+        {
+            std::swap(content, rhs.content);
+            return *this;
+        }
+
+        template<typename ValueType>
+        any & operator=(const ValueType & rhs)
+        {
+            any(rhs).swap(*this);
+            return *this;
+        }
+
+        any & operator=(const any & rhs)
+        {
+            any(rhs).swap(*this);
+            return *this;
+        }
+
+    public: // queries
+
+        bool empty() const
+        {
+            return !content;
+        }
+
+        const std::type_info & type() const
+        {
+            return content ? content->type() : typeid(void);
+        }
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+    private: // types
+#else
+    public: // types (public so any_cast can be non-friend)
+#endif
+
+        class placeholder
+        {
+        public: // structors
+    
+            virtual ~placeholder()
+            {
+            }
+
+        public: // queries
+
+            virtual const std::type_info & type() const = 0;
+
+            virtual placeholder * clone() const = 0;
+    
+        };
+
+        template<typename ValueType>
+        class holder : public placeholder
+        {
+        public: // structors
+
+            holder(const ValueType & value)
+              : held(value)
+            {
+            }
+
+        public: // queries
+
+            virtual const std::type_info & type() const
+            {
+                return typeid(ValueType);
+            }
+
+            virtual placeholder * clone() const
+            {
+                return new holder(held);
+            }
+
+        public: // representation
+
+            ValueType held;
+
+        };
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+
+    private: // representation
+
+        template<typename ValueType>
+        friend ValueType * any_cast(any *);
+
+#else
+
+    public: // representation (public so any_cast can be non-friend)
+
+#endif
+
+        placeholder * content;
+
+    };
+
+    class bad_any_cast : public std::bad_cast
+    {
+    public:
+        virtual const char * what() const throw()
+        {
+            return "boost::bad_any_cast: "
+                   "failed conversion using boost::any_cast";
+        }
+    };
+
+    template<typename ValueType>
+    ValueType * any_cast(any * operand)
+    {
+        return operand && operand->type() == typeid(ValueType)
+                    ? &static_cast<any::holder<ValueType> *>(operand->content)->held
+                    : 0;
+    }
+
+    template<typename ValueType>
+    const ValueType * any_cast(const any * operand)
+    {
+        return any_cast<ValueType>(const_cast<any *>(operand));
+    }
+
+    template<typename ValueType>
+    ValueType any_cast(const any & operand)
+    {
+        const ValueType * result = any_cast<ValueType>(&operand);
+        if(!result)
+            throw bad_any_cast();
+        return *result;
+    }
+
+}
+
+// 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.
+
+#endif
index 0840003b62078bbc3bc9c790513c5484f9348b02..6e78aeb4e9e89eb0e0d4326dd9fa8e0a31f23da9 100644 (file)
@@ -53,6 +53,12 @@ namespace boost {
 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
         typedef std::reverse_iterator<iterator> reverse_iterator;
         typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
+        // workaround for broken reverse_iterator in VC7
+        typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
+                                      reference, iterator, reference> > reverse_iterator;
+        typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
+                                               const_reference, iterator, reference> > const_reverse_iterator;
 #else
         // workaround for broken reverse_iterator implementations
         typedef std::reverse_iterator<iterator,T> reverse_iterator;
@@ -154,3 +160,4 @@ namespace boost {
 } /* namespace boost */
 
 #endif /*BOOST_ARRAY_HPP*/
+
diff --git a/boost/boost/array_traits.hpp b/boost/boost/array_traits.hpp
new file mode 100644 (file)
index 0000000..de032f2
--- /dev/null
@@ -0,0 +1,163 @@
+// -*-C++-*- array_traits.hpp
+// <!!----------------------------------------------------------------------> 
+// <!! Copyright (C) 1998 Dietmar Kuehl, Claas Solutions GmbH > 
+// <!!> 
+// <!! Permission to use, copy, modify, distribute and sell this > 
+// <!! software for any purpose is hereby granted without fee, provided > 
+// <!! that the above copyright notice appears in all copies and that > 
+// <!! both that copyright notice and this permission notice appear in > 
+// <!! supporting documentation. Dietmar Kuehl and Claas Solutions make no > 
+// <!! representations about the suitability of this software for any > 
+// <!! purpose. It is provided "as is" without express or implied warranty. > 
+// <!!----------------------------------------------------------------------> 
+
+// Author: Dietmar Kuehl dietmar.kuehl@claas-solutions.de 
+// Title:  STL container support, including support for built-in arrays
+// Version: $Id: array_traits.hpp,v 1.1 2002/05/21 23:39:53 larsbj Exp $
+
+// Dec 4, 2000  Added some more typedefs to array_traits including
+//              an iterator type to supersede iter_type. -J.Siek
+
+// -------------------------------------------------------------------------- 
+
+#if !defined(BOOST_ARRAY_TRAITS_HPP)
+#define BOOST_ARRAY_TRAITS_HPP 1
+
+// -------------------------------------------------------------------------- 
+
+#include <cstddef>
+#include <boost/config.hpp>
+
+// -------------------------------------------------------------------------- 
+
+namespace boost
+{
+
+  // --- a general version of container traits ------------------------------ 
+
+  template <typename Cont>
+    struct array_traits
+    {
+      typedef typename Cont::iterator  iterator;
+      typedef iterator iter_type; // just for backward compatibility
+      typedef typename Cont::size_type size_type;
+      typedef typename Cont::value_type value_type;
+      typedef typename Cont::reference reference;
+      typedef typename Cont::pointer pointer;
+      static iterator begin(Cont &cont) { return cont.begin(); }
+      static iterator end(Cont &cont) { return cont.end(); }
+      static size_type size(Cont &cont) { return cont.size(); }
+    };
+
+  // --- a version of container traits for constant constainer --------------
+
+  template <typename Cont>
+    struct array_traits<Cont const>
+    {
+      typedef typename Cont::const_iterator iterator;
+      typedef iterator iter_type; // just for backward compatibility
+      typedef typename Cont::size_type size_type;
+      typedef typename Cont::value_type value_type;
+      typedef typename Cont::const_reference reference;
+      typedef typename Cont::const_pointer pointer;
+      static iterator begin(Cont const &cont) { return cont.begin(); }
+      static iterator end(Cont const &cont) { return cont.end(); }
+      static size_type size(Cont const &cont) { return cont.size(); }
+    };
+
+  // --- a special version for non-const built-in arrays -------------------- 
+
+  template <typename T, std::size_t sz>
+    struct array_traits<T[sz]>
+    {
+      typedef T* iterator;
+      typedef iterator iter_type; // just for backward compatibility
+      typedef T value_type;
+      typedef value_type& reference;
+      typedef std::size_t size_type;
+      static iterator begin(T (&array)[sz]) { return array; }
+      static iterator end(T (&array)[sz]) { return array + sz; }
+      static size_type size(T (&)[sz]) { return sz; }
+    };
+
+  // --- a special version for const built-in arrays ------------------------ 
+
+  template <typename T, std::size_t sz>
+    struct array_traits<T const[sz]>
+    {
+      typedef T const* iterator;
+      typedef iterator iter_type; // just for backward compatibility
+      typedef std::size_t size_type;
+      typedef T const value_type;
+      typedef value_type& reference;
+      typedef value_type* pointer;
+      static iterator begin(T const (&array)[sz]) { return array; }
+      static iterator end(T const (&array)[sz]) { return array + sz; }
+      static size_type size(T const (&)[sz]) { return sz; }
+    };
+
+  template <typename T, int sz>
+  inline char (&sizer(T (&)[sz]))[sz];
+  
+  // --- general version of the global accessor functions --------------------- 
+
+  template <typename Cont>
+    inline typename array_traits<Cont>::iterator
+    begin(Cont &cont) { return array_traits<Cont>::begin(cont); }
+
+  template <typename Cont>
+    inline typename array_traits<Cont>::iterator
+    end(Cont &cont) { return array_traits<Cont>::end(cont); }
+
+  template <typename Cont>
+    inline typename array_traits<Cont>::size_type
+    size(Cont &cont) { return array_traits<Cont>::size(cont); }
+
+  // --- Actually the above should be sufficient but compilers seem -----------
+  // --- to welcome some help. So here we go:
+
+  template <typename T, std::size_t sz>
+    inline typename array_traits<T[sz]>::iterator
+    begin(T (&a)[sz]) { return array_traits<T[sz]>::begin(a); }
+  
+  template <typename T, std::size_t sz>
+    inline typename array_traits<T[sz]>::iterator
+    end(T (&a)[sz]) { return array_traits<T[sz]>::end(a); }
+  
+  template <typename T, std::size_t sz>
+    inline typename array_traits<T[sz]>::size_type
+    size(T (&a)[sz]) { return array_traits<T[sz]>::size(a); }
+  
+  // --- Apparently the compilers also need some specific help, ---------------
+
+  // --- EDG-2.39 wants to pass around pointers in some contexts --------------
+#ifdef __EDG__
+  template <typename T>
+    struct array_traits<T*>
+    {
+      typedef T*     iterator;
+      typedef iterator iter_type; // just for backward compatibility
+      typedef std::size_t size_type;
+    };
+#endif
+
+  // --- egcs-1998-11-22 apparently likes an extra const version: -------------
+#ifdef __GNUG__
+  template <typename T, std::size_t sz>
+    inline typename array_traits<T const[sz]>::iterator
+    begin(T const(&a)[sz]) { return array_traits<T const[sz]>::begin(a); }
+  
+  template <typename T, std::size_t sz>
+    inline typename array_traits<T const[sz]>::iterator
+    end(T const(&a)[sz]) { return array_traits<T const[sz]>::end(a); }
+  
+  template <typename T, std::size_t sz>
+    inline typename array_traits<T const[sz]>::size_type
+    size(T const (&a)[sz]) { return array_traits<T const[sz]>::size(a); }
+#endif
+  
+}
+
+// -----------------------------------------------------------------------------
+
+#endif /* BOOST_ARRAY_TRAITS_HPP */
diff --git a/boost/boost/assert.hpp b/boost/boost/assert.hpp
new file mode 100644 (file)
index 0000000..645404d
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef BOOST_ASSERT_HPP_INCLUDED
+#define BOOST_ASSERT_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/assert.hpp
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+//
+//  When BOOST_DEBUG is not defined, it defaults to 0 (off)
+//  for compatibility with programs that do not expect asserts
+//  in the smart pointer class templates.
+//
+//  This default may be changed after an initial transition period.
+//
+
+#ifndef BOOST_DEBUG
+#define BOOST_DEBUG 0
+#endif
+
+#if BOOST_DEBUG
+
+#include <assert.h>
+
+#ifndef BOOST_ASSERT
+
+#include <boost/current_function.hpp>
+
+bool boost_error(char const * expr, char const * func, char const * file, long line);
+
+# define BOOST_ASSERT(expr) ((expr) || !boost_error(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) || (assert(expr), true))
+
+#endif // #ifndef BOOST_ASSERT
+
+#else // #if BOOST_DEBUG
+
+#undef BOOST_ASSERT
+#define BOOST_ASSERT(expr) ((void)0)
+
+#endif // #if BOOST_DEBUG
+
+#endif // #ifndef BOOST_ASSERT_HPP_INCLUDED
diff --git a/boost/boost/bind.hpp b/boost/boost/bind.hpp
new file mode 100644 (file)
index 0000000..ddbabbd
--- /dev/null
@@ -0,0 +1,1382 @@
+#ifndef BOOST_BIND_HPP_INCLUDED
+#define BOOST_BIND_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  bind.hpp - binds function objects to arguments
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <boost/config.hpp>
+#include <boost/ref.hpp>
+#include <boost/mem_fn.hpp>
+#include <boost/bind/arg.hpp>
+
+// Borland-specific bug, visit_each() silently fails to produce code
+
+#if defined(__BORLANDC__)
+#  define BOOST_BIND_VISIT_EACH boost::visit_each
+#else
+#  define BOOST_BIND_VISIT_EACH visit_each
+#endif
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4512) // assignment operator could not be generated
+#endif
+
+namespace boost
+{
+
+namespace _bi // implementation details
+{
+
+// result_traits
+
+template<class R, class F> struct result_traits
+{
+    typedef R type;
+};
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+struct unspecified {};
+
+template<class F> struct result_traits<unspecified, F>
+{
+    typedef typename F::result_type type;
+};
+
+#endif
+
+// bind_t forward declaration for listN
+
+template<class R, class F, class L> class bind_t;
+
+// value
+
+template<class T> class value
+{
+public:
+
+    value(T const & t): t_(t) {}
+
+    T & get() { return t_; }
+    T const & get() const { return t_; }
+
+private:
+
+    T t_;
+};
+
+// type
+
+template<class T> class type {};
+
+// listN
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+template <class R> struct evaluator0;
+template <class R> struct evaluator1;
+template <class R> struct evaluator2;
+template <class R> struct evaluator3;
+template <class R> struct evaluator4;
+template <class R> struct evaluator5;
+template <class R> struct evaluator6;
+template <class R> struct evaluator7;
+template <class R> struct evaluator8;
+template <class R> struct evaluator9;
+
+#endif
+
+class list0
+{
+public:
+
+    list0() {}
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A &) const
+    {
+        return f();
+    }
+
+    template<class V> void accept(V &) const
+    {
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator0<R> type;
+    };
+
+#endif
+
+};
+
+template<class A1> class list1
+{
+public:
+
+    explicit list1(A1 a1): a1_(a1) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator1<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+};
+
+template<class A1, class A2> class list2
+{
+public:
+
+    list2(A1 a1, A2 a2): a1_(a1), a2_(a2) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator2<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+};
+
+template<class A1, class A2, class A3> class list3
+{
+public:
+
+    list3(A1 a1, A2 a2, A3 a3): a1_(a1), a2_(a2), a3_(a3) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator3<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+};
+
+template<class A1, class A2, class A3, class A4> class list4
+{
+public:
+
+    list4(A1 a1, A2 a2, A3 a3, A4 a4): a1_(a1), a2_(a2), a3_(a3), a4_(a4) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+    A4 operator[] (arg<4>) const { return a4_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+    A4 operator[] (arg<4> (*) ()) const { return a4_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_], a[a4_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+        BOOST_BIND_VISIT_EACH(v, a4_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator4<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+    A4 a4_;
+};
+
+template<class A1, class A2, class A3, class A4, class A5> class list5
+{
+public:
+
+    list5(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+    A4 operator[] (arg<4>) const { return a4_; }
+    A5 operator[] (arg<5>) const { return a5_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+    A4 operator[] (arg<4> (*) ()) const { return a4_; }
+    A5 operator[] (arg<5> (*) ()) const { return a5_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+        BOOST_BIND_VISIT_EACH(v, a4_, 0);
+        BOOST_BIND_VISIT_EACH(v, a5_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator5<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+    A4 a4_;
+    A5 a5_;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> class list6
+{
+public:
+
+    list6(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+    A4 operator[] (arg<4>) const { return a4_; }
+    A5 operator[] (arg<5>) const { return a5_; }
+    A6 operator[] (arg<6>) const { return a6_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+    A4 operator[] (arg<4> (*) ()) const { return a4_; }
+    A5 operator[] (arg<5> (*) ()) const { return a5_; }
+    A6 operator[] (arg<6> (*) ()) const { return a6_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+        BOOST_BIND_VISIT_EACH(v, a4_, 0);
+        BOOST_BIND_VISIT_EACH(v, a5_, 0);
+        BOOST_BIND_VISIT_EACH(v, a6_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator6<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+    A4 a4_;
+    A5 a5_;
+    A6 a6_;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7
+{
+public:
+
+    list7(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+    A4 operator[] (arg<4>) const { return a4_; }
+    A5 operator[] (arg<5>) const { return a5_; }
+    A6 operator[] (arg<6>) const { return a6_; }
+    A7 operator[] (arg<7>) const { return a7_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+    A4 operator[] (arg<4> (*) ()) const { return a4_; }
+    A5 operator[] (arg<5> (*) ()) const { return a5_; }
+    A6 operator[] (arg<6> (*) ()) const { return a6_; }
+    A7 operator[] (arg<7> (*) ()) const { return a7_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+        BOOST_BIND_VISIT_EACH(v, a4_, 0);
+        BOOST_BIND_VISIT_EACH(v, a5_, 0);
+        BOOST_BIND_VISIT_EACH(v, a6_, 0);
+        BOOST_BIND_VISIT_EACH(v, a7_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator7<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+    A4 a4_;
+    A5 a5_;
+    A6 a6_;
+    A7 a7_;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> class list8
+{
+public:
+
+    list8(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+    A4 operator[] (arg<4>) const { return a4_; }
+    A5 operator[] (arg<5>) const { return a5_; }
+    A6 operator[] (arg<6>) const { return a6_; }
+    A7 operator[] (arg<7>) const { return a7_; }
+    A8 operator[] (arg<8>) const { return a8_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+    A4 operator[] (arg<4> (*) ()) const { return a4_; }
+    A5 operator[] (arg<5> (*) ()) const { return a5_; }
+    A6 operator[] (arg<6> (*) ()) const { return a6_; }
+    A7 operator[] (arg<7> (*) ()) const { return a7_; }
+    A8 operator[] (arg<8> (*) ()) const { return a8_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+        BOOST_BIND_VISIT_EACH(v, a4_, 0);
+        BOOST_BIND_VISIT_EACH(v, a5_, 0);
+        BOOST_BIND_VISIT_EACH(v, a6_, 0);
+        BOOST_BIND_VISIT_EACH(v, a7_, 0);
+        BOOST_BIND_VISIT_EACH(v, a8_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator8<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+    A4 a4_;
+    A5 a5_;
+    A6 a6_;
+    A7 a7_;
+    A8 a8_;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9
+{
+public:
+
+    list9(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9): a1_(a1), a2_(a2), a3_(a3), a4_(a4), a5_(a5), a6_(a6), a7_(a7), a8_(a8), a9_(a9) {}
+
+    A1 operator[] (arg<1>) const { return a1_; }
+    A2 operator[] (arg<2>) const { return a2_; }
+    A3 operator[] (arg<3>) const { return a3_; }
+    A4 operator[] (arg<4>) const { return a4_; }
+    A5 operator[] (arg<5>) const { return a5_; }
+    A6 operator[] (arg<6>) const { return a6_; }
+    A7 operator[] (arg<7>) const { return a7_; }
+    A8 operator[] (arg<8>) const { return a8_; }
+    A9 operator[] (arg<9>) const { return a9_; }
+
+    A1 operator[] (arg<1> (*) ()) const { return a1_; }
+    A2 operator[] (arg<2> (*) ()) const { return a2_; }
+    A3 operator[] (arg<3> (*) ()) const { return a3_; }
+    A4 operator[] (arg<4> (*) ()) const { return a4_; }
+    A5 operator[] (arg<5> (*) ()) const { return a5_; }
+    A6 operator[] (arg<6> (*) ()) const { return a6_; }
+    A7 operator[] (arg<7> (*) ()) const { return a7_; }
+    A8 operator[] (arg<8> (*) ()) const { return a8_; }
+    A9 operator[] (arg<9> (*) ()) const { return a9_; }
+
+    template<class T> T & operator[] (value<T> & v) const { return v.get(); }
+
+    template<class T> T const & operator[] (value<T> const & v) const { return v.get(); }
+
+    template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+    template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+    template<class R, class F, class A> R operator()(type<R>, F f, A & a) const
+    {
+        return f(a[a1_], a[a2_], a[a3_], a[a4_], a[a5_], a[a6_], a[a7_], a[a8_], a[a9_]);
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, a1_, 0);
+        BOOST_BIND_VISIT_EACH(v, a2_, 0);
+        BOOST_BIND_VISIT_EACH(v, a3_, 0);
+        BOOST_BIND_VISIT_EACH(v, a4_, 0);
+        BOOST_BIND_VISIT_EACH(v, a5_, 0);
+        BOOST_BIND_VISIT_EACH(v, a6_, 0);
+        BOOST_BIND_VISIT_EACH(v, a7_, 0);
+        BOOST_BIND_VISIT_EACH(v, a8_, 0);
+        BOOST_BIND_VISIT_EACH(v, a9_, 0);
+    }
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+    template<class R> struct evaluator
+    {
+        typedef evaluator9<R> type;
+    };
+
+#else
+
+private:
+
+#endif
+
+    A1 a1_;
+    A2 a2_;
+    A3 a3_;
+    A4 a4_;
+    A5 a5_;
+    A6 a6_;
+    A7 a7_;
+    A8 a8_;
+    A9 a9_;
+};
+
+#ifdef BOOST_NO_VOID_RETURNS
+
+template <class R> struct evaluator0
+{
+    template<class L, class F, class A>
+    static R eval(L const&, F f, A &)
+    {
+        return f();
+    }
+};
+
+template <> struct evaluator0<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const&, F f, A &)
+    {
+        f();
+    }
+};
+
+template <class R> struct evaluator1
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_]);
+    }
+};
+
+template <> struct evaluator1<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_]);
+    }
+};
+
+template <class R> struct evaluator2
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_]);
+    }
+};
+
+template <> struct evaluator2<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_]);
+    }
+};
+
+template <class R> struct evaluator3
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_]);
+    }
+};
+
+template <> struct evaluator3<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_], a[l.a3_]);
+    }
+};
+
+template <class R> struct evaluator4
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
+    }
+};
+
+template <> struct evaluator4<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_]);
+    }
+};
+
+template <class R> struct evaluator5
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
+    }
+};
+
+template <> struct evaluator5<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_]);
+    }
+};
+
+template <class R> struct evaluator6
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
+    }
+};
+
+template <> struct evaluator6<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_]);
+    }
+};
+
+template <class R> struct evaluator7
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
+    }
+};
+
+template <> struct evaluator7<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_]);
+    }
+};
+
+template <class R> struct evaluator8
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
+    }
+};
+
+template <> struct evaluator8<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_]);
+    }
+};
+
+template <class R> struct evaluator9
+{
+    template<class L, class F, class A>
+    static R eval(L const& l, F f, A & a)
+    {
+        return f(a[l.a1_], a[l.a2_], a[l.a3_], a[l.a4_], a[l.a5_], a[l.a6_], a[l.a7_], a[l.a8_], a[l.a9_]);
+    }
+};
+
+template <> struct evaluator9<void>
+{
+    template<class L, class F, class A>
+    static void eval(L const& l, F f, A & a)
+    {
+        f(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
+
+template<class R, class F, class L> class bind_t
+{
+public:
+
+    bind_t(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_EVALUATE return l_(type<result_type>(), f_, a)
+#include <boost/bind/bind_template.hpp>
+#undef BOOST_BIND_EVALUATE
+
+};
+
+#else
+
+template<class R> struct bind_t_generator
+{
+
+template<class F, class L> class implementation
+{
+public:
+
+    implementation(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_EVALUATE return L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
+#include <boost/bind/bind_template.hpp>
+#undef BOOST_BIND_EVALUATE
+
+};
+
+};
+
+template<> struct bind_t_generator<void>
+{
+
+template<class F, class L> class implementation
+{
+private:
+
+    typedef void R;
+
+public:
+
+    implementation(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_EVALUATE L::BOOST_NESTED_TEMPLATE evaluator<result_type>::type::eval(l_, f_, a);
+#include <boost/bind/bind_template.hpp>
+#undef BOOST_BIND_EVALUATE
+
+};
+
+};
+
+template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
+{
+public:
+
+    bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
+
+};
+
+#endif
+
+// add_value
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
+
+template<class T> struct add_value
+{
+    typedef value<T> type;
+};
+
+template<class T> struct add_value< value<T> >
+{
+    typedef value<T> type;
+};
+
+template<class T> struct add_value< reference_wrapper<T> >
+{
+    typedef reference_wrapper<T> type;
+};
+
+template<int I> struct add_value< arg<I> >
+{
+    typedef arg<I> type;
+};
+
+template<int I> struct add_value< arg<I> (*) () >
+{
+    typedef arg<I> (*type) ();
+};
+
+template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
+{
+    typedef bind_t<R, F, L> type;
+};
+
+#else
+
+template<int I> struct _avt_0;
+
+template<> struct _avt_0<1>
+{
+    template<class T> struct inner
+    {
+        typedef T type;
+    };
+};
+
+template<> struct _avt_0<2>
+{
+    template<class T> struct inner
+    {
+        typedef value<T> type;
+    };
+};
+
+typedef char (&_avt_r1) [1];
+typedef char (&_avt_r2) [2];
+
+template<class T> _avt_r1 _avt_f(value<T>);
+template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
+template<int I> _avt_r1 _avt_f(arg<I>);
+template<int I> _avt_r1 _avt_f(arg<I> (*) ());
+template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
+
+_avt_r2 _avt_f(...);
+
+template<class T> struct add_value
+{
+    static T t();
+    typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
+};
+
+#endif
+
+// list_av_N
+
+template<class A1> struct list_av_1
+{
+    typedef typename add_value<A1>::type B1;
+    typedef list1<B1> type;
+};
+
+template<class A1, class A2> struct list_av_2
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef list2<B1, B2> type;
+};
+
+template<class A1, class A2, class A3> struct list_av_3
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef list3<B1, B2, B3> type;
+};
+
+template<class A1, class A2, class A3, class A4> struct list_av_4
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef typename add_value<A4>::type B4;
+    typedef list4<B1, B2, B3, B4> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef typename add_value<A4>::type B4;
+    typedef typename add_value<A5>::type B5;
+    typedef list5<B1, B2, B3, B4, B5> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef typename add_value<A4>::type B4;
+    typedef typename add_value<A5>::type B5;
+    typedef typename add_value<A6>::type B6;
+    typedef list6<B1, B2, B3, B4, B5, B6> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef typename add_value<A4>::type B4;
+    typedef typename add_value<A5>::type B5;
+    typedef typename add_value<A6>::type B6;
+    typedef typename add_value<A7>::type B7;
+    typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef typename add_value<A4>::type B4;
+    typedef typename add_value<A5>::type B5;
+    typedef typename add_value<A6>::type B6;
+    typedef typename add_value<A7>::type B7;
+    typedef typename add_value<A8>::type B8;
+    typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
+{
+    typedef typename add_value<A1>::type B1;
+    typedef typename add_value<A2>::type B2;
+    typedef typename add_value<A3>::type B3;
+    typedef typename add_value<A4>::type B4;
+    typedef typename add_value<A5>::type B5;
+    typedef typename add_value<A6>::type B6;
+    typedef typename add_value<A7>::type B7;
+    typedef typename add_value<A8>::type B8;
+    typedef typename add_value<A9>::type B9;
+    typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
+};
+
+} // namespace _bi
+
+// visit_each
+
+template<class V, class T> void visit_each(V & v, _bi::value<T> const & t, int)
+{
+    BOOST_BIND_VISIT_EACH(v, t.get(), 0);
+}
+
+template<class V, class R, class F, class L> void visit_each(V & v, _bi::bind_t<R, F, L> const & t, int)
+{
+    t.accept(v);
+}
+
+// bind
+
+#ifndef BOOST_BIND
+#define BOOST_BIND bind
+#endif
+
+// generic function objects
+
+template<class R, class F>
+    _bi::bind_t<R, F, _bi::list0>
+    BOOST_BIND(F f)
+{
+    typedef _bi::list0 list_type;
+    return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class F, class A1>
+    _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
+    BOOST_BIND(F f, A1 a1)
+{
+    typedef typename _bi::list_av_1<A1>::type list_type;
+    return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class F, class A1, class A2>
+    _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2)
+{
+    typedef typename _bi::list_av_2<A1, A2>::type list_type;
+    return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R, class F, class A1, class A2, class A3>
+    _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
+{
+    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4>
+    _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5>
+    _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
+    _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+    _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+    _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+    _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+// adaptable function objects
+
+template<class F>
+    _bi::bind_t<_bi::unspecified, F, _bi::list0>
+    BOOST_BIND(F f)
+{
+    typedef _bi::list0 list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
+}
+
+template<class F, class A1>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
+    BOOST_BIND(F f, A1 a1)
+{
+    typedef typename _bi::list_av_1<A1>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
+}
+
+template<class F, class A1, class A2>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2)
+{
+    typedef typename _bi::list_av_2<A1, A2>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class F, class A1, class A2, class A3>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
+{
+    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class F, class A1, class A2, class A3, class A4>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+    _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+    return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+// function pointers
+
+#define BOOST_BIND_CC
+#define BOOST_BIND_ST
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#ifdef BOOST_BIND_ENABLE_STDCALL
+
+#define BOOST_BIND_CC __stdcall
+#define BOOST_BIND_ST
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#endif
+
+#ifdef BOOST_BIND_ENABLE_PASCAL
+
+#define BOOST_BIND_ST pascal
+#define BOOST_BIND_CC
+
+#include <boost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_ST
+#undef BOOST_BIND_CC
+
+#endif
+
+// member function pointers
+
+#define BOOST_BIND_MF_NAME(X) X
+#define BOOST_BIND_MF_CC
+
+#include <boost/bind/bind_mf_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_BIND_MF_NAME(X) X##_stdcall
+#define BOOST_BIND_MF_CC __stdcall
+
+#include <boost/bind/bind_mf_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+// data member pointers
+
+template<class R, class T, class A1>
+    _bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
+    BOOST_BIND(R T::*f, A1 a1)
+{
+    typedef _mfi::dm<R, T> F;
+    typedef typename _bi::list_av_1<A1>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+} // namespace boost
+
+#ifndef BOOST_BIND_NO_PLACEHOLDERS
+
+# include <boost/bind/placeholders.hpp>
+
+#endif
+
+#ifdef BOOST_MSVC
+# pragma warning(default: 4512) // assignment operator could not be generated
+# pragma warning(pop)
+#endif
+
+#endif // #ifndef BOOST_BIND_HPP_INCLUDED
diff --git a/boost/boost/bind/apply.hpp b/boost/boost/bind/apply.hpp
new file mode 100644 (file)
index 0000000..d903581
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef BOOST_BIND_APPLY_HPP_INCLUDED
+#define BOOST_BIND_APPLY_HPP_INCLUDED
+
+//
+//  apply.hpp
+//
+//  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.
+//
+
+namespace boost
+{
+
+template<class R> struct apply
+{
+    typedef R result_type;
+
+    template<class F> result_type operator()(F f) const
+    {
+        return f();
+    }
+
+    template<class F, class A1> result_type operator()(F f, A1 & a1) const
+    {
+        return f(a1);
+    }
+
+    template<class F, class A1, class A2> result_type operator()(F f, A1 & a1, A2 & a2) const
+    {
+        return f(a1, a2);
+    }
+
+    template<class F, class A1, class A2, class A3> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3) const
+    {
+        return f(a1, a2, a3);
+    }
+
+    template<class F, class A1, class A2, class A3, class A4> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+    {
+        return f(a1, a2, a3, a4);
+    }
+
+    template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+    {
+        return f(a1, a2, a3, a4, a5);
+    }
+
+    template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+    {
+        return f(a1, a2, a3, a4, a5, a6);
+    }
+
+    template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+    {
+        return f(a1, a2, a3, a4, a5, a6, a7);
+    }
+
+    template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+    {
+        return f(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+    {
+        return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    }
+};
+
+} // namespace boost
+
+#endif // #ifndef BOOST_BIND_APPLY_HPP_INCLUDED
diff --git a/boost/boost/bind/arg.hpp b/boost/boost/bind/arg.hpp
new file mode 100644 (file)
index 0000000..c0c32d2
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef BOOST_BIND_ARG_HPP_INCLUDED
+#define BOOST_BIND_ARG_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  bind/arg.hpp
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+namespace boost
+{
+
+template<int I> class arg
+{
+};
+
+} // 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
new file mode 100644 (file)
index 0000000..a192dec
--- /dev/null
@@ -0,0 +1,118 @@
+//
+//  bind/bind_cc.hpp - support for different calling conventions
+//
+//  Do not include this header directly.
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+template<class R>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (), _bi::list0>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) ())
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) ();
+    typedef _bi::list0 list_type;
+    return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class B1, class A1>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1), typename _bi::list_av_1<A1>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1), A1 a1)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1);
+    typedef typename _bi::list_av_1<A1>::type list_type;
+    return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class B1, class B2, class A1, class A2>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2), typename _bi::list_av_2<A1, A2>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2), A1 a1, A2 a2)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2);
+    typedef typename _bi::list_av_2<A1, A2>::type list_type;
+    return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R,
+    class B1, class B2, class B3,
+    class A1, class A2, class A3>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3), typename _bi::list_av_3<A1, A2, A3>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3), A1 a1, A2 a2, A3 a3)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3);
+    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R,
+    class B1, class B2, class B3, class B4,
+    class A1, class A2, class A3, class A4>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4), typename _bi::list_av_4<A1, A2, A3, A4>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4);
+    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R,
+    class B1, class B2, class B3, class B4, class B5,
+    class A1, class A2, class A3, class A4, class A5>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5), typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5);
+    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R,
+    class B1, class B2, class B3, class B4, class B5, class B6,
+    class A1, class A2, class A3, class A4, class A5, class A6>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6), typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6);
+    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7), typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7);
+    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8), typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8);
+    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+    _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8, B9), typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+    typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9);
+    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+    return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
diff --git a/boost/boost/bind/bind_mf_cc.hpp b/boost/boost/bind/bind_mf_cc.hpp
new file mode 100644 (file)
index 0000000..71b1e1c
--- /dev/null
@@ -0,0 +1,228 @@
+//
+//  bind/bind_mf_cc.hpp - support for different calling conventions
+//
+//  Do not include this header directly.
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+// 0
+
+template<class R, class T,
+    class A1>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
+    typedef typename _bi::list_av_1<A1>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+template<class R, class T,
+    class A1>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
+    typedef typename _bi::list_av_1<A1>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+// 1
+
+template<class R, class T,
+    class B1,
+    class A1, class A2>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
+    typedef typename _bi::list_av_2<A1, A2>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class R, class T,
+    class B1,
+    class A1, class A2>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
+    typedef typename _bi::list_av_2<A1, A2>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
+}
+
+// 2
+
+template<class R, class T,
+    class B1, class B2,
+    class A1, class A2, class A3>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
+    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class R, class T,
+    class B1, class B2,
+    class A1, class A2, class A3>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
+    typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+// 3
+
+template<class R, class T,
+    class B1, class B2, class B3,
+    class A1, class A2, class A3, class A4>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
+    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class R, class T,
+    class B1, class B2, class B3,
+    class A1, class A2, class A3, class A4>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
+    typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+// 4
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4,
+    class A1, class A2, class A3, class A4, class A5>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
+    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4,
+    class A1, class A2, class A3, class A4, class A5>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
+    typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+// 5
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5,
+    class A1, class A2, class A3, class A4, class A5, class A6>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
+    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5,
+    class A1, class A2, class A3, class A4, class A5, class A6>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
+    typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+// 6
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5, class B6,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5, class B6,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+    typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+// 7
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+    typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+// 8
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class R, class T,
+    class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+    class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+    _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+    typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+    typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+    return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
diff --git a/boost/boost/bind/bind_template.hpp b/boost/boost/bind/bind_template.hpp
new file mode 100644 (file)
index 0000000..d6e5a3b
--- /dev/null
@@ -0,0 +1,157 @@
+//
+//  bind/bind_template.hpp
+//
+//  Do not include this header directly.
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+    typedef typename result_traits<R, F>::type result_type;
+
+    result_type operator()()
+    {
+        list0 a;
+        BOOST_BIND_EVALUATE;
+    }
+
+    result_type operator()() const
+    {
+        list0 a;
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1> result_type operator()(A1 & a1)
+    {
+        list1<A1 &> a(a1);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1> result_type operator()(A1 & a1) const
+    {
+        list1<A1 &> a(a1);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
+    {
+        list2<A1 &, A2 &> a(a1, a2);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
+    {
+        list2<A1 &, A2 &> a(a1, a2);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
+    {
+        list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
+    {
+        list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
+    {
+        list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+    {
+        list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
+    {
+        list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+    {
+        list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
+    {
+        list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+    {
+        list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
+    {
+        list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+    {
+        list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
+    {
+        list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+    {
+        list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
+    {
+        list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+    {
+        list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A> result_type eval(A & a)
+    {
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class A> result_type eval(A & a) const
+    {
+        BOOST_BIND_EVALUATE;
+    }
+
+    template<class V> void accept(V & v) const
+    {
+        BOOST_BIND_VISIT_EACH(v, f_, 0);
+        l_.accept(v);
+    }
+
+private:
+
+    F f_;
+    L l_;
diff --git a/boost/boost/bind/make_adaptable.hpp b/boost/boost/bind/make_adaptable.hpp
new file mode 100644 (file)
index 0000000..01a1d4d
--- /dev/null
@@ -0,0 +1,172 @@
+#ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
+#define BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
+
+//
+//  make_adaptable.hpp
+//
+//  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.
+//
+
+namespace boost
+{
+
+namespace _bi
+{
+
+template<class F> void instantiate(F)
+{
+}
+
+template<class R, class F> class af0
+{
+public:
+
+    typedef R result_type;
+
+    explicit af0(F f): f_(f)
+    {
+    }
+
+    result_type operator()()
+    {
+        return f_();
+    }
+
+private:
+
+    F f_;
+};
+
+template<class R, class A1, class F> class af1
+{
+public:
+
+    typedef R result_type;
+    typedef A1 argument_type;
+    typedef A1 arg1_type;
+
+    explicit af1(F f): f_(f)
+    {
+    }
+
+    result_type operator()(A1 a1)
+    {
+        return f_(a1);
+    }
+
+private:
+
+    F f_;
+};
+
+template<class R, class A1, class A2, class F> class af2
+{
+public:
+
+    typedef R result_type;
+    typedef A1 first_argument_type;
+    typedef A2 second_argument_type;
+    typedef A1 arg1_type;
+    typedef A2 arg2_type;
+
+    explicit af2(F f): f_(f)
+    {
+    }
+
+    result_type operator()(A1 a1, A2 a2)
+    {
+        return f_(a1, a2);
+    }
+
+private:
+
+    F f_;
+};
+
+template<class R, class A1, class A2, class A3, class F> class af3
+{
+public:
+
+    typedef R result_type;
+    typedef A1 arg1_type;
+    typedef A2 arg2_type;
+    typedef A3 arg3_type;
+
+    explicit af3(F f): f_(f)
+    {
+    }
+
+    result_type operator()(A1 a1, A2 a2, A3 a3)
+    {
+        return f_(a1, a2, a3);
+    }
+
+private:
+
+    F f_;
+};
+
+template<class R, class A1, class A2, class A3, class A4, class F> class af4
+{
+public:
+
+    typedef R result_type;
+    typedef A1 arg1_type;
+    typedef A2 arg2_type;
+    typedef A3 arg3_type;
+    typedef A4 arg4_type;
+
+    explicit af4(F f): f_(f)
+    {
+    }
+
+    result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4)
+    {
+        return f_(a1, a2, a3, a4);
+    }
+
+private:
+
+    F f_;
+};
+
+} // namespace _bi
+
+template<class R, class F> _bi::af0<R, F> make_adaptable(F f)
+{
+    _bi::instantiate( &_bi::af0<R, F>::operator() ); // for early error detection
+    return _bi::af0<R, F>(f);
+}
+
+template<class R, class A1, class F> _bi::af1<R, A1, F> make_adaptable(F f)
+{
+    instantiate( &_bi::af1<R, A1, F>::operator() );
+    return _bi::af1<R, A1, F>(f);
+}
+
+template<class R, class A1, class A2, class F> _bi::af2<R, A1, A2, F> make_adaptable(F f)
+{
+    instantiate( &_bi::af2<R, A1, A2, F>::operator() );
+    return _bi::af2<R, A1, A2, F>(f);
+}
+
+template<class R, class A1, class A2, class A3, class F> _bi::af3<R, A1, A2, A3, F> make_adaptable(F f)
+{
+    instantiate( &_bi::af3<R, A1, A2, A3, F>::operator() );
+    return _bi::af3<R, A1, A2, A3, F>(f);
+}
+
+template<class R, class A1, class A2, class A3, class A4, class F> _bi::af4<R, A1, A2, A3, A4, F> make_adaptable(F f)
+{
+    instantiate( &_bi::af4<R, A1, A2, A3, A4, F>::operator() );
+    return _bi::af4<R, A1, A2, A3, A4, F>(f);
+}
+
+} // namespace boost
+
+#endif // #ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
diff --git a/boost/boost/bind/mem_fn_cc.hpp b/boost/boost/bind/mem_fn_cc.hpp
new file mode 100644 (file)
index 0000000..a89a2ee
--- /dev/null
@@ -0,0 +1,104 @@
+//
+//  bind/mem_fn_cc.hpp - support for different calling conventions
+//
+//  Do not include this header directly.
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/mem_fn.html for documentation.
+//
+
+template<class R, class T> _mfi::BOOST_MEM_FN_NAME(mf0)<R, T> mem_fn(R (BOOST_MEM_FN_CC T::*f) ())
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf0)<R, T>(f);
+}
+
+template<class R, class T> _mfi::BOOST_MEM_FN_NAME(cmf0)<R, T> mem_fn(R (BOOST_MEM_FN_CC T::*f) () const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf0)<R, T>(f);
+}
+
+template<class R, class T, class A1> _mfi::BOOST_MEM_FN_NAME(mf1)<R, T, A1> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf1)<R, T, A1>(f);
+}
+
+template<class R, class T, class A1> _mfi::BOOST_MEM_FN_NAME(cmf1)<R, T, A1> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf1)<R, T, A1>(f);
+}
+
+template<class R, class T, class A1, class A2> _mfi::BOOST_MEM_FN_NAME(mf2)<R, T, A1, A2> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf2)<R, T, A1, A2>(f);
+}
+
+template<class R, class T, class A1, class A2> _mfi::BOOST_MEM_FN_NAME(cmf2)<R, T, A1, A2> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf2)<R, T, A1, A2>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3> _mfi::BOOST_MEM_FN_NAME(mf3)<R, T, A1, A2, A3> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf3)<R, T, A1, A2, A3>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3> _mfi::BOOST_MEM_FN_NAME(cmf3)<R, T, A1, A2, A3> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf3)<R, T, A1, A2, A3>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4> _mfi::BOOST_MEM_FN_NAME(mf4)<R, T, A1, A2, A3, A4> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf4)<R, T, A1, A2, A3, A4>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4> _mfi::BOOST_MEM_FN_NAME(cmf4)<R, T, A1, A2, A3, A4> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf4)<R, T, A1, A2, A3, A4>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5> _mfi::BOOST_MEM_FN_NAME(mf5)<R, T, A1, A2, A3, A4, A5> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf5)<R, T, A1, A2, A3, A4, A5>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5> _mfi::BOOST_MEM_FN_NAME(cmf5)<R, T, A1, A2, A3, A4, A5> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf5)<R, T, A1, A2, A3, A4, A5>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> _mfi::BOOST_MEM_FN_NAME(mf6)<R, T, A1, A2, A3, A4, A5, A6> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf6)<R, T, A1, A2, A3, A4, A5, A6>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> _mfi::BOOST_MEM_FN_NAME(cmf6)<R, T, A1, A2, A3, A4, A5, A6> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf6)<R, T, A1, A2, A3, A4, A5, A6>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> _mfi::BOOST_MEM_FN_NAME(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> _mfi::BOOST_MEM_FN_NAME(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> _mfi::BOOST_MEM_FN_NAME(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7, A8))
+{
+    return _mfi::BOOST_MEM_FN_NAME(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f);
+}
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> _mfi::BOOST_MEM_FN_NAME(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8> mem_fn(R (BOOST_MEM_FN_CC T::*f) (A1, A2, A3, A4, A5, A6, A7, A8) const)
+{
+    return _mfi::BOOST_MEM_FN_NAME(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8>(f);
+}
diff --git a/boost/boost/bind/mem_fn_template.hpp b/boost/boost/bind/mem_fn_template.hpp
new file mode 100644 (file)
index 0000000..ac260b8
--- /dev/null
@@ -0,0 +1,755 @@
+//
+//  bind/mem_fn_template.hpp
+//
+//  Do not include this header directly
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/mem_fn.html for documentation.
+//
+
+// mf0
+
+template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf0)
+{
+public:
+
+    typedef R result_type;
+    typedef T * argument_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) ())
+    F f_;
+
+    template<class U> R call(U & u, T const *) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)();
+    }
+
+    template<class U> R call(U & u, void const *) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf0)(F f): f_(f) {}
+
+    R operator()(T * p) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)();
+    }
+
+    template<class U> R operator()(U & u) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u);
+    }
+
+    R operator()(T & t) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)();
+    }
+};
+
+// cmf0
+
+template<class R, class T BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf0)
+{
+public:
+
+    typedef R result_type;
+    typedef T const * argument_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) () const)
+    F f_;
+
+    template<class U> R call(U & u, T const *) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)();
+    }
+
+    template<class U> R call(U & u, void const *) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)();
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf0)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u);
+    }
+
+    R operator()(T const & t) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)();
+    }
+};
+
+// mf1
+
+template<class R, class T, class A1 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf1)
+{
+public:
+
+    typedef R result_type;
+    typedef T * first_argument_type;
+    typedef A1 second_argument_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1))
+    F f_;
+
+    template<class U, class B1> R call(U & u, T const *, B1 & b1) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1);
+    }
+
+    template<class U, class B1> R call(U & u, void const *, B1 & b1) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf1)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1);
+    }
+
+    template<class U> R operator()(U & u, A1 a1) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1);
+    }
+
+    R operator()(T & t, A1 a1) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1);
+    }
+};
+
+// cmf1
+
+template<class R, class T, class A1 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf1)
+{
+public:
+
+    typedef R result_type;
+    typedef T const * first_argument_type;
+    typedef A1 second_argument_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1) const)
+    F f_;
+
+    template<class U, class B1> R call(U & u, T const *, B1 & b1) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1);
+    }
+
+    template<class U, class B1> R call(U & u, void const *, B1 & b1) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf1)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1);
+    }
+
+    R operator()(T const & t, A1 a1) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1);
+    }
+};
+
+// mf2
+
+template<class R, class T, class A1, class A2 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf2)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2))
+    F f_;
+
+    template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
+    }
+
+    template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf2)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
+    }
+};
+
+// cmf2
+
+template<class R, class T, class A1, class A2 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf2)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2) const)
+    F f_;
+
+    template<class U, class B1, class B2> R call(U & u, T const *, B1 & b1, B2 & b2) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2);
+    }
+
+    template<class U, class B1, class B2> R call(U & u, void const *, B1 & b1, B2 & b2) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf2)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2);
+    }
+};
+
+// mf3
+
+template<class R, class T, class A1, class A2, class A3 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf3)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3))
+    F f_;
+
+    template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
+    }
+
+    template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf3)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2, A3 a3) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2, A3 a3) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
+    }
+};
+
+// cmf3
+
+template<class R, class T, class A1, class A2, class A3 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf3)
+{
+public:
+
+    typedef R result_type;
+
+private:
+
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const)
+    F f_;
+
+    template<class U, class B1, class B2, class B3> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3);
+    }
+
+    template<class U, class B1, class B2, class B3> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3);
+    }
+
+public:
+
+    explicit BOOST_MEM_FN_NAME(cmf3)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2, A3 a3) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3);
+    }
+};
+
+// mf4
+
+template<class R, class T, class A1, class A2, class A3, class A4 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf4)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4))
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf4)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
+    }
+};
+
+// cmf4
+
+template<class R, class T, class A1, class A2, class A3, class A4 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf4)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const)
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf4)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4);
+    }
+};
+
+// mf5
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf5)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5))
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf5)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
+    }
+};
+
+// cmf5
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf5)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const)
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf5)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5);
+    }
+};
+
+// mf6
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf6)
+{
+public:
+
+    typedef R result_type;
+
+private:
+
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6))
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
+    }
+
+public:
+
+    explicit BOOST_MEM_FN_NAME(mf6)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
+    }
+};
+
+// cmf6
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf6)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const)
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf6)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6);
+    }
+};
+
+// mf7
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf7)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7))
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf7)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
+    }
+};
+
+// cmf7
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf7)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const)
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf7)(F f): f_(f) {}
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7);
+    }
+};
+
+// mf8
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(mf8)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8))
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(mf8)(F f): f_(f) {}
+
+    R operator()(T * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    template<class U> R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    R operator()(T & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+};
+
+// cmf8
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 BOOST_MEM_FN_CLASS_F> class BOOST_MEM_FN_NAME(cmf8)
+{
+public:
+
+    typedef R result_type;
+
+private:
+    
+    BOOST_MEM_FN_TYPEDEF(R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const)
+    F f_;
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, T const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
+    {
+        BOOST_MEM_FN_RETURN (u.*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+    }
+
+    template<class U, class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8> R call(U & u, void const *, B1 & b1, B2 & b2, B3 & b3, B4 & b4, B5 & b5, B6 & b6, B7 & b7, B8 & b8) const
+    {
+        BOOST_MEM_FN_RETURN (get_pointer(u)->*f_)(b1, b2, b3, b4, b5, b6, b7, b8);
+    }
+
+public:
+    
+    explicit BOOST_MEM_FN_NAME(cmf8)(F f): f_(f) {}
+
+    R operator()(T const * p, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
+    {
+        BOOST_MEM_FN_RETURN (p->*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    template<class U> R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
+    {
+        BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const
+    {
+        BOOST_MEM_FN_RETURN (t.*f_)(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+};
+
diff --git a/boost/boost/bind/mem_fn_vw.hpp b/boost/boost/bind/mem_fn_vw.hpp
new file mode 100644 (file)
index 0000000..6e9f78e
--- /dev/null
@@ -0,0 +1,131 @@
+//
+//  bind/mem_fn_vw.hpp - void return helper wrappers
+//
+//  Do not include this header directly
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/mem_fn.html for documentation.
+//
+
+template<class R, class T> struct BOOST_MEM_FN_NAME(mf0): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)<R, T, R (BOOST_MEM_FN_CC T::*) ()>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) ();
+    explicit BOOST_MEM_FN_NAME(mf0)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf0)<R, T, F>(f) {}
+};
+
+template<class R, class T> struct BOOST_MEM_FN_NAME(cmf0): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)<R, T, R (BOOST_MEM_FN_CC T::*) () const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) () const;
+    explicit BOOST_MEM_FN_NAME(cmf0)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf0)<R, T, F>(f) {}
+};
+
+
+template<class R, class T, class A1> struct BOOST_MEM_FN_NAME(mf1): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)<R, T, A1, R (BOOST_MEM_FN_CC T::*) (A1)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1);
+    explicit BOOST_MEM_FN_NAME(mf1)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf1)<R, T, A1, F>(f) {}
+};
+
+template<class R, class T, class A1> struct BOOST_MEM_FN_NAME(cmf1): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)<R, T, A1, R (BOOST_MEM_FN_CC T::*) (A1) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1) const;
+    explicit BOOST_MEM_FN_NAME(cmf1)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf1)<R, T, A1, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2> struct BOOST_MEM_FN_NAME(mf2): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)<R, T, A1, A2, R (BOOST_MEM_FN_CC T::*) (A1, A2)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2);
+    explicit BOOST_MEM_FN_NAME(mf2)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf2)<R, T, A1, A2, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2> struct BOOST_MEM_FN_NAME(cmf2): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)<R, T, A1, A2, R (BOOST_MEM_FN_CC T::*) (A1, A2) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2) const;
+    explicit BOOST_MEM_FN_NAME(cmf2)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf2)<R, T, A1, A2, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2, class A3> struct BOOST_MEM_FN_NAME(mf3): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)<R, T, A1, A2, A3, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3);
+    explicit BOOST_MEM_FN_NAME(mf3)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf3)<R, T, A1, A2, A3, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2, class A3> struct BOOST_MEM_FN_NAME(cmf3): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)<R, T, A1, A2, A3, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3) const;
+    explicit BOOST_MEM_FN_NAME(cmf3)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf3)<R, T, A1, A2, A3, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2, class A3, class A4> struct BOOST_MEM_FN_NAME(mf4): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)<R, T, A1, A2, A3, A4, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4);
+    explicit BOOST_MEM_FN_NAME(mf4)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf4)<R, T, A1, A2, A3, A4, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2, class A3, class A4> struct BOOST_MEM_FN_NAME(cmf4): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)<R, T, A1, A2, A3, A4, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4) const;
+    explicit BOOST_MEM_FN_NAME(cmf4)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf4)<R, T, A1, A2, A3, A4, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5> struct BOOST_MEM_FN_NAME(mf5): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)<R, T, A1, A2, A3, A4, A5, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5);
+    explicit BOOST_MEM_FN_NAME(mf5)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf5)<R, T, A1, A2, A3, A4, A5, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5> struct BOOST_MEM_FN_NAME(cmf5): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)<R, T, A1, A2, A3, A4, A5, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5) const;
+    explicit BOOST_MEM_FN_NAME(cmf5)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf5)<R, T, A1, A2, A3, A4, A5, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> struct BOOST_MEM_FN_NAME(mf6): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)<R, T, A1, A2, A3, A4, A5, A6, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6);
+    explicit BOOST_MEM_FN_NAME(mf6)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf6)<R, T, A1, A2, A3, A4, A5, A6, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6> struct BOOST_MEM_FN_NAME(cmf6): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)<R, T, A1, A2, A3, A4, A5, A6, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6) const;
+    explicit BOOST_MEM_FN_NAME(cmf6)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf6)<R, T, A1, A2, A3, A4, A5, A6, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct BOOST_MEM_FN_NAME(mf7): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7);
+    explicit BOOST_MEM_FN_NAME(mf7)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf7)<R, T, A1, A2, A3, A4, A5, A6, A7, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct BOOST_MEM_FN_NAME(cmf7): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7) const;
+    explicit BOOST_MEM_FN_NAME(cmf7)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf7)<R, T, A1, A2, A3, A4, A5, A6, A7, F>(f) {}
+};
+
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct BOOST_MEM_FN_NAME(mf8): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7, A8)>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8);
+    explicit BOOST_MEM_FN_NAME(mf8)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(mf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, F>(f) {}
+};
+
+template<class R, class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct BOOST_MEM_FN_NAME(cmf8): public mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, R (BOOST_MEM_FN_CC T::*) (A1, A2, A3, A4, A5, A6, A7, A8) const>
+{
+    typedef R (BOOST_MEM_FN_CC T::*F) (A1, A2, A3, A4, A5, A6, A7, A8) const;
+    explicit BOOST_MEM_FN_NAME(cmf8)(F f): mf<R>::BOOST_NESTED_TEMPLATE BOOST_MEM_FN_NAME2(cmf8)<R, T, A1, A2, A3, A4, A5, A6, A7, A8, F>(f) {}
+};
+
diff --git a/boost/boost/bind/placeholders.hpp b/boost/boost/bind/placeholders.hpp
new file mode 100644 (file)
index 0000000..c76f7f5
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
+#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  bind/placeholders.hpp - _N definitions
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <boost/bind/arg.hpp>
+#include <boost/config.hpp>
+
+namespace
+{
+
+#if defined(__BORLANDC__)
+
+static inline boost::arg<1> _1() { return boost::arg<1>(); }
+static inline boost::arg<2> _2() { return boost::arg<2>(); }
+static inline boost::arg<3> _3() { return boost::arg<3>(); }
+static inline boost::arg<4> _4() { return boost::arg<4>(); }
+static inline boost::arg<5> _5() { return boost::arg<5>(); }
+static inline boost::arg<6> _6() { return boost::arg<6>(); }
+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)
+
+static boost::arg<1> _1;
+static boost::arg<2> _2;
+static boost::arg<3> _3;
+static boost::arg<4> _4;
+static boost::arg<5> _5;
+static boost::arg<6> _6;
+static boost::arg<7> _7;
+static boost::arg<8> _8;
+static boost::arg<9> _9;
+
+#else
+
+boost::arg<1> _1;
+boost::arg<2> _2;
+boost::arg<3> _3;
+boost::arg<4> _4;
+boost::arg<5> _5;
+boost::arg<6> _6;
+boost::arg<7> _7;
+boost::arg<8> _8;
+boost::arg<9> _9;
+
+#endif
+
+} // unnamed namespace
+
+#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
diff --git a/boost/boost/bind/protect.hpp b/boost/boost/bind/protect.hpp
new file mode 100644 (file)
index 0000000..73b6dce
--- /dev/null
@@ -0,0 +1,145 @@
+#ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
+#define BOOST_BIND_PROTECT_HPP_INCLUDED
+
+//
+//  protect.hpp
+//
+//  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.
+//
+
+namespace boost
+{
+
+namespace _bi
+{
+
+template<class F> class protected_bind_t
+{
+public:
+
+    typedef typename F::result_type result_type;
+
+    explicit protected_bind_t(F f): f_(f)
+    {
+    }
+
+    result_type operator()()
+    {
+        return f_();
+    }
+
+    result_type operator()() const
+    {
+        return f_();
+    }
+
+    template<class A1> result_type operator()(A1 & a1)
+    {
+        return f_(a1);
+    }
+
+    template<class A1> result_type operator()(A1 & a1) const
+    {
+        return f_(a1);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
+    {
+        return f_(a1, a2, a3);
+    }
+
+    template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
+    {
+        return f_(a1, a2, a3);
+    }
+
+    template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
+    {
+        return f_(a1, a2, a3, a4);
+    }
+
+    template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+    {
+        return f_(a1, a2, a3, a4);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
+    {
+        return f_(a1, a2, a3, a4, a5);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+    {
+        return f_(a1, a2, a3, a4, a5);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
+    {
+        return f_(a1, a2, a3, a4, a5, a6);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    }
+
+private:
+
+    F f_;
+};
+
+} // namespace _bi
+
+template<class F> _bi::protected_bind_t<F> protect(F f)
+{
+    return _bi::protected_bind_t<F>(f);
+}
+
+} // namespace boost
+
+#endif // #ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
diff --git a/boost/boost/call_traits.hpp b/boost/boost/call_traits.hpp
new file mode 100644 (file)
index 0000000..345a440
--- /dev/null
@@ -0,0 +1,23 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version including documentation.
+//  See boost/detail/call_traits.hpp and boost/detail/ob_call_traits.hpp
+//  for full copyright notices.
+
+#ifndef BOOST_CALL_TRAITS_HPP
+#define BOOST_CALL_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/detail/ob_call_traits.hpp>
+#else
+#include <boost/detail/call_traits.hpp>
+#endif
+
+#endif // BOOST_CALL_TRAITS_HPP
diff --git a/boost/boost/cast.hpp b/boost/boost/cast.hpp
new file mode 100644 (file)
index 0000000..fcbad0d
--- /dev/null
@@ -0,0 +1,340 @@
+//  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.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Revision History
+//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included 
+//             <boost/limits.hpp> instead (the workaround did not 
+//             actually compile when BOOST_NO_LIMITS was defined in 
+//             any case, so we loose nothing). (John Maddock)
+//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
+//             worked with stock GCC; trying to get it to do that broke
+//             vc-stlport.
+//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
+//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
+//             boost::detail::type to boost/type.hpp. Made it compile with
+//             stock gcc again (Dave Abrahams)
+//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
+//             Review (Beman Dawes)
+//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
+//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
+//             (Dave Abrahams)
+//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
+//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
+//  27 Jun 00  More MSVC6 workarounds 
+//  15 Jun 00  Add workarounds for MSVC6
+//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
+//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
+//  29 Dec 99  Change using declarations so usages in other namespaces work
+//             correctly (Dave Abrahams)
+//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
+//             as suggested Darin Adler and improved by Valentin Bonnard.  
+//   2 Sep 99  Remove controversial asserts, simplify, rename.
+//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
+//             place in nested namespace.
+//   3 Aug 99  Initial version
+
+#ifndef BOOST_CAST_HPP
+#define BOOST_CAST_HPP
+
+# include <boost/config.hpp>
+# include <cassert>
+# include <typeinfo>
+# include <boost/type.hpp>
+# include <boost/limits.hpp>
+
+//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
+//  time if you use a template function which has template parameters that don't
+//  appear in the function's argument list.
+//
+//  TODO: Add this to config.hpp?
+# if defined(BOOST_MSVC) && BOOST_MSVC <= 1200 // 1200 = VC6
+#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
+# else
+#  define BOOST_EXPLICIT_DEFAULT_TARGET
+# endif
+
+namespace boost
+{
+//  See the documentation for descriptions of how to choose between
+//  static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
+
+//  polymorphic_cast  --------------------------------------------------------//
+
+    //  Runtime checked polymorphic downcasts and crosscasts.
+    //  Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup, 
+    //  section 15.8 exercise 1, page 425.
+
+    template <class Target, class Source>
+    inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
+    {
+        Target tmp = dynamic_cast<Target>(x);
+        if ( tmp == 0 ) throw std::bad_cast();
+        return tmp;
+    }
+
+//  polymorphic_downcast  ----------------------------------------------------//
+
+    //  assert() checked polymorphic downcast.  Crosscasts prohibited.
+
+    //  WARNING: Because this cast uses assert(), it violates the One Definition
+    //  Rule if NDEBUG is inconsistently defined across translation units.
+
+    //  Contributed by Dave Abrahams
+
+    template <class Target, class Source>
+    inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
+    {
+        assert( dynamic_cast<Target>(x) == x );  // detect logic error
+        return static_cast<Target>(x);
+    }
+
+//  implicit_cast  -----------------------------------------------------------//
+//
+//  Removed due to uncertain purpose.  Use either numeric_cast (see below)
+//  or static_cast according to the need. 
+
+//  numeric_cast and related exception  --------------------------------------//
+
+//  Contributed by Kevlin Henney
+
+//  bad_numeric_cast  --------------------------------------------------------//
+
+    // exception used to indicate runtime numeric_cast failure
+    class bad_numeric_cast : public std::bad_cast
+    {
+    public:
+        // constructors, destructors and assignment operator defaulted
+
+        // function inlined for brevity and consistency with rest of library
+        virtual const char *what() const throw()
+        {
+            return "bad numeric cast: loss of range in numeric_cast";
+        }
+    };
+
+//  numeric_cast  ------------------------------------------------------------//
+
+#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)
+  
+    namespace detail
+    {
+       template <bool is_signed> struct numeric_min_select;
+    
+       template<>
+       struct numeric_min_select<true>
+       {
+         template <class T>
+         struct limits : std::numeric_limits<T>
+         {
+         static inline T min()
+# ifndef __GNUC__ // bug workaround courtesy Jens Maurer
+             {
+                 return std::numeric_limits<T>::min() >= 0
+                     // unary minus causes integral promotion, thus the static_cast<>
+                     ? static_cast<T>(-std::numeric_limits<T>::max())
+                     : std::numeric_limits<T>::min();
+             }
+# else
+                 ;
+# endif
+         };
+       };
+
+# ifdef __GNUC__ // bug workaround courtesy Jens Maurer
+      template<> template<class T>
+      inline T numeric_min_select<true>::limits<T>::min()
+      {
+           return std::numeric_limits<T>::min() >= 0
+               // unary minus causes integral promotion, thus the static_cast<>
+               ? static_cast<T>(-std::numeric_limits<T>::max())
+               : std::numeric_limits<T>::min();
+      }
+# endif
+    
+      template<>
+      struct numeric_min_select<false>
+      {
+          template <class T>
+          struct limits : std::numeric_limits<T> {};
+      };
+      
+      // Move to namespace boost in utility.hpp?
+      template <class T>
+      struct fixed_numeric_limits
+          : public numeric_min_select<
+                       std::numeric_limits<T>::is_signed 
+                   >::template limits<T>
+      {
+      };
+    } // namespace detail
+  
+// less_than_type_min -
+  //    x_is_signed should be numeric_limits<X>::is_signed
+  //    y_is_signed should be numeric_limits<Y>::is_signed
+  //    y_min should be numeric_limits<Y>::min()
+  //
+  //    check(x, y_min) returns true iff x < y_min without invoking comparisons
+  //    between signed and unsigned values.
+  //
+  //    "poor man's partial specialization" is in use here.
+    template <bool x_is_signed, bool y_is_signed>
+    struct less_than_type_min
+    {
+        template <class X, class Y>
+        static bool check(X x, Y y_min)
+            { return x < y_min; }
+    };
+
+    template <>
+    struct less_than_type_min<false, true>
+    {
+        template <class X, class Y>
+        static bool check(X, Y)
+            { return false; }
+    };
+    
+    template <>
+    struct less_than_type_min<true, false>
+    {
+        template <class X, class Y>
+        static bool check(X x, Y)
+            { return x < 0; }
+    };
+    
+  // greater_than_type_max -
+  //    same_sign should be:
+  //            numeric_limits<X>::is_signed == numeric_limits<Y>::is_signed
+  //    y_max should be numeric_limits<Y>::max()
+  //
+  //    check(x, y_max) returns true iff x > y_max without invoking comparisons
+  //    between signed and unsigned values.
+  //
+  //    "poor man's partial specialization" is in use here.
+    template <bool same_sign, bool x_is_signed>
+    struct greater_than_type_max;
+
+    template<>
+    struct greater_than_type_max<true, true>
+    {
+        template <class X, class Y>
+        static inline bool check(X x, Y y_max)
+            { return x > y_max; }
+    };
+
+    template <>
+    struct greater_than_type_max<false, true>
+    {
+        // What does the standard say about this? I think it's right, and it
+        // will work with every compiler I know of.
+        template <class X, class Y>
+        static inline bool check(X x, Y)
+            { return x >= 0 && static_cast<X>(static_cast<Y>(x)) != x; }
+    };
+
+    template<>
+    struct greater_than_type_max<true, false>
+    {
+        template <class X, class Y>
+        static inline bool check(X x, Y y_max)
+            { return x > y_max; }
+    };
+
+    template <>
+    struct greater_than_type_max<false, false>
+    {
+        // What does the standard say about this? I think it's right, and it
+        // will work with every compiler I know of.
+        template <class X, class Y>
+        static inline bool check(X x, Y)
+            { return static_cast<X>(static_cast<Y>(x)) != x; }
+    };
+  
+#else // use #pragma hacks if available
+
+  namespace detail
+  {
+# if BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable : 4018)
+#  pragma warning(disable : 4146)
+#elif defined(__BORLANDC__)
+#  pragma option push -w-8041
+# endif
+
+       // Move to namespace boost in utility.hpp?
+       template <class T>
+       struct fixed_numeric_limits : public std::numeric_limits<T>
+       {
+           static inline T min()
+           {
+               return std::numeric_limits<T>::is_signed && std::numeric_limits<T>::min() >= 0
+                   ? T(-std::numeric_limits<T>::max()) : std::numeric_limits<T>::min();
+           }
+       };
+  
+# if BOOST_MSVC
+#  pragma warning(pop)
+#elif defined(__BORLANDC__)
+#  pragma option pop
+# endif
+  } // namespace detail
+  
+#endif
+  
+    template<typename Target, typename Source>
+    inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
+    {
+        // typedefs abbreviating respective trait classes
+        typedef std::numeric_limits<Source> arg_traits;
+        typedef detail::fixed_numeric_limits<Target> result_traits;
+        
+#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)
+        // typedefs that act as compile time assertions
+        // (to be replaced by boost compile time assertions
+        // as and when they become available and are stable)
+        typedef bool argument_must_be_numeric[arg_traits::is_specialized];
+        typedef bool result_must_be_numeric[result_traits::is_specialized];
+
+        const bool arg_is_signed = arg_traits::is_signed;
+        const bool result_is_signed = result_traits::is_signed;
+        const bool same_sign = arg_is_signed == result_is_signed;
+
+        if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, result_traits::min())
+            || greater_than_type_max<same_sign, arg_is_signed>::check(arg, result_traits::max())
+            )
+            
+#else // We need to use #pragma hacks if available
+            
+# if BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable : 4018)
+#elif defined(__BORLANDC__)
+#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
+# if BOOST_MSVC
+#  pragma warning(pop)
+#elif defined(__BORLANDC__)
+#pragma option pop
+# endif
+#endif
+        {
+            throw bad_numeric_cast();
+        }
+        return static_cast<Target>(arg);
+    } // numeric_cast
+
+#  undef BOOST_EXPLICIT_DEFAULT_TARGET
+
+} // namespace boost
+
+#endif  // BOOST_CAST_HPP
diff --git a/boost/boost/checked_delete.hpp b/boost/boost/checked_delete.hpp
new file mode 100644 (file)
index 0000000..abb2ce0
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
+#define BOOST_CHECKED_DELETE_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/checked_delete.hpp
+//
+//  Copyright (c) 1999, 2000, 2001, 2002 boost.org
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+namespace boost
+{
+
+// verify that types are complete for increased safety
+
+template< typename T > inline void checked_delete(T * x)
+{
+    typedef char type_must_be_complete[sizeof(T)];
+    delete x;
+}
+
+template< typename T > inline void checked_array_delete(T * x)
+{
+    typedef char type_must_be_complete[sizeof(T)];
+    delete [] x;
+}
+
+template<class T> struct checked_deleter
+{
+    typedef void result_type;
+    typedef T * argument_type;
+
+    void operator()(T * x)
+    {
+        checked_delete(x);
+    }
+};
+
+template<class T> struct checked_array_deleter
+{
+    typedef void result_type;
+    typedef T * argument_type;
+
+    void operator()(T * x)
+    {
+        checked_array_delete(x);
+    }
+};
+
+} // namespace boost
+
+#endif  // #ifndef BOOST_CHECKED_DELETE_HPP_INCLUDED
diff --git a/boost/boost/compose.hpp b/boost/boost/compose.hpp
new file mode 100644 (file)
index 0000000..859038f
--- /dev/null
@@ -0,0 +1,226 @@
+/* supplementing compose function objects
+ * Fri Jul 16 21:01:58 MEST 1999
+ */
+/* The following code example is taken from the book
+ * "The C++ Standard Library - A Tutorial and Reference"
+ * by Nicolai M. Josuttis, Addison-Wesley, 1999
+ *
+ * (C) Copyright Nicolai M. Josuttis 1999.
+ * Permission to copy, use, modify, sell and distribute this software
+ * is granted provided this copyright notice appears in all copies.
+ * This software is provided "as is" without express or implied
+ * warranty, and with no claim as to its suitability for any purpose.
+ */
+#ifndef BOOST_COMPOSE_HPP
+#define BOOST_COMPOSE_HPP
+
+#include <functional>
+
+namespace boost {
+
+/**********************************************************
+ * type nullary_function
+ * - as supplement to unary_function and binary_function
+ **********************************************************/
+template <class Result>
+struct nullary_function {
+    typedef Result result_type;
+};
+
+/**********************************************************
+ * ptr_fun for functions with no argument
+ **********************************************************/
+template <class Result>
+class pointer_to_nullary_function : public nullary_function<Result>
+{
+  protected:
+    Result (*ptr)();
+  public:
+    pointer_to_nullary_function() {
+    }
+    explicit pointer_to_nullary_function(Result (*x)()) : ptr(x) {
+    }
+    Result operator()() const { 
+        return ptr();
+    }
+};
+
+template <class Result>
+inline pointer_to_nullary_function<Result> ptr_fun(Result (*x)())
+{
+  return pointer_to_nullary_function<Result>(x);
+}
+
+/*********** compose_f_gx_t and compose_f_gx **********************/
+
+/* class for the compose_f_gx adapter
+ */
+template <class OP1, class OP2>
+class compose_f_gx_t
+ : public std::unary_function<typename OP2::argument_type,
+                              typename OP1::result_type>
+{
+  private:
+    OP1 op1;    // process: op1(op2(x))
+    OP2 op2;
+  public:
+    // constructor
+    compose_f_gx_t(const OP1& o1, const OP2& o2)
+     : op1(o1), op2(o2) {
+    }
+
+    // function call
+    typename OP1::result_type
+    operator()(const typename OP2::argument_type& x) const {
+        return op1(op2(x));
+    }
+};
+
+/* convenience functions for the compose_f_gx adapter
+ */
+template <class OP1, class OP2>
+inline compose_f_gx_t<OP1,OP2>
+compose_f_gx (const OP1& o1, const OP2& o2) {
+    return compose_f_gx_t<OP1,OP2>(o1,o2);
+}
+
+/*********** compose_f_gx_hx_t and compose_f_gx_hx **********************/
+
+/* class for the compose_f_gx_hx adapter
+ */
+template <class OP1, class OP2, class OP3>
+class compose_f_gx_hx_t
+ : public std::unary_function<typename OP2::argument_type,
+                              typename OP1::result_type>
+{
+  private:
+    OP1 op1;    // process: op1(op2(x),op3(x))
+    OP2 op2;
+    OP3 op3;
+  public:
+    // constructor
+    compose_f_gx_hx_t (const OP1& o1, const OP2& o2, const OP3& o3)
+     : op1(o1), op2(o2), op3(o3) {
+    }
+
+    // function call
+    typename OP1::result_type
+    operator()(const typename OP2::argument_type& x) const {
+        return op1(op2(x),op3(x));
+    }
+};
+
+/* convenience functions for the compose_f_gx_hx adapter
+ */
+template <class OP1, class OP2, class OP3>
+inline compose_f_gx_hx_t<OP1,OP2,OP3>
+compose_f_gx_hx (const OP1& o1, const OP2& o2, const OP3& o3) {
+    return compose_f_gx_hx_t<OP1,OP2,OP3>(o1,o2,o3);
+}
+
+/*********** compose_f_gxy_t and compose_f_gxy **********************/
+
+/* class for the compose_f_gxy adapter
+ */
+template <class OP1, class OP2>
+class compose_f_gxy_t
+ : public std::binary_function<typename OP2::first_argument_type,
+                               typename OP2::second_argument_type,
+                               typename OP1::result_type>
+{
+  private:
+    OP1 op1;    // process: op1(op2(x,y))
+    OP2 op2;
+  public:
+    // constructor
+    compose_f_gxy_t (const OP1& o1, const OP2& o2)
+     : op1(o1), op2(o2) {
+    }
+
+    // function call
+    typename OP1::result_type
+    operator()(const typename OP2::first_argument_type& x,
+               const typename OP2::second_argument_type& y) const {
+        return op1(op2(x,y));
+    }
+};
+
+/* convenience function for the compose_f_gxy adapter
+ */
+template <class OP1, class OP2>
+inline compose_f_gxy_t<OP1,OP2>
+compose_f_gxy (const OP1& o1, const OP2& o2) {
+    return compose_f_gxy_t<OP1,OP2>(o1,o2);
+}
+
+/*********** compose_f_gx_hy_t and compose_f_gx_hy **********************/
+
+/* class for the compose_f_gx_hy adapter
+ */
+template <class OP1, class OP2, class OP3>
+class compose_f_gx_hy_t
+ : public std::binary_function<typename OP2::argument_type,
+                               typename OP3::argument_type,
+                               typename OP1::result_type>
+{
+  private:
+    OP1 op1;    // process: op1(op2(x),op3(y))
+    OP2 op2;
+    OP3 op3;
+  public:
+    // constructor
+    compose_f_gx_hy_t (const OP1& o1, const OP2& o2, const OP3& o3)
+     : op1(o1), op2(o2), op3(o3) {
+    }
+
+    // function call
+    typename OP1::result_type
+    operator()(const typename OP2::argument_type& x,
+               const typename OP3::argument_type& y) const {
+        return op1(op2(x),op3(y));
+    }
+};
+
+/* convenience function for the compose_f_gx_hy adapter
+ */
+template <class OP1, class OP2, class OP3>
+inline compose_f_gx_hy_t<OP1,OP2,OP3>
+compose_f_gx_hy (const OP1& o1, const OP2& o2, const OP3& o3) {
+    return compose_f_gx_hy_t<OP1,OP2,OP3>(o1,o2,o3);
+}
+
+/*********** compose_f_g_t and compose_f_g **********************/
+
+/* class for the compose_f_g adapter
+ */
+template <class OP1, class OP2>
+class compose_f_g_t
+ : public boost::nullary_function<typename OP1::result_type>
+{
+  private:
+    OP1 op1;    // process: op1(op2())
+    OP2 op2;
+  public:
+    // constructor
+    compose_f_g_t(const OP1& o1, const OP2& o2)
+     : op1(o1), op2(o2) {
+    }
+
+    // function call
+    typename OP1::result_type
+    operator()() const {
+        return op1(op2());
+    }
+};
+
+/* convenience functions for the compose_f_g adapter
+ */
+template <class OP1, class OP2>
+inline compose_f_g_t<OP1,OP2>
+compose_f_g (const OP1& o1, const OP2& o2) {
+    return compose_f_g_t<OP1,OP2>(o1,o2);
+}
+
+} /* namespace boost */
+
+#endif /*BOOST_COMPOSE_HPP*/
diff --git a/boost/boost/compressed_pair.hpp b/boost/boost/compressed_pair.hpp
new file mode 100644 (file)
index 0000000..c55ca2d
--- /dev/null
@@ -0,0 +1,23 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version including documentation.
+//  See boost/detail/compressed_pair.hpp and boost/detail/ob_compressed_pair.hpp
+//  for full copyright notices.
+
+#ifndef BOOST_COMPRESSED_PAIR_HPP
+#define BOOST_COMPRESSED_PAIR_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/detail/ob_compressed_pair.hpp>
+#else
+#include <boost/detail/compressed_pair.hpp>
+#endif
+
+#endif // BOOST_COMPRESSED_PAIR_HPP
diff --git a/boost/boost/concept_archetype.hpp b/boost/boost/concept_archetype.hpp
new file mode 100644 (file)
index 0000000..de310fd
--- /dev/null
@@ -0,0 +1,688 @@
+//
+// (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.
+//
+// Revision History:
+//
+//   17 July  2001: Added const to some member functions. (Jeremy Siek) 
+//   05 May   2001: Removed static dummy_cons object. (Jeremy Siek)
+
+#ifndef BOOST_CONCEPT_ARCHETYPES_HPP
+#define BOOST_CONCEPT_ARCHETYPES_HPP
+
+#include <boost/config.hpp>
+#include <boost/iterator.hpp>
+#include <functional>
+
+namespace boost {
+
+  //===========================================================================
+  // Basic Archetype Classes
+
+  namespace detail {
+    class dummy_constructor { };
+  }
+
+  // A type that models no concept. The template parameter 
+  // is only there so that null_archetype types can be created
+  // that have different type.
+  template <class T = int>
+  class null_archetype {
+  private:
+    null_archetype() { }
+    null_archetype(const null_archetype&) { }
+    null_archetype& operator=(const null_archetype&) { return *this; }
+  public:
+    null_archetype(detail::dummy_constructor) { }
+#ifndef __MWERKS__
+    template <class TT>
+    friend void dummy_friend(); // just to avoid warnings
+#endif
+  };
+
+  // This is a helper class that provides a way to get a reference to
+  // an object. The get() function will never be called at run-time
+  // (nothing in this file will) so this seemingly very bad function
+  // is really quite innocent. The name of this class needs to be
+  // changed.
+  template <class T>
+  class static_object {
+  public:
+    static T& get() {
+     static char d[sizeof(T)];
+      return *reinterpret_cast<T*>(d);
+    }
+  };
+
+  template <class Base = null_archetype<> >
+  class default_constructible_archetype : public Base {
+  public:
+    default_constructible_archetype() 
+      : Base(static_object<detail::dummy_constructor>::get()) { }
+    default_constructible_archetype(detail::dummy_constructor x) : Base(x) { }
+  };
+
+  template <class Base = null_archetype<> >
+  class assignable_archetype : public Base {
+    assignable_archetype() { }
+    assignable_archetype(const assignable_archetype&) { }
+  public:
+    assignable_archetype& operator=(const assignable_archetype&) {
+      return *this;
+    }
+    assignable_archetype(detail::dummy_constructor x) : Base(x) { }
+  };
+
+  template <class Base = null_archetype<> >
+  class copy_constructible_archetype : public Base {
+  public:
+    copy_constructible_archetype() 
+      : Base(static_object<detail::dummy_constructor>::get()) { }
+    copy_constructible_archetype(const copy_constructible_archetype&)
+      : Base(static_object<detail::dummy_constructor>::get()) { }
+    copy_constructible_archetype(detail::dummy_constructor x) : Base(x) { }
+  };
+
+  template <class Base = null_archetype<> >
+  class sgi_assignable_archetype : public Base {
+  public:
+    sgi_assignable_archetype(const sgi_assignable_archetype&)
+      : Base(static_object<detail::dummy_constructor>::get()) { }
+    sgi_assignable_archetype& operator=(const sgi_assignable_archetype&) {
+      return *this;
+    }
+    sgi_assignable_archetype(const detail::dummy_constructor& x) : Base(x) { }
+  };
+
+  struct default_archetype_base {
+    default_archetype_base(detail::dummy_constructor) { }
+  };
+
+  // Careful, don't use same type for T and Base. That results in the
+  // conversion operator being invalid.  Since T is often
+  // null_archetype, can't use null_archetype for Base.
+  template <class T, class Base = default_archetype_base>
+  class convertible_to_archetype : public Base {
+  private:
+    convertible_to_archetype() { }
+    convertible_to_archetype(const convertible_to_archetype& ) { }
+    convertible_to_archetype& operator=(const convertible_to_archetype&)
+      { return *this; }
+  public:
+    convertible_to_archetype(detail::dummy_constructor x) : Base(x) { }
+    operator const T&() const { return static_object<T>::get(); }
+  };
+
+  template <class T, class Base = default_archetype_base>
+  class convertible_from_archetype : public Base {
+  private:
+    convertible_from_archetype() { }
+    convertible_from_archetype(const convertible_from_archetype& ) { }
+    convertible_from_archetype& operator=(const convertible_from_archetype&)
+      { return *this; }
+  public:
+    convertible_from_archetype(detail::dummy_constructor x) : Base(x) { }
+    convertible_from_archetype(const T&) { }
+    convertible_from_archetype& operator=(const T&)
+      { return *this; }
+  };
+
+  class boolean_archetype {
+  public:
+    boolean_archetype(const boolean_archetype&) { }
+    operator bool() const { return true; }
+    boolean_archetype(detail::dummy_constructor) { }
+  private:
+    boolean_archetype() { }
+    boolean_archetype& operator=(const boolean_archetype&) { return *this; }
+  };
+  
+  template <class Base = null_archetype<> >
+  class equality_comparable_archetype : public Base {
+  public:
+    equality_comparable_archetype(detail::dummy_constructor x) : Base(x) { }
+  };
+  template <class Base>
+  boolean_archetype
+  operator==(const equality_comparable_archetype<Base>&,
+             const equality_comparable_archetype<Base>&) 
+  { 
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+  template <class Base>
+  boolean_archetype
+  operator!=(const equality_comparable_archetype<Base>&,
+             const equality_comparable_archetype<Base>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+
+
+  template <class Base = null_archetype<> >
+  class equality_comparable2_first_archetype : public Base {
+  public:
+    equality_comparable2_first_archetype(detail::dummy_constructor x) 
+      : Base(x) { }
+  };
+  template <class Base = null_archetype<> >
+  class equality_comparable2_second_archetype : public Base {
+  public:
+    equality_comparable2_second_archetype(detail::dummy_constructor x) 
+      : Base(x) { }
+  };
+  template <class Base1, class Base2>
+  boolean_archetype
+  operator==(const equality_comparable2_first_archetype<Base1>&,
+             const equality_comparable2_second_archetype<Base2>&) 
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+  template <class Base1, class Base2>
+  boolean_archetype
+  operator!=(const equality_comparable2_first_archetype<Base1>&,
+             const equality_comparable2_second_archetype<Base2>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+
+
+  template <class Base = null_archetype<> >
+  class less_than_comparable_archetype : public Base {
+  public:
+    less_than_comparable_archetype(detail::dummy_constructor x) : Base(x) { }
+  };
+  template <class Base>
+  boolean_archetype
+  operator<(const less_than_comparable_archetype<Base>&,
+            const less_than_comparable_archetype<Base>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+
+
+
+  template <class Base = null_archetype<> >
+  class comparable_archetype : public Base {
+  public:
+    comparable_archetype(detail::dummy_constructor x) : Base(x) { }
+  };
+  template <class Base>
+  boolean_archetype
+  operator<(const comparable_archetype<Base>&,
+            const comparable_archetype<Base>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+  template <class Base>
+  boolean_archetype
+  operator<=(const comparable_archetype<Base>&,
+             const comparable_archetype<Base>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+  template <class Base>
+  boolean_archetype
+  operator>(const comparable_archetype<Base>&,
+            const comparable_archetype<Base>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+  template <class Base>
+  boolean_archetype
+  operator>=(const comparable_archetype<Base>&,
+             const comparable_archetype<Base>&)
+  {
+    return boolean_archetype(static_object<detail::dummy_constructor>::get());
+  }
+
+
+  // The purpose of the optags is so that one can specify
+  // exactly which types the operator< is defined between.
+  // This is useful for allowing the operations:
+  //
+  // A a; B b;
+  // a < b
+  // b < a
+  //
+  // without also allowing the combinations:
+  //
+  // a < a
+  // b < b
+  //
+  struct optag1 { };
+  struct optag2 { };
+  struct optag3 { };
+
+#define BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(OP, NAME) \
+  template <class Base = null_archetype<>, class Tag = optag1 > \
+  class NAME##_first_archetype : public Base { \
+  public: \
+    NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
+  }; \
+  \
+  template <class Base = null_archetype<>, class Tag = optag1 > \
+  class NAME##_second_archetype : public Base { \
+  public: \
+    NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
+  }; \
+  \
+  template <class BaseFirst, class BaseSecond, class Tag> \
+  boolean_archetype \
+  operator OP (const NAME##_first_archetype<BaseFirst, Tag>&, \
+               const NAME##_second_archetype<BaseSecond, Tag>&) \
+  { \
+   return boolean_archetype(static_object<detail::dummy_constructor>::get()); \
+  }
+
+  BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(==, equal_op)
+  BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(!=, not_equal_op)
+  BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(<, less_than_op)
+  BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(<=, less_equal_op)
+  BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(>, greater_than_op)
+  BOOST_DEFINE_BINARY_PREDICATE_ARCHETYPE(>=, greater_equal_op)
+
+#define BOOST_DEFINE_OPERATOR_ARCHETYPE(OP, NAME) \
+  template <class Base = null_archetype<> > \
+  class NAME##_archetype : public Base { \
+  public: \
+    NAME##_archetype(detail::dummy_constructor x) : Base(x) { } \
+    NAME##_archetype(const NAME##_archetype&)  \
+      : Base(static_object<detail::dummy_constructor>::get()) { } \
+    NAME##_archetype& operator=(const NAME##_archetype&) { return *this; } \
+  }; \
+  template <class Base> \
+  NAME##_archetype<Base> \
+  operator OP (const NAME##_archetype<Base>&,\
+               const NAME##_archetype<Base>&)  \
+  { \
+    return \
+     NAME##_archetype<Base>(static_object<detail::dummy_constructor>::get()); \
+  }
+
+  BOOST_DEFINE_OPERATOR_ARCHETYPE(+, addable)
+  BOOST_DEFINE_OPERATOR_ARCHETYPE(-, subtractable)
+  BOOST_DEFINE_OPERATOR_ARCHETYPE(*, multipliable)
+  BOOST_DEFINE_OPERATOR_ARCHETYPE(/, dividable)
+  BOOST_DEFINE_OPERATOR_ARCHETYPE(%, modable)
+
+  // As is, these are useless because of the return type.
+  // Need to invent a better way...
+#define BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(OP, NAME) \
+  template <class Return, class Base = null_archetype<> > \
+  class NAME##_first_archetype : public Base { \
+  public: \
+    NAME##_first_archetype(detail::dummy_constructor x) : Base(x) { } \
+  }; \
+  \
+  template <class Return, class Base = null_archetype<> > \
+  class NAME##_second_archetype : public Base { \
+  public: \
+    NAME##_second_archetype(detail::dummy_constructor x) : Base(x) { } \
+  }; \
+  \
+  template <class Return, class BaseFirst, class BaseSecond> \
+  Return \
+  operator OP (const NAME##_first_archetype<Return, BaseFirst>&, \
+               const NAME##_second_archetype<Return, BaseSecond>&) \
+  { \
+    return Return(static_object<detail::dummy_constructor>::get()); \
+  }
+
+  BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(+, plus_op)
+  BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(*, time_op)
+  BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(/, divide_op)
+  BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(-, subtract_op)
+  BOOST_DEFINE_BINARY_OPERATOR_ARCHETYPE(%, mod_op)
+
+  //===========================================================================
+  // Function Object Archetype Classes
+
+  template <class Return>
+  class generator_archetype {
+  public:
+    const Return& operator()() {
+      return static_object<Return>::get(); 
+    }
+  };
+
+  class void_generator_archetype {
+  public:
+    void operator()() { }
+  };
+
+  template <class Arg, class Return>
+  class unary_function_archetype {
+  private:
+    unary_function_archetype() { }
+  public:
+    unary_function_archetype(detail::dummy_constructor) { }
+    const Return& operator()(const Arg&) const {
+      return static_object<Return>::get(); 
+    }
+  };
+
+  template <class Arg1, class Arg2, class Return>
+  class binary_function_archetype {
+  private:
+    binary_function_archetype() { }
+  public:
+    binary_function_archetype(detail::dummy_constructor) { }
+    const Return& operator()(const Arg1&, const Arg2&) const {
+      return static_object<Return>::get(); 
+    }
+  };
+
+  template <class Arg>
+  class unary_predicate_archetype {
+    typedef boolean_archetype Return;
+    unary_predicate_archetype() { }
+  public:
+    unary_predicate_archetype(detail::dummy_constructor) { }
+    const Return& operator()(const Arg&) const {
+      return static_object<Return>::get(); 
+    }
+  };
+
+  template <class Arg1, class Arg2, class Base = null_archetype<> >
+  class binary_predicate_archetype {
+    typedef boolean_archetype Return;
+    binary_predicate_archetype() { }
+  public:
+    binary_predicate_archetype(detail::dummy_constructor) { }
+    const Return& operator()(const Arg1&, const Arg2&) const {
+      return static_object<Return>::get(); 
+    }
+  };
+
+  //===========================================================================
+  // Iterator Archetype Classes
+
+  template <class T>
+  struct input_proxy {
+    operator const T&() { return static_object<T>::get(); }
+  };
+  template <class T>
+  class trivial_iterator_archetype
+  {
+    typedef trivial_iterator_archetype self;
+  public:
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+    typedef T value_type;
+    typedef void reference;
+    typedef void pointer;
+    typedef void difference_type;
+    typedef void iterator_category;
+#endif
+    trivial_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    input_proxy<T> operator*() const { return input_proxy<T>(); }
+  };
+} // namespace boost
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+namespace std {
+  template <class T>
+  struct iterator_traits< boost::trivial_iterator_archetype<T> >
+  {
+    typedef T value_type;
+  };
+}
+#endif
+
+namespace boost {
+  template <class T>
+  struct input_output_proxy {
+    input_output_proxy<T>& operator=(const T&) { return *this; }
+    operator const T&() { return static_object<T>::get(); }
+  };
+  template <class T>
+  class mutable_trivial_iterator_archetype
+  {
+    typedef mutable_trivial_iterator_archetype self;
+  public:
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+    typedef T value_type;
+    typedef void reference;
+    typedef void pointer;
+    typedef void difference_type;
+    typedef void iterator_category;
+#endif
+    mutable_trivial_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    input_output_proxy<T> operator*() const { return input_output_proxy<T>(); }
+  };
+} // namespace boost
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+namespace std {
+  template <class T>
+  struct iterator_traits< boost::mutable_trivial_iterator_archetype<T> >
+  {
+    typedef T value_type;
+  };
+}
+#endif
+
+namespace boost {
+
+  template <class T>
+  class input_iterator_archetype
+  {
+  public:
+    typedef input_iterator_archetype self;
+  public:
+    typedef std::input_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef const T& reference;
+    typedef const T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    input_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+  };
+
+ template <class T>
+  struct output_proxy {
+    output_proxy& operator=(const T&) { return *this; }
+  };
+
+  template <class T>
+  class output_iterator_archetype
+  {
+  public:
+    typedef output_iterator_archetype self;
+  public:
+    typedef std::output_iterator_tag iterator_category;
+    typedef output_proxy<T> value_type;
+    typedef output_proxy<T> reference;
+    typedef void pointer;
+    typedef void difference_type;
+    output_iterator_archetype(const self&) { }
+    self& operator=(const self&) { return *this; }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return output_proxy<T>(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+  private:
+    output_iterator_archetype() { }
+  };
+
+  template <class T>
+  class forward_iterator_archetype
+  {
+  public:
+    typedef forward_iterator_archetype self;
+  public:
+    typedef std::forward_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef const T& reference;
+    typedef T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    forward_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+  };
+
+  template <class T>
+  class mutable_forward_iterator_archetype
+  {
+  public:
+    typedef mutable_forward_iterator_archetype self;
+  public:
+    typedef std::forward_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef T& reference;
+    typedef T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    mutable_forward_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+  };
+
+  template <class T>
+  class bidirectional_iterator_archetype
+  {
+  public:
+    typedef bidirectional_iterator_archetype self;
+  public:
+    typedef std::bidirectional_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef const T& reference;
+    typedef T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    bidirectional_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+    self& operator--() { return *this; }
+    self operator--(int) { return *this; }
+  };
+
+  template <class T>
+  class mutable_bidirectional_iterator_archetype
+  {
+  public:
+    typedef mutable_bidirectional_iterator_archetype self;
+  public:
+    typedef std::bidirectional_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef T& reference;
+    typedef T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    mutable_bidirectional_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+    self& operator--() { return *this; }
+    self operator--(int) { return *this; }
+  };
+
+  template <class T>
+  class random_access_iterator_archetype
+  {
+  public:
+    typedef random_access_iterator_archetype self;
+  public:
+    typedef std::random_access_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef const T& reference;
+    typedef T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    random_access_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+    self& operator--() { return *this; }
+    self operator--(int) { return *this; }
+    reference operator[](difference_type) const
+      { return static_object<T>::get(); }
+    self& operator+=(difference_type) { return *this; }
+    self& operator-=(difference_type) { return *this; }
+    difference_type operator-(const self&) const
+      { return difference_type(); }
+    self operator+(difference_type) const { return *this; }
+    self operator-(difference_type) const { return *this; }
+    bool operator<(const self&) const { return true; }
+    bool operator<=(const self&) const { return true; }
+    bool operator>(const self&) const { return true; }
+    bool operator>=(const self&) const { return true; }
+  };
+  template <class T>
+  random_access_iterator_archetype<T> 
+  operator+(typename random_access_iterator_archetype<T>::difference_type, 
+            const random_access_iterator_archetype<T>& x) 
+    { return x; }
+
+
+  template <class T>
+  class mutable_random_access_iterator_archetype
+  {
+  public:
+    typedef mutable_random_access_iterator_archetype self;
+  public:
+    typedef std::random_access_iterator_tag iterator_category;
+    typedef T value_type;
+    typedef T& reference;
+    typedef T* pointer;
+    typedef std::ptrdiff_t difference_type;
+    mutable_random_access_iterator_archetype() { }
+    self& operator=(const self&) { return *this;  }
+    bool operator==(const self&) const { return true; }
+    bool operator!=(const self&) const { return true; }
+    reference operator*() const { return static_object<T>::get(); }
+    self& operator++() { return *this; }
+    self operator++(int) { return *this; }
+    self& operator--() { return *this; }
+    self operator--(int) { return *this; }
+    reference operator[](difference_type) const
+      { return static_object<T>::get(); }
+    self& operator+=(difference_type) { return *this; }
+    self& operator-=(difference_type) { return *this; }
+    difference_type operator-(const self&) const
+      { return difference_type(); }
+    self operator+(difference_type) const { return *this; }
+    self operator-(difference_type) const { return *this; }
+    bool operator<(const self&) const { return true; }
+    bool operator<=(const self&) const { return true; }
+    bool operator>(const self&) const { return true; }
+    bool operator>=(const self&) const { return true; }
+  };
+  template <class T>
+  mutable_random_access_iterator_archetype<T> 
+  operator+
+    (typename mutable_random_access_iterator_archetype<T>::difference_type, 
+     const mutable_random_access_iterator_archetype<T>& x) 
+    { return x; }
+
+} // namespace boost
+
+#endif // BOOST_CONCEPT_ARCHETYPES_H
diff --git a/boost/boost/concept_check.hpp b/boost/boost/concept_check.hpp
new file mode 100644 (file)
index 0000000..882bd1d
--- /dev/null
@@ -0,0 +1,1036 @@
+//
+// (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.
+//
+// Revision History:
+//   05 May   2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
+//   02 April 2001: Removed limits header altogether. (Jeremy Siek)
+//   01 April 2001: Modified to use new <boost/limits.hpp> header. (JMaddock)
+//
+#ifndef BOOST_CONCEPT_CHECKS_HPP
+#define BOOST_CONCEPT_CHECKS_HPP
+
+#include <boost/config.hpp>
+#include <boost/iterator.hpp>
+#include <boost/type_traits/conversion_traits.hpp>
+#include <utility>
+#include <boost/type_traits/conversion_traits.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/type.hpp>
+
+
+#if defined(BOOST_MSVC) || defined(__BORLANDC__)
+#define BOOST_FPTR
+#else
+#define BOOST_FPTR &
+#endif
+
+namespace boost {
+
+/*
+  "inline" is used for ignore_unused_variable_warning()
+   and function_requires() to make sure there is no
+   overhead with g++.
+ */
+
+template <class T> inline void ignore_unused_variable_warning(const T&) { }
+
+// the unused, defaulted parameter is a workaround for MSVC and Compaq C++
+template <class Concept>
+inline void function_requires(type<Concept>* = 0)
+{
+#if !defined(NDEBUG)
+  void (Concept::*x)() = BOOST_FPTR Concept::constraints;
+  ignore_unused_variable_warning(x);
+#endif
+}
+
+// The BOOST_CLASS_REQUIRES macros use function pointers as
+// template parameters, which VC++ does not support.
+
+#if defined(BOOST_NO_FUNCTION_PTR_TEMPLATE_PARAMETERS)
+
+#define BOOST_CLASS_REQUIRES(type_var, concept)
+#define BOOST_CLASS_REQUIRES2(type_var1, type_var2, concept)
+#define BOOST_CLASS_REQUIRES3(type_var1, type_var2, type_var3, concept)
+#define BOOST_CLASS_REQUIRES4(type_var1, type_var2, type_var3, type_var4, concept)
+
+#else
+
+#define BOOST_CLASS_REQUIRES(type_var, concept) \
+  typedef void (concept <type_var>::* func##type_var##concept)(); \
+  template <func##type_var##concept _Tp1> \
+  struct concept_checking_##type_var##concept { }; \
+  typedef concept_checking_##type_var##concept< \
+    BOOST_FPTR concept <type_var>::constraints> \
+    concept_checking_typedef_##type_var##concept
+
+#define BOOST_CLASS_REQUIRES2(type_var1, type_var2, concept) \
+  typedef void (concept <type_var1,type_var2>::* func##type_var1##type_var2##concept)(); \
+  template <func##type_var1##type_var2##concept _Tp1> \
+  struct concept_checking_##type_var1##type_var2##concept { }; \
+  typedef concept_checking_##type_var1##type_var2##concept< \
+    BOOST_FPTR concept <type_var1,type_var2>::constraints> \
+    concept_checking_typedef_##type_var1##type_var2##concept
+
+#define BOOST_CLASS_REQUIRES3(type_var1, type_var2, type_var3, concept) \
+  typedef void (concept <type_var1,type_var2,type_var3>::* func##type_var1##type_var2##type_var3##concept)(); \
+  template <func##type_var1##type_var2##type_var3##concept _Tp1> \
+  struct concept_checking_##type_var1##type_var2##type_var3##concept { }; \
+  typedef concept_checking_##type_var1##type_var2##type_var3##concept< \
+    BOOST_FPTR concept <type_var1,type_var2,type_var3>::constraints>  \
+  concept_checking_typedef_##type_var1##type_var2##type_var3##concept
+
+#define BOOST_CLASS_REQUIRES4(type_var1, type_var2, type_var3, type_var4, concept) \
+  typedef void (concept <type_var1,type_var2,type_var3,type_var4>::* func##type_var1##type_var2##type_var3##type_var4##concept)(); \
+  template <func##type_var1##type_var2##type_var3##type_var4##concept _Tp1> \
+  struct concept_checking_##type_var1##type_var2##type_var3##type_var4##concept { }; \
+  typedef concept_checking_##type_var1##type_var2##type_var3##type_var4##concept< \
+    BOOST_FPTR concept <type_var1,type_var2,type_var3,type_var4>::constraints>  \
+    concept_checking_typedef_##type_var1##type_var2##type_var3##type_var4##concept
+
+
+#endif
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <class T, class U>
+struct require_same { };
+
+template <class T>
+struct require_same<T,T> { typedef T type; };
+#else
+// This version does not perform checking, but will not do any harm.
+template <class T, class U>
+struct require_same { typedef T type; };
+#endif
+
+  template <class T>
+  struct IntegerConcept {
+    void constraints() { 
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+      x.error_type_must_be_an_integer_type();
+#endif      
+    }
+    T x;
+  };
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <> struct IntegerConcept<short> { void constraints() {} };
+  template <> struct IntegerConcept<unsigned short> { void constraints() {} };
+  template <> struct IntegerConcept<int> { void constraints() {} };
+  template <> struct IntegerConcept<unsigned int> { void constraints() {} };
+  template <> struct IntegerConcept<long> { void constraints() {} };
+  template <> struct IntegerConcept<unsigned long> { void constraints() {} };
+  // etc.
+#endif      
+
+  template <class T>
+  struct SignedIntegerConcept {
+    void constraints() { 
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+      x.error_type_must_be_a_signed_integer_type();
+#endif      
+    }
+    T x;
+  };
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <> struct SignedIntegerConcept<short> { void constraints() {} };
+  template <> struct SignedIntegerConcept<int> { void constraints() {} };
+  template <> struct SignedIntegerConcept<long> { void constraints() {} };
+# if defined(BOOST_HAS_LONG_LONG)
+  template <> struct SignedIntegerConcept<long long> { void constraints() {} };
+# endif
+  // etc.
+#endif      
+
+  template <class T>
+  struct UnsignedIntegerConcept {
+    void constraints() { 
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+      x.error_type_must_be_an_unsigned_integer_type();
+#endif      
+    }
+    T x;
+  };
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <> struct UnsignedIntegerConcept<unsigned short>
+    { void constraints() {} };
+  template <> struct UnsignedIntegerConcept<unsigned int>
+    { void constraints() {} };
+  template <> struct UnsignedIntegerConcept<unsigned long>
+    { void constraints() {} };
+  // etc.
+#endif      
+
+  //===========================================================================
+  // Basic Concepts
+
+  template <class TT>
+  struct DefaultConstructibleConcept
+  {
+    void constraints() {
+      TT a;               // require default constructor
+      ignore_unused_variable_warning(a);
+    }
+  };
+
+  template <class TT>
+  struct AssignableConcept
+  {
+    void constraints() {
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+      a = a;              // require assignment operator
+#endif
+      const_constraints(a);
+    }
+    void const_constraints(const TT& b) {
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+      a = b;              // const required for argument to assignment
+#endif
+    }
+    TT a;
+  };
+
+  template <class TT>
+  struct CopyConstructibleConcept
+  {
+    void constraints() {
+      TT a(b);            // require copy constructor
+      TT* ptr = &a;       // require address of operator
+      const_constraints(a);
+      ignore_unused_variable_warning(ptr);
+    }
+    void const_constraints(const TT& a) {
+      TT c(a);            // require const copy constructor
+      const TT* ptr = &a; // require const address of operator
+      ignore_unused_variable_warning(c);
+      ignore_unused_variable_warning(ptr);
+    }
+    TT b;
+  };
+
+  // The SGI STL version of Assignable requires copy constructor and operator=
+  template <class TT>
+  struct SGIAssignableConcept
+  {
+    void constraints() {
+      TT b(a);
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+      a = a;              // require assignment operator
+#endif
+      const_constraints(a);
+      ignore_unused_variable_warning(b);
+    }
+    void const_constraints(const TT& b) {
+      TT c(b);
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+      a = b;              // const required for argument to assignment
+#endif
+      ignore_unused_variable_warning(c);
+    }
+    TT a;
+  };
+
+  template <class X, class Y>
+  struct ConvertibleConcept
+  {
+    void constraints() {
+      Y y = x;
+      ignore_unused_variable_warning(y);
+    }
+    X x;
+  };
+
+  // The C++ standard requirements for many concepts talk about return
+  // types that must be "convertible to bool".  The problem with this
+  // requirement is that it leaves the door open for evil proxies that
+  // define things like operator|| with strange return types.  Two
+  // possible solutions are:
+  // 1) require the return type to be exactly bool
+  // 2) stay with convertible to bool, and also
+  //    specify stuff about all the logical operators.
+  // For now we just test for convertible to bool.
+  template <class TT>
+  void require_boolean_expr(const TT& t) {
+    bool x = t;
+    ignore_unused_variable_warning(x);
+  }
+
+  template <class TT>
+  struct EqualityComparableConcept
+  {
+    void constraints() {
+      require_boolean_expr(a == b);
+      require_boolean_expr(a != b);
+    }
+    TT a, b;
+  };
+
+  template <class TT>
+  struct LessThanComparableConcept
+  {
+    void constraints() {
+      require_boolean_expr(a < b);
+    }
+    TT a, b;
+  };
+
+  // This is equivalent to SGI STL's LessThanComparable.
+  template <class TT>
+  struct ComparableConcept
+  {
+    void constraints() {
+      require_boolean_expr(a < b);
+      require_boolean_expr(a > b);
+      require_boolean_expr(a <= b);
+      require_boolean_expr(a >= b);
+    }
+    TT a, b;
+  };
+
+#define BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(OP,NAME) \
+  template <class First, class Second> \
+  struct NAME { \
+    void constraints() { (void)constraints_(); } \
+    bool constraints_() {  \
+      return  a OP b; \
+    } \
+    First a; \
+    Second b; \
+  }
+
+#define BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(OP,NAME) \
+  template <class Ret, class First, class Second> \
+  struct NAME { \
+    void constraints() { (void)constraints_(); } \
+    Ret constraints_() {  \
+      return a OP b; \
+    } \
+    First a; \
+    Second b; \
+  }
+
+  BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, EqualOpConcept);
+  BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, NotEqualOpConcept);
+  BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, LessThanOpConcept);
+  BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, LessEqualOpConcept);
+  BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, GreaterThanOpConcept);
+  BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, GreaterEqualOpConcept);
+
+  BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, PlusOpConcept);
+  BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, TimesOpConcept);
+  BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, DivideOpConcept);
+  BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, SubtractOpConcept);
+  BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, ModOpConcept);
+
+  //===========================================================================
+  // Function Object Concepts
+
+  template <class Func, class Return>
+  struct GeneratorConcept
+  {
+    void constraints() {
+      const Return& r = f();   // require operator() member function
+      ignore_unused_variable_warning(r);
+    }
+    Func f;
+  };
+
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <class Func>
+  struct GeneratorConcept<Func,void>
+  {
+    void constraints() {
+      f();              // require operator() member function
+    }
+    Func f;
+  };
+#endif
+
+  template <class Func, class Return, class Arg>
+  struct UnaryFunctionConcept
+  {
+    // required in case any of our template args are const-qualified:
+    UnaryFunctionConcept();
+    
+    void constraints() {
+      r = f(arg); // require operator()
+    }
+    Func f;
+    Arg arg;
+    Return r;
+  };
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <class Func, class Arg>
+  struct UnaryFunctionConcept<Func, void, Arg> {
+    void constraints() { 
+      f(arg);                 // require operator()
+    }
+    Func f;
+    Arg arg;
+  };
+#endif
+
+  template <class Func, class Return, class First, class Second>
+  struct BinaryFunctionConcept
+  {
+    void constraints() { 
+      r = f(first, second); // require operator()
+    }
+    Func f;
+    First first;
+    Second second;
+    Return r;
+  };
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <class Func, class First, class Second>
+  struct BinaryFunctionConcept<Func, void, First, Second>
+  {
+    void constraints() {
+      f(first, second); // require operator()
+    }
+    Func f;
+    First first;
+    Second second;
+  };
+#endif
+
+  template <class Func, class Arg>
+  struct UnaryPredicateConcept
+  {
+    void constraints() {
+      require_boolean_expr(f(arg)); // require operator() returning bool
+    }
+    Func f;
+    Arg arg;
+  };
+
+  template <class Func, class First, class Second>
+  struct BinaryPredicateConcept
+  {
+    void constraints() {
+      require_boolean_expr(f(a, b)); // require operator() returning bool
+    }
+    Func f;
+    First a;
+    Second b;
+  };
+
+  // use this when functor is used inside a container class like std::set
+  template <class Func, class First, class Second>
+  struct Const_BinaryPredicateConcept {
+    void constraints() { 
+      const_constraints(f);
+    }
+    void const_constraints(const Func& fun) {
+      function_requires<BinaryPredicateConcept<Func, First, Second> >();
+      // operator() must be a const member function
+      require_boolean_expr(fun(a, b));
+    }
+    Func f;
+    First a;
+    Second b;
+  };
+
+  template <class Func, class Return>
+  struct AdaptableGeneratorConcept
+  {
+    void constraints() {
+      typedef typename Func::result_type result_type;
+      BOOST_STATIC_ASSERT((is_convertible<result_type, Return>::value));
+      function_requires< GeneratorConcept<Func, result_type> >();
+    }
+  };
+
+  template <class Func, class Return, class Arg>
+  struct AdaptableUnaryFunctionConcept
+  {
+    void constraints() {
+      typedef typename Func::argument_type argument_type;
+      typedef typename Func::result_type result_type;
+      BOOST_STATIC_ASSERT((is_convertible<result_type, Return>::value));
+      BOOST_STATIC_ASSERT((is_convertible<Arg, argument_type>::value));
+      function_requires< UnaryFunctionConcept<Func, result_type, argument_type> >();
+    }
+  };
+
+  template <class Func, class Return, class First, class Second>
+  struct AdaptableBinaryFunctionConcept
+  {
+    void constraints() {
+      typedef typename Func::first_argument_type first_argument_type;
+      typedef typename Func::second_argument_type second_argument_type;
+      typedef typename Func::result_type result_type;
+      BOOST_STATIC_ASSERT((is_convertible<result_type, Return>::value));
+      BOOST_STATIC_ASSERT((is_convertible<First, first_argument_type>::value));
+      BOOST_STATIC_ASSERT((is_convertible<Second, second_argument_type>::value));
+      function_requires< BinaryFunctionConcept<Func, result_type, 
+        first_argument_type, second_argument_type> >();
+    }
+  };
+
+  template <class Func, class Arg>
+  struct AdaptablePredicateConcept
+  {
+    void constraints() {
+      function_requires< UnaryPredicateConcept<Func, Arg> >();
+      function_requires< AdaptableUnaryFunctionConcept<Func, bool, Arg> >();
+    }
+  };
+
+  template <class Func, class First, class Second>
+  struct AdaptableBinaryPredicateConcept
+  {
+    void constraints() {
+      function_requires< BinaryPredicateConcept<Func, First, Second> >();
+      function_requires< AdaptableBinaryFunctionConcept<Func, bool, First, Second> >();
+    }
+  };
+
+  //===========================================================================
+  // Iterator Concepts
+
+  template <class TT>
+  struct TrivialIteratorConcept
+  {
+    void constraints() {
+      function_requires< AssignableConcept<TT> >();
+      function_requires< DefaultConstructibleConcept<TT> >();
+      function_requires< EqualityComparableConcept<TT> >();
+      (void)*i;           // require dereference operator
+    }
+    TT i;
+  };
+
+  template <class TT>
+  struct Mutable_TrivialIteratorConcept
+  {
+    void constraints() {
+      function_requires< TrivialIteratorConcept<TT> >();
+      *i = *j;            // require dereference and assignment
+    }
+    TT i, j;
+  };
+
+  template <class TT>
+  struct InputIteratorConcept
+  {
+    void constraints() {
+      function_requires< TrivialIteratorConcept<TT> >();
+      // require iterator_traits typedef's
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+      typedef typename std::iterator_traits<TT>::difference_type D;
+      // Hmm, the following is a bit fragile
+      //function_requires< SignedIntegerConcept<D> >();
+      typedef typename std::iterator_traits<TT>::reference R;
+      typedef typename std::iterator_traits<TT>::pointer P;
+      typedef typename std::iterator_traits<TT>::iterator_category C;
+      function_requires< ConvertibleConcept<C, std::input_iterator_tag> >();
+#endif
+      ++i;                // require preincrement operator
+      i++;                // require postincrement operator
+    }
+    TT i;
+  };
+
+  template <class TT, class ValueT>
+  struct OutputIteratorConcept
+  {
+    void constraints() {
+      function_requires< AssignableConcept<TT> >();
+      ++i;                // require preincrement operator
+      i++;                // require postincrement operator
+      *i++ = t;           // require postincrement and assignment
+    }
+    TT i, j;
+    ValueT t;
+  };
+
+  template <class TT>
+  struct ForwardIteratorConcept
+  {
+    void constraints() {
+      function_requires< InputIteratorConcept<TT> >();
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+      typedef typename std::iterator_traits<TT>::iterator_category C;
+      function_requires< ConvertibleConcept<C, std::forward_iterator_tag> >();
+      typedef typename std::iterator_traits<TT>::reference reference;
+      reference r = *i;
+      ignore_unused_variable_warning(r);
+#endif
+    }
+    TT i;
+  };
+
+  template <class TT>
+  struct Mutable_ForwardIteratorConcept
+  {
+    void constraints() {
+      function_requires< ForwardIteratorConcept<TT> >();
+      *i++ = *i;         // require postincrement and assignment
+    }
+    TT i;
+  };
+
+  template <class TT>
+  struct BidirectionalIteratorConcept
+  {
+    void constraints() {
+      function_requires< ForwardIteratorConcept<TT> >();
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+      typedef typename std::iterator_traits<TT>::iterator_category C;
+      function_requires< ConvertibleConcept<C, 
+        std::bidirectional_iterator_tag> >();
+#endif
+      --i;                // require predecrement operator
+      i--;                // require postdecrement operator
+    }
+    TT i;
+  };
+
+  template <class TT>
+  struct Mutable_BidirectionalIteratorConcept
+  {
+    void constraints() {
+      function_requires< BidirectionalIteratorConcept<TT> >();
+      function_requires< Mutable_ForwardIteratorConcept<TT> >();
+      *i-- = *i;                  // require postdecrement and assignment
+    }
+    TT i;
+  };
+
+
+  template <class TT>
+  struct RandomAccessIteratorConcept
+  {
+    void constraints() {
+      function_requires< BidirectionalIteratorConcept<TT> >();
+      function_requires< ComparableConcept<TT> >();
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+      typedef typename std::iterator_traits<TT>::iterator_category C;
+      function_requires< ConvertibleConcept< C,
+        std::random_access_iterator_tag> >();
+      typedef typename std::iterator_traits<TT>::reference R;
+#endif
+
+      i += n;             // require assignment addition operator
+      i = i + n; i = n + i; // require addition with difference type
+      i -= n;             // require assignment subtraction operator
+      i = i - n;                  // require subtraction with difference type
+      n = i - j;                  // require difference operator
+      (void)i[n];                 // require element access operator
+    }
+    TT a, b;
+    TT i, j;
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+    typename std::iterator_traits<TT>::difference_type n;
+#else
+    std::ptrdiff_t n;
+#endif
+  };
+
+  template <class TT>
+  struct Mutable_RandomAccessIteratorConcept
+  {
+    void constraints() {
+      function_requires< RandomAccessIteratorConcept<TT> >();
+      function_requires< Mutable_BidirectionalIteratorConcept<TT> >();
+      i[n] = *i;                  // require element access and assignment
+    }
+    TT i;
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
+    typename std::iterator_traits<TT>::difference_type n;
+#else
+    std::ptrdiff_t n;
+#endif
+  };
+
+  //===========================================================================
+  // Container Concepts
+
+  template <class Container>
+  struct ContainerConcept
+  {
+    typedef typename Container::value_type value_type;
+    typedef typename Container::difference_type difference_type;
+    typedef typename Container::size_type size_type;
+    typedef typename Container::const_reference const_reference;
+    typedef typename Container::const_pointer const_pointer;
+    typedef typename Container::const_iterator const_iterator;
+
+    void constraints() {
+      function_requires< InputIteratorConcept<const_iterator> >();
+      function_requires< AssignableConcept<Container> >();
+      const_constraints(c);
+    }
+    void const_constraints(const Container& c) {
+      i = c.begin();
+      i = c.end();
+      n = c.size();
+      n = c.max_size();
+      b = c.empty();
+    }
+    Container c;
+    bool b;
+    const_iterator i;
+    size_type n;
+  };
+
+  template <class Container>
+  struct Mutable_ContainerConcept
+  {
+    typedef typename Container::value_type value_type;
+    typedef typename Container::reference reference;
+    typedef typename Container::iterator iterator;
+    typedef typename Container::pointer pointer;
+    
+    void constraints() {
+      function_requires< ContainerConcept<Container> >();
+      function_requires< AssignableConcept<value_type> >();
+      function_requires< InputIteratorConcept<iterator> >();
+
+      i = c.begin();
+      i = c.end();
+      c.swap(c2);
+    }
+    iterator i;
+    Container c, c2;
+  };
+
+  template <class ForwardContainer>
+  struct ForwardContainerConcept
+  {
+    void constraints() {
+      function_requires< ContainerConcept<ForwardContainer> >();
+      typedef typename ForwardContainer::const_iterator const_iterator;
+      function_requires< ForwardIteratorConcept<const_iterator> >();
+    }
+  };  
+
+  template <class ForwardContainer>
+  struct Mutable_ForwardContainerConcept
+  {
+    void constraints() {
+      function_requires< ForwardContainerConcept<ForwardContainer> >();
+      function_requires< Mutable_ContainerConcept<ForwardContainer> >();
+      typedef typename ForwardContainer::iterator iterator;
+      function_requires< Mutable_ForwardIteratorConcept<iterator> >();
+    }
+  };  
+
+  template <class ReversibleContainer>
+  struct ReversibleContainerConcept
+  {
+    typedef typename ReversibleContainer::const_iterator const_iterator;
+    typedef typename ReversibleContainer::const_reverse_iterator
+      const_reverse_iterator;
+
+    void constraints() {
+      function_requires< ForwardContainerConcept<ReversibleContainer> >();
+      function_requires< BidirectionalIteratorConcept<const_iterator> >();
+      function_requires< 
+        BidirectionalIteratorConcept<const_reverse_iterator> >();
+      const_constraints(c);
+    }
+    void const_constraints(const ReversibleContainer& c) {
+      const_reverse_iterator i = c.rbegin();
+      i = c.rend();
+    }
+    ReversibleContainer c;
+  };
+
+  template <class ReversibleContainer>
+  struct Mutable_ReversibleContainerConcept
+  {
+    typedef typename ReversibleContainer::iterator iterator;
+    typedef typename ReversibleContainer::reverse_iterator reverse_iterator;
+
+    void constraints() {
+      function_requires< ReversibleContainerConcept<ReversibleContainer> >();
+      function_requires<
+        Mutable_ForwardContainerConcept<ReversibleContainer> >();
+      function_requires< Mutable_BidirectionalIteratorConcept<iterator> >();
+      function_requires<
+        Mutable_BidirectionalIteratorConcept<reverse_iterator> >();
+
+      reverse_iterator i = c.rbegin();
+      i = c.rend();
+    }
+    ReversibleContainer c;
+  };
+
+  template <class RandomAccessContainer>
+  struct RandomAccessContainerConcept
+  {
+    typedef typename RandomAccessContainer::size_type size_type;
+    typedef typename RandomAccessContainer::const_reference const_reference;
+    typedef typename RandomAccessContainer::const_iterator const_iterator;
+    typedef typename RandomAccessContainer::const_reverse_iterator
+      const_reverse_iterator;
+
+    void constraints() {
+      function_requires< ReversibleContainerConcept<RandomAccessContainer> >();
+      function_requires< RandomAccessIteratorConcept<const_iterator> >();
+      function_requires<
+        RandomAccessIteratorConcept<const_reverse_iterator> >();
+
+      const_constraints(c);
+    }
+    void const_constraints(const RandomAccessContainer& c) {
+      const_reference r = c[n];
+      ignore_unused_variable_warning(r);
+    }
+    RandomAccessContainer c;
+    size_type n;
+  };
+
+  template <class RandomAccessContainer>
+  struct Mutable_RandomAccessContainerConcept
+  {
+    typedef typename RandomAccessContainer::size_type size_type;
+    typedef typename RandomAccessContainer::reference reference;
+    typedef typename RandomAccessContainer::iterator iterator;
+    typedef typename RandomAccessContainer::reverse_iterator reverse_iterator;
+
+    void constraints() {
+      function_requires<
+        RandomAccessContainerConcept<RandomAccessContainer> >();
+      function_requires<
+        Mutable_ReversibleContainerConcept<RandomAccessContainer> >();
+      function_requires< Mutable_RandomAccessIteratorConcept<iterator> >();
+      function_requires<
+        Mutable_RandomAccessIteratorConcept<reverse_iterator> >();
+
+      reference r = c[i];
+      ignore_unused_variable_warning(r);
+    }
+    size_type i;
+    RandomAccessContainer c;
+  };
+
+  // A Sequence is inherently mutable
+  template <class Sequence>
+  struct SequenceConcept
+  {
+
+    typedef typename Sequence::reference reference;
+    typedef typename Sequence::const_reference const_reference;
+
+    void constraints() {
+      // Matt Austern's book puts DefaultConstructible here, the C++
+      // standard places it in Container
+      //    function_requires< DefaultConstructible<Sequence> >();
+      function_requires< Mutable_ForwardContainerConcept<Sequence> >();
+      function_requires< DefaultConstructibleConcept<Sequence> >();
+
+      Sequence 
+        c(n),
+        c2(n, t),
+        c3(first, last);
+
+      c.insert(p, t);
+      c.insert(p, n, t);
+      c.insert(p, first, last);
+
+      c.erase(p);
+      c.erase(p, q);
+
+      reference r = c.front();
+
+      ignore_unused_variable_warning(c);
+      ignore_unused_variable_warning(c2);
+      ignore_unused_variable_warning(c3);
+      ignore_unused_variable_warning(r);
+      const_constraints(c);
+    }
+    void const_constraints(const Sequence& c) {
+      const_reference r = c.front();
+      ignore_unused_variable_warning(r);
+    }
+    typename Sequence::value_type t;
+    typename Sequence::size_type n;
+    typename Sequence::value_type* first, *last;
+    typename Sequence::iterator p, q;
+  };
+
+  template <class FrontInsertionSequence>
+  struct FrontInsertionSequenceConcept
+  {
+    void constraints() {
+      function_requires< SequenceConcept<FrontInsertionSequence> >();
+
+      c.push_front(t);
+      c.pop_front();
+    }
+    FrontInsertionSequence c;
+    typename FrontInsertionSequence::value_type t;
+  };
+
+  template <class BackInsertionSequence>
+  struct BackInsertionSequenceConcept
+  {
+    typedef typename BackInsertionSequence::reference reference;
+    typedef typename BackInsertionSequence::const_reference const_reference;
+
+    void constraints() {
+      function_requires< SequenceConcept<BackInsertionSequence> >();
+
+      c.push_back(t);
+      c.pop_back();
+      reference r = c.back();
+      ignore_unused_variable_warning(r);
+    }
+    void const_constraints(const BackInsertionSequence& c) {
+      const_reference r = c.back();
+      ignore_unused_variable_warning(r);
+    };
+    BackInsertionSequence c;
+    typename BackInsertionSequence::value_type t;
+  };
+
+  template <class AssociativeContainer>
+  struct AssociativeContainerConcept
+  {
+    void constraints() {
+      function_requires< ForwardContainerConcept<AssociativeContainer> >();
+      function_requires< DefaultConstructibleConcept<AssociativeContainer> >();
+    
+      i = c.find(k);
+      r = c.equal_range(k);
+      c.erase(k);
+      c.erase(i);
+      c.erase(r.first, r.second);
+      const_constraints(c);
+    }
+    void const_constraints(const AssociativeContainer& c) {
+      ci = c.find(k);
+      n = c.count(k);
+      cr = c.equal_range(k);
+    }
+    typedef typename AssociativeContainer::iterator iterator;
+    typedef typename AssociativeContainer::const_iterator const_iterator;
+
+    AssociativeContainer c;
+    iterator i;
+    std::pair<iterator,iterator> r;
+    const_iterator ci;
+    std::pair<const_iterator,const_iterator> cr;
+    typename AssociativeContainer::key_type k;
+    typename AssociativeContainer::size_type n;
+  };
+
+  template <class UniqueAssociativeContainer>
+  struct UniqueAssociativeContainerConcept
+  {
+    void constraints() {
+      function_requires< AssociativeContainerConcept<UniqueAssociativeContainer> >();
+    
+      UniqueAssociativeContainer c(first, last);
+      
+      pos_flag = c.insert(t);
+      c.insert(first, last);
+
+      ignore_unused_variable_warning(c);
+    }
+    std::pair<typename UniqueAssociativeContainer::iterator, bool> pos_flag;
+    typename UniqueAssociativeContainer::value_type t;
+    typename UniqueAssociativeContainer::value_type* first, *last;
+  };
+
+  template <class MultipleAssociativeContainer>
+  struct MultipleAssociativeContainerConcept
+  {
+    void constraints() {
+      function_requires< AssociativeContainerConcept<MultipleAssociativeContainer> >();
+
+      MultipleAssociativeContainer c(first, last);
+      
+      pos = c.insert(t);
+      c.insert(first, last);
+
+      ignore_unused_variable_warning(c);
+      ignore_unused_variable_warning(pos);
+    }
+    typename MultipleAssociativeContainer::iterator pos;
+    typename MultipleAssociativeContainer::value_type t;
+    typename MultipleAssociativeContainer::value_type* first, *last;
+  };
+
+  template <class SimpleAssociativeContainer>
+  struct SimpleAssociativeContainerConcept
+  {
+    void constraints() {
+      function_requires< AssociativeContainerConcept<SimpleAssociativeContainer> >();
+      typedef typename SimpleAssociativeContainer::key_type key_type;
+      typedef typename SimpleAssociativeContainer::value_type value_type;
+      typedef typename require_same<key_type, value_type>::type req;
+    }
+  };
+
+  template <class SimpleAssociativeContainer>
+  struct PairAssociativeContainerConcept
+  {
+    void constraints() {
+      function_requires< AssociativeContainerConcept<SimpleAssociativeContainer> >();
+      typedef typename SimpleAssociativeContainer::key_type key_type;
+      typedef typename SimpleAssociativeContainer::value_type value_type;
+      typedef typename SimpleAssociativeContainer::mapped_type mapped_type;
+      typedef std::pair<const key_type, mapped_type> required_value_type;
+      typedef typename require_same<value_type, required_value_type>::type req;
+    }
+  };
+
+  template <class SortedAssociativeContainer>
+  struct SortedAssociativeContainerConcept
+  {
+    void constraints() {
+      function_requires< AssociativeContainerConcept<SortedAssociativeContainer> >();
+      function_requires< ReversibleContainerConcept<SortedAssociativeContainer> >();
+
+      SortedAssociativeContainer 
+        c(kc),
+        c2(first, last),
+        c3(first, last, kc);
+
+      p = c.upper_bound(k);
+      p = c.lower_bound(k);
+      r = c.equal_range(k);
+      
+      c.insert(p, t);
+      
+      ignore_unused_variable_warning(c);
+      ignore_unused_variable_warning(c2);
+      ignore_unused_variable_warning(c3);
+    }
+    void const_constraints(const SortedAssociativeContainer& c) {
+      kc = c.key_comp();
+      vc = c.value_comp();
+
+      cp = c.upper_bound(k);
+      cp = c.lower_bound(k);
+      cr = c.equal_range(k);
+    }
+    typename SortedAssociativeContainer::key_compare kc;
+    typename SortedAssociativeContainer::value_compare vc;
+    typename SortedAssociativeContainer::value_type t;
+    typename SortedAssociativeContainer::key_type k;
+    typedef typename SortedAssociativeContainer::iterator iterator;
+    typedef typename SortedAssociativeContainer::const_iterator const_iterator;
+    iterator p;
+    const_iterator cp;
+    std::pair<iterator,iterator> r;
+    std::pair<const_iterator,const_iterator> cr;
+    typename SortedAssociativeContainer::value_type* first, *last;
+  };
+
+  // HashedAssociativeContainer
+
+} // namespace boost
+
+#endif // BOOST_CONCEPT_CHECKS_HPP
+
index b942095395c79c1f8dbe261547903cf290bacc18..5b53b68590699da04376e60fb205fe05ea6e158e 100644 (file)
@@ -1,6 +1,6 @@
 //  Boost config.hpp configuration header file  ------------------------------//
 
-//  (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and
+//  (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.
 
 //  Boost config.hpp policy and rationale documentation has been moved to
 //  http://www.boost.org/libs/config
-
-//  Revision History (excluding minor changes for specific compilers)
-//   29 Mar 01  BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS (Daryle Walker)
-//   16 Mar 01  Added BOOST_VERSION (Jens Maurer)
-//   06 Mar 01  Refactored EDG checks for Intel C++ (Dave Abrahams)
-//   04 Mar 01  Factored EDG checks, added BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-//              for Intel C++ 5.0 (Dave Abrahams)
-//   17 Feb 01  BOOST_NO_CV_SPECIALIZATIONS
-//              BOOST_NO_CV_VOID_SPECIALIZATIONS (John Maddock)
-//   11 Feb 01  Added BOOST_STATIC_CONSTANT (Dave Abrahams)
-//   20 Jan 01  BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS moved here from
-//              cast.hpp. Added missing BOOST_NO_STRINGSTREAM which some
-//              boost code seemed to depend on. (Dave Abrahams)
-//   13 Jan 01  SGI MIPSpro and Compaq Tru64 Unix compiler support added
-//              (Jens Maurer)
-//   13 Jan 01  BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP (Jens Maurer)
-//   17 Nov 00  BOOST_NO_AUTO_PTR (John Maddock)
-//    4 Oct 00  BOOST_NO_STD_MIN_MAX (Jeremy Siek)
-//   29 Sep 00  BOOST_NO_INTEGRAL_INT64_T (Jens Maurer)
-//   25 Sep 00  BOOST_NO_STD_ALLOCATOR (Jeremy Siek)
-//   18 SEP 00  BOOST_NO_SLIST, BOOST_NO_HASH, 
-//              BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
-//              BOOST_NO_LIMITS (Jeremy Siek)
-//    1 Sep 00  BOOST_NO_PRIVATE_IN_AGGREGATE added. (Mark Rodgers)
-//   23 Jul 00  Fixed spelling of BOOST_NO_INCLASS_MEMBER_INITIALIZATION in
-//              comment (Dave Abrahams). 
-//   10 Jul 00  BOOST_NO_POINTER_TO_MEMBER_CONST added (Mark Rodgers)
-//   26 Jun 00  BOOST_NO_STD_ITERATOR, BOOST_MSVC_STD_ITERATOR,
-//              BOOST_NO_STD_ITERATOR_TRAITS, BOOST_NO_USING_TEMPLATE,
-//              added (Jeremy Siek)
-//   20 Jun 00  BOOST_MSVC added (Aleksey Gurtovoy)
-//   14 Jun 00  BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS (Jens M.)
-//   22 Mar 00  BOOST_MSVC6_MEMBER_TEMPLATES added (Dave Abrahams)
-//   18 Feb 00  BOOST_NO_INCLASS_MEMBER_INITIALIZATION added (Jens Maurer)
-//   26 Jan 00  Borland compiler support added (John Maddock)
-//   26 Jan 00  Sun compiler support added (Jörg Schaible)
-//   30 Dec 99  BOOST_NMEMBER_TEMPLATES compatibility moved here from
-//              smart_ptr.hpp. (Dave Abrahams)
-//   15 Nov 99  BOOST_NO_OPERATORS_IN_NAMESPACE,
-//              BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION added (Beman Dawes)
-//   11 Oct 99  BOOST_NO_STDC_NAMESPACE refined; <cstddef> supplied
-//   29 Sep 99  BOOST_NO_STDC_NAMESPACE added (Ed Brey)
-//   24 Sep 99  BOOST_DECL added (Ed Brey)
-//   10 Aug 99  Endedness flags added, GNU CC support added
-//   22 Jul 99  Initial version
-
-#ifndef BOOST_CONFIG_HPP
-#define BOOST_CONFIG_HPP
-
-#define BOOST_VERSION 102400
-
-//  BOOST_VERSION % 100 is the sub-minor version
-//  BOOST_VERSION / 100 % 1000 is the minor version
-//  BOOST_VERSION / 100000 is the major version
-
-
-//  Conformance Flag Macros  -------------------------------------------------//
 //
-//  Conformance flag macros should identify the absence of C++ Standard 
-//  conformance rather than its presence.  This ensures that standard conforming
-//  compilers do not require a lot of configuration flag macros.  It places the
-//  burden where it should be, on non-conforming compilers.  In the future,
-//  hopefully, less rather than more conformance flags will have to be defined.
-
-//  BOOST_NO_CV_SPECIALIZATIONS: if template specializations for cv-qualified
-//  types conflict with a specialization for unqualififed type.
-
-//  BOOST_NO_CV_VOID_SPECIALIZATIONS: if template specializations for cv-void
-//  types conflict with a specialization for void.
-
-//  BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP: Compiler does not implement
-//  argument-dependent lookup (also named Koenig lookup); see std::3.4.2
-//  [basic.koenig.lookup]
-
-//  BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS: Template value
-//  parameters cannot have a dependent type, for example
-//  "template<class T, typename T::type value> class X { ... };"
-
-//  BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS: Can only use deduced
-//  template arguments when calling function template instantiations.
-
-//  BOOST_NO_INCLASS_MEMBER_INITIALIZATION: Compiler violates std::9.4.2/4. 
-
-//  BOOST_NO_INT64_T: <boost/cstdint.hpp> does not support 64-bit integer
-//  types.  (Set by <boost/cstdint.hpp> rather than <boost/config.hpp>).
-
-//  BOOST_NO_INTEGRAL_INT64_T: int64_t as defined by <boost/cstdint.hpp> is
-//  not an integral type.
-
-//  BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS: constants such as
-//  numeric_limits<T>::is_signed are not available for use at compile-time.
-
-//  BOOST_NO_MEMBER_TEMPLATES: Member template functions not fully supported.
-//  Also see BOOST_MSVC6_MEMBER_TEMPLATES in the Compiler Control section below.
-
-//  BOOST_NO_MEMBER_TEMPLATE_FRIENDS: Member template friend syntax
-//  ("template<class P> friend class frd;") described in the C++ Standard,
-//  14.5.3, not supported.
-
-//  BOOST_NO_OPERATORS_IN_NAMESPACE: Compiler requires inherited operator
-//  friend functions to be defined at namespace scope, then using'ed to boost.
-//  Probably GCC specific.  See boost/operators.hpp for example.
-
-//  BOOST_NO_POINTER_TO_MEMBER_CONST: The compiler does not correctly handle
-//  pointers to const member functions, preventing use of these in overloaded 
-//  function templates.  See boost/functional.hpp for example.
-
-//  BOOST_NO_PRIVATE_IN_AGGREGATE: The compiler misreads 8.5.1, treating classes
-//  as non-aggregate if they contain private or protected member functions. 
-
-//  BOOST_NO_STD_ITERATOR: The C++ implementation fails to provide the
-//  std::iterator class.
-
-//  BOOST_NO_STD_ITERATOR_TRAITS: The compiler does not provide a standard
-//  compliant implementation of std::iterator_traits. Note that
-//  the compiler may still have a non-standard implementation.
-
-//  BOOST_NO_STDC_NAMESPACE: The contents of C++ standard headers for C library
-//  functions (the <c...> headers) have not been placed in namespace std.
-//  Because the use of std::size_t is so common, a specific workaround for
-//  <cstddef> (and thus std::size_t) is provided in this header (see below).
-//  For other <c...> headers, a workaround must be provided in the boost header:
+//  CAUTION: This file is intended to be completely stable -
+//           DO NOT MODIFY THIS FILE!
 //
-//    #include <cstdlib>  // for abs
-//    #ifdef BOOST_NO_STDC_NAMESPACE
-//      namespace std { using ::abs; }
-//    #endif
-
-//  BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION. Class template partial
-//  specialization (14.5.4 [temp.class.spec]) not supported.
-
-//  BOOST_NO_USING_TEMPLATE: The compiler will not accept a using declaration
-//  that imports a template from the global namespace into a named namespace.
-//  Probably Borland specific.
-
-//  BOOST_NO_AUTO_PTR: If the compiler / library supplies non-standard or broken
-//  std::auto_ptr.
-
-//  BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING: The compiler does not perform 
-//  function template ordering or its function template ordering is incorrect.
-//  
-//  template<typename T> void f(T); // #1
-//  template<typename T, typename U> void f(T (*)(U)); // #2
-//  void bar(int);
-//  f(&bar); // should choose #2. 
-
-//  BOOST_NO_DEPENDENT_NESTED_DERIVATIONS: The compiler fails to compile
-//  a nested class that has a dependent base class:
-//  template<typename T>
-//  struct foo : public T {  
-//    template<typename U>
-//    struct bar : public T, public U {};
-//  };
-
-//  
-//  Compiler Control or Information Macros  ----------------------------------//
-//
-//  Compilers often supply features outside of the C++ Standard which need to be
-//  controlled or detected. As usual, reasonable default behavior should occur
-//  if any of these macros are not defined.
-
-//  BOOST_DECL:  Certain compilers for Microsoft operating systems require
-//  non-standard class and function decoration if dynamic load library linking
-//  is desired.  BOOST_DECL supplies that decoration.  Boost does not require
-//  use of BOOST_DECL - it is non-standard and to be avoided if practical to do
-//  so. Even compilers requiring it for DLL's only require it in certain cases.
-//
-//    BOOST_DECL_EXPORTS:  User defined, usually via command line or IDE,
-//    it causes BOOST_DECL to be defined as __declspec(dllexport).
-//
-//    BOOST_DECL_IMPORTS:  User defined, usually via command line or IDE,
-//    it causes BOOST_DECL to be defined as __declspec(dllimport).
-//
-//    If neither BOOST_DECL_EXPORTS nor BOOST_DECL_IMPORTS is defined, or if
-//    the compiler does not require __declspec() decoration, BOOST_DECL is
-//    defined as a null string.
-
-//  BOOST_MSVC6_MEMBER_TEMPLATES:  Microsoft Visual C++ 6.0 has enough member
-//  template idiosyncrasies (being polite) that BOOST_NO_MEMBER_TEMPLATES is
-//  defined for this compiler. BOOST_MSVC6_MEMBER_TEMPLATES is defined to allow
-//  compiler specific workarounds.
-
-//  BOOST_MSVC: defined as _MSC_VER for the Microsoft compiler only. In general,
-//  boost headers should test for a specific conformance flag macro (for
-//  example, BOOST_NO_MEMBER_TEMPLATE_FRIENDS) rather than a specific compiler.
-//  VC++ is a special case, however, since many libraries try to support it yet
-//  it has so many conformance issues that sometimes it is just easier to test
-//  for it directly. On the other hand, the obvious way to do this doesn't work,
-//  as many non-Microsoft compilers define _MSC_VER.  Thus BOOST_MSVC.
-
-//  BOOST_MSVC_STD_ITERATOR: Microsoft's broken version of std::iterator
-//  is being used. 
-
-//  BOOST_SYSTEM_HAS_STDINT_H: There are no 1998 C++ Standard headers <stdint.h> 
-//  or <cstdint>, although the 1999 C Standard does include <stdint.h>. 
-//  If <stdint.h> is present, <boost/stdint.h> can make good use of it,
-//  so a flag is supplied (signalling presence; thus the default is not
-//  present, conforming to the current C++ standard).
-
-//  BOOST_NO_SLIST: The C++ implementation does not provide the slist class.
-
-//  BOOST_NO_STRINGSTREAM: The C++ implementation does not provide the <sstream> header.
-
-//  BOOST_NO_HASH: The C++ implementation does not provide the hash_set
-//  or hash_map classes.
-
-//  BOOST_STD_EXTENSION_NAMESPACE: The name of the namespace in which the slist,
-//  hash_set and/or hash_map templates are defined in this implementation (if any).
-
-//  BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS: The standard library does not provide
-//  templated iterator constructors for its containers.
-
-//  BOOST_NO_LIMITS: The C++ implementation does not provide the <limits> header.
-
-//  BOOST_NO_INTRINSIC_WCHAR_T: The C++ implementation does not provide wchar_t,
-//  or it is really a synonym for another integral type. Use this symbol to
-//  decide whether it is appropriate to explicitly specialize a template on
-//  wchar_t if there is already a specialization for other integer types.
-
-//  BOOST_NO_STD_ALLOCATOR: The C++ standard library does not provide
-//  a standards conforming std::allocator.
-
-//  BOOST_NO_STD_MIN_MAX: The C++ standard library does not provide
-//  the min() and max() template functions that should be in <algorithm>.
-
-//  Common compiler front-ends precede all compiler checks  ------------------//
-
-//  Edison Design Group front-ends
-# if defined(__EDG_VERSION__)
-#   if __EDG_VERSION__ <= 241
-#     define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-#   endif
-
-# endif
-
-//  Compiler-specific checks -------------------------------------------------//
-//  Compilers are listed in alphabetic order by vendor name
-//  (except VC++ must be last - see below)
 
-//  Borland ------------------------------------------------------------------//
+#ifndef BOOST_CONFIG_HPP
+#define BOOST_CONFIG_HPP
 
-#if defined __BORLANDC__
-#   define BOOST_NO_SLIST
-#   define BOOST_NO_HASH
-// pull in standard library version:
-#   include <memory>
-#   if __BORLANDC__ <= 0x0551
-#     define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
-#     define BOOST_NO_INTEGRAL_INT64_T
-#     define BOOST_NO_PRIVATE_IN_AGGREGATE
-#   endif
-#   if __BORLANDC__ <= 0x0550
-// Borland C++ Builder 4 and 5:
-#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
-#     define BOOST_NO_USING_TEMPLATE
-#     if __BORLANDC__ == 0x0550
-// Borland C++ Builder 5, command-line compiler 5.5:
-#       define BOOST_NO_OPERATORS_IN_NAMESPACE
-#     endif
-#   endif
-#   if defined BOOST_DECL_EXPORTS
-#     if defined BOOST_DECL_IMPORTS
-#       error Not valid to define both BOOST_DECL_EXPORTS and BOOST_DECL_IMPORTS
-#     endif
-#     define BOOST_DECL __declspec(dllexport)
-#   elif defined BOOST_DECL_IMPORTS
-#     define BOOST_DECL __declspec(dllimport)
-#   else
-#     define BOOST_DECL
-#   endif
-#if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)
-// <climits> is partly broken, some macos define symbols that are really in
-// namespace std, so you end up having to use illegal constructs like
-// std::DBL_MAX, as a fix we'll just include float.h and have done with:
-#include <float.h>
+// if we don't have a user config, then use the default location:
+#if !defined(BOOST_USER_CONFIG) && !defined(BOOST_NO_USER_CONFIG)
+#  define BOOST_USER_CONFIG <boost/config/user.hpp>
 #endif
-#   define BOOST_NO_CV_SPECIALIZATIONS
-#   define BOOST_NO_CV_VOID_SPECIALIZATIONS
-
-// Comeau C++ ----------------------------------------------------------------//
-
-# elif defined __COMO__
-#   if __COMO_VERSION__ <= 4245
-#     define BOOST_FUNCTION_USE_VIRTUAL_FUNCTIONS
-#     if defined(_MSC_VER) && _MSC_VER <= 1200
-#       define BOOST_NO_STDC_NAMESPACE
-#     endif
-#   endif
-
-//  Compaq Tru64 Unix cxx ---------------------------------------------------
-
-# elif defined __DECCXX
-#   define BOOST_NO_SLIST
-#   define BOOST_NO_HASH
-
-//  GNU CC (also known as GCC and G++)  --------------------------------------//
-
-# elif defined __GNUC__
-#   if __GNUC__ == 2 && __GNUC_MINOR__ == 91
-       // egcs 1.1 won't parse smart_ptr.hpp without this:
-#      define BOOST_NO_AUTO_PTR
-#   endif
-#   if __GNUC__ == 2 && __GNUC_MINOR__ <= 97
-#     include "LString.h"  // not sure this is the right way to do this -JGS
-#     if defined(__BASTRING__) && !defined(__GLIBCPP__) && !defined(_CXXRT_STD) && !defined(__SGI_STL) // need to ask Dietmar about this -JGS
-        // this should only detect the stdlibc++ that ships with gcc, and
-        // not any replacements that may be installed...
-#       define BOOST_NO_STD_ITERATOR
-#       define BOOST_NO_LIMITS
-#     endif
-#     if !defined(_CXXRT_STD) && !defined(__SGI_STL_OWN_IOSTREAMS)
-#       define BOOST_NO_STRINGSTREAM
-#     endif
-#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
-#     define BOOST_NO_OPERATORS_IN_NAMESPACE
-#     define BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
-#   endif
-#   if __GNUC__ == 2 && __GNUC_MINOR__ <= 8
-#     define BOOST_NO_MEMBER_TEMPLATES
-#   endif
-#   if __GNUC__ >= 3
-#     include <iterator>
-#     if defined(__GLIBCPP__)
-        // The new GNU C++ library has slist, hash_map, hash_set headers
-        // in <ext/*>, but client code assumes they're in <*> --- Jens M. 
-#       define BOOST_NO_SLIST
-#       define BOOST_NO_HASH
-#     endif
-#   endif
-
-//  Greenhills C++ -----------------------------------------------------------//
-
-#elif defined __ghs
-#   define BOOST_NO_SLIST
-#   define BOOST_NO_HASH
-
-//  HP aCC -------------------------------------------------------------------
-
-# elif defined __HP_aCC
-#    define BOOST_NO_SLIST
-#    define BOOST_NO_HASH
-#    define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
-#    define BOOST_NO_OPERATORS_IN_NAMESPACE
-     // (support for HP aCC is not complete, see the regression test results)
-
-//  Intel on Linux -----------------------------------------------------------//
-
-#elif defined __ICC
-#   include <iterator>
-#   ifdef _CPPLIB_VER 
-      // shipped with Dinkumware 3.10, which has a different hash_map
-#     define BOOST_NO_HASH
-#   endif
-
-//  Intel on Windows --------------------------------------------------------//
-
-# elif defined __ICL
-#   if __ICL <= 500
-      // Intel C++ 5.0.1 uses EDG 2.45, but fails to activate Koenig lookup
-      // in the frontend even in "strict" mode.  (reported by Kirk Klobe)
-#     ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-#       define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-#     endif
-#     define BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
-#     define BOOST_NO_INTRINSIC_WCHAR_T // tentative addition - required for VC6 compatibility? (added by JM 19 Feb 2001)
-#   endif
-#   include <iterator>  // not sure this is the right way to do this -JGS
-#   if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES)
-        // a perfectly good implementation of std::iterator is supplied
-#   elif defined(__SGI_STL_ITERATOR)
-#     define BOOST_NO_STD_ITERATOR // No std::iterator in this case
-#   elif defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
-#     // full dinkumware 3.06 and above
-#     define BOOST_NO_HASH
-#     define BOOST_NO_STD_ITERATOR_TRAITS
-#     if !_GLOBAL_USING   // can be defined in yvals.h
-#       define BOOST_NO_STDC_NAMESPACE
-#     endif
-#   else // assume using dinkumware's STL that comes with VC++ 6.0
-#     define BOOST_MSVC_STD_ITERATOR
-#     define BOOST_NO_STD_ITERATOR_TRAITS
-#     define BOOST_NO_STDC_NAMESPACE
-#     define BOOST_NO_SLIST
-#     define BOOST_NO_HASH
-#     define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
-#     define BOOST_NO_STD_ALLOCATOR
-#     define BOOST_NO_STD_MIN_MAX
-#   endif
-
-//  Kai C++ ----------------------------------------------------------------
-
-#elif defined __KCC
-#   define BOOST_NO_SLIST
-#   define BOOST_NO_HASH
-
-#   if __KCC_VERSION <= 4001
-      // at least on Sun, the contents of <cwchar> is not in namespace std
-#     define BOOST_NO_STDC_NAMESPACE
-#   endif
-//  Metrowerks CodeWarrior  -------------------------------------------------//
-
-# elif defined  __MWERKS__
-#   if __MWERKS__ <= 0x2405  // 7
-#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
-#   endif
-#   if __MWERKS__ <= 0x2401  // 6.2
-#     define BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
-#   endif
-#   if __MWERKS__ <= 0x2301  // 5.3
-#     define BOOST_NO_POINTER_TO_MEMBER_CONST
-#     define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
-#     define BOOST_NO_HASH
-#   endif
-#   if __MWERKS__ >= 0x2400
-#     define BOOST_STD_EXTENSION_NAMESPACE Metrowerks
-#   endif
-#   if __MWERKS__ >= 0x2300
-#     define BOOST_SYSTEM_HAS_STDINT_H
-#   endif
-#   if defined BOOST_DECL_EXPORTS
-#     if defined BOOST_DECL_IMPORTS
-#       error Not valid to define both BOOST_DECL_EXPORTS and BOOST_DECL_IMPORTS
-#     endif
-#     define BOOST_DECL __declspec(dllexport)
-#   elif defined BOOST_DECL_IMPORTS
-#     define BOOST_DECL __declspec(dllimport)
-#   else
-#     define BOOST_DECL
-#   endif
-
-//  SGI MIPSpro C++ ---------------------------------------------------------//
-
-# elif defined __sgi
-    // This is a generic STLport condition and could be moved elsewhere.
-#   include <iterator>
-#   if defined(__SGI_STL_PORT) && !defined(__STL_MEMBER_TEMPLATE_CLASSES) && !defined(_STLP_MEMBER_TEMPLATE_CLASSES)
-#     define BOOST_NO_STD_ALLOCATOR
-#   endif
-
-//  Sun Workshop Compiler C++ -----------------------------------------------//
-
-# elif defined  __SUNPRO_CC
-#    if __SUNPRO_CC <= 0x520
-#      define BOOST_NO_SLIST
-#      define BOOST_NO_HASH
-#      define BOOST_NO_STD_ITERATOR_TRAITS
-#      define BOOST_NO_STD_ALLOCATOR
-
-       // although sunpro 5.1 supports the syntax for
-       // inline initialization it often gets the value
-       // wrong, especially where the value is computed
-       // from other constants (J Maddock 6th May 2001)
-#      define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-
-       // although sunpro 5.1 supports the syntax for
-       // partial specialization, it often seems to
-       // bind to the wrong specialization.  Better
-       // to disable it until suppport becomes more stable
-       // (J Maddock 6th May 2001).
-#      define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#    endif
-#    if __SUNPRO_CC <= 0x500
-#      define BOOST_NO_MEMBER_TEMPLATES
-#      define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#    endif
-
-//  Microsoft Visual C++ (excluding Intel/EDG front end)  --------------------
-//
-//  Must remain the last #elif since some other vendors (Metrowerks, for
-//  example) also #define _MSC_VER
-
-# elif defined _MSC_VER
-#   define BOOST_MSVC _MSC_VER
-
-    // turn off the warnings before we #include anything
-#   pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
-#   pragma warning( disable : 4503 ) // warning: decorated name length exceeded
-
-#   if _MSC_VER <= 1200  // 1200 == VC++ 6.0
-#     define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-#     define BOOST_NO_PRIVATE_IN_AGGREGATE
-#     define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-#     define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
-
-#     define BOOST_NO_INTEGRAL_INT64_T
-#     define BOOST_NO_INTRINSIC_WCHAR_T
-
-//    VC++ 6.0 has member templates but they have numerous problems including
-//    cases of silent failure, so for safety we define:
-#     define BOOST_NO_MEMBER_TEMPLATES
-//    For VC++ experts wishing to attempt workarounds, we define:
-#     define BOOST_MSVC6_MEMBER_TEMPLATES
-
-#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
-#     define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#     define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
-#     define BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
-#     include <iterator>  // not sure this is the right way to do this -JGS
-#     if __SGI_STL_PORT >= 0x400 || __SGI_STL_PORT >= 0x321 && defined(__STL_USE_NAMESPACES)
-        // a perfectly good implementation of std::iterator is supplied
-        // A conforming allocator is supplied, but the compiler cannot cope
-        // when using "rebind".  (Douglas Gregor)
-#       define BOOST_NO_STD_ALLOCATOR
-#     elif defined(__SGI_STL_ITERATOR)
-#       define BOOST_NO_STD_ITERATOR // No std::iterator in this case
-#     elif defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
-        // full dinkumware 3.06 and above
-#       define BOOST_NO_HASH
-#       define BOOST_NO_STD_ITERATOR_TRAITS
-#       ifndef _GLOBAL_USING    // can be defined in yvals.h
-#         define BOOST_NO_STDC_NAMESPACE
-#       endif
-#       if _CPPLIB_VER < 308 // fix due to kensai@pacbell.net
-#        define BOOST_MSVC_STD_ITERATOR
-#       endif
-#     else
-#       define BOOST_MSVC_STD_ITERATOR
-#       define BOOST_NO_SLIST
-#       define BOOST_NO_HASH
-#       define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
-#       define BOOST_NO_STD_ALLOCATOR
-#       ifndef _CPPLIB_VER
-          // Updated Dinkum library defines this, and provides
-          // its own min and max definitions.
-#         define BOOST_NO_STD_MIN_MAX
-#         undef min
-#         undef max
-#       endif
-#       ifndef NOMINMAX
-          // avoid spurious NOMINMAX redefinition warning
-#         define NOMINMAX
-#       endif
-#     endif
-#     define BOOST_NO_STD_ITERATOR_TRAITS
-#     define BOOST_NO_CV_VOID_SPECIALIZATIONS
-
-
-// Make sure at least one standard library header is included so that library
-// implementation detection will work, even if no standard headers have been
-// included in front of a boost header. (Ed Brey 5 Jun 00)
-#     include <cstddef>
-
-// Determine if the standard library implementation is already pulling names
-// into std.  STLport defines the following if so. (Ed Brey 5 Jun 00)
-#     if !defined( __STL_IMPORT_VENDOR_CSTD ) || defined( __STL_NO_CSTD_FUNCTION_IMPORTS )
-#       define BOOST_NO_STDC_NAMESPACE
-#     endif
-
-#   endif
-
-#   if defined BOOST_DECL_EXPORTS
-#     if defined BOOST_DECL_IMPORTS
-#       error Not valid to define both BOOST_DECL_EXPORTS and BOOST_DECL_IMPORTS
-#     endif
-#     define BOOST_DECL __declspec(dllexport)
-#   elif defined BOOST_DECL_IMPORTS
-#     define BOOST_DECL __declspec(dllimport)
-#   else
-#     define BOOST_DECL
-#   endif
-
-# endif // Microsoft (excluding Intel/EDG frontend) 
-
-# ifndef BOOST_DECL
-#   define BOOST_DECL  // default for compilers not needing this decoration.
-# endif
-
-//  end of compiler specific portion  ----------------------------------------//
-
-#if defined(BOOST_NO_LIMITS) || (defined(_RWSTD_VER) && defined(__BORLANDC__) && _RWSTD_VER < 0x020300) || (defined(__SGI_STL_PORT) && __SGI_STL_PORT <= 0x410 && defined(__STL_STATIC_CONST_INIT_BUG))
-// STLPort 4.0 doesn't define the static constants in numeric_limits<> so that they
-// can be used at compile time if the compiler bug indicated by
-// __STL_STATIC_CONST_INIT_BUG is present.
-
-// Rogue wave STL (C++ Builder) also has broken numeric_limits
-// with default template defining members out of line.
-// However, Compaq C++ also uses RogueWave (version 0x0203) and it's ok.
-#   define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+// include it first:
+#ifdef BOOST_USER_CONFIG
+#  include BOOST_USER_CONFIG
 #endif
 
-#if defined(__hpux)
-// HP-UX has a nice stdint.h in a different location, see boost/cstdint.hpp
-# define BOOST_SYSTEM_HAS_STDINT_H
+// if we don't have a compiler config set, try and find one:
+#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG) && !defined(BOOST_NO_CONFIG)
+#  include <boost/config/select_compiler_config.hpp>
 #endif
-
-#ifndef BOOST_STD_EXTENSION_NAMESPACE
-# define BOOST_STD_EXTENSION_NAMESPACE std
+// if we have a compiler config, include it now:
+#ifdef BOOST_COMPILER_CONFIG
+#  include BOOST_COMPILER_CONFIG
 #endif
 
-// Check for old name "BOOST_NMEMBER_TEMPLATES" for compatibility  -----------//
-// Don't use BOOST_NMEMBER_TEMPLATES. It is deprecated and will be removed soon.
-#if defined( BOOST_NMEMBER_TEMPLATES ) && !defined( BOOST_NO_MEMBER_TEMPLATES )
-  #define BOOST_NO_MEMBER_TEMPLATES
+// if we don't have a std library config set, try and find one:
+#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG)
+#  include <boost/config/select_stdlib_config.hpp>
+#endif
+// if we have a std library config, include it now:
+#ifdef BOOST_STDLIB_CONFIG
+#  include BOOST_STDLIB_CONFIG
 #endif
 
-//  BOOST_NO_STDC_NAMESPACE workaround  --------------------------------------//
-//
-//  Because std::size_t usage is so common, even in boost headers which do not
-//  otherwise use the C library, the <cstddef> workaround is included here so
-//  that ugly workaround code need not appear in many other boost headers.
-//  NOTE WELL: This is a workaround for non-conforming compilers; <cstddef> 
-//  must still be #included in the usual places so that <cstddef> inclusion
-//  works as expected with standard conforming compilers.  The resulting
-//  double inclusion of <cstddef> is harmless.
-
-# ifdef BOOST_NO_STDC_NAMESPACE
-#   include <cstddef>
-    namespace std { using ::ptrdiff_t; using ::size_t; }
-    // using ::wchar_t; removed since wchar_t is a C++ built-in type (Ed Brey)
-# endif
-
-#ifdef BOOST_NO_STD_MIN_MAX
-namespace std {
-  template <class _Tp>
-  inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
-    return __b < __a ? __b : __a;
-  }
-  template <class _Tp>
-  inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
-    return  __a < __b ? __b : __a;
-  }
-#ifdef BOOST_MSVC
-  inline long min(long __a, long __b) {
-    return __b < __a ? __b : __a;
-  }
-  inline long max(long __a, long __b) {
-    return  __a < __b ? __b : __a;
-  }
+// if we don't have a platform config set, try and find one:
+#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG) && !defined(BOOST_NO_CONFIG)
+#  include <boost/config/select_platform_config.hpp>
 #endif
-}
+// if we have a platform config, include it now:
+#ifdef BOOST_PLATFORM_CONFIG
+#  include BOOST_PLATFORM_CONFIG
 #endif
 
-// BOOST_STATIC_CONSTANT workaround --------------------------------------- //
-// On compilers which don't allow in-class initialization of static integral
-// constant members, we must use enums as a workaround if we want the constants
-// to be available at compile-time. This macro gives us a convenient way to
-// declare such constants.
-#ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-# define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
-#else
-# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
-#endif
+// get config suffix code:
+#include <boost/config/suffix.hpp>
 
 #endif  // BOOST_CONFIG_HPP
 
@@ -662,3 +64,6 @@ namespace std {
 
 
 
+
+
+
diff --git a/boost/boost/config/compiler/borland.hpp b/boost/boost/config/compiler/borland.hpp
new file mode 100644 (file)
index 0000000..9d2d99a
--- /dev/null
@@ -0,0 +1,90 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Borland C++ compiler setup:
+
+// Version 5.0 and below:
+#   if __BORLANDC__ <= 0x0550
+// Borland C++Builder 4 and 5:
+#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#     if __BORLANDC__ == 0x0550
+// Borland C++Builder 5, command-line compiler 5.5:
+#       define BOOST_NO_OPERATORS_IN_NAMESPACE
+#     endif
+#   endif
+
+// Version 5.51 and below:
+#if (__BORLANDC__ <= 0x551)
+#  define BOOST_NO_CV_SPECIALIZATIONS
+#  define BOOST_NO_CV_VOID_SPECIALIZATIONS
+#  define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#endif
+
+// Version 6.0 and below:
+#if (__BORLANDC__ <= 0x560) || !defined(BOOST_STRICT_CONFIG)
+#  define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+#  define BOOST_NO_INTEGRAL_INT64_T
+#  define BOOST_NO_PRIVATE_IN_AGGREGATE
+#  define BOOST_NO_SWPRINTF
+#  define BOOST_NO_USING_TEMPLATE
+#  define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
+#  define BOOST_NO_TEMPLATE_TEMPLATES
+   // we shouldn't really need this - but too many things choke
+   // without it, this needs more investigation:
+#  define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#endif
+
+// Borland C++Builder 6 defaults to using STLPort.  If _USE_OLD_RW_STL is
+// defined, then we have 0x560 or greater with the Rogue Wave implementation
+// which presumably has the std::DBL_MAX bug.
+#if ((__BORLANDC__ >= 0x550) && (__BORLANDC__ < 0x560)) || defined(_USE_OLD_RW_STL)
+// <climits> is partly broken, some macros define symbols that are really in
+// namespace std, so you end up having to use illegal constructs like
+// std::DBL_MAX, as a fix we'll just include float.h and have done with:
+#include <float.h>
+#endif
+//
+// __int64:
+//
+#if __BORLANDC__ >= 0x530
+#  define BOOST_HAS_MS_INT64
+#endif
+//
+// check for exception handling support:
+//
+#ifndef _CPPUNWIND
+#  define BOOST_NO_EXCEPTIONS
+#endif
+//
+// all versions have a <dirent.h>:
+//
+#define BOOST_HAS_DIRENT_H
+//
+// Disable Win32 support in ANSI mode:
+//
+#pragma defineonoption BOOST_DISABLE_WIN32 -A
+
+#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
+
+//
+// versions check:
+// we don't support Borland prior to version 5.4:
+#if __BORLANDC__ < 0x540
+#  error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 5.6:
+#if (__BORLANDC__ > 0x560)
+#  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/compiler/comeau.hpp b/boost/boost/config/compiler/comeau.hpp
new file mode 100644 (file)
index 0000000..a0e8835
--- /dev/null
@@ -0,0 +1,65 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Comeau C++ compiler setup:
+
+#include "boost/config/compiler/common_edg.hpp"
+
+#if (__COMO_VERSION__ <= 4245) || !defined(BOOST_STRICT_CONFIG)
+#  if defined(_MSC_VER) && _MSC_VER <= 1300
+#     define BOOST_NO_STDC_NAMESPACE
+#     define BOOST_NO_SWPRINTF
+#     if _MSC_VER > 100
+         // only set this in non-strict mode:
+#        define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+#     endif
+#  endif
+
+// Void returns don't work when emulating VC 6 (Peter Dimov)
+
+#  if defined(_MSC_VER) && (_MSC_VER == 1200)
+#     define BOOST_NO_VOID_RETURNS
+#  endif
+
+
+#endif  // version 4245
+
+//
+// enable __int64 support in VC emulation mode
+// we should also set BOOST_HAS_LONG_LONG when that is
+// supported, but there is no way we can detect it:
+//
+#  if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#     define BOOST_HAS_MS_INT64
+#  endif
+
+//
+// disable win32 support unless we are in VC emulation mode,
+// (what does this do to Como on top of Borland?):
+//
+#if defined(_WIN32) && (_MSC_VER+0 < 1000)
+#  define BOOST_DISABLE_WIN32
+#endif
+
+#define BOOST_COMPILER "Comeau compiler version " BOOST_STRINGIZE(__COMO_VERSION__)
+
+//
+// versions check:
+// we don't know Comeau prior to version 4245:
+#if __COMO_VERSION__ < 4245
+#  error "Compiler not configured - please reconfigure"
+#endif
+//
+// last known and checked version is 4245:
+#if (__COMO_VERSION__ > 4245)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
+
+
diff --git a/boost/boost/config/compiler/common_edg.hpp b/boost/boost/config/compiler/common_edg.hpp
new file mode 100644 (file)
index 0000000..c8522dd
--- /dev/null
@@ -0,0 +1,34 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//
+// Options common to all edg based compilers.
+//
+// This is included from within the individual compiler mini-configs.
+
+#ifndef __EDG_VERSION__
+#  error This file requires that __EDG_VERSION__ be defined.
+#endif
+
+#if (__EDG_VERSION__ <= 238)
+#   define BOOST_NO_INTEGRAL_INT64_T
+#endif
+
+#if (__EDG_VERSION__ <= 240)
+#   define BOOST_NO_VOID_RETURNS
+#endif
+
+#if (__EDG_VERSION__ <= 241) && !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
+#   define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+#endif
+
+#ifdef c_plusplus
+// EDG has "long long" in non-strict mode
+// However, some libraries have insufficient "long long" support
+// #define BOOST_HAS_LONG_LONG
+#endif
+
diff --git a/boost/boost/config/compiler/compaq_cxx.hpp b/boost/boost/config/compiler/compaq_cxx.hpp
new file mode 100644 (file)
index 0000000..8d09ff4
--- /dev/null
@@ -0,0 +1,18 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Dec Alpha True64 C++ compiler setup:
+
+#define BOOST_COMPILER "Dec Alpha True64 " BOOST_STRINGIZE(__DECCXX_VER)
+
+#include "boost/config/compiler/common_edg.hpp"
+
+//
+// versions check:
+// Nothing to do here?
+
+
diff --git a/boost/boost/config/compiler/gcc.hpp b/boost/boost/config/compiler/gcc.hpp
new file mode 100644 (file)
index 0000000..f8dc97f
--- /dev/null
@@ -0,0 +1,59 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  GNU C++ compiler setup:
+
+#   if __GNUC__ == 2 && __GNUC_MINOR__ == 91
+       // egcs 1.1 won't parse shared_ptr.hpp without this:
+#      define BOOST_NO_AUTO_PTR
+#   endif
+#   if __GNUC__ == 2 && __GNUC_MINOR__ < 95
+      //
+      // Prior to gcc 2.95 member templates only partly
+      // work - define BOOST_MSVC6_MEMBER_TEMPLATES
+      // instead since inline member templates mostly work.
+      //
+#     define BOOST_NO_MEMBER_TEMPLATES
+#     if __GNUC_MINOR__ >= 9
+#       define BOOST_MSVC6_MEMBER_TEMPLATES
+#     endif
+#   endif
+
+#   if __GNUC__ == 2 && __GNUC_MINOR__ <= 97
+#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#     define BOOST_NO_OPERATORS_IN_NAMESPACE
+#   endif
+
+//
+// Threading support:
+// Turn this on unconditionally here, it will get turned off again later
+// if no threading API is detected.
+//
+#define BOOST_HAS_THREADS
+
+//
+// gcc has "long long"
+//
+#define BOOST_HAS_LONG_LONG
+
+#define BOOST_COMPILER "GNU C++ version " BOOST_STRINGIZE(__GNUC__) "." BOOST_STRINGIZE(__GNUC_MINOR__)
+
+//
+// versions check:
+// we don't know gcc prior to version 2.90:
+#if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
+#  error "Compiler not configured - please reconfigure"
+#endif
+//
+// last known and checked version is 3.2:
+#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 2))
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  else
+#     warning "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
diff --git a/boost/boost/config/compiler/greenhills.hpp b/boost/boost/config/compiler/greenhills.hpp
new file mode 100644 (file)
index 0000000..793ef52
--- /dev/null
@@ -0,0 +1,27 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Greenhills C++ compiler setup:
+
+#define BOOST_COMPILER "Greenhills C++ version " BOOST_STRINGIZE(__ghs)
+
+#include "boost/config/compiler/common_edg.hpp"
+
+//
+// versions check:
+// we don't support Greenhills prior to version 0:
+#if __ghs < 0
+#  error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0:
+#if (__ghs > 0)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
diff --git a/boost/boost/config/compiler/hp_acc.hpp b/boost/boost/config/compiler/hp_acc.hpp
new file mode 100644 (file)
index 0000000..44f79c4
--- /dev/null
@@ -0,0 +1,41 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  HP aCC C++ compiler setup:
+
+#if (__HP_aCC <= 33100)
+#    define BOOST_NO_INTEGRAL_INT64_T
+#    define BOOST_NO_OPERATORS_IN_NAMESPACE
+#  if !defined(_NAMESPACE_STD)
+#     define BOOST_NO_STD_LOCALE
+#     define BOOST_NO_STRINGSTREAM
+#  endif
+#endif
+
+#if (__HP_aCC <= 33300) || !defined(BOOST_STRICT_CONFIG)
+// member templates are sufficiently broken that we disable them for now
+#    define BOOST_NO_MEMBER_TEMPLATES
+#    define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+#    define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+#endif
+
+#define BOOST_COMPILER "HP aCC version " BOOST_STRINGIZE(__HP_aCC)
+
+//
+// versions check:
+// we don't support HP aCC prior to version 0:
+#if __HP_aCC < 33000
+#  error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0:
+#if (__HP_aCC > 33300)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
diff --git a/boost/boost/config/compiler/intel.hpp b/boost/boost/config/compiler/intel.hpp
new file mode 100644 (file)
index 0000000..4d76eab
--- /dev/null
@@ -0,0 +1,81 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Intel compiler setup:
+
+#include "boost/config/compiler/common_edg.hpp"
+
+#ifdef __ICL
+#  define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(__ICL)
+#  define BOOST_INTEL_CXX_VERSION __ICL
+#else
+#  define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(__ICC)
+#  define BOOST_INTEL_CXX_VERSION __ICC
+#endif
+
+#if (BOOST_INTEL_CXX_VERSION <= 500) && defined(_MSC_VER)
+#  define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+#endif
+
+#if (BOOST_INTEL_CXX_VERSION <= 600) || !defined(BOOST_STRICT_CONFIG)
+
+#  if defined(_MSC_VER) && (_MSC_VER <= 1300) // added check for <= VC 7 (Peter Dimov)
+
+      // Intel C++ 5.0.1 uses EDG 2.45, but fails to activate Koenig lookup
+      // in the frontend even in "strict" mode, unless you use 
+      // -Qoption,cpp,--arg_dep_lookup.  (reported by Kirk Klobe & Thomas Witt)
+      // Similarly, -Qoption,cpp,--new_for_init enables new-style "for" loop
+      // variable scoping. (reported by Thomas Witt)
+      // Intel C++ 6.0 (currently in Beta test) doesn't have any front-end
+      // changes at all.  (reported by Kirk Klobe)
+#     ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+#        define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+#     endif
+#     define BOOST_NO_SWPRINTF
+#  endif
+
+// Void returns, 64 bit integrals don't work when emulating VC 6 (Peter Dimov)
+
+#  if defined(_MSC_VER) && (_MSC_VER <= 1200)
+#     define BOOST_NO_VOID_RETURNS
+#     define BOOST_NO_INTEGRAL_INT64_T
+#  endif
+
+#endif
+
+#if _MSC_VER+0 >= 1000
+#  ifndef _NATIVE_WCHAR_T_DEFINED
+#     define BOOST_NO_INTRINSIC_WCHAR_T
+#  endif
+#  if _MSC_VER >= 1200
+#     define BOOST_HAS_MS_INT64
+#  endif
+#  define BOOST_NO_SWPRINTF
+#elif defined(_WIN32)
+#  define BOOST_DISABLE_WIN32
+#endif
+
+
+//
+// versions check:
+// we don't support Intel prior to version 5.0:
+#if BOOST_INTEL_CXX_VERSION < 500
+#  error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 600:
+#if (BOOST_INTEL_CXX_VERSION > 600)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  elif defined(_MSC_VER)
+#     pragma message("Unknown compiler version - please run the configure tests and report the results")
+#  endif
+#endif
+
+
+
+
diff --git a/boost/boost/config/compiler/kai.hpp b/boost/boost/config/compiler/kai.hpp
new file mode 100644 (file)
index 0000000..6b8ab84
--- /dev/null
@@ -0,0 +1,27 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Kai C++ compiler setup:
+
+#include "boost/config/compiler/common_edg.hpp"
+
+#   if (__KCC_VERSION <= 4001) || !defined(BOOST_STRICT_CONFIG)
+      // at least on Sun, the contents of <cwchar> is not in namespace std
+#     define BOOST_NO_STDC_NAMESPACE
+#   endif
+
+#define BOOST_COMPILER "Kai C++ version " BOOST_STRINGIZE(__KCC_VERSION)
+
+//
+// last known and checked version is 4001:
+#if (__KCC_VERSION > 4001)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
+
diff --git a/boost/boost/config/compiler/metrowerks.hpp b/boost/boost/config/compiler/metrowerks.hpp
new file mode 100644 (file)
index 0000000..a190025
--- /dev/null
@@ -0,0 +1,56 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Metrowerks C++ compiler setup:
+
+// locale support is disabled when linking with the dynamic runtime
+#   ifdef _MSL_NO_LOCALE
+#     define BOOST_NO_STD_LOCALE
+#   endif 
+
+#   if __MWERKS__ <= 0x2301  // 5.3
+#     define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#     define BOOST_NO_POINTER_TO_MEMBER_CONST
+#     define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+#     define BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+#   endif
+
+#   if __MWERKS__ <= 0x2401  // 6.2
+//#     define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#   endif
+
+#   if(__MWERKS__ <= 0x2406) || !defined(BOOST_STRICT_CONFIG)  // 7.0 & 7.1
+#     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#     define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
+#   endif
+
+#if !__option(wchar_type)
+#   define BOOST_NO_INTRINSIC_WCHAR_T
+#endif
+
+
+#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(__MWERKS__)
+
+//
+// versions check:
+// we don't support Metrowerks prior to version 5.3:
+#if __MWERKS__ < 0x2301
+#  error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0x2406:
+#if (__MWERKS__ > 0x2406)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
+
+
+
+
+
diff --git a/boost/boost/config/compiler/mpw.hpp b/boost/boost/config/compiler/mpw.hpp
new file mode 100644 (file)
index 0000000..3cd979a
--- /dev/null
@@ -0,0 +1,49 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  MPW C++ compilers setup:
+
+#   if    defined(__SC__)
+#     define BOOST_COMPILER "MPW SCpp version " BOOST_STRINGIZE(__SC__)
+#   elif defined(__MRC__)
+#     define BOOST_COMPILER "MPW MrCpp version " BOOST_STRINGIZE(__MRC__)
+#   else
+#     error "Using MPW compiler configuration by mistake.  Please update."
+#   endif
+
+//
+// MPW 8.90:
+//
+#if (MPW_CPLUS <= 0x890) || !defined(BOOST_STRICT_CONFIG)
+#  define BOOST_NO_CV_SPECIALIZATIONS
+#  define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+#  define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+#  define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+#  define BOOST_NO_INTRINSIC_WCHAR_T
+#  define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#  define BOOST_NO_USING_TEMPLATE
+
+#  define BOOST_NO_CWCHAR
+#  define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+
+#  define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
+#endif
+
+//
+// versions check:
+// we don't support MPW prior to version 8.9:
+#if MPW_CPLUS < 0x890
+#  error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0x890:
+#if (MPW_CPLUS > 0x890)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
diff --git a/boost/boost/config/compiler/sgi_mipspro.hpp b/boost/boost/config/compiler/sgi_mipspro.hpp
new file mode 100644 (file)
index 0000000..51e9f6f
--- /dev/null
@@ -0,0 +1,23 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  SGI C++ compiler setup:
+
+#define BOOST_COMPILER "SGI Irix compiler version " BOOST_STRINGIZE(_COMPILER_VERSION)
+
+#include "boost/config/compiler/common_edg.hpp"
+
+//
+// Threading support:
+// Turn this on unconditionally here, it will get turned off again later
+// if no threading API is detected.
+//
+#define BOOST_HAS_THREADS
+//
+// version check:
+// probably nothing to do here?
+
diff --git a/boost/boost/config/compiler/sunpro_cc.hpp b/boost/boost/config/compiler/sunpro_cc.hpp
new file mode 100644 (file)
index 0000000..bc3915c
--- /dev/null
@@ -0,0 +1,66 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Sun C++ compiler setup:
+
+#    if __SUNPRO_CC <= 0x500
+#      define BOOST_NO_MEMBER_TEMPLATES
+#      define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#    endif
+
+#    if (__SUNPRO_CC <= 0x520)
+       //
+       // Sunpro 5.2 and earler:
+       //
+       // although sunpro 5.2 supports the syntax for
+       // inline initialization it often gets the value
+       // wrong, especially where the value is computed
+       // from other constants (J Maddock 6th May 2001)
+#      define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+
+       // Although sunpro 5.2 supports the syntax for
+       // partial specialization, it often seems to
+       // bind to the wrong specialization.  Better
+       // to disable it until suppport becomes more stable
+       // (J Maddock 6th May 2001).
+#      define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#    endif
+
+#    if (__SUNPRO_CC <= 0x530) || !defined(BOOST_STRICT_CONFIG)
+       // SunPro 5.3 has better support for partial specialization,
+       // but breaks when compiling std::less<shared_ptr<T> >
+       // (Jens Maurer 4 Nov 2001).
+
+       // std::less specialization fixed as reported by George
+       // Heintzelman; partial specialization re-enabled
+       // (Peter Dimov 17 Jan 2002)
+
+//#      define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+       // integral constant expressions with 64 bit numbers fail
+#      define BOOST_NO_INTEGRAL_INT64_T
+#    endif
+
+#define BOOST_COMPILER "Sun compiler version " BOOST_STRINGIZE(__SUNPRO_CC)
+
+//
+// versions check:
+// we don't support sunpro prior to version 4:
+#if __SUNPRO_CC < 0x400
+#error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 0x530:
+#if (__SUNPRO_CC > 0x530)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
+
+
+
diff --git a/boost/boost/config/compiler/vacpp.hpp b/boost/boost/config/compiler/vacpp.hpp
new file mode 100644 (file)
index 0000000..c4ef9f1
--- /dev/null
@@ -0,0 +1,37 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Visual Age (IBM) C++ compiler setup:
+
+#define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+#define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
+//
+// On AIX thread support seems to be indicated by _THREAD_SAFE:
+//
+#ifdef _THREAD_SAFE
+#  define BOOST_HAS_THREADS
+#endif
+
+#define BOOST_COMPILER "IBM Visual Age" BOOST_STRINGIZE(__IBMCPP__)
+
+//
+// versions check:
+// we don't support Visual age prior to version 5:
+#if __IBMCPP__ < 500
+#error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 500:
+#if (__IBMCPP__ > 500)
+#  if defined(BOOST_ASSERT_CONFIG)
+#     error "Unknown compiler version - please run the configure tests and report the results"
+#  endif
+#endif
+
+
+
diff --git a/boost/boost/config/compiler/visualc.hpp b/boost/boost/config/compiler/visualc.hpp
new file mode 100644 (file)
index 0000000..fe604f5
--- /dev/null
@@ -0,0 +1,116 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Microsoft Visual C++ compiler setup:
+
+#define BOOST_MSVC _MSC_VER
+
+// 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
+#pragma warning( disable : 4786 ) // ident trunc to '255' chars in debug info
+#  define BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+#  define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+#  define BOOST_NO_VOID_RETURNS
+   // disable min/max macro defines on vc6:
+   //
+#  ifndef NOMINMAX
+#     define NOMINMAX
+#  endif
+#endif
+
+#if (_MSC_VER <= 1300) // || !defined(BOOST_STRICT_CONFIG) // VC7 Beta 2 or later
+
+#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS)      // VC7 bug with /Za
+#  define BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+#endif
+
+#  define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+#  define BOOST_NO_PRIVATE_IN_AGGREGATE
+#  define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+#  define BOOST_NO_INTEGRAL_INT64_T
+
+//    VC++ 6/7 has member templates but they have numerous problems including
+//    cases of silent failure, so for safety we define:
+#  define BOOST_NO_MEMBER_TEMPLATES
+//    For VC++ experts wishing to attempt workarounds, we define:
+#  define BOOST_MSVC6_MEMBER_TEMPLATES
+
+#  define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+#  define BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#  define BOOST_NO_CV_VOID_SPECIALIZATIONS
+#  define BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#  define BOOST_NO_USING_TEMPLATE
+#  define BOOST_NO_SWPRINTF
+#  define BOOST_NO_TEMPLATE_TEMPLATES
+#  if (_MSC_VER > 1200)
+#     define BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
+#  endif
+   //
+   // disable min/max macros if defined:
+   //
+#  ifdef min
+#     undef min
+#  endif
+#  ifdef max
+#     undef max
+#  endif
+
+#endif
+
+#if _MSC_VER <= 1301
+#  define BOOST_NO_SWPRINTF
+#endif
+
+#ifndef _NATIVE_WCHAR_T_DEFINED
+#  define BOOST_NO_INTRINSIC_WCHAR_T
+#endif
+
+//   
+// check for exception handling support:   
+#ifndef _CPPUNWIND   
+#  define BOOST_NO_EXCEPTIONS   
+#endif 
+
+//
+// __int64 support:
+//
+#if (_MSC_VER >= 1200) && defined(_MSC_EXTENSIONS)
+#   define BOOST_HAS_MS_INT64
+#endif
+//
+// disable Win32 API's if compiler extentions are
+// turned off:
+//
+#ifndef _MSC_EXTENSIONS
+#  define BOOST_DISABLE_WIN32
+#endif
+
+
+
+#define BOOST_COMPILER "Microsoft Visual C++ version " BOOST_STRINGIZE(_MSC_VER)
+
+//
+// versions check:
+// we don't support Visual C++ prior to version 6:
+#if _MSC_VER < 1200
+#error "Compiler not supported or configured - please reconfigure"
+#endif
+//
+// last known and checked version is 1301:
+#if (_MSC_VER > 1301)
+#  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/aix.hpp b/boost/boost/config/platform/aix.hpp
new file mode 100644 (file)
index 0000000..670bf0b
--- /dev/null
@@ -0,0 +1,24 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  IBM/Aix specific config options:
+
+#define BOOST_PLATFORM "IBM Aix"
+
+#define BOOST_HAS_UNISTD_H
+#define BOOST_HAS_PTHREADS
+#define BOOST_HAS_NL_TYPES_H
+
+// Threading API's:
+#define BOOST_HAS_PTHREAD_DELAY_NP
+#define BOOST_HAS_PTHREAD_YIELD
+
+// boilerplate code:
+#include <boost/config/posix_features.hpp>
+
+
+
diff --git a/boost/boost/config/platform/amigaos.hpp b/boost/boost/config/platform/amigaos.hpp
new file mode 100644 (file)
index 0000000..7aa85d1
--- /dev/null
@@ -0,0 +1,15 @@
+
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+#define BOOST_PLATFORM "AmigaOS"
+
+#define BOOST_DISABLE_THREADS
+#define BOOST_NO_CWCHAR
+#define BOOST_NO_STD_WSTRING
+#define BOOST_NO_INTRINSIC_WCHAR_T
diff --git a/boost/boost/config/platform/beos.hpp b/boost/boost/config/platform/beos.hpp
new file mode 100644 (file)
index 0000000..b2c0de5
--- /dev/null
@@ -0,0 +1,25 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  BeOS specific config options:
+
+#define BOOST_PLATFORM "BeOS"
+
+#define BOOST_NO_CWCHAR
+#define BOOST_NO_CWCTYPE
+#define BOOST_HAS_UNISTD_H
+
+#define BOOST_HAS_BETHREADS
+
+#ifndef BOOST_DISABLE_THREADS
+#  define BOOST_HAS_THREADS
+#endif
+
+// boilerplate code:
+#include <boost/config/posix_features.hpp>
+
diff --git a/boost/boost/config/platform/bsd.hpp b/boost/boost/config/platform/bsd.hpp
new file mode 100644 (file)
index 0000000..0af5364
--- /dev/null
@@ -0,0 +1,61 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  generic BSD config options:
+
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+#error "This platform is not BSD"
+#endif
+
+#ifdef __FreeBSD__
+#define BOOST_PLATFORM "FreeBSD " BOOST_STRINGIZE(__FreeBSD__)
+#elif defined(__NetBSD__)
+#define BOOST_PLATFORM "NetBSD " BOOST_STRINGIZE(__NetBSD__)
+#elif defined(__OpenBSD__)
+#define BOOST_PLATFORM "OpenBSD " BOOST_STRINGIZE(__OpenBSD__)
+#endif
+
+//
+// is this the correct version check?
+// FreeBSD has <nl_types.h> but does not
+// advertise the fact in <unistd.h>:
+//
+#if defined(__FreeBSD__) && (__FreeBSD__ >= 3)
+#  define BOOST_HAS_NL_TYPES_H
+#endif
+
+//
+// FreeBSD 3.x has pthreads support, but defines _POSIX_THREADS in <pthread.h>
+// and not in <unistd.h>
+//
+#if defined(__FreeBSD__) && (__FreeBSD__ <= 3)
+#  define BOOST_HAS_PTHREADS
+#endif
+
+//
+// No wide character support in the BSD header files:
+//
+#define BOOST_NO_CWCHAR
+
+//
+// The BSD <ctype.h> has macros only, no functions:
+//
+#define BOOST_NO_CTYPE_FUNCTIONS
+
+//
+// thread API's not auto detected:
+//
+#define BOOST_HAS_SCHED_YIELD
+#define BOOST_HAS_NANOSLEEP
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include <boost/config/posix_features.hpp>
+
+
diff --git a/boost/boost/config/platform/cygwin.hpp b/boost/boost/config/platform/cygwin.hpp
new file mode 100644 (file)
index 0000000..6e77bb5
--- /dev/null
@@ -0,0 +1,37 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  cygwin specific config options:
+
+#define BOOST_PLATFORM "Cygwin"
+#define BOOST_NO_CWCTYPE
+#define BOOST_NO_CWCHAR
+#define BOOST_NO_SWPRINTF
+
+//
+// Threading API:
+// See if we have POSIX threads, if we do use them, otherwise
+// revert to native Win threads.
+#define BOOST_HAS_UNISTD_H
+#include <unistd.h>
+#if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
+#  define BOOST_HAS_PTHREADS
+#  define BOOST_HAS_SCHED_YIELD
+#  define BOOST_HAS_GETTIMEOFDAY
+#  define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+#else
+#  if !defined(BOOST_HAS_WINTHREADS)
+#     define BOOST_HAS_WINTHREADS
+#  endif
+#  define BOOST_HAS_FTIME
+#endif
+
+// boilerplate code:
+#include <boost/config/posix_features.hpp>
+
+
diff --git a/boost/boost/config/platform/hpux.hpp b/boost/boost/config/platform/hpux.hpp
new file mode 100644 (file)
index 0000000..7766946
--- /dev/null
@@ -0,0 +1,28 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  hpux specific config options:
+
+#define BOOST_PLATFORM "HP-UX"
+
+// In principle, HP-UX has a nice <stdint.h> under the name <inttypes.h>
+// However, it has the following problem:
+// Use of UINT32_C(0) results in "0u l" for the preprocessed source
+// (verifyable with gcc 2.95.3, assumed for HP aCC)
+// #define BOOST_HAS_STDINT_H
+
+#define BOOST_NO_SWPRINTF 
+#define BOOST_NO_CWCTYPE
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include <boost/config/posix_features.hpp>
+
+#ifndef BOOST_HAS_GETTIMEOFDAY
+// gettimeofday is always available
+#define BOOST_HAS_GETTIMEOFDAY
+#endif
diff --git a/boost/boost/config/platform/irix.hpp b/boost/boost/config/platform/irix.hpp
new file mode 100644 (file)
index 0000000..d137ffc
--- /dev/null
@@ -0,0 +1,24 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  SGI Irix specific config options:
+
+#define BOOST_PLATFORM "SGI Irix"
+
+#define BOOST_NO_SWPRINTF 
+//
+// these are not auto detected by POSIX feature tests:
+//
+#define BOOST_HAS_GETTIMEOFDAY
+#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include <boost/config/posix_features.hpp>
+
+
diff --git a/boost/boost/config/platform/linux.hpp b/boost/boost/config/platform/linux.hpp
new file mode 100644 (file)
index 0000000..61fb23c
--- /dev/null
@@ -0,0 +1,87 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  linux specific config options:
+
+#define BOOST_PLATFORM "linux"
+
+// make sure we have __GLIBC_PREREQ if available at all
+#include <cstdlib>
+
+//
+// <stdint.h> added to glibc 2.1.1
+// We can only test for 2.1 though:
+//
+#if defined(__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)))
+   // <stdint.h> defines int64_t unconditionally, but <sys/types.h> defines
+   // int64_t only if __GNUC__.  Thus, assume a fully usable <stdint.h>
+   // only when using GCC.
+#  if defined __GNUC__
+#    define BOOST_HAS_STDINT_H
+#  endif
+#endif
+
+//
+// como on linux doesn't have std:: c functions:
+//
+#ifdef __COMO__
+#  define BOOST_NO_STDC_NAMESPACE
+#endif
+
+//
+// If glibc is past version 2 then we definitely have
+// gettimeofday, earlier versions may or may not have it:
+//
+#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+#  define BOOST_HAS_GETTIMEOFDAY
+#endif
+
+#ifdef __USE_POSIX199309
+#  define BOOST_HAS_NANOSLEEP
+#endif
+
+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+// __GLIBC_PREREQ is available since 2.1.2
+
+   // swprintf is available since glibc 2.2.0
+#  if !__GLIBC_PREREQ(2,2) || (!defined(__USE_ISOC99) && !defined(__USE_UNIX98))
+#    define BOOST_NO_SWPRINTF
+#  endif
+#else
+#  define BOOST_NO_SWPRINTF
+#endif
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include <boost/config/posix_features.hpp>
+
+#ifndef __GNUC__
+//
+// if the compiler is not gcc we still need to be able to parse
+// the GNU system headers, some of which (mainly <stdint.h>)
+// use GNU specific extensions:
+//
+#  ifndef __extension__
+#     define __extension__
+#  endif
+#  ifndef __const__
+#     define __const__ const
+#  endif
+#  ifndef __volatile__
+#     define __volatile__ volatile
+#  endif
+#  ifndef __signed__
+#     define __signed__ signed
+#  endif
+#  ifndef __typeof__
+#     define __typeof__ typeof
+#  endif
+#  ifndef __inline__
+#     define __inline__ inline
+#  endif
+#endif
+
diff --git a/boost/boost/config/platform/macos.hpp b/boost/boost/config/platform/macos.hpp
new file mode 100644 (file)
index 0000000..51d0301
--- /dev/null
@@ -0,0 +1,59 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Mac OS specific config options:
+
+#define BOOST_PLATFORM "Mac OS"
+
+// If __MACH__, we're using the BSD standard C library, not the MSL:
+#if defined(__MACH__)
+
+#  define BOOST_NO_CTYPE_FUNCTIONS
+#  define BOOST_NO_CWCHAR
+#  ifndef BOOST_HAS_UNISTD_H
+#    define BOOST_HAS_UNISTD_H
+#  endif
+// boilerplate code:
+#  include <boost/config/posix_features.hpp>
+#  ifndef BOOST_HAS_STDINT_H
+#     define BOOST_HAS_STDINT_H
+#  endif
+
+//
+// BSD runtime has pthreads, sched_yield and gettimeofday,
+// of these only pthreads are advertised in <unistd.h>, so set the 
+// other options explicitly:
+//
+#  define BOOST_HAS_SCHED_YIELD
+#  define BOOST_HAS_GETTIMEOFDAY
+
+#  ifndef __APPLE_CC__
+
+// GCC strange "ignore std" mode works better if you pretend everything
+// is in the std namespace, for the most part.
+
+#    define BOOST_NO_STDC_NAMESPACE
+#  endif
+
+#else
+
+// We will eventually support threads in non-Carbon builds, but we do
+// not support this yet.
+#  if TARGET_CARBON
+
+#    define BOOST_HAS_MPTASKS
+
+// The MP task implementation of Boost Threads aims to replace MP-unsafe
+// parts of the MSL, so we turn on threads unconditionally.
+#    define BOOST_HAS_THREADS
+
+// The remote call manager depends on this.
+#    define BOOST_BIND_ENABLE_PASCAL
+
+#  endif
+
+#endif
diff --git a/boost/boost/config/platform/solaris.hpp b/boost/boost/config/platform/solaris.hpp
new file mode 100644 (file)
index 0000000..fae4293
--- /dev/null
@@ -0,0 +1,19 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  sun specific config options:
+
+#define BOOST_PLATFORM "sun"
+
+#define BOOST_HAS_GETTIMEOFDAY
+
+// boilerplate code:
+#define BOOST_HAS_UNISTD_H
+#include <boost/config/posix_features.hpp>
+
+
+
diff --git a/boost/boost/config/platform/win32.hpp b/boost/boost/config/platform/win32.hpp
new file mode 100644 (file)
index 0000000..491b8c3
--- /dev/null
@@ -0,0 +1,39 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Win32 specific config options:
+
+#define BOOST_PLATFORM "Win32"
+
+#if defined BOOST_DECL_EXPORTS
+#  if defined BOOST_DECL_IMPORTS
+#     error Not valid to define both BOOST_DECL_EXPORTS and BOOST_DECL_IMPORTS
+#  endif
+#  define BOOST_DECL __declspec(dllexport)
+#elif defined BOOST_DECL_IMPORTS
+#  define BOOST_DECL __declspec(dllimport)
+#else
+#  define BOOST_DECL
+#endif
+
+#if defined(__GNUC__) && !defined(BOOST_NO_SWPRINTF)
+#  define BOOST_NO_SWPRINTF
+#endif
+
+#ifndef BOOST_DISABLE_WIN32
+//
+// Win32 will normally be using native Win32 threads,
+// but there is a pthread library avaliable as an option:
+//
+#ifndef BOOST_HAS_PTHREADS
+#  define BOOST_HAS_WINTHREADS
+#endif
+
+// WEK: Added
+#define BOOST_HAS_FTIME
+
+#endif
diff --git a/boost/boost/config/posix_features.hpp b/boost/boost/config/posix_features.hpp
new file mode 100644 (file)
index 0000000..2d9ec29
--- /dev/null
@@ -0,0 +1,71 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+// All POSIX feature tests go in this file:
+
+#  ifdef BOOST_HAS_UNISTD_H
+#     include <unistd.h>
+
+      // XOpen has <nl_types.h>, but is this the correct version check?
+#     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 3)
+#        define BOOST_HAS_NL_TYPES_H
+#     endif
+
+      // POSIX version 6 requires <stdint.h>
+#     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200100)
+#        define BOOST_HAS_STDINT_H
+#     endif
+
+      // POSIX version 2 requires <dirent.h>
+#     if defined(_POSIX_VERSION) && (_POSIX_VERSION >= 199009L)
+#        define BOOST_HAS_DIRENT_H
+#     endif
+
+      // POSIX defines _POSIX_THREADS > 0 for pthread support,
+      // however some platforms define _POSIX_THREADS without
+      // a value, hence the (_POSIX_THREADS+0 >= 0) check.
+      // Strictly speaking this may catch platforms with a
+      // non-functioning stub <pthreads.h>, but such occurrences should
+      // occur very rarely if at all.
+#     if defined(_POSIX_THREADS) && (_POSIX_THREADS+0 >= 0) && !defined(BOOST_HAS_WINTHREADS)
+#        define BOOST_HAS_PTHREADS
+#     endif
+
+      // BOOST_HAS_NANOSLEEP:
+      // This is predicated on _POSIX_TIMERS or _XOPEN_REALTIME:
+#     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0)) \
+             || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
+#        define BOOST_HAS_NANOSLEEP
+#     endif
+
+      // BOOST_HAS_CLOCK_GETTIME:
+      // This is predicated on _POSIX_TIMERS (also on _XOPEN_REALTIME
+      // but at least one platform - linux - defines that flag without
+      // defining clock_gettime):
+#     if (defined(_POSIX_TIMERS) && (_POSIX_TIMERS+0 >= 0))
+#        define BOOST_HAS_CLOCK_GETTIME
+#     endif
+
+      // BOOST_HAS_SCHED_YIELD:
+      // This is predicated on _POSIX_PRIORITY_SCHEDULING or
+      // on _POSIX_THREAD_PRIORITY_SCHEDULING or on _XOPEN_REALTIME.
+#     if defined(_POSIX_PRIORITY_SCHEDULING) && (_POSIX_PRIORITY_SCHEDULING+0 > 0)\
+            || (defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING+0 > 0))\
+            || (defined(_XOPEN_REALTIME) && (_XOPEN_REALTIME+0 >= 0))
+#        define BOOST_HAS_SCHED_YIELD
+#     endif
+
+      // BOOST_HAS_GETTIMEOFDAY:
+      // BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE:
+      // These are predicated on _XOPEN_VERSION, and appears to be first released
+      // in issue 4, version 2 (_XOPEN_VERSION > 500).
+#     if defined(_XOPEN_VERSION) && (_XOPEN_VERSION+0 >= 500)
+#        define BOOST_HAS_GETTIMEOFDAY
+#        define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
+#     endif
+
+#  endif
diff --git a/boost/boost/config/select_compiler_config.hpp b/boost/boost/config/select_compiler_config.hpp
new file mode 100644 (file)
index 0000000..14780ba
--- /dev/null
@@ -0,0 +1,78 @@
+//  Boost compiler configuration selection header file
+
+//  (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version.
+
+// locate which compiler we are using and define
+// BOOST_COMPILER_CONFIG as needed: 
+
+#if defined __GNUC__
+//  GNU C++:
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc.hpp"
+
+# elif defined __COMO__
+//  Comeau C++
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
+
+#elif defined __KCC
+//  Kai C++
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/kai.hpp"
+
+#elif defined __sgi
+//  SGI MIPSpro C++
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/sgi_mipspro.hpp"
+
+#elif defined __DECCXX
+//  Compaq Tru64 Unix cxx
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/compaq_cxx.hpp"
+
+#elif defined __ghs
+//  Greenhills C++
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/greenhills.hpp"
+
+#elif defined __BORLANDC__
+//  Borland
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/borland.hpp"
+
+#elif defined(__ICL) || defined(__ICC)
+//  Intel
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/intel.hpp"
+
+#elif defined  __MWERKS__
+//  Metrowerks CodeWarrior
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/metrowerks.hpp"
+
+#elif defined  __SUNPRO_CC
+//  Sun Workshop Compiler C++
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/sunpro_cc.hpp"
+
+#elif defined __HP_aCC
+//  HP aCC
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/hp_acc.hpp"
+
+#elif defined(__MRC__) || defined(__SC__)
+//  MPW MrCpp or SCpp
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/mpw.hpp"
+
+#elif defined(__IBMCPP__)
+//  IBM Visual Age
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/vacpp.hpp"
+
+#elif defined _MSC_VER
+//  Microsoft Visual C++
+//
+//  Must remain the last #elif since some other vendors (Metrowerks, for
+//  example) also #define _MSC_VER
+#   define BOOST_COMPILER_CONFIG "boost/config/compiler/visualc.hpp"
+
+#elif defined (BOOST_ASSERT_CONFIG)
+// this must come last - generate an error if we don't
+// recognise the compiler:
+#  error "Unknown compiler - please configure and report the results to boost.org"
+
+#endif
+
diff --git a/boost/boost/config/select_platform_config.hpp b/boost/boost/config/select_platform_config.hpp
new file mode 100644 (file)
index 0000000..5921cc5
--- /dev/null
@@ -0,0 +1,84 @@
+//  Boost compiler configuration selection header file
+
+//  (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version.
+
+// locate which platform we are on and define BOOST_PLATFORM_CONFIG as needed.
+// Note that we define the headers to include using "header_name" not
+// <header_name> in order to prevent macro expansion within the header
+// name (for example "linux" is a macro on linux systems).
+
+#if defined(linux) || defined(__linux) || defined(__linux__)
+// linux:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp"
+
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+// BSD:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/bsd.hpp"
+
+#elif defined(sun) || defined(__sun)
+// solaris:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/solaris.hpp"
+
+#elif defined(__sgi)
+// SGI Irix:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/irix.hpp"
+
+#elif defined(__hpux)
+// hp unix:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/hpux.hpp"
+
+#elif defined(__CYGWIN__)
+// cygwin is not win32:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/cygwin.hpp"
+
+#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+// win32:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/win32.hpp"
+
+#elif defined(__BEOS__)
+// BeOS
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/beos.hpp"
+
+#elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
+// MacOS
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/macos.hpp"
+
+#elif defined(__IBMCPP__)
+// IBM
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/aix.hpp"
+
+#elif defined(__amigaos__)
+// AmigaOS
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/amigaos.hpp"
+
+#else
+
+#  if defined(unix) \
+      || defined(__unix) \
+      || defined(_XOPEN_SOURCE) \
+      || defined(_POSIX_SOURCE)
+
+   // generic unix platform:
+
+#  ifndef BOOST_HAS_UNISTD_H
+#     define BOOST_HAS_UNISTD_H
+#  endif
+
+#  include <boost/config/posix_features.hpp>
+
+#  endif
+
+#  if defined (BOOST_ASSERT_CONFIG)
+      // this must come last - generate an error if we don't
+      // recognise the platform:
+#     error "Unknown platform - please configure and report the results to boost.org"
+#  endif
+
+#endif
+
+
diff --git a/boost/boost/config/select_stdlib_config.hpp b/boost/boost/config/select_stdlib_config.hpp
new file mode 100644 (file)
index 0000000..a3fa2ca
--- /dev/null
@@ -0,0 +1,61 @@
+//  Boost compiler configuration selection header file
+
+//  (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version.
+
+// locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed:
+
+// we need to include a std lib header here in order to detect which
+// library is in use, use <utility> as it's about the smallest
+// of the std lib headers - do not rely on this header being included -
+// users can short-circuit this header if they know whose std lib
+// they are using.
+
+#include <utility>
+
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+// STLPort library; this _must_ come first, otherwise since
+// STLport typically sits on top of some other library, we
+// can end up detecting that first rather than STLport:
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp"
+
+#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
+// Rogue Wave library:
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
+
+#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
+// Dinkumware Library:
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/dinkumware.hpp"
+
+#elif defined(__GLIBCPP__)
+// GNU libstdc++ 3
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
+
+#elif defined(__STL_CONFIG_H)
+// generic SGI STL
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/sgi.hpp"
+
+#elif defined(__MSL_CPP__)
+// MSL standard lib:
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/msl.hpp"
+
+#elif defined(__IBMCPP__)
+// take the default VACPP std lib
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/vacpp.hpp"
+
+#elif defined(MSIPL_COMPILE_H)
+// Modena C++ standard library
+#  define BOOST_STDLIB_CONFIG "boost/config/stdlib/modena.hpp"
+
+#elif defined (BOOST_ASSERT_CONFIG)
+// this must come last - generate an error if we don't
+// recognise the library:
+#  error "Unknown standard library - please configure and report the results to boost.org"
+
+#endif
+
+
diff --git a/boost/boost/config/stdlib/dinkumware.hpp b/boost/boost/config/stdlib/dinkumware.hpp
new file mode 100644 (file)
index 0000000..5b13f7e
--- /dev/null
@@ -0,0 +1,73 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Dinkumware standard library config:
+
+#if !defined(_YVALS) && !defined(_CPPLIB_VER)
+#include <utility>
+#if !defined(_YVALS) && !defined(_CPPLIB_VER)
+#error This is not the Dinkumware lib!
+#endif
+#endif
+
+
+#if defined(_CPPLIB_VER) && (_CPPLIB_VER >= 306)
+   // full dinkumware 3.06 and above
+   // fully conforming provided the compiler supports it:
+#  if !(defined(_GLOBAL_USING) && (_GLOBAL_USING+0 > 0)) && !defined(_STD)   // can be defined in yvals.h
+#     define BOOST_NO_STDC_NAMESPACE
+#  endif
+#  if !(defined(_HAS_MEMBER_TEMPLATES_REBIND) && (_HAS_MEMBER_TEMPLATES_REBIND+0 > 0))
+#     define BOOST_NO_STD_ALLOCATOR
+#  endif
+#  if defined(_MSC_VER) && (_MSC_VER < 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
+      // C lib functions aren't in namespace std either:
+#     define BOOST_NO_STDC_NAMESPACE
+#  endif
+// 3.06 appears to have (non-sgi versions of) <hash_set> & <hash_map>, 
+// and no <slist> at all
+#else
+#  define BOOST_MSVC_STD_ITERATOR 1
+#  define BOOST_NO_STD_ITERATOR
+#  define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
+#  define BOOST_NO_STD_ALLOCATOR
+#  define BOOST_NO_STDC_NAMESPACE
+#  define BOOST_NO_STD_USE_FACET
+#  define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
+#  define BOOST_HAS_MACRO_USE_FACET
+#  ifndef _CPPLIB_VER
+      // Updated Dinkum library defines this, and provides
+      // its own min and max definitions.
+#     define BOOST_NO_STD_MIN_MAX
+#     undef min
+#     undef max
+#  endif
+#  ifndef NOMINMAX
+      // avoid spurious NOMINMAX redefinition warning
+#     define NOMINMAX
+#  endif
+#endif
+
+#if defined(_MSC_VER) && (_MSC_VER <= 1200) || !defined(_CPPLIB_VER) || _CPPLIB_VER < 306
+   // if we're using a dinkum lib that's
+   // been configured for VC6 then there is
+   // no iterator traits (true even for icl)
+#  define BOOST_NO_STD_ITERATOR_TRAITS
+#endif
+
+#ifdef _CPPLIB_VER
+#  define BOOST_STDLIB "Dinkumware standard library version " BOOST_STRINGIZE(_CPPLIB_VER)
+#else
+#  define BOOST_STDLIB "Dinkumware standard library version 1.x"
+#endif
+
+
+
+
diff --git a/boost/boost/config/stdlib/libstdcpp3.hpp b/boost/boost/config/stdlib/libstdcpp3.hpp
new file mode 100644 (file)
index 0000000..7493677
--- /dev/null
@@ -0,0 +1,24 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  config for libstdc++ v3
+//  not much to go in here:
+
+#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
+
+#ifndef _GLIBCPP_USE_WCHAR_T
+#  define BOOST_NO_CWCHAR
+#  define BOOST_NO_CWCTYPE
+#  define BOOST_NO_STD_WSTRING
+#endif
+#ifndef _GLIBCPP_USE_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/modena.hpp b/boost/boost/config/stdlib/modena.hpp
new file mode 100644 (file)
index 0000000..8d68cee
--- /dev/null
@@ -0,0 +1,29 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Modena C++ standard library (comes with KAI C++)
+
+#if !defined(MSIPL_COMPILE_H)
+#  include <utility>
+#  if !defined(__MSIPL_COMPILE_H)
+#      error "This is not the Modena C++ library!"
+#  endif
+#endif
+
+#ifndef MSIPL_NL_TYPES
+#define BOOST_NO_STD_MESSAGES
+#endif
+
+#ifndef MSIPL_WCHART
+#define BOOST_NO_STD_WSTRING
+#endif
+
+#define BOOST_STDLIB "Modena C++ standard library"
+
+
+
+
diff --git a/boost/boost/config/stdlib/msl.hpp b/boost/boost/config/stdlib/msl.hpp
new file mode 100644 (file)
index 0000000..009e779
--- /dev/null
@@ -0,0 +1,50 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Metrowerks standard library:
+
+#ifndef __MSL_CPP__
+#  include <utility>
+#  ifndef __MSL_CPP__
+#     error This is not the MSL standard library!
+#  endif
+#endif
+
+#if __MSL_CPP__ >= 0x6000  // Pro 6
+#  define BOOST_HAS_HASH
+#  define BOOST_STD_EXTENSION_NAMESPACE Metrowerks
+#endif
+#define BOOST_HAS_SLIST
+
+#if __MSL_CPP__ < 0x6209
+#  define BOOST_NO_STD_MESSAGES
+#endif
+
+// check C lib version for <stdint.h>
+#include <cstddef>
+
+#if defined(__MSL__) && (__MSL__ >= 0x5000)
+#  define BOOST_HAS_STDINT_H
+#  define BOOST_HAS_UNISTD_H
+   // boilerplate code:
+#  include <boost/config/posix_features.hpp>
+#endif
+
+#if _MWMT
+#  define BOOST_HAS_THREADS
+#endif
+
+
+#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)
+
+
+
+
+
+
+
+
diff --git a/boost/boost/config/stdlib/roguewave.hpp b/boost/boost/config/stdlib/roguewave.hpp
new file mode 100644 (file)
index 0000000..07e3729
--- /dev/null
@@ -0,0 +1,107 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  Rogue Wave std lib:
+
+#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
+#  include <utility>
+#  if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
+#     error This is not the Rogue Wave standard library
+#  endif
+#endif
+//
+// figure out a consistent version number:
+//
+#ifndef _RWSTD_VER
+#  define BOOST_RWSTD_VER 0x010000
+#elif _RWSTD_VER < 0x010000
+#  define BOOST_RWSTD_VER (_RWSTD_VER << 8)
+#else
+#  define BOOST_RWSTD_VER _RWSTD_VER
+#endif
+
+#ifndef _RWSTD_VER
+#  define BOOST_STDLIB "Rogue Wave standard library version (Unknown version)"
+#else
+#  define BOOST_STDLIB "Rogue Wave standard library version " BOOST_STRINGIZE(_RWSTD_VER)
+#endif
+
+//
+// Prior to version 2.2.0 the primary template for std::numeric_limits
+// does not have compile time constants, even though specializations of that
+// template do:
+//
+#if BOOST_RWSTD_VER < 0x020200
+#  define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#endif
+
+//
+// No std::iterator if it can't figure out default template args:
+//
+#if defined(_RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || defined(RWSTD_NO_SIMPLE_DEFAULT_TEMPLATES) || (BOOST_RWSTD_VER < 0x020000)
+#  define BOOST_NO_STD_ITERATOR
+#endif
+
+//
+// No iterator traits without partial specialization:
+//
+#if defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) || defined(RWSTD_NO_CLASS_PARTIAL_SPEC)
+#  define BOOST_NO_STD_ITERATOR_TRAITS
+#endif
+
+//
+// Prior to version 2.0, std::auto_ptr was buggy, and there were no
+// new-style iostreams, and no conformant std::allocator:
+//
+#if (BOOST_RWSTD_VER < 0x020000)
+#  define BOOST_NO_AUTO_PTR
+#  define BOOST_NO_STRINGSTREAM
+#  define BOOST_NO_STD_ALLOCATOR
+#  define BOOST_NO_STD_LOCALE
+#endif
+
+//
+// No template iterator constructors without member template support:
+//
+#if defined(RWSTD_NO_MEMBER_TEMPLATES) || defined(_RWSTD_NO_MEMBER_TEMPLATES)
+#  define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
+#endif
+
+//
+// RW defines _RWSTD_ALLOCATOR if the allocator is conformant and in use
+// (the or _HPACC_ part is a hack - the library seems to define _RWSTD_ALLOCATOR
+// on HP aCC systems even though the allocator is in fact broken):
+//
+#if !defined(_RWSTD_ALLOCATOR) || (defined(__HP_aCC) && __HP_aCC <= 33100)
+#  define BOOST_NO_STD_ALLOCATOR
+#endif
+
+//
+// If we have a std::locale, we still may not have std::use_facet:
+//
+#if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE) && !defined(BOOST_NO_STD_LOCALE)
+#  define BOOST_NO_STD_USE_FACET
+#  define BOOST_HAS_TWO_ARG_USE_FACET
+#endif
+
+//
+// There's no std::distance prior to version 2, or without
+// partial specialization support:
+//
+#if (BOOST_RWSTD_VER < 0x020000) || defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+    #define BOOST_NO_STD_DISTANCE
+#endif
+
+//
+// Some versions of the rogue wave library don't have assignable
+// OutputIterators:
+//
+#if BOOST_RWSTD_VER < 0x020100
+#  define BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
+#endif
+
+
diff --git a/boost/boost/config/stdlib/sgi.hpp b/boost/boost/config/stdlib/sgi.hpp
new file mode 100644 (file)
index 0000000..dd086c2
--- /dev/null
@@ -0,0 +1,107 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  generic SGI STL:
+
+#if !defined(__STL_CONFIG_H)
+#  include <utility>
+#  if !defined(__STL_CONFIG_H)
+#      error "This is not the SGI STL!"
+#  endif
+#endif
+
+//
+// No std::iterator traits without partial specialisation:
+//
+#if !defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
+#  define BOOST_NO_STD_ITERATOR_TRAITS
+#endif
+
+//
+// No std::stringstream with gcc < 3
+//
+#if defined(__GNUC__) && (__GNUC__ < 3) && \
+     ((__GNUC_MINOR__ < 95) || (__GNUC_MINOR__ == 96)) && \
+     !defined(__STL_USE_NEW_IOSTREAMS) || \
+   defined(__APPLE_CC__)
+   // Note that we only set this for GNU C++ prior to 2.95 since the
+   // latest patches for that release do contain a minimal <sstream>
+   // If you are running a 2.95 release prior to 2.95.3 then this will need
+   // setting, but there is no way to detect that automatically (other
+   // than by running the configure script).
+   // Also, the unofficial GNU C++ 2.96 included in RedHat 7.1 doesn't
+   // have <sstream>.
+#  define BOOST_NO_STRINGSTREAM
+#endif
+
+//
+// Assume no std::locale without own iostreams (this may be an
+// incorrect assumption in some cases):
+//
+#if !defined(__SGI_STL_OWN_IOSTREAMS) && !defined(__STL_USE_NEW_IOSTREAMS)
+#  define BOOST_NO_STD_LOCALE
+#endif
+
+//
+// Original native SGI streams have non-standard std::messages facet:
+//
+#if defined(__sgi) && (_COMPILER_VERSION <= 650) && !defined(__SGI_STL_OWN_IOSTREAMS)
+#  define BOOST_NO_STD_LOCALE
+#endif
+
+//
+// SGI's new iostreams have missing "const" in messages<>::open
+//
+#if defined(__sgi) && (_COMPILER_VERSION <= 730) && defined(__STL_USE_NEW_IOSTREAMS)
+#  define BOOST_NO_STD_MESSAGES
+#endif
+
+//
+// No template iterator constructors, or std::allocator
+// without member templates:
+//
+#if !defined(__STL_MEMBER_TEMPLATES)
+#  define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
+#  define BOOST_NO_STD_ALLOCATOR
+#endif
+
+//
+// We always have SGI style hash_set, hash_map, and slist:
+//
+#define BOOST_HAS_HASH
+#define BOOST_HAS_SLIST
+
+//
+// If this is GNU libstdc++2, then no <limits> and no std::wstring:
+//
+#if (defined(__GNUC__) && (__GNUC__ < 3))
+#  include <string>
+#  if defined(__BASTRING__)
+#     define BOOST_NO_LIMITS
+// Note: <boost/limits.hpp> will provide compile-time constants
+#     undef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#     define BOOST_NO_STD_WSTRING
+#  endif
+#endif
+
+//
+// There is no standard iterator unless we have namespace support:
+//
+#if !defined(__STL_USE_NAMESPACES)
+#  define BOOST_NO_STD_ITERATOR
+#endif
+
+//
+// Intrinsic type_traits support.
+// The SGI STL has it's own __type_traits class, which
+// has intrinsic compiler support with SGI's compilers.
+// Whatever map SGI style type traits to boost equivalents:
+//
+#define BOOST_HAS_SGI_TYPE_TRAITS
+
+#define BOOST_STDLIB "SGI standard library"
+
diff --git a/boost/boost/config/stdlib/stlport.hpp b/boost/boost/config/stdlib/stlport.hpp
new file mode 100644 (file)
index 0000000..41ac097
--- /dev/null
@@ -0,0 +1,134 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+//  STLPort standard library config:
+
+#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+#  include <utility>
+#  if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+#      error "This is not STLPort!"
+#  endif
+#endif
+
+//
+// __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+// for versions prior to 4.1(beta)
+//
+#if (defined(__STL_STATIC_CONST_INIT_BUG) || defined(_STLP_STATIC_CONST_INIT_BUG)) && (__SGI_STL_PORT <= 0x400)
+#  define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#endif
+
+//
+// If STLport thinks that there is no partial specialisation, then there is no
+// std::iterator traits:
+//
+#if !(defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || defined(__STL_CLASS_PARTIAL_SPECIALIZATION))
+#  define BOOST_NO_STD_ITERATOR_TRAITS
+#endif
+
+//
+// No new style iostreams on GCC without STLport's iostreams enabled:
+//
+#if (defined(__GNUC__) && (__GNUC__ < 3)) && !(defined(__SGI_STL_OWN_IOSTREAMS) || defined(_STLP_OWN_IOSTREAMS))
+#  define BOOST_NO_STRINGSTREAM
+#endif
+
+//
+// No new iostreams implies no std::locale, and no std::stringstream:
+//
+#if defined(__STL_NO_IOSTREAMS) || defined(__STL_NO_NEW_IOSTREAMS) || defined(_STLP_NO_IOSTREAMS) || defined(_STLP_NO_NEW_IOSTREAMS)
+#  define BOOST_NO_STD_LOCALE
+#  define BOOST_NO_STRINGSTREAM
+#endif
+
+//
+// If the streams are not native, and we have a "using ::x" compiler bug
+// then the io stream facets are not available in namespace std::
+//
+#if !defined(_STLP_OWN_IOSTREAMS) && defined(_STLP_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
+#  define BOOST_NO_STD_LOCALE
+#endif
+#if !defined(__SGI_STL_OWN_IOSTREAMS) && defined(__STL_USE_NAMESPACES) && defined(BOOST_NO_USING_TEMPLATE) && !defined(__BORLANDC__)
+#  define BOOST_NO_STD_LOCALE
+#endif
+
+//
+// Without member template support enabled, their are no template
+// iterate constructors, and no std::allocator:
+//
+#if !(defined(__STL_MEMBER_TEMPLATES) || defined(_STLP_MEMBER_TEMPLATES))
+#  define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
+#  define BOOST_NO_STD_ALLOCATOR
+#endif
+
+#if !defined(_STLP_MEMBER_TEMPLATE_CLASSES)
+#  define BOOST_NO_STD_ALLOCATOR
+#endif
+
+//
+// We always have SGI style hash_set, hash_map, and slist:
+//
+#define BOOST_HAS_HASH
+#define BOOST_HAS_SLIST
+
+//
+// STLport does a good job of importing names into namespace std::,
+// but doesn't always get them all, define BOOST_NO_STDC_NAMESPACE, since our
+// workaround does not conflict with STLports:
+//
+//
+// Harold Howe says:
+// Borland switched to STLport in BCB6. Defining BOOST_NO_STDC_NAMESPACE with
+// BCB6 does cause problems. If we detect BCB6, then don't define 
+// BOOST_NO_STDC_NAMESPACE
+//
+#if !defined(__BORLANDC__) || (__BORLANDC__ < 0x560)
+#  if defined(__STL_IMPORT_VENDOR_CSTD) || defined(__STL_USE_OWN_NAMESPACE) || defined(_STLP_IMPORT_VENDOR_CSTD) || defined(_STLP_USE_OWN_NAMESPACE)
+#     define BOOST_NO_STDC_NAMESPACE
+#  endif
+#endif
+//
+// std::iterator behaves like VC6's under some circumstances:
+//
+#if defined (_STLP_USE_OLD_HP_ITERATOR_QUERIES)  || defined (__STL_USE_OLD_HP_ITERATOR_QUERIES)\
+ || (!defined ( _STLP_CLASS_PARTIAL_SPECIALIZATION ) && !defined ( __STL_CLASS_PARTIAL_SPECIALIZATION ))
+#  define BOOST_MSVC_STD_ITERATOR
+#endif
+
+//
+// std::use_facet may be non-standard, uses a class instead:
+//
+#if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) || defined(_STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS)
+#  define BOOST_NO_STD_USE_FACET
+#  define BOOST_HAS_STLP_USE_FACET
+#endif
+
+//
+// If STLport thinks there are no wide functions, <cwchar> etc. is not working; but
+// only if BOOST_NO_STDC_NAMESPACE is not defined (if it is then we do the import 
+// into std:: ourselves).
+//
+#if defined(_STLP_NO_NATIVE_WIDE_FUNCTIONS) && !defined(BOOST_NO_STDC_NAMESPACE)
+#  define BOOST_NO_CWCHAR
+#  define BOOST_NO_CWTYPE
+#endif
+
+//
+// Borland ships a version of STLport with C++ Builder 6 that lacks
+// hashtables and the like:
+//
+#if defined(__BORLANDC__) && (__BORLANDC__ == 0x560)
+#  undef BOOST_HAS_HASH
+#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
new file mode 100644 (file)
index 0000000..ad4d2fc
--- /dev/null
@@ -0,0 +1,13 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version.
+
+#define BOOST_HAS_MACRO_USE_FACET
+#define BOOST_NO_STD_ALLOCATOR
+
+#define BOOST_STDLIB "Visual Age default standard library"
+
+
diff --git a/boost/boost/config/suffix.hpp b/boost/boost/config/suffix.hpp
new file mode 100644 (file)
index 0000000..7175f80
--- /dev/null
@@ -0,0 +1,346 @@
+//  Boost config.hpp configuration header file  ------------------------------//
+
+//  (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version.
+
+//  Boost config.hpp policy and rationale documentation has been moved to
+//  http://www.boost.org/libs/config
+//
+//  This file is intended to be stable, and relatively unchanging.
+//  It should contain boilerplate code only - no compiler specific
+//  code unless it is unavoidable - no changes unless unavoidable.
+
+#ifndef BOOST_CONFIG_SUFFIX_HPP
+#define BOOST_CONFIG_SUFFIX_HPP
+
+# ifndef BOOST_DECL
+#   define BOOST_DECL  // default for compilers not needing this decoration.
+# endif
+
+//
+// look for long long by looking for the appropriate macros in <limits.h>.
+// Note that we use limits.h rather than climits for maximal portability,
+// remember that since these just declare a bunch of macros, there should be
+// no namespace issues from this.
+//
+#include <limits.h>
+# if !defined(BOOST_MSVC) && !defined(__BORLANDC__) \
+   && (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
+#  define BOOST_HAS_LONG_LONG
+#endif
+#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_INTEGRAL_INT64_T)
+#  define BOOST_NO_INTEGRAL_INT64_T
+#endif
+
+// GCC 3.x will clean up all of those nasty macro definitions that
+// BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
+// it under GCC 3.x.
+#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
+#  undef BOOST_NO_CTYPE_FUNCTIONS
+#endif
+
+
+//
+// Assume any extensions are in namespace std:: unless stated otherwise:
+//
+#  ifndef BOOST_STD_EXTENSION_NAMESPACE
+#    define BOOST_STD_EXTENSION_NAMESPACE std
+#  endif
+
+//
+// If cv-qualified specializations are not allowed, then neither are cv-void ones:
+//
+#  if defined(BOOST_NO_CV_SPECIALIZATIONS) \
+      && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
+#     define BOOST_NO_CV_VOID_SPECIALIZATIONS
+#  endif
+
+//
+// If there is no numeric_limits template, then it can't have any compile time
+// constants either!
+//
+#  if defined(BOOST_NO_LIMITS) \
+      && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
+#     define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#  endif
+
+//
+// if member templates are supported then so is the
+// VC6 subset of member templates:
+//
+#  if !defined(BOOST_NO_MEMBER_TEMPLATES) \
+       && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+#     define BOOST_MSVC6_MEMBER_TEMPLATES
+#  endif
+
+//
+// Without partial specialization, can't test for partial specialisation bugs:
+//
+#  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+      && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
+#     define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
+#  endif
+
+//
+// Without partial specialization, std::iterator_traits can't work:
+//
+#  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+      && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+#     define BOOST_NO_STD_ITERATOR_TRAITS
+#  endif
+
+//
+// Without member template support, we can't have template constructors
+// in the standard library either:
+//
+#  if defined(BOOST_NO_MEMBER_TEMPLATES) \
+      && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
+      && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
+#     define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
+#  endif
+
+//
+// Without member template support, we can't have a conforming
+// std::allocator template either:
+//
+#  if defined(BOOST_NO_MEMBER_TEMPLATES) \
+      && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
+      && !defined(BOOST_NO_STD_ALLOCATOR)
+#     define BOOST_NO_STD_ALLOCATOR
+#  endif
+
+//
+// We can't have a working std::use_facet if there is no std::locale:
+//
+#  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
+#     define BOOST_NO_STD_USE_FACET
+#  endif
+
+//
+// We can't have a std::messages facet if there is no std::locale:
+//
+#  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
+#     define BOOST_NO_STD_MESSAGES
+#  endif
+
+//
+// We can't have a <cwctype> if there is no <cwchar>:
+//
+#  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
+#     define BOOST_NO_CWCTYPE
+#  endif
+
+//
+// We can't have a swprintf if there is no <cwchar>:
+//
+#  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
+#     define BOOST_NO_SWPRINTF
+#  endif
+
+//
+// If Win32 support is turned off, then we must turn off
+// threading support also, unless there is some other
+// thread API enabled:
+//
+#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
+   && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
+#  define BOOST_DISABLE_THREADS
+#endif
+
+//
+// Turn on threading support if the compiler thinks that it's in
+// multithreaded mode.  We put this here because there are only a
+// limited number of macros that identify this (if there's any missing
+// from here then add to the appropriate compiler section):
+//
+#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
+    || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
+#  define BOOST_HAS_THREADS
+#endif
+
+//
+// Turn threading support off if BOOST_DISABLE_THREADS is defined:
+//
+#if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
+#  undef BOOST_HAS_THREADS
+#endif
+
+//
+// Turn threading support off if we don't recognise the threading API:
+//
+#if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
+      && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
+      && !defined(BOOST_HAS_MPTASKS)
+#  undef BOOST_HAS_THREADS
+#endif
+
+//
+// If the compiler claims to be C99 conformant, then it had better
+// have a <stdint.h>:
+//
+#  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
+#     define BOOST_HAS_STDINT_H
+#  endif
+
+//
+// Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
+// Note that this is for backwards compatibility only.
+//
+#  ifndef BOOST_HAS_SLIST
+#     define BOOST_NO_SLIST
+#  endif
+
+#  ifndef BOOST_HAS_HASH
+#     define BOOST_NO_HASH
+#  endif
+
+//  BOOST_NO_STDC_NAMESPACE workaround  --------------------------------------//
+//  Because std::size_t usage is so common, even in boost headers which do not
+//  otherwise use the C library, the <cstddef> workaround is included here so
+//  that ugly workaround code need not appear in many other boost headers.
+//  NOTE WELL: This is a workaround for non-conforming compilers; <cstddef> 
+//  must still be #included in the usual places so that <cstddef> inclusion
+//  works as expected with standard conforming compilers.  The resulting
+//  double inclusion of <cstddef> is harmless.
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+#   include <cstddef>
+    namespace std { using ::ptrdiff_t; using ::size_t; }
+# endif
+
+//  BOOST_NO_STD_MIN_MAX workaround  -----------------------------------------//
+
+#  ifdef BOOST_NO_STD_MIN_MAX
+
+namespace std {
+  template <class _Tp>
+  inline const _Tp& min(const _Tp& __a, const _Tp& __b) {
+    return __b < __a ? __b : __a;
+  }
+  template <class _Tp>
+  inline const _Tp& max(const _Tp& __a, const _Tp& __b) {
+    return  __a < __b ? __b : __a;
+  }
+#     ifdef BOOST_MSVC
+  // 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;
+  }
+#     endif
+}
+
+#  endif
+
+// BOOST_STATIC_CONSTANT workaround --------------------------------------- //
+// On compilers which don't allow in-class initialization of static integral
+// constant members, we must use enums as a workaround if we want the constants
+// to be available at compile-time. This macro gives us a convenient way to
+// declare such constants.
+
+#  ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+#       define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
+#  else
+#     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
+#  endif
+
+// BOOST_USE_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.
+// Usage:
+//    replace
+//       std::use_facet<Type>(loc);
+//    with
+//       BOOST_USE_FACET(Type, loc);
+//    Note do not add a std:: prefix to the front of BOOST_USE_FACET!
+
+#if defined(BOOST_NO_STD_USE_FACET)
+#  ifdef BOOST_HAS_TWO_ARG_USE_FACET
+#     define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
+#  elif defined(BOOST_HAS_MACRO_USE_FACET)
+#     define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
+#  elif defined(BOOST_HAS_STLP_USE_FACET)
+#     define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
+#  endif
+#else
+#  define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
+#endif
+
+// BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
+// Member templates are supported by some compilers even though they can't use
+// the A::template member<U> syntax, as a workaround replace:
+//
+// typedef typename A::template rebind<U> binder;
+//
+// with:
+//
+// typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
+#  define BOOST_NESTED_TEMPLATE template
+#else
+#  define BOOST_NESTED_TEMPLATE
+#endif
+
+// ---------------------------------------------------------------------------//
+
+//
+// Helper macro BOOST_STRINGIZE:
+// Converts the parameter X to a string after macro replacement
+// on X has been performed.
+//
+#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
+#define BOOST_DO_STRINGIZE(X) #X
+
+//
+// Helper macro BOOST_JOIN:
+// The following piece of macro magic joins the two 
+// arguments together, even when one of the arguments is
+// itself a macro (see 16.3.1 in C++ standard).  The key
+// is that macro expansion of macro arguments does not
+// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
+//
+#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
+#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
+#define BOOST_DO_JOIN2( X, Y ) X##Y
+
+//
+// Set some default values for compiler/library/platform names.
+// These are for debugging config setup only:
+//
+#  ifndef BOOST_COMPILER
+#     define BOOST_COMPILER "Unknown ISO C++ Compiler"
+#  endif
+#  ifndef BOOST_STDLIB
+#     define BOOST_STDLIB "Unknown ISO standard library"
+#  endif
+#  ifndef BOOST_PLATFORM
+#     if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
+         || defined(_POSIX_SOURCE)
+#        define BOOST_PLATFORM "Generic Unix"
+#     else
+#        define BOOST_PLATFORM "Unknown"
+#     endif
+#  endif
+
+#endif
+
diff --git a/boost/boost/config/user.hpp b/boost/boost/config/user.hpp
new file mode 100644 (file)
index 0000000..98adbac
--- /dev/null
@@ -0,0 +1,68 @@
+//  boost/config/user.hpp  ---------------------------------------------------//
+
+//  (C) Copyright Boost.org 2001. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  Do not check in modified versions of this file,
+//  This file may be customized by the end user, but not by boost.
+
+//
+//  Use this file to define a site and compiler specific
+//  configuration policy:
+//
+
+// define this to locate a compiler config file:
+// #define BOOST_COMPILER_CONFIG <myheader>
+
+// define this to locate a stdlib config file:
+// #define BOOST_STDLIB_CONFIG   <myheader>
+
+// define this to locate a platform config file:
+// #define BOOST_PLATFORM_CONFIG <myheader>
+
+// define this to disable compiler config,
+// use if your compiler config has nothing to set:
+// #define BOOST_NO_COMPILER_CONFIG
+
+// define this to disable stdlib config,
+// use if your stdlib config has nothing to set:
+// #define BOOST_NO_STDLIB_CONFIG
+
+// define this to disable platform config,
+// use if your platform config has nothing to set:
+// #define BOOST_NO_PLATFORM_CONFIG
+
+// define this to disable all config options,
+// excluding the user config.  Use if your
+// setup is fully ISO compliant, and has no
+// useful extensions, or for autoconf generated
+// setups:
+// #define BOOST_NO_CONFIG
+
+// define this to make the config "optimistic"
+// about unknown compiler versions.  Normally
+// unknown compiler versions are assumed to have
+// all the defects of the last known version, however
+// setting this flag, causes the config to assume
+// that unknown compiler versions are fully conformant
+// with the standard:
+// #define BOOST_STRICT_CONFIG
+
+// define this to cause the config to halt compilation
+// with an #error if it encounters anything unknown --
+// either an unknown compiler version or an unknown
+// compiler/platform/library:
+// #define BOOST_ASSERT_CONFIG
+
+
+// define if you want to disable threading support, even
+// when available:
+// #define BOOST_DISABLE_THREADS
+
+// define when you want to disable Win32 specific features
+// even when available:
+// #define BOOST_DISABLE_WIN32
+
+
diff --git a/boost/boost/counting_iterator.hpp b/boost/boost/counting_iterator.hpp
new file mode 100644 (file)
index 0000000..ef3b07d
--- /dev/null
@@ -0,0 +1,229 @@
+// (C) Copyright David Abrahams and Jeremy Siek 2000-2001. Permission to copy,
+// use, modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided "as is"
+// without express or implied warranty, and with no claim as to its suitability
+// for any purpose.
+//
+// See http://www.boost.org for most recent version including documentation.
+//
+// Supplies:
+//
+//   template <class Incrementable> class counting_iterator_traits;
+//   template <class Incrementable> class counting_iterator_policies;
+//
+//     Iterator traits and policies for adapted iterators whose dereferenced
+//     value progresses through consecutive values of Incrementable when the
+//     iterator is derferenced.
+//
+//   template <class Incrementable> struct counting_iterator_generator;
+//
+//     A "type generator" whose nested type "type" is a counting iterator as
+//     described above.
+//
+//   template <class Incrementable>
+//     typename counting_iterator_generator<Incrementable>::type
+//     make_counting_iterator(Incrementable);
+//
+//     A function which produces an adapted counting iterator over values of
+//     Incrementable.
+// 
+// Revision History
+// 14 Feb 2001  Removed unnecessary typedefs from counting_iterator_traits
+//              (Jeremy Siek)
+// 11 Feb 2001  Use BOOST_STATIC_CONSTANT (Dave Abrahams)
+// 11 Feb 2001  Clean up after John Maddocks's (finally effective!) Borland
+//              fixes (David Abrahams).
+// 10 Feb 2001  Use new iterator_adaptor<> interface (David Abrahams)
+// 10 Feb 2001  Rolled in supposed Borland fixes from John Maddock, but not
+//              seeing any improvement yet (David Abrahams)
+// 09 Feb 2001  Factored out is_numeric computation. Borland still
+//              unhappy :( (David Abrahams)
+// 08 Feb 2001  Beginning of a failed attempt to appease Borland
+//              (David Abrahams)
+// 07 Feb 2001  rename counting_iterator() -> make_counting_iterator()
+//              (David Abrahams)        
+// 04 Feb 2001  Added counting_iterator_generator; updated comments
+//              (David Abrahams)
+// 24 Jan 2001  initial revision, based on Jeremy Siek's
+//              boost/pending/integer_range.hpp (David Abrahams)
+
+#ifndef BOOST_COUNTING_ITERATOR_HPP_DWA20000119
+# define BOOST_COUNTING_ITERATOR_HPP_DWA20000119
+
+# include <boost/config.hpp>
+# include <boost/detail/iterator.hpp>
+# include <boost/iterator_adaptors.hpp>
+# include <boost/type_traits.hpp>
+# include <boost/detail/numeric_traits.hpp>
+# include <boost/static_assert.hpp>
+# include <boost/limits.hpp>
+
+namespace boost {
+
+namespace detail {
+
+  // Template class counting_iterator_traits_select -- choose an
+  // iterator_category and difference_type for a counting_iterator at
+  // compile-time based on whether or not it wraps an integer or an iterator,
+  // using "poor man's partial specialization".
+  template <bool is_integer> struct counting_iterator_traits_select;
+
+  // Incrementable is an iterator type
+  template <>
+  struct counting_iterator_traits_select<false>
+  {
+      template <class Incrementable>
+      struct traits
+      {
+       private:
+          typedef boost::detail::iterator_traits<Incrementable> x;
+       public:
+          typedef typename x::iterator_category iterator_category;
+          typedef typename x::difference_type difference_type;
+      };
+  };
+
+  // Incrementable is a numeric type
+  template <>
+  struct counting_iterator_traits_select<true>
+  {
+      template <class Incrementable>
+      struct traits
+      {
+          typedef typename
+            boost::detail::numeric_traits<Incrementable>::difference_type
+          difference_type;
+          typedef std::random_access_iterator_tag iterator_category;
+      };
+  };
+
+  // Template class distance_policy_select -- choose a policy for computing the
+  // distance between counting_iterators at compile-time based on whether or not
+  // the iterator wraps an integer or an iterator, using "poor man's partial
+  // specialization".
+
+  template <bool is_integer> struct distance_policy_select;
+
+  // A policy for wrapped iterators
+  template <>
+  struct distance_policy_select<false>
+  {
+      template <class Distance, class Incrementable>
+      struct policy {
+          static Distance distance(Incrementable x, Incrementable y)
+              { return boost::detail::distance(x, y); }
+      };
+  };
+
+  // A policy for wrapped numbers
+  template <>
+  struct distance_policy_select<true>
+  {
+      template <class Distance, class Incrementable>
+      struct policy {
+          static Distance distance(Incrementable x, Incrementable y)
+              { return numeric_distance(x, y); }
+      };
+  };
+
+  // Try to detect numeric types at compile time in ways compatible with the
+  // limitations of the compiler and library.
+  template <class T>
+  struct is_numeric {
+    // For a while, this wasn't true, but we rely on it below. This is a regression assert.
+    BOOST_STATIC_ASSERT(::boost::is_integral<char>::value);
+# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#  if defined(BOOST_HAS_LONG_LONG)
+    BOOST_STATIC_CONSTANT(bool,
+                          value = (
+                              std::numeric_limits<T>::is_specialized
+                              | boost::is_same<T,long long>::value
+                              | boost::is_same<T,unsigned long long>::value));
+#  else
+     BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<T>::is_specialized);
+#  endif
+# else
+#  if !defined(__BORLANDC__)
+    BOOST_STATIC_CONSTANT(bool, value = (
+        boost::is_convertible<int,T>::value && boost::is_convertible<T,int>::value));
+#  else
+    BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic<T>::value);
+#  endif
+# endif
+  };
+
+  // Compute the distance over arbitrary numeric and/or iterator types
+  template <class Distance, class Incrementable>
+  Distance any_distance(Incrementable start, Incrementable finish, Distance* = 0)
+  {
+    
+      return distance_policy_select<(
+          is_numeric<Incrementable>::value)>::template
+          policy<Distance, Incrementable>::distance(start, finish);
+  }
+  
+} // namespace detail
+
+template <class Incrementable>
+struct counting_iterator_traits {
+ private:
+    typedef ::boost::detail::counting_iterator_traits_select<(
+        ::boost::detail::is_numeric<Incrementable>::value
+        )> binder;
+    typedef typename binder::template traits<Incrementable> traits;
+ public:
+    typedef typename traits::difference_type difference_type;
+    typedef typename traits::iterator_category iterator_category;
+};
+
+template <class Incrementable>
+struct counting_iterator_policies : public default_iterator_policies
+{
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& i) const
+        { return i.base(); }
+    
+    template <class Iterator1, class Iterator2>
+    typename Iterator1::difference_type distance(
+        const Iterator1& x, const Iterator2& y) const
+    {
+        typedef typename Iterator1::difference_type difference_type;
+        return boost::detail::any_distance<difference_type>(
+            x.base(), y.base());
+    }
+};
+
+// A type generator for counting iterators
+template <class Incrementable>
+struct counting_iterator_generator
+{
+    typedef typename boost::remove_const<
+        Incrementable
+    >::type value_type;
+    
+    typedef counting_iterator_traits<value_type> traits;
+    
+    typedef iterator_adaptor<
+        value_type
+        , counting_iterator_policies<value_type>
+        , value_type
+        , value_type const&
+        , value_type const*
+        , typename traits::iterator_category
+        , typename traits::difference_type
+    > type;
+};
+
+// Manufacture a counting iterator for an arbitrary incrementable type
+template <class Incrementable>
+inline typename counting_iterator_generator<Incrementable>::type
+make_counting_iterator(Incrementable x)
+{
+  typedef typename counting_iterator_generator<Incrementable>::type result_t;
+  return result_t(x);
+}
+
+
+} // namespace boost
+
+#endif // BOOST_COUNTING_ITERATOR_HPP_DWA20000119
index d7bff778f8cd1a719583a84c066d25a465c1937f..272482964ffb896b2d95942272d765a056f8759e 100644 (file)
@@ -23,7 +23,7 @@
 // on the CRC's bit count.  This macro expresses that type in a compact
 // form, but also allows an alternate type for compilers that don't support
 // dependent types (in template value-parameters).
-#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
+#if !(defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) || (defined(BOOST_MSVC) && (BOOST_MSVC <= 1300)))
 #define BOOST_CRC_PARM_TYPE  typename ::boost::uint_t<Bits>::fast
 #else
 #define BOOST_CRC_PARM_TYPE  unsigned long
@@ -280,15 +280,10 @@ namespace detail
         typedef typename base_type::least  least;
         typedef typename base_type::fast   fast;
 
-#ifdef __DECCXX
-           static const least high_bit = 1ul << (Bits - 1u);
-           static const fast high_bit_fast = 1ul << (Bits - 1u);
-#else
         BOOST_STATIC_CONSTANT( least, high_bit = (least( 1u ) << ( Bits
          - 1u )) );
         BOOST_STATIC_CONSTANT( fast, high_bit_fast = (fast( 1u ) << ( Bits
          - 1u )) );
-#endif
 
     };  // boost::detail::high_uint_t
 
@@ -345,11 +340,7 @@ namespace detail
         BOOST_STATIC_CONSTANT( fast, high_bit_fast = base_type::high_bit_fast );
         #endif
 
-#ifdef __DECCXX
-           static const least sig_bits = (~( ~(0ul) << Bits));
-#else
         BOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits )) );
-#endif
         BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) );
 
     };  // boost::detail::mask_uint_t
@@ -457,7 +448,13 @@ namespace detail
 
         typedef mask_uint_t<Bits>            masking_type;
         typedef typename masking_type::fast  value_type;
+#if defined(__BORLANDC__) && defined(_M_IX86) && (__BORLANDC__ == 0x560)
+        // for some reason Borland's command line compiler (version 0x560)
+        // chokes over this unless we do the calculation for it: 
+        typedef value_type                   table_type[ 0x100 ];
+#else
         typedef value_type                   table_type[ byte_combos ];
+#endif
 
         static  void  init_table();
 
@@ -1068,3 +1065,4 @@ augmented_crc
 
 
 #endif  // BOOST_CRC_HPP
+
diff --git a/boost/boost/cregex.hpp b/boost/boost/cregex.hpp
new file mode 100644 (file)
index 0000000..cd62855
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         cregex.cpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Declares POSIX API functions
+  *                + boost::RegEx high level wrapper.
+  */
+
+#ifndef BOOST_RE_CREGEX_HPP
+#define BOOST_RE_CREGEX_HPP
+
+#include <boost/regex/config.hpp>
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+/* include these defs only for POSIX compatablity */
+#ifdef __cplusplus
+namespace boost{
+extern "C" {
+#endif
+
+#if defined(__cplusplus) && !defined(BOOST_NO_STDC_NAMESPACE)
+typedef std::ptrdiff_t regoff_t;
+typedef std::size_t regsize_t;
+#else
+typedef ptrdiff_t regoff_t;
+typedef size_t regsize_t;
+#endif
+
+typedef struct
+{
+   unsigned int re_magic;
+   unsigned int re_nsub;      /* number of parenthesized subexpressions */
+   const char* re_endp;       /* end pointer for REG_PEND */
+   void* guts;             /* none of your business :-) */
+   unsigned int eflags;       /* none of your business :-) */
+} regex_tA;
+
+#ifndef BOOST_NO_WREGEX
+typedef struct
+{
+   unsigned int re_magic;
+   unsigned int re_nsub;      /* number of parenthesized subexpressions */
+   const wchar_t* re_endp;       /* end pointer for REG_PEND */
+   void* guts;             /* none of your business :-) */
+   unsigned int eflags;       /* none of your business :-) */
+} regex_tW;
+#endif
+
+typedef struct
+{
+   regoff_t rm_so;      /* start of match */
+   regoff_t rm_eo;      /* end of match */
+} regmatch_t;
+
+/* regcomp() flags */
+typedef enum{
+   REG_BASIC = 0000,
+   REG_EXTENDED = 0001,
+   REG_ICASE = 0002,
+   REG_NOSUB = 0004,
+   REG_NEWLINE = 0010,
+   REG_NOSPEC = 0020,
+   REG_PEND = 0040,
+   REG_DUMP = 0200,
+   REG_NOCOLLATE = 0400,
+   REG_ESCAPE_IN_LISTS = 01000,
+   REG_NEWLINE_ALT = 02000,
+
+   REG_PERL = REG_EXTENDED | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS,
+   REG_AWK = REG_EXTENDED | REG_ESCAPE_IN_LISTS,
+   REG_GREP = REG_BASIC | REG_NEWLINE_ALT,
+   REG_EGREP = REG_EXTENDED | REG_NEWLINE_ALT,
+
+   REG_ASSERT = 15,
+   REG_INVARG = 16,
+   REG_ATOI = 255,   /* convert name to number (!) */
+   REG_ITOA = 0400   /* convert number to name (!) */
+} reg_comp_flags;
+
+/* regexec() flags */
+typedef enum{
+   REG_NOTBOL =    00001,
+   REG_NOTEOL =    00002,
+   REG_STARTEND =  00004
+} reg_exec_flags;
+
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA*, const char*, int);
+BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int, const regex_tA*, char*, regsize_t);
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecA(const regex_tA*, const char*, regsize_t, regmatch_t*, int);
+BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeA(regex_tA*);
+
+#ifndef BOOST_NO_WREGEX
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW*, const wchar_t*, int);
+BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int, const regex_tW*, wchar_t*, regsize_t);
+BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW*, const wchar_t*, regsize_t, regmatch_t*, int);
+BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*);
+#endif
+
+#ifdef UNICODE
+#define regcomp regcompW
+#define regerror regerrorW
+#define regexec regexecW
+#define regfree regfreeW
+#define regex_t regex_tW
+#else
+#define regcomp regcompA
+#define regerror regerrorA
+#define regexec regexecA
+#define regfree regfreeA
+#define regex_t regex_tA
+#endif
+
+/* regerror() flags */
+typedef enum
+{
+  REG_NOERROR = 0,   /* Success.  */
+  REG_NOMATCH = 1,      /* Didn't find a match (for regexec).  */
+
+  /* POSIX regcomp return error codes.  (In the order listed in the
+     standard.)  */
+  REG_BADPAT = 2,    /* Invalid pattern.  */
+  REG_ECOLLATE = 3,  /* Undefined collating element.  */
+  REG_ECTYPE = 4,    /* Invalid character class name.  */
+  REG_EESCAPE = 5,   /* Trailing backslash.  */
+  REG_ESUBREG = 6,   /* Invalid back reference.  */
+  REG_EBRACK = 7,    /* Unmatched left bracket.  */
+  REG_EPAREN = 8,    /* Parenthesis imbalance.  */
+  REG_EBRACE = 9,    /* Unmatched \{.  */
+  REG_BADBR = 10,    /* Invalid contents of \{\}.  */
+  REG_ERANGE = 11,   /* Invalid range end.  */
+  REG_ESPACE = 12,   /* Ran out of memory.  */
+  REG_BADRPT = 13,   /* No preceding re for repetition op.  */
+  REG_EEND = 14,     /* unexpected end of expression */
+  REG_ESIZE = 15,    /* expression too big */
+  REG_ERPAREN = 16,   /* unmatched right parenthesis */
+  REG_EMPTY = 17,    /* empty expression */
+  REG_E_MEMORY = REG_ESIZE, /* out of memory */
+  REG_E_UNKNOWN = 18 /* unknown error */
+} reg_errcode_t;
+
+enum match_flags
+{
+   match_default = 0,
+   match_not_bol = 1,                                // first is not start of line
+   match_not_eol = match_not_bol << 1,               // last is not end of line
+   match_not_bob = match_not_eol << 1,               // first is not start of buffer
+   match_not_eob = match_not_bob << 1,               // last is not end of buffer
+   match_not_bow = match_not_eob << 1,               // first is not start of word
+   match_not_eow = match_not_bow << 1,               // last is not end of word
+   match_not_dot_newline = match_not_eow << 1,       // \n is not matched by '.'
+   match_not_dot_null = match_not_dot_newline << 1,  // '\0' is not matched by '.'
+   match_prev_avail = match_not_dot_null << 1,       // *--first is a valid expression
+   match_init = match_prev_avail << 1,               // internal use
+   match_any = match_init << 1,                      // don't care what we match
+   match_not_null = match_any << 1,                  // string can't be null
+   match_continuous = match_not_null << 1,           // each grep match must continue from
+                                                     // uninterupted from the previous one
+   match_partial = match_continuous << 1,            // find partial matches
+   
+   match_stop = match_partial << 1,                  // stop after first match (grep)
+   match_all = match_stop << 1,                      // must find the whole of input even if match_any is set
+   match_max = match_all
+};
+
+
+#ifdef __cplusplus
+} // extern "C"
+} // namespace
+#endif
+
+
+#ifdef __BORLANDC__
+ #if __BORLANDC__ > 0x520
+  #pragma option pop
+ #endif
+#endif
+
+
+//
+// C++ high level wrapper goes here:
+//
+#if defined(__cplusplus)
+#include <string>
+#include <vector>
+namespace boost{
+
+#ifdef __BORLANDC__
+   #if __BORLANDC__ == 0x530
+    #pragma option push -a4 -b
+   #elif __BORLANDC__ > 0x530
+    #pragma option push -a8 -b
+   #endif
+#endif
+
+class RegEx;
+
+namespace re_detail{
+
+class RegExData;
+struct pred1;
+struct pred2;
+struct pred3;
+struct pred4;
+
+}  // namespace re_detail
+
+#if defined(BOOST_MSVC) || defined(__BORLANDC__)
+typedef bool (__cdecl *GrepCallback)(const RegEx& expression);
+typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression);
+typedef bool (__cdecl *FindFilesCallback)(const char* file);
+#else
+typedef bool (*GrepCallback)(const RegEx& expression);
+typedef bool (*GrepFileCallback)(const char* file, const RegEx& expression);
+typedef bool (*FindFilesCallback)(const char* file);
+#endif
+
+class BOOST_REGEX_DECL RegEx
+{
+private:
+   re_detail::RegExData* pdata;
+public:
+   RegEx();
+   RegEx(const RegEx& o);
+   ~RegEx();
+   explicit RegEx(const char* c, bool icase = false);
+   explicit RegEx(const std::string& s, bool icase = false);
+   RegEx& operator=(const RegEx& o);
+   RegEx& operator=(const char* p);
+   RegEx& operator=(const std::string& s){ return this->operator=(s.c_str()); }
+   unsigned int SetExpression(const char* p, bool icase = false);
+   unsigned int SetExpression(const std::string& s, bool icase = false){ return SetExpression(s.c_str(), icase); }
+   std::string Expression()const;
+   unsigned int error_code()const;
+   //
+   // now matching operators:
+   //
+   bool Match(const char* p, unsigned int flags = match_default);
+   bool Match(const std::string& s, unsigned int flags = match_default) { return Match(s.c_str(), flags); }
+   bool Search(const char* p, unsigned int flags = match_default);
+   bool Search(const std::string& s, unsigned int flags = match_default) { return Search(s.c_str(), flags); }
+   unsigned int Grep(GrepCallback cb, const char* p, unsigned int flags = match_default);
+   unsigned int Grep(GrepCallback cb, const std::string& s, unsigned int flags = match_default) { return Grep(cb, s.c_str(), flags); }
+   unsigned int Grep(std::vector<std::string>& v, const char* p, unsigned int flags = match_default);
+   unsigned int Grep(std::vector<std::string>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
+   unsigned int Grep(std::vector<std::size_t>& v, const char* p, unsigned int flags = match_default);
+   unsigned int Grep(std::vector<std::size_t>& v, const std::string& s, unsigned int flags = match_default) { return Grep(v, s.c_str(), flags); }
+#ifndef BOOST_REGEX_NO_FILEITER
+   unsigned int GrepFiles(GrepFileCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
+   unsigned int GrepFiles(GrepFileCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return GrepFiles(cb, files.c_str(), recurse, flags); }
+   unsigned int FindFiles(FindFilesCallback cb, const char* files, bool recurse = false, unsigned int flags = match_default);
+   unsigned int FindFiles(FindFilesCallback cb, const std::string& files, bool recurse = false, unsigned int flags = match_default) { return FindFiles(cb, files.c_str(), recurse, flags); }
+#endif
+
+   std::string Merge(const std::string& in, const std::string& fmt,
+                       bool copy = true, unsigned int flags = match_default);
+   std::string Merge(const char* in, const char* fmt,
+                       bool copy = true, unsigned int flags = match_default);
+
+   std::size_t Split(std::vector<std::string>& v, std::string& s, unsigned flags = match_default, unsigned max_count = ~0);
+   //
+   // now operators for returning what matched in more detail:
+   //
+   std::size_t Position(int i = 0)const;
+   std::size_t Length(int i = 0)const;
+   bool Matched(int i = 0)const;
+   unsigned int Line()const;
+   unsigned int Marks()const;
+   std::string What(int i = 0)const;
+   std::string operator[](int i)const { return What(i); }
+
+   static const unsigned int npos;
+
+   friend struct re_detail::pred1;
+   friend struct re_detail::pred2;
+   friend struct re_detail::pred3;
+   friend struct re_detail::pred4;
+};
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#endif
+
+#endif // include guard
+
+
+
+
+
+
+
diff --git a/boost/boost/cstdint.hpp b/boost/boost/cstdint.hpp
new file mode 100644 (file)
index 0000000..06959a9
--- /dev/null
@@ -0,0 +1,376 @@
+//  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.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Revision History
+//   31 Oct 01  use BOOST_HAS_LONG_LONG to check for "long long" (Jens M.)
+//   16 Apr 01  check LONGLONG_MAX when looking for "long long" (Jens Maurer)
+//   23 Jan 01  prefer "long" over "int" for int32_t and intmax_t (Jens Maurer)
+//   12 Nov 00  Merged <boost/stdint.h> (Jens Maurer)
+//   23 Sep 00  Added INTXX_C macro support (John Maddock).
+//   22 Sep 00  Better 64-bit support (John Maddock)
+//   29 Jun 00  Reimplement to avoid including stdint.h within namespace boost
+//    8 Aug 99  Initial version (Beman Dawes)
+
+
+#ifndef BOOST_CSTDINT_HPP
+#define BOOST_CSTDINT_HPP
+
+#include <boost/config.hpp>
+
+
+#ifdef BOOST_HAS_STDINT_H
+
+// The following #include is an implementation artifact; not part of interface.
+# ifdef __hpux
+// HP-UX has a vaguely nice <stdint.h> in a non-standard location
+#   include <inttypes.h>
+#   ifdef __STDC_32_MODE__
+      // this is triggered with GCC, because it defines __cplusplus < 199707L
+#     define BOOST_NO_INT64_T
+#   endif 
+# elif defined(__FreeBSD__)
+#   include <inttypes.h>
+# else
+#   include <stdint.h>
+# endif
+
+namespace boost
+{
+
+  using ::int8_t;             
+  using ::int_least8_t;       
+  using ::int_fast8_t;        
+  using ::uint8_t;            
+  using ::uint_least8_t;      
+  using ::uint_fast8_t;       
+                     
+  using ::int16_t;            
+  using ::int_least16_t;      
+  using ::int_fast16_t;       
+  using ::uint16_t;           
+  using ::uint_least16_t;     
+  using ::uint_fast16_t;      
+                     
+  using ::int32_t;            
+  using ::int_least32_t;      
+  using ::int_fast32_t;       
+  using ::uint32_t;           
+  using ::uint_least32_t;     
+  using ::uint_fast32_t;      
+                     
+# ifndef BOOST_NO_INT64_T
+
+  using ::int64_t;            
+  using ::int_least64_t;      
+  using ::int_fast64_t;       
+  using ::uint64_t;           
+  using ::uint_least64_t;     
+  using ::uint_fast64_t;      
+                     
+# endif
+
+  using ::intmax_t;      
+  using ::uintmax_t;     
+
+} // namespace boost
+
+#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4)
+// FreeBSD has an <inttypes.h> that contains much of what we need
+# include <inttypes.h>
+
+namespace boost {
+
+  using ::int8_t;             
+  typedef int8_t int_least8_t;       
+  typedef int8_t int_fast8_t;        
+  using ::uint8_t;            
+  typedef uint8_t uint_least8_t;      
+  typedef uint8_t uint_fast8_t;       
+                     
+  using ::int16_t;            
+  typedef int16_t int_least16_t;      
+  typedef int16_t int_fast16_t;       
+  using ::uint16_t;           
+  typedef uint16_t uint_least16_t;     
+  typedef uint16_t uint_fast16_t;      
+                     
+  using ::int32_t;            
+  typedef int32_t int_least32_t;      
+  typedef int32_t int_fast32_t;       
+  using ::uint32_t;           
+  typedef uint32_t uint_least32_t;     
+  typedef uint32_t uint_fast32_t;      
+         
+# ifndef BOOST_NO_INT64_T          
+
+  using ::int64_t;            
+  typedef int64_t int_least64_t;      
+  typedef int64_t int_fast64_t;       
+  using ::uint64_t;           
+  typedef uint64_t uint_least64_t;     
+  typedef uint64_t uint_fast64_t;      
+
+  typedef int64_t intmax_t;
+  typedef uint64_t uintmax_t;
+
+# else
+
+  typedef int32_t intmax_t;
+  typedef uint32_t uintmax_t;
+
+# endif
+
+} // namespace boost
+
+#else  // BOOST_HAS_STDINT_H
+
+# include <limits.h> // implementation artifact; not part of interface
+
+
+namespace boost
+{
+
+//  These are fairly safe guesses for some 16-bit, and most 32-bit and 64-bit
+//  platforms.  For other systems, they will have to be hand tailored.
+//
+//  Because the fast types are assumed to be the same as the undecorated types,
+//  it may be possible to hand tailor a more efficient implementation.  Such
+//  an optimization may be illusionary; on the Intel x86-family 386 on, for
+//  example, byte arithmetic and load/stores are as fast as "int" sized ones.
+
+//  8-bit types  ------------------------------------------------------------//
+
+# if UCHAR_MAX == 0xff
+     typedef signed char     int8_t;
+     typedef signed char     int_least8_t;
+     typedef signed char     int_fast8_t;
+     typedef unsigned char   uint8_t;
+     typedef unsigned char   uint_least8_t;
+     typedef unsigned char   uint_fast8_t;
+# else
+#    error defaults not correct; you must hand modify boost/cstdint.hpp
+# endif
+
+//  16-bit types  -----------------------------------------------------------//
+
+# if USHRT_MAX == 0xffff
+     typedef short           int16_t;
+     typedef short           int_least16_t;
+     typedef short           int_fast16_t;
+     typedef unsigned short  uint16_t;
+     typedef unsigned short  uint_least16_t;
+     typedef unsigned short  uint_fast16_t;
+# else
+#    error defaults not correct; you must hand modify boost/cstdint.hpp
+# endif
+
+//  32-bit types  -----------------------------------------------------------//
+
+# if ULONG_MAX == 0xffffffff
+     typedef long            int32_t;
+     typedef long            int_least32_t;
+     typedef long            int_fast32_t;
+     typedef unsigned long   uint32_t;
+     typedef unsigned long   uint_least32_t;
+     typedef unsigned long   uint_fast32_t;
+# elif UINT_MAX == 0xffffffff
+     typedef int             int32_t;
+     typedef int             int_least32_t;
+     typedef int             int_fast32_t;
+     typedef unsigned int    uint32_t;
+     typedef unsigned int    uint_least32_t;
+     typedef unsigned int    uint_fast32_t;
+# else
+#    error defaults not correct; you must hand modify boost/cstdint.hpp
+# endif
+
+//  64-bit types + intmax_t and uintmax_t  ----------------------------------//
+
+# if defined(BOOST_HAS_LONG_LONG) && \
+   !defined(BOOST_MSVC) && !defined(__BORLANDC__) && \
+   (!defined(__GLIBCPP__) || defined(_GLIBCPP_USE_LONG_LONG)) && \
+   (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
+#    if defined(__hpux)
+     // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
+#    elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL)
+                                                                 // 2**64 - 1
+#    else
+#       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;
+
+# elif ULONG_MAX != 0xffffffff
+
+#    if ULONG_MAX == 18446744073709551615 // 2**64 - 1
+     typedef long                 intmax_t;
+     typedef unsigned long        uintmax_t;
+     typedef long                 int64_t;
+     typedef long                 int_least64_t;
+     typedef long                 int_fast64_t;
+     typedef unsigned long        uint64_t;
+     typedef unsigned long        uint_least64_t;
+     typedef unsigned long        uint_fast64_t;
+#    else
+#       error defaults not correct; you must hand modify boost/cstdint.hpp
+#    endif
+# elif (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520))
+     //
+     // we have Borland/Microsoft __int64:
+     //
+     typedef __int64             intmax_t;
+     typedef unsigned __int64    uintmax_t;
+     typedef __int64             int64_t;
+     typedef __int64             int_least64_t;
+     typedef __int64             int_fast64_t;
+     typedef unsigned __int64    uint64_t;
+     typedef unsigned __int64    uint_least64_t;
+     typedef unsigned __int64    uint_fast64_t;
+# else // assume no 64-bit integers
+#  define BOOST_NO_INT64_T
+     typedef int32_t              intmax_t;
+     typedef uint32_t             uintmax_t;
+# endif
+
+} // namespace boost
+
+
+#endif // BOOST_HAS_STDINT_H
+
+#endif // BOOST_CSTDINT_HPP
+
+
+/****************************************************
+
+Macro definition section:
+
+Define various INTXX_C macros only if
+__STDC_CONSTANT_MACROS is defined.
+
+Undefine the macros if __STDC_CONSTANT_MACROS is
+not defined and the macros are (cf <cassert>).
+
+Added 23rd September 2000 (John Maddock).
+Modified 11th September 2001 to be excluded when
+BOOST_HAS_STDINT_H is defined (John Maddock).
+
+******************************************************/
+
+#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H)
+# define BOOST__STDC_CONSTANT_MACROS_DEFINED
+# if (defined(BOOST_MSVC) && (BOOST_MSVC >= 1100)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x520))
+//
+// Borland/Microsoft compilers have width specific suffixes:
+//
+#  define INT8_C(value)     value##i8
+#  define INT16_C(value)    value##i16
+#  define INT32_C(value)    value##i32
+#  define INT64_C(value)    value##i64
+#  ifdef __BORLANDC__
+    // Borland bug: appending ui8 makes the type a signed char
+#   define UINT8_C(value)    static_cast<unsigned char>(value##u)
+#  else
+#   define UINT8_C(value)    value##ui8
+#  endif
+#  define UINT16_C(value)   value##ui16
+#  define UINT32_C(value)   value##ui32
+#  define UINT64_C(value)   value##ui64
+#  define INTMAX_C(value)   value##i64
+#  define UINTMAX_C(value)  value##ui64
+
+# else
+//  do it the old fashioned way:
+
+//  8-bit types  ------------------------------------------------------------//
+
+#  if UCHAR_MAX == 0xff
+#   define INT8_C(value) static_cast<boost::int8_t>(value)
+#   define UINT8_C(value) static_cast<boost::uint8_t>(value##u)
+#  endif
+
+//  16-bit types  -----------------------------------------------------------//
+
+#  if USHRT_MAX == 0xffff
+#   define INT16_C(value) static_cast<boost::int16_t>(value)
+#   define UINT16_C(value) static_cast<boost::uint16_t>(value##u)
+#  endif
+
+//  32-bit types  -----------------------------------------------------------//
+
+#  if UINT_MAX == 0xffffffff
+#   define INT32_C(value) value
+#   define UINT32_C(value) value##u
+#  elif ULONG_MAX == 0xffffffff
+#   define INT32_C(value) value##L
+#   define UINT32_C(value) value##uL
+#  endif
+
+//  64-bit types + intmax_t and uintmax_t  ----------------------------------//
+
+#  if defined(BOOST_HAS_LONG_LONG) && \
+    (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
+
+#    if defined(__hpux)
+     // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions
+#    elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) ||  \
+        (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) ||  \
+        (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U)
+
+#    else
+#       error defaults not correct; you must hand modify boost/cstdint.hpp
+#    endif
+#    define INT64_C(value) value##LL
+#    define UINT64_C(value) value##uLL
+#  elif ULONG_MAX != 0xffffffff
+
+#    if ULONG_MAX == 18446744073709551615 // 2**64 - 1
+#       define INT64_C(value) value##L
+#       define UINT64_C(value) value##uL
+#    else
+#       error defaults not correct; you must hand modify boost/cstdint.hpp
+#    endif
+#  endif
+
+#  ifdef BOOST_NO_INT64_T
+#   define INTMAX_C(value) INT32_C(value)
+#   define UINTMAX_C(value) UINT32_C(value)
+#  else
+#   define INTMAX_C(value) INT64_C(value)
+#   define UINTMAX_C(value) UINT64_C(value)
+#  endif
+
+# endif // Borland/Microsoft specific width suffixes
+
+
+#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H)
+//
+// undef all the macros:
+//
+# undef INT8_C
+# undef INT16_C
+# undef INT32_C
+# undef INT64_C
+# undef UINT8_C
+# undef UINT16_C
+# undef UINT32_C
+# undef UINT64_C
+# undef INTMAX_C
+# undef UINTMAX_C
+
+#endif // __STDC_CONSTANT_MACROS_DEFINED etc.
+
+
diff --git a/boost/boost/cstdlib.hpp b/boost/boost/cstdlib.hpp
new file mode 100644 (file)
index 0000000..39419b4
--- /dev/null
@@ -0,0 +1,42 @@
+//  boost/cstdlib.hpp header  ------------------------------------------------//
+
+//  (C) Copyright Beman Dawes 2001. Permission to copy, use, modify, sell
+//  and distribute this software is granted provided this copyright notice
+//  appears in all copies. This software is provided "as is" without express or
+//  implied warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for updates and documentation.
+
+//  Revision History
+//   26 Feb 01  Initial version (Beman Dawes)
+
+#ifndef BOOST_CSTDLIB_HPP
+#define BOOST_CSTDLIB_HPP
+
+#include <cstdlib>
+
+namespace boost
+{
+   //  The intent is to propose the following for addition to namespace std
+   //  in the C++ Standard Library, and to then deprecate EXIT_SUCCESS and
+   //  EXIT_FAILURE.  As an implementation detail, this header defines the
+   //  new constants in terms of EXIT_SUCCESS and EXIT_FAILURE.  In a new
+   //  standard, the constants would be implementation-defined, although it
+   //  might be worthwhile to "suggest" (which a standard is allowed to do)
+   //  values of 0 and 1 respectively.
+
+   //  Rationale for having multiple failure values: some environments may
+   //  wish to distinguish between different classes of errors.
+   //  Rationale for choice of values: programs often use values < 100 for
+   //  their own error reporting.  Values > 255 are sometimes reserved for
+   //  system detected errors.  200/201 were suggested to minimize conflict.
+
+   const int exit_success = EXIT_SUCCESS;  // implementation-defined value
+   const int exit_failure = EXIT_FAILURE;  // implementation-defined value
+   const int exit_exception_failure = 200; // otherwise uncaught exception
+   const int exit_test_failure = 201;      // report_error or
+                                           //  report_critical_error called.
+}
+
+#endif
+
diff --git a/boost/boost/current_function.hpp b/boost/boost/current_function.hpp
new file mode 100644 (file)
index 0000000..6d52404
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
+#define BOOST_CURRENT_FUNCTION_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/current_function.hpp - BOOST_CURRENT_FUNCTION
+//
+//  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.
+//
+
+namespace boost
+{
+
+namespace detail
+{
+
+inline void current_function_helper()
+{
+
+#if defined(__GNUC__)
+
+# define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__
+
+#elif defined(__FUNCSIG__)
+
+# define BOOST_CURRENT_FUNCTION __FUNCSIG__
+
+#elif defined(__BORLANDC__)
+
+# define BOOST_CURRENT_FUNCTION __FUNC__
+
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
+
+# define BOOST_CURRENT_FUNCTION __func__
+
+#else
+
+# define BOOST_CURRENT_FUNCTION "(unknown)"
+
+#endif
+
+}
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED
diff --git a/boost/boost/detail/algorithm.hpp b/boost/boost/detail/algorithm.hpp
new file mode 100644 (file)
index 0000000..a26ed3e
--- /dev/null
@@ -0,0 +1,249 @@
+// (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.
+
+/*
+ *
+ * Copyright (c) 1994
+ * Hewlett-Packard Company
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Hewlett-Packard Company makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ *
+ *
+ * Copyright (c) 1996
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied warranty.
+ */
+
+#ifndef BOOST_ALGORITHM_HPP
+# define BOOST_ALGORITHM_HPP
+# include <boost/detail/iterator.hpp>
+// Algorithms on sequences
+//
+// The functions in this file have not yet gone through formal
+// review, and are subject to change. This is a work in progress.
+// They have been checked into the detail directory because
+// there are some graph algorithms that use these functions.
+
+#include <algorithm>
+#include <vector>
+
+namespace boost {
+
+  template <typename Iter1, typename Iter2>
+  Iter1 begin(const std::pair<Iter1, Iter2>& p) { return p.first; }
+
+  template <typename Iter1, typename Iter2>
+  Iter2 end(const std::pair<Iter1, Iter2>& p) { return p.second; }
+
+  template <typename Iter1, typename Iter2>
+  typename boost::detail::iterator_traits<Iter1>::difference_type
+  size(const std::pair<Iter1, Iter2>& p) {
+    return std::distance(p.first, p.second);
+  }
+
+#if 0
+  // These seem to interfere with the std::pair overloads :(
+  template <typename Container>
+  typename Container::iterator
+  begin(Container& c) { return c.begin(); }
+
+  template <typename Container>
+  typename Container::const_iterator
+  begin(const Container& c) { return c.begin(); }
+
+  template <typename Container>
+  typename Container::iterator
+  end(Container& c) { return c.end(); }
+
+  template <typename Container>
+  typename Container::const_iterator
+  end(const Container& c) { return c.end(); }
+
+  template <typename Container>
+  typename Container::size_type
+  size(const Container& c) { return c.size(); }
+#else
+  template <typename T>
+  typename std::vector<T>::iterator
+  begin(std::vector<T>& c) { return c.begin(); }
+
+  template <typename T>
+  typename std::vector<T>::const_iterator
+  begin(const std::vector<T>& c) { return c.begin(); }
+
+  template <typename T>
+  typename std::vector<T>::iterator
+  end(std::vector<T>& c) { return c.end(); }
+
+  template <typename T>
+  typename std::vector<T>::const_iterator
+  end(const std::vector<T>& c) { return c.end(); }
+
+  template <typename T>
+  typename std::vector<T>::size_type
+  size(const std::vector<T>& c) { return c.size(); }
+#endif
+  
+  template <class ForwardIterator, class T>
+  void iota(ForwardIterator first, ForwardIterator last, T value)
+  {
+    for (; first != last; ++first, ++value)
+      *first = value;
+  }
+  template <typename Container, typename T>
+  void iota(Container& c, const T& value)
+  {
+    iota(begin(c), end(c), value);
+  }
+  // Also do version with 2nd container?
+  template <typename Container, typename OutIter>
+  OutIter copy(const Container& c, OutIter result) {
+    return std::copy(begin(c), end(c), result);
+  }
+
+  template <typename Container1, typename Container2>
+  bool equal(const Container1& c1, const Container2& c2)
+  {
+    if (size(c1) != size(c2))
+      return false;
+    return std::equal(begin(c1), end(c1), begin(c2));
+  }
+
+  template <typename Container>
+  void sort(Container& c) { std::sort(begin(c), end(c)); }
+
+  template <typename Container, typename Predicate>
+  void sort(Container& c, const Predicate& p) { 
+    std::sort(begin(c), end(c), p);
+  }
+
+  template <typename Container>
+  void stable_sort(Container& c) { std::stable_sort(begin(c), end(c)); }
+
+  template <typename Container, typename Predicate>
+  void stable_sort(Container& c, const Predicate& p) { 
+    std::stable_sort(begin(c), end(c), p);
+  }
+
+  template <typename InputIterator, typename Predicate>
+  bool any_if(InputIterator first, InputIterator last, Predicate p)
+  {
+    return std::find_if(first, last, p) != last;
+  }
+  template <typename Container, typename Predicate>
+  bool any_if(const Container& c, Predicate p)
+  {
+    return any_if(begin(c), end(c), p);
+  }
+
+  template <typename InputIterator, typename T>
+  bool contains(InputIterator first, InputIterator last, T value)
+  {
+    return std::find(first, last, value) != last;
+  }
+  template <typename Container, typename T>
+  bool contains(const Container& c, const T& value)
+  {
+    return contains(begin(c), end(c), value);
+  }
+
+  template <typename InputIterator, typename Predicate>
+  bool all(InputIterator first, InputIterator last, Predicate p)
+  {
+    for (; first != last; ++first)
+      if (!p(*first))
+        return false;
+    return true;
+  }
+  template <typename Container, typename Predicate>
+  bool all(const Container& c, Predicate p)
+  {
+    return all(begin(c), end(c), p);
+  }
+
+  template <typename InputIterator, typename Predicate>
+  bool none(InputIterator first, InputIterator last, Predicate p)
+  {
+    return std::find_if(first, last, p) == last;
+  }
+  template <typename Container, typename Predicate>
+  bool none(const Container& c, Predicate p)
+  {
+    return none(begin(c), end(c), p);
+  }
+
+  template <typename Container, typename T>
+  std::size_t count(const Container& c, const T& value)
+  {
+    return std::count(begin(c), end(c), value);
+  }
+
+  template <typename Container, typename Predicate>
+  std::size_t count_if(const Container& c, Predicate p)
+  {
+    return std::count_if(begin(c), end(c), p);
+  }
+
+  template <typename ForwardIterator>
+  bool is_sorted(ForwardIterator first, ForwardIterator last)
+  {
+    if (first == last)
+      return true;
+
+    ForwardIterator next = first;
+    for (++next; next != last; first = next, ++next) {
+      if (*next < *first)
+       return false;
+    }
+
+    return true;
+  }
+
+  template <typename ForwardIterator, typename StrictWeakOrdering>
+  bool is_sorted(ForwardIterator first, ForwardIterator last,
+                StrictWeakOrdering comp)
+  {
+    if (first == last)
+      return true;
+
+    ForwardIterator next = first;
+    for (++next; next != last; first = next, ++next) {
+      if (comp(*next, *first))
+       return false;
+    }
+
+    return true;
+  }
+
+  template <typename Container>
+  bool is_sorted(const Container& c)
+  {
+    return is_sorted(begin(c), end(c));
+  }
+
+  template <typename Container, typename StrictWeakOrdering>
+  bool is_sorted(const Container& c, StrictWeakOrdering comp)
+  {
+    return is_sorted(begin(c), end(c), comp);
+  }
+
+} // namespace boost
+
+#endif // BOOST_ALGORITHM_HPP
diff --git a/boost/boost/detail/allocator.hpp b/boost/boost/detail/allocator.hpp
new file mode 100644 (file)
index 0000000..a56228d
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ *
+ * Copyright (c) 2001
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+#ifndef BOOST_DETAIL_ALLOCATOR_HPP
+#define BOOST_DETAIL_ALLOCATOR_HPP
+
+#include <boost/config.hpp>
+#include <cstdlib>
+#if defined(BOOST_NO_STDC_NAMESPACE)
+namespace std{
+using ::ptrdiff_t;
+using ::size_t;
+}
+#endif
+
+// see if we have SGI alloc class:
+#if defined(BOOST_NO_STD_ALLOCATOR) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__GLIBCPP__) || defined(__STL_CONFIG_H))
+#  define BOOST_HAVE_SGI_ALLOCATOR
+#  include <memory>
+#  if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
+namespace boost{ namespace detail{
+   typedef std::__sgi_alloc alloc_type;
+}}
+#  else
+namespace boost{ namespace detail{
+   typedef std::alloc alloc_type;
+}}
+#  endif
+#endif
+
+
+namespace boost{ namespace detail{
+
+template <class T>
+void allocator_construct(T* p, const T& t)
+{ new (p) T(t); }
+
+template <class T>
+void allocator_destroy(T* p)
+{ p->~T(); }
+
+} }
+
+#if !defined(BOOST_NO_STD_ALLOCATOR)
+
+#include <memory>
+
+#define BOOST_DEFAULT_ALLOCATOR(T) std::allocator<T>
+
+namespace boost{ namespace detail{
+
+template <class T, class A>
+struct rebind_allocator
+{
+   typedef typename A::template rebind<T> binder;
+   typedef typename binder::other type;
+};
+
+} // namespace detail
+} // namespace boost
+
+#elif !defined(BOOST_NO_MEMBER_TEMPLATES)
+
+// no std::allocator, but the compiler supports the necessary syntax,
+// write our own allocator instead:
+
+#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator<T>
+
+namespace boost{ namespace detail{
+
+template <class T>
+class allocator
+{
+public:
+
+   typedef T              value_type;
+   typedef value_type *   pointer;
+   typedef const T*       const_pointer;
+   typedef T&             reference;
+   typedef const T&       const_reference;
+   typedef std::size_t    size_type;
+   typedef std::ptrdiff_t difference_type;
+
+   template <class U>
+   struct rebind
+   {
+      typedef allocator<U> other;
+   };
+
+   allocator(){}
+   
+   template <class U>
+   allocator(const allocator<U>&){}
+
+   allocator(const allocator&){}
+
+   template <class U>
+   allocator& operator=(const allocator<U>&)
+   { return *this; }
+
+   ~allocator(){}
+
+   pointer address(reference x) { return &x; }
+
+   const_pointer address(const_reference x) const { return &x; }
+
+   pointer allocate(size_type n, const void* = 0) 
+   {
+      #ifdef BOOST_HAVE_SGI_ALLOCATOR
+      return n != 0 ?
+         reinterpret_cast<pointer>(alloc_type::allocate(n * sizeof(value_type)))
+         : 0;
+      #else
+      return n != 0 ?
+         reinterpret_cast<pointer>(::operator new(n * sizeof(value_type)))
+         : 0;
+      #endif
+   }
+
+   void deallocate(pointer p, size_type n) 
+   {
+      #ifdef BOOST_HAVE_SGI_ALLOCATOR
+      assert( (p == 0) == (n == 0) );
+      if (p != 0)
+         alloc_type::deallocate((void*)p, n);
+      #else
+      assert( (p == 0) == (n == 0) );
+      if (p != 0)
+         ::operator delete((void*)p);
+      #endif
+   }
+
+   size_type max_size() const
+   { return size_t(-1) / sizeof(value_type); }
+
+   void construct(pointer p, const T& val) const
+   { allocator_construct(p, val); }
+
+   void destroy(pointer p) const
+   { allocator_destroy(p); }
+};
+
+template <class T, class A>
+struct rebind_allocator
+{
+   typedef typename A::template rebind<T> binder;
+   typedef typename binder::other type;
+};
+
+} // namespace detail
+} // namespace boost
+
+#else
+
+// no std::allocator, use workaround version instead,
+// each allocator class must derive from a base class
+// that allocates blocks of bytes:
+
+#define BOOST_DEFAULT_ALLOCATOR(T) ::boost::detail::allocator_adapter<T, ::boost::detail::simple_alloc>
+
+namespace boost{ namespace detail{
+
+class simple_alloc
+{
+public:
+
+   typedef void           value_type;
+   typedef value_type *   pointer;
+   typedef const void*    const_pointer;
+   typedef std::size_t    size_type;
+   typedef std::ptrdiff_t difference_type;
+
+   simple_alloc(){}
+   simple_alloc(const simple_alloc&){}
+
+   ~simple_alloc(){}
+
+   pointer allocate(size_type n, const void* = 0) 
+   {
+      #ifdef BOOST_HAVE_SGI_ALLOCATOR
+      return n != 0 ?
+         reinterpret_cast<pointer>(alloc_type::allocate(n))
+         : 0;
+      #else
+      return n != 0 ?
+         reinterpret_cast<pointer>(::operator new(n))
+         : 0;
+      #endif
+   }
+
+   void deallocate(pointer p, size_type n) 
+   {
+      #ifdef BOOST_HAVE_SGI_ALLOCATOR
+      assert( (p == 0) == (n == 0) );
+      if (p != 0)
+         alloc_type::deallocate((void*)p, n);
+      #else
+      assert( (p == 0) == (n == 0) );
+      if (p != 0)
+         ::operator delete((void*)p);
+      #endif
+   }
+};
+
+template <class T, class Base>
+class allocator_adapter : public Base
+{
+public:
+
+   typedef T              value_type;
+   typedef value_type *   pointer;
+   typedef const T*       const_pointer;
+   typedef T&             reference;
+   typedef const T&       const_reference;
+   typedef size_t         size_type;
+   typedef std::ptrdiff_t difference_type;
+   typedef Base      base_type;
+
+   allocator_adapter(){}
+   allocator_adapter(const base_type& x) : Base(x){}
+   allocator_adapter& operator=(const base_type& x)
+   {
+      *(static_cast<base_type*>(this)) = x;
+      return *this;
+   }
+
+   ~allocator_adapter(){}
+
+   pointer address(reference x) { return &x; }
+
+   const_pointer address(const_reference x) const { return &x; }
+
+   pointer allocate(size_type n, const void* = 0) 
+   {
+      return n != 0 ?
+         reinterpret_cast<pointer>(base_type::allocate(n * sizeof(value_type)))
+         : 0;
+   }
+
+   void deallocate(pointer p, size_type n) 
+   {
+      assert( (p == 0) == (n == 0) );
+      if (p != 0)
+         static_cast<base_type*>(this)->deallocate((void*)p, n * sizeof(value_type));
+   }
+
+   size_type max_size() const
+   { return size_t(-1) / sizeof(value_type); }
+
+   void construct(pointer p, const T& val) const
+   { allocator_construct(p, val); }
+
+   void destroy(pointer __p) const
+   { allocator_destroy(p); }
+};
+
+template <class T, class A>
+struct rebind_allocator
+{
+   typedef allocator_adapter<T, typename A::base_type> type;
+};
+
+} // namespace detail
+} // namespace boost
+
+#endif
+
+#endif // include guard
diff --git a/boost/boost/detail/atomic_count.hpp b/boost/boost/detail/atomic_count.hpp
new file mode 100644 (file)
index 0000000..b34dc85
--- /dev/null
@@ -0,0 +1,123 @@
+#ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
+#define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/atomic_count.hpp - thread/SMP safe reference counter
+//
+//  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.
+//
+//  typedef <implementation-defined> boost::detail::atomic_count;
+//
+//  atomic_count a(n);
+//
+//    (n is convertible to long)
+//
+//    Effects: Constructs an atomic_count with an initial value of n
+//
+//  a;
+//
+//    Returns: (long) the current value of a
+//
+//  ++a;
+//
+//    Effects: Atomically increments the value of a
+//    Returns: nothing
+//
+//  --a;
+//
+//    Effects: Atomically decrements the value of a
+//    Returns: (long) zero if the new value of a is zero,
+//      unspecified non-zero value otherwise (usually the new value)
+//
+//    Important note: when --a returns zero, it must act as a
+//      read memory barrier (RMB); i.e. the calling thread must
+//      have a synchronized view of the memory
+//
+//    On Intel IA-32 (x86) memory is always synchronized, so this
+//      is not a problem.
+//
+//    On many architectures the atomic instructions already act as
+//      a memory barrier.
+//
+//    This property is necessary for proper reference counting, since
+//      a thread can update the contents of a shared object, then
+//      release its reference, and another thread may immediately
+//      release the last reference causing object destruction.
+//
+//    The destructor needs to have a synchronized view of the
+//      object to perform proper cleanup.
+//
+//    Original example by Alexander Terekhov:
+//
+//    Given:
+//
+//    - a mutable shared object OBJ;
+//    - two threads THREAD1 and THREAD2 each holding 
+//      a private smart_ptr object pointing to that OBJ.
+//
+//    t1: THREAD1 updates OBJ (thread-safe via some synchronization)
+//      and a few cycles later (after "unlock") destroys smart_ptr;
+//
+//    t2: THREAD2 destroys smart_ptr WITHOUT doing any synchronization 
+//      with respect to shared mutable object OBJ; OBJ destructors
+//      are called driven by smart_ptr interface...
+//
+
+//  Note: atomic_count_linux.hpp has been disabled by default; see the
+//        comments inside for more info.
+
+#include <boost/config.hpp>
+
+#ifndef BOOST_HAS_THREADS
+
+namespace boost
+{
+
+namespace detail
+{
+
+typedef long atomic_count;
+
+}
+
+}
+
+#elif defined(BOOST_USE_ASM_ATOMIC_H)
+#  include <boost/detail/atomic_count_linux.hpp>
+#elif defined(BOOST_AC_USE_PTHREADS)
+#  include <boost/detail/atomic_count_pthreads.hpp>
+#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+#  include <boost/detail/atomic_count_win32.hpp>
+#elif defined(__GLIBCPP__)
+#  include <boost/detail/atomic_count_gcc.hpp>
+#elif defined(BOOST_HAS_PTHREADS)
+#  define BOOST_AC_USE_PTHREADS
+#  include <boost/detail/atomic_count_pthreads.hpp>
+#else
+
+// #warning Unrecognized platform, detail::atomic_count will not be thread safe
+
+namespace boost
+{
+
+namespace detail
+{
+
+typedef long atomic_count;
+
+}
+
+}
+
+#endif
+
+#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED
diff --git a/boost/boost/detail/atomic_count_gcc.hpp b/boost/boost/detail/atomic_count_gcc.hpp
new file mode 100644 (file)
index 0000000..c3d29a8
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED
+#define BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED
+
+//
+//  boost/detail/atomic_count_gcc.hpp
+//
+//  atomic_count for GNU libstdc++ v3
+//
+//  http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//  Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org>
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+#include <bits/atomicity.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class atomic_count
+{
+public:
+
+    explicit atomic_count(long v) : value_(v) {}
+
+    void operator++()
+    {
+        __atomic_add(&value_, 1);
+    }
+
+    long operator--()
+    {
+        return !__exchange_and_add(&value_, -1);
+    }
+
+    operator long() const
+    {
+        return __exchange_and_add(&value_, 0);
+    }
+
+private:
+
+    atomic_count(atomic_count const &);
+    atomic_count & operator=(atomic_count const &);
+
+    _Atomic_word value_;
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_GCC_HPP_INCLUDED
diff --git a/boost/boost/detail/atomic_count_linux.hpp b/boost/boost/detail/atomic_count_linux.hpp
new file mode 100644 (file)
index 0000000..1a69cec
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED
+#define BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED
+
+//
+//  boost/detail/atomic_count_linux.hpp
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+//
+//  This implementation uses <asm/atomic.h>. This is a kernel header;
+//  using kernel headers in a user program may cause a number of problems,
+//  and not all flavors of Linux provide the atomic instructions.
+//
+//  This file is only provided because the performance of this implementation
+//  is significantly higher than the pthreads version. Use at your own risk
+//  (by defining BOOST_USE_ASM_ATOMIC_H.)
+//
+
+#include <asm/atomic.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class atomic_count
+{
+public:
+
+    explicit atomic_count(long v)
+    {
+        atomic_t init = ATOMIC_INIT(v);
+        value_ = init;
+    }
+
+    void operator++()
+    {
+        atomic_inc(&value_);
+    }
+
+    long operator--()
+    {
+        return !atomic_dec_and_test(&value_);
+    }
+
+    operator long() const
+    {
+        return atomic_read(&value_);
+    }
+
+private:
+
+    atomic_count(atomic_count const &);
+    atomic_count & operator=(atomic_count const &);
+
+    atomic_t value_;
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_LINUX_HPP_INCLUDED
diff --git a/boost/boost/detail/atomic_count_pthreads.hpp b/boost/boost/detail/atomic_count_pthreads.hpp
new file mode 100644 (file)
index 0000000..0f8c663
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED
+#define BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED
+
+//
+//  boost/detail/atomic_count_pthreads.hpp
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+#include <pthread.h>
+
+//
+//  The generic pthread_mutex-based implementation sometimes leads to
+//    inefficiencies. Example: a class with two atomic_count members
+//    can get away with a single mutex.
+//
+//  Users can detect this situation by checking BOOST_AC_USE_PTHREADS.
+//
+
+namespace boost
+{
+
+namespace detail
+{
+
+class atomic_count
+{
+private:
+
+    class scoped_lock
+    {
+    public:
+
+        scoped_lock(pthread_mutex_t & m): m_(m)
+        {
+            pthread_mutex_lock(&m_);
+        }
+
+        ~scoped_lock()
+        {
+            pthread_mutex_unlock(&m_);
+        }
+
+    private:
+
+        pthread_mutex_t & m_;
+    };
+
+public:
+
+    explicit atomic_count(long v): value_(v)
+    {
+        pthread_mutex_init(&mutex_, 0);
+    }
+
+    ~atomic_count()
+    {
+        pthread_mutex_destroy(&mutex_);
+    }
+
+    void operator++()
+    {
+        scoped_lock lock(mutex_);
+        ++value_;
+    }
+
+    long operator--()
+    {
+        scoped_lock lock(mutex_);
+        return --value_;
+    }
+
+    operator long() const
+    {
+        scoped_lock lock(mutex_);
+        return value_;
+    }
+
+private:
+
+    atomic_count(atomic_count const &);
+    atomic_count & operator=(atomic_count const &);
+
+    mutable pthread_mutex_t mutex_;
+    long value_;
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_PTHREADS_HPP_INCLUDED
diff --git a/boost/boost/detail/atomic_count_win32.hpp b/boost/boost/detail/atomic_count_win32.hpp
new file mode 100644 (file)
index 0000000..0482757
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
+#define BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/atomic_count_win32.hpp
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+#include <boost/detail/winapi.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class atomic_count
+{
+public:
+
+    explicit atomic_count(long v): value_(v)
+    {
+    }
+
+    long operator++()
+    {
+        return winapi::InterlockedIncrement(&value_);
+    }
+
+    long operator--()
+    {
+        return winapi::InterlockedDecrement(&value_);
+    }
+
+    operator long() const
+    {
+        return value_;
+    }
+
+private:
+
+    atomic_count(atomic_count const &);
+    atomic_count & operator=(atomic_count const &);
+
+    volatile long value_;
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_WIN32_HPP_INCLUDED
diff --git a/boost/boost/detail/binary_search.hpp b/boost/boost/detail/binary_search.hpp
new file mode 100644 (file)
index 0000000..c19763e
--- /dev/null
@@ -0,0 +1,217 @@
+// 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) 1994
+// Hewlett-Packard Company
+// 
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation.  Hewlett-Packard Company makes no
+// representations about the suitability of this software for any
+// purpose.  It is provided "as is" without express or implied warranty.
+// 
+// Copyright (c) 1996
+// Silicon Graphics Computer Systems, Inc.
+// 
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation.  Silicon Graphics makes no
+// representations about the suitability of this software for any
+// purpose.  It is provided "as is" without express or implied warranty.
+// 
+#ifndef BINARY_SEARCH_DWA_122600_H_
+# define BINARY_SEARCH_DWA_122600_H_
+
+# include <boost/detail/iterator.hpp>
+# include <utility>
+
+namespace boost { namespace detail {
+
+template <class ForwardIter, class Tp>
+ForwardIter lower_bound(ForwardIter first, ForwardIter last,
+                             const Tp& val) 
+{
+    typedef detail::iterator_traits<ForwardIter> traits;
+    
+    typename traits::difference_type len = boost::detail::distance(first, last);
+    typename traits::difference_type half;
+    ForwardIter middle;
+
+    while (len > 0) {
+      half = len >> 1;
+      middle = first;
+      std::advance(middle, half);
+      if (*middle < val) {
+        first = middle;
+        ++first;
+        len = len - half - 1;
+      }
+      else
+        len = half;
+    }
+    return first;
+}
+
+template <class ForwardIter, class Tp, class Compare>
+ForwardIter lower_bound(ForwardIter first, ForwardIter last,
+                              const Tp& val, Compare comp)
+{
+  typedef detail::iterator_traits<ForwardIter> traits;
+
+  typename traits::difference_type len = boost::detail::distance(first, last);
+  typename traits::difference_type half;
+  ForwardIter middle;
+
+  while (len > 0) {
+    half = len >> 1;
+    middle = first;
+    std::advance(middle, half);
+    if (comp(*middle, val)) {
+      first = middle;
+      ++first;
+      len = len - half - 1;
+    }
+    else
+      len = half;
+  }
+  return first;
+}
+
+template <class ForwardIter, class Tp>
+ForwardIter upper_bound(ForwardIter first, ForwardIter last,
+                           const Tp& val)
+{
+  typedef detail::iterator_traits<ForwardIter> traits;
+
+  typename traits::difference_type len = boost::detail::distance(first, last);
+  typename traits::difference_type half;
+  ForwardIter middle;
+
+  while (len > 0) {
+    half = len >> 1;
+    middle = first;
+    std::advance(middle, half);
+    if (val < *middle)
+      len = half;
+    else {
+      first = middle;
+      ++first;
+      len = len - half - 1;
+    }
+  }
+  return first;
+}
+
+template <class ForwardIter, class Tp, class Compare>
+ForwardIter upper_bound(ForwardIter first, ForwardIter last,
+                           const Tp& val, Compare comp)
+{
+  typedef detail::iterator_traits<ForwardIter> traits;
+
+  typename traits::difference_type len = boost::detail::distance(first, last);
+  typename traits::difference_type half;
+  ForwardIter middle;
+
+  while (len > 0) {
+    half = len >> 1;
+    middle = first;
+    std::advance(middle, half);
+    if (comp(val, *middle))
+      len = half;
+    else {
+      first = middle;
+      ++first;
+      len = len - half - 1;
+    }
+  }
+  return first;
+}
+
+template <class ForwardIter, class Tp>
+std::pair<ForwardIter, ForwardIter>
+equal_range(ForwardIter first, ForwardIter last, const Tp& val)
+{
+  typedef detail::iterator_traits<ForwardIter> traits;
+
+  typename traits::difference_type len = boost::detail::distance(first, last);
+  typename traits::difference_type half;
+  ForwardIter middle, left, right;
+
+  while (len > 0) {
+    half = len >> 1;
+    middle = first;
+    std::advance(middle, half);
+    if (*middle < val) {
+      first = middle;
+      ++first;
+      len = len - half - 1;
+    }
+    else if (val < *middle)
+      len = half;
+    else {
+      left = boost::detail::lower_bound(first, middle, val);
+      std::advance(first, len);
+      right = boost::detail::upper_bound(++middle, first, val);
+      return std::pair<ForwardIter, ForwardIter>(left, right);
+    }
+  }
+  return std::pair<ForwardIter, ForwardIter>(first, first);
+}
+
+template <class ForwardIter, class Tp, class Compare>
+std::pair<ForwardIter, ForwardIter>
+equal_range(ForwardIter first, ForwardIter last, const Tp& val,
+              Compare comp)
+{
+  typedef detail::iterator_traits<ForwardIter> traits;
+
+  typename traits::difference_type len = boost::detail::distance(first, last);
+  typename traits::difference_type half;
+  ForwardIter middle, left, right;
+
+  while (len > 0) {
+    half = len >> 1;
+    middle = first;
+    std::advance(middle, half);
+    if (comp(*middle, val)) {
+      first = middle;
+      ++first;
+      len = len - half - 1;
+    }
+    else if (comp(val, *middle))
+      len = half;
+    else {
+      left = boost::detail::lower_bound(first, middle, val, comp);
+      std::advance(first, len);
+      right = boost::detail::upper_bound(++middle, first, val, comp);
+      return std::pair<ForwardIter, ForwardIter>(left, right);
+    }
+  }
+  return std::pair<ForwardIter, ForwardIter>(first, first);
+}           
+
+template <class ForwardIter, class Tp>
+bool binary_search(ForwardIter first, ForwardIter last,
+                   const Tp& val) {
+  ForwardIter i = boost::detail::lower_bound(first, last, val);
+  return i != last && !(val < *i);
+}
+
+template <class ForwardIter, class Tp, class Compare>
+bool binary_search(ForwardIter first, ForwardIter last,
+                   const Tp& val,
+                   Compare comp) {
+  ForwardIter i = boost::detail::lower_bound(first, last, val, comp);
+  return i != last && !comp(val, *i);
+}
+
+}} // namespace boost::detail
+
+#endif // BINARY_SEARCH_DWA_122600_H_
diff --git a/boost/boost/detail/call_traits.hpp b/boost/boost/detail/call_traits.hpp
new file mode 100644 (file)
index 0000000..c1fd918
--- /dev/null
@@ -0,0 +1,158 @@
+//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+//  Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+// call_traits: defines typedefs for function usage
+// (see libs/utility/call_traits.htm)
+
+/* Release notes:
+   23rd July 2000:
+      Fixed array specialization. (JM)
+      Added Borland specific fixes for reference types
+      (issue raised by Steve Cleary).
+*/
+
+#ifndef BOOST_DETAIL_CALL_TRAITS_HPP
+#define BOOST_DETAIL_CALL_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+
+#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
+#include <boost/type_traits/arithmetic_traits.hpp>
+#endif
+#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP
+#include <boost/type_traits/composite_traits.hpp>
+#endif
+
+namespace boost{
+
+namespace detail{
+
+template <typename T, bool small_>
+struct ct_imp2
+{
+   typedef const T& param_type;
+};
+
+template <typename T>
+struct ct_imp2<T, true>
+{
+   typedef const T param_type;
+};
+
+template <typename T, bool isp, bool b1>
+struct ct_imp
+{
+   typedef const T& param_type;
+};
+
+template <typename T, bool isp>
+struct ct_imp<T, isp, true>
+{
+   typedef typename ct_imp2<T, sizeof(T) <= sizeof(void*)>::param_type param_type;
+};
+
+template <typename T, bool b1>
+struct ct_imp<T, true, b1>
+{
+   typedef T const param_type;
+};
+
+}
+
+template <typename T>
+struct call_traits
+{
+public:
+   typedef T value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   //
+   // C++ Builder workaround: we should be able to define a compile time
+   // constant and pass that as a single template parameter to ct_imp<T,bool>,
+   // however compiler bugs prevent this - instead pass three bool's to
+   // ct_imp<T,bool,bool,bool> and add an extra partial specialisation
+   // of ct_imp to handle the logic. (JM)
+   typedef typename detail::ct_imp<
+      T,
+      ::boost::is_pointer<T>::value,
+      ::boost::is_arithmetic<T>::value
+   >::param_type param_type;
+};
+
+template <typename T>
+struct call_traits<T&>
+{
+   typedef T& value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef T& param_type;  // hh removed const
+};
+
+#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
+// these are illegal specialisations; cv-qualifies applied to
+// references have no effect according to [8.3.2p1],
+// C++ Builder requires them though as it treats cv-qualified
+// references as distinct types...
+template <typename T>
+struct call_traits<T&const>
+{
+   typedef T& value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef T& param_type;  // hh removed const
+};
+template <typename T>
+struct call_traits<T&volatile>
+{
+   typedef T& value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef T& param_type;  // hh removed const
+};
+template <typename T>
+struct call_traits<T&const volatile>
+{
+   typedef T& value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef T& param_type;  // hh removed const
+};
+#endif
+#ifndef __SUNPRO_CC
+template <typename T, std::size_t N>
+struct call_traits<T [N]>
+{
+private:
+   typedef T array_type[N];
+public:
+   // degrades array to pointer:
+   typedef const T* value_type;
+   typedef array_type& reference;
+   typedef const array_type& const_reference;
+   typedef const T* const param_type;
+};
+
+template <typename T, std::size_t N>
+struct call_traits<const T [N]>
+{
+private:
+   typedef const T array_type[N];
+public:
+   // degrades array to pointer:
+   typedef const T* value_type;
+   typedef array_type& reference;
+   typedef const array_type& const_reference;
+   typedef const T* const param_type;
+};
+#endif
+
+}
+
+#endif // BOOST_DETAIL_CALL_TRAITS_HPP
diff --git a/boost/boost/detail/catch_exceptions.hpp b/boost/boost/detail/catch_exceptions.hpp
new file mode 100644 (file)
index 0000000..3fb2fde
--- /dev/null
@@ -0,0 +1,147 @@
+//  boost/catch_exceptions.hpp -----------------------------------------------//
+
+//  (C) Copyright Beman Dawes 1995-2001. Permission to copy, use, modify, sell
+//  and distribute this software is granted provided this copyright notice
+//  appears in all copies. This software is provided "as is" without express or
+//  implied warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for updates, documentation, and revision history.
+
+//  Revision History
+//   13 Jun 01 report_exception() made inline. (John Maddock, Jesse Jones)
+//   26 Feb 01 Numerous changes suggested during formal review. (Beman)
+//   25 Jan 01 catch_exceptions.hpp code factored out of cpp_main.cpp.
+//   22 Jan 01 Remove test_tools dependencies to reduce coupling.
+//    5 Nov 00 Initial boost version (Beman Dawes)
+
+#ifndef BOOST_CATCH_EXCEPTIONS_HPP
+#define BOOST_CATCH_EXCEPTIONS_HPP
+
+//  header dependencies are deliberately restricted to the standard library
+//  to reduce coupling to other boost libraries.
+#include <string>             // for string
+#include <new>                // for bad_alloc
+#include <typeinfo>           // for bad_cast, bad_typeid
+#include <exception>          // for exception, bad_exception
+#include <stdexcept>          // for std exception hierarchy
+#include <boost/cstdlib.hpp>  // for exit codes
+# if __GNUC__ != 2 || __GNUC_MINOR__ > 96
+#   include <ostream>         // for ostream
+# else
+#   include <iostream> // workaround GNU missing ostream header
+# endif
+
+# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x0551)
+#   define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT 
+# endif
+
+#if defined(MPW_CPLUS) && (MPW_CPLUS <= 0x890)
+#   define BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT 
+    namespace std { class bad_typeid { }; }
+# endif
+
+namespace boost
+{
+
+  namespace detail
+  {
+    //  A separate reporting function was requested during formal review.
+    inline void report_exception( std::ostream & os, 
+                                  const char * name, const char * info )
+      { os << "\n** uncaught exception: " << name << " " << info << std::endl; }
+  }
+
+  //  catch_exceptions  ------------------------------------------------------//
+
+  template< class Generator >  // Generator is function object returning int
+  int catch_exceptions( Generator function_object,
+                        std::ostream & out, std::ostream & err )
+  {
+    int result = 0;               // quiet compiler warnings
+    bool exception_thrown = true; // avoid setting result for each excptn type
+
+#ifndef BOOST_NO_EXCEPTIONS
+    try
+    {
+#endif
+      result = function_object();
+      exception_thrown = false;
+#ifndef BOOST_NO_EXCEPTIONS
+    }
+
+    //  As a result of hard experience with strangely interleaved output
+    //  under some compilers, there is a lot of use of endl in the code below
+    //  where a simple '\n' might appear to do.
+
+    //  The rules for catch & arguments are a bit different from function 
+    //  arguments (ISO 15.3 paragraphs 18 & 19). Apparently const isn't
+    //  required, but it doesn't hurt and some programmers ask for it.
+
+    catch ( const char * ex )
+      { detail::report_exception( out, "", ex ); }
+    catch ( const std::string & ex )
+      { detail::report_exception( out, "", ex.c_str() ); }
+
+    //  std:: exceptions
+    catch ( const std::bad_alloc & ex )
+      { detail::report_exception( out, "std::bad_alloc:", ex.what() ); }
+
+# ifndef BOOST_BUILT_IN_EXCEPTIONS_MISSING_WHAT
+    catch ( const std::bad_cast & ex )
+      { detail::report_exception( out, "std::bad_cast:", ex.what() ); }
+    catch ( const std::bad_typeid & ex )
+      { detail::report_exception( out, "std::bad_typeid:", ex.what() ); }
+# else
+    catch ( const std::bad_cast & )
+      { detail::report_exception( out, "std::bad_cast", "" ); }
+    catch ( const std::bad_typeid & )
+      { detail::report_exception( out, "std::bad_typeid", "" ); }
+# endif
+
+    catch ( const std::bad_exception & ex )
+      { detail::report_exception( out, "std::bad_exception:", ex.what() ); }
+    catch ( const std::domain_error & ex )
+      { detail::report_exception( out, "std::domain_error:", ex.what() ); }
+    catch ( const std::invalid_argument & ex )
+      { detail::report_exception( out, "std::invalid_argument:", ex.what() ); }
+    catch ( const std::length_error & ex )
+      { detail::report_exception( out, "std::length_error:", ex.what() ); }
+    catch ( const std::out_of_range & ex )
+      { detail::report_exception( out, "std::out_of_range:", ex.what() ); }
+    catch ( const std::range_error & ex )
+      { detail::report_exception( out, "std::range_error:", ex.what() ); }
+    catch ( const std::overflow_error & ex )
+      { detail::report_exception( out, "std::overflow_error:", ex.what() ); }
+    catch ( const std::underflow_error & ex )
+      { detail::report_exception( out, "std::underflow_error:", ex.what() ); }
+    catch ( const std::logic_error & ex )
+      { detail::report_exception( out, "std::logic_error:", ex.what() ); }
+    catch ( const std::runtime_error & ex )
+      { detail::report_exception( out, "std::runtime_error:", ex.what() ); }
+    catch ( const std::exception & ex )
+      { detail::report_exception( out, "std::exception:", ex.what() ); }
+
+    catch ( ... )
+      { detail::report_exception( out, "unknown exception", "" ); }
+#endif // BOOST_NO_EXCEPTIONS
+
+    if ( exception_thrown ) result = boost::exit_exception_failure;
+
+    if ( result != 0 && result != exit_success )
+    {
+      out << std::endl << "**** returning with error code "
+                << result << std::endl;
+      err
+        << "**********  errors detected; see stdout for details  ***********"
+        << std::endl;
+    }
+#if !defined(BOOST_NO_CPP_MAIN_SUCCESS_MESSAGE)
+    else { out << std::flush << "no errors detected" << std::endl; }
+#endif
+    return result;
+  } // catch_exceptions
+
+} // boost
+
+#endif  // BOOST_CATCH_EXCEPTIONS_HPP
+
diff --git a/boost/boost/detail/compressed_pair.hpp b/boost/boost/detail/compressed_pair.hpp
new file mode 100644 (file)
index 0000000..0a74d8a
--- /dev/null
@@ -0,0 +1,435 @@
+//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+//  Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+// compressed_pair: pair that "compresses" empty members
+// (see libs/utility/compressed_pair.htm)
+//
+// JM changes 25 Jan 2000:
+// Removed default arguments from compressed_pair_switch to get
+// C++ Builder 4 to accept them
+// rewriten swap to get gcc and C++ builder to compile.
+// added partial specialisations for case T1 == T2 to avoid duplicate constructor defs.
+
+#ifndef BOOST_DETAIL_COMPRESSED_PAIR_HPP
+#define BOOST_DETAIL_COMPRESSED_PAIR_HPP
+
+#include <algorithm>
+#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP
+#include <boost/type_traits/object_traits.hpp>
+#endif
+#ifndef BOOST_SAME_TRAITS_HPP
+#include <boost/type_traits/same_traits.hpp>
+#endif
+#ifndef BOOST_CALL_TRAITS_HPP
+#include <boost/call_traits.hpp>
+#endif
+
+namespace boost
+{
+
+template <class T1, class T2>
+class compressed_pair;
+
+
+// compressed_pair
+
+namespace details
+{
+   // JM altered 26 Jan 2000:
+   template <class T1, class T2, bool IsSame, bool FirstEmpty, bool SecondEmpty>
+   struct compressed_pair_switch;
+
+   template <class T1, class T2>
+   struct compressed_pair_switch<T1, T2, false, false, false>
+      {static const int value = 0;};
+
+   template <class T1, class T2>
+   struct compressed_pair_switch<T1, T2, false, true, true>
+      {static const int value = 3;};
+
+   template <class T1, class T2>
+   struct compressed_pair_switch<T1, T2, false, true, false>
+      {static const int value = 1;};
+
+   template <class T1, class T2>
+   struct compressed_pair_switch<T1, T2, false, false, true>
+      {static const int value = 2;};
+
+   template <class T1, class T2>
+   struct compressed_pair_switch<T1, T2, true, true, true>
+      {static const int value = 4;};
+
+   template <class T1, class T2>
+   struct compressed_pair_switch<T1, T2, true, false, false>
+      {static const int value = 5;};
+
+   template <class T1, class T2, int Version> class compressed_pair_imp;
+
+#ifdef __GNUC__
+   // workaround for GCC (JM):
+   using std::swap;
+#endif
+   //
+   // can't call unqualified swap from within classname::swap
+   // as Koenig lookup rules will find only the classname::swap
+   // member function not the global declaration, so use cp_swap
+   // as a forwarding function (JM):
+   template <typename T>
+   inline void cp_swap(T& t1, T& t2)
+   {
+#ifndef __GNUC__
+      using std::swap;
+#endif
+      swap(t1, t2);
+   }
+
+   // 0    derive from neither
+
+   template <class T1, class T2>
+   class compressed_pair_imp<T1, T2, 0>
+   {
+   public:
+      typedef T1                                                 first_type;
+      typedef T2                                                 second_type;
+      typedef typename call_traits<first_type>::param_type       first_param_type;
+      typedef typename call_traits<second_type>::param_type      second_param_type;
+      typedef typename call_traits<first_type>::reference        first_reference;
+      typedef typename call_traits<second_type>::reference       second_reference;
+      typedef typename call_traits<first_type>::const_reference  first_const_reference;
+      typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+      compressed_pair_imp() {} 
+
+      compressed_pair_imp(first_param_type x, second_param_type y)
+         : first_(x), second_(y) {}
+
+      compressed_pair_imp(first_param_type x)
+         : first_(x) {}
+
+      compressed_pair_imp(second_param_type y)
+         : second_(y) {}
+
+      first_reference       first()       {return first_;}
+      first_const_reference first() const {return first_;}
+
+      second_reference       second()       {return second_;}
+      second_const_reference second() const {return second_;}
+
+      void swap(::boost::compressed_pair<T1, T2>& y)
+      {
+         cp_swap(first_, y.first());
+         cp_swap(second_, y.second());
+      }
+   private:
+      first_type first_;
+      second_type second_;
+   };
+
+   // 1    derive from T1
+
+   template <class T1, class T2>
+   class compressed_pair_imp<T1, T2, 1>
+      : private T1
+   {
+   public:
+      typedef T1                                                 first_type;
+      typedef T2                                                 second_type;
+      typedef typename call_traits<first_type>::param_type       first_param_type;
+      typedef typename call_traits<second_type>::param_type      second_param_type;
+      typedef typename call_traits<first_type>::reference        first_reference;
+      typedef typename call_traits<second_type>::reference       second_reference;
+      typedef typename call_traits<first_type>::const_reference  first_const_reference;
+      typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+      compressed_pair_imp() {}
+
+      compressed_pair_imp(first_param_type x, second_param_type y)
+         : first_type(x), second_(y) {}
+
+      compressed_pair_imp(first_param_type x)
+         : first_type(x) {}
+
+      compressed_pair_imp(second_param_type y)
+         : second_(y) {}
+
+      first_reference       first()       {return *this;}
+      first_const_reference first() const {return *this;}
+
+      second_reference       second()       {return second_;}
+      second_const_reference second() const {return second_;}
+
+      void swap(::boost::compressed_pair<T1,T2>& y)
+      {
+         // no need to swap empty base class:
+         cp_swap(second_, y.second());
+      }
+   private:
+      second_type second_;
+   };
+
+   // 2    derive from T2
+
+   template <class T1, class T2>
+   class compressed_pair_imp<T1, T2, 2>
+      : private T2
+   {
+   public:
+      typedef T1                                                 first_type;
+      typedef T2                                                 second_type;
+      typedef typename call_traits<first_type>::param_type       first_param_type;
+      typedef typename call_traits<second_type>::param_type      second_param_type;
+      typedef typename call_traits<first_type>::reference        first_reference;
+      typedef typename call_traits<second_type>::reference       second_reference;
+      typedef typename call_traits<first_type>::const_reference  first_const_reference;
+      typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+      compressed_pair_imp() {}
+
+      compressed_pair_imp(first_param_type x, second_param_type y)
+         : second_type(y), first_(x) {}
+
+      compressed_pair_imp(first_param_type x)
+         : first_(x) {}
+
+      compressed_pair_imp(second_param_type y)
+         : second_type(y) {}
+
+      first_reference       first()       {return first_;}
+      first_const_reference first() const {return first_;}
+
+      second_reference       second()       {return *this;}
+      second_const_reference second() const {return *this;}
+
+      void swap(::boost::compressed_pair<T1,T2>& y)
+      {
+         // no need to swap empty base class:
+         cp_swap(first_, y.first());
+      }
+
+   private:
+      first_type first_;
+   };
+
+   // 3    derive from T1 and T2
+
+   template <class T1, class T2>
+   class compressed_pair_imp<T1, T2, 3>
+      : private T1,
+        private T2
+   {
+   public:
+      typedef T1                                                 first_type;
+      typedef T2                                                 second_type;
+      typedef typename call_traits<first_type>::param_type       first_param_type;
+      typedef typename call_traits<second_type>::param_type      second_param_type;
+      typedef typename call_traits<first_type>::reference        first_reference;
+      typedef typename call_traits<second_type>::reference       second_reference;
+      typedef typename call_traits<first_type>::const_reference  first_const_reference;
+      typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+      compressed_pair_imp() {}
+
+      compressed_pair_imp(first_param_type x, second_param_type y)
+         : first_type(x), second_type(y) {}
+
+      compressed_pair_imp(first_param_type x)
+         : first_type(x) {}
+
+      compressed_pair_imp(second_param_type y)
+         : second_type(y) {}
+
+      first_reference       first()       {return *this;}
+      first_const_reference first() const {return *this;}
+
+      second_reference       second()       {return *this;}
+      second_const_reference second() const {return *this;}
+      //
+      // no need to swap empty bases:
+      void swap(::boost::compressed_pair<T1,T2>&) {}
+   };
+
+   // JM
+   // 4    T1 == T2, T1 and T2 both empty
+   //      Note does not actually store an instance of T2 at all -
+   //      but reuses T1 base class for both first() and second().
+   template <class T1, class T2>
+   class compressed_pair_imp<T1, T2, 4>
+      : private T1
+   {
+   public:
+      typedef T1                                                 first_type;
+      typedef T2                                                 second_type;
+      typedef typename call_traits<first_type>::param_type       first_param_type;
+      typedef typename call_traits<second_type>::param_type      second_param_type;
+      typedef typename call_traits<first_type>::reference        first_reference;
+      typedef typename call_traits<second_type>::reference       second_reference;
+      typedef typename call_traits<first_type>::const_reference  first_const_reference;
+      typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+      compressed_pair_imp() {}
+
+      compressed_pair_imp(first_param_type x, second_param_type)
+         : first_type(x) {}
+
+      compressed_pair_imp(first_param_type x)
+         : first_type(x) {}
+
+      first_reference       first()       {return *this;}
+      first_const_reference first() const {return *this;}
+
+      second_reference       second()       {return *this;}
+      second_const_reference second() const {return *this;}
+
+      void swap(::boost::compressed_pair<T1,T2>&) {}
+   private:
+   };
+
+   // 5    T1 == T2 and are not empty:   //JM
+
+   template <class T1, class T2>
+   class compressed_pair_imp<T1, T2, 5>
+   {
+   public:
+      typedef T1                                                 first_type;
+      typedef T2                                                 second_type;
+      typedef typename call_traits<first_type>::param_type       first_param_type;
+      typedef typename call_traits<second_type>::param_type      second_param_type;
+      typedef typename call_traits<first_type>::reference        first_reference;
+      typedef typename call_traits<second_type>::reference       second_reference;
+      typedef typename call_traits<first_type>::const_reference  first_const_reference;
+      typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+      compressed_pair_imp() {}
+
+      compressed_pair_imp(first_param_type x, second_param_type y)
+         : first_(x), second_(y) {}
+
+      compressed_pair_imp(first_param_type x)
+         : first_(x), second_(x) {}
+
+      first_reference       first()       {return first_;}
+      first_const_reference first() const {return first_;}
+
+      second_reference       second()       {return second_;}
+      second_const_reference second() const {return second_;}
+
+      void swap(::boost::compressed_pair<T1, T2>& y)
+      {
+         cp_swap(first_, y.first());
+         cp_swap(second_, y.second());
+      }
+   private:
+      first_type first_;
+      second_type second_;
+   };
+
+}  // details
+
+template <class T1, class T2>
+class compressed_pair
+   : private ::boost::details::compressed_pair_imp<T1, T2,
+             ::boost::details::compressed_pair_switch<
+                    T1,
+                    T2,
+                    ::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
+                    ::boost::is_empty<T1>::value,
+                    ::boost::is_empty<T2>::value>::value>
+{
+private:
+   typedef details::compressed_pair_imp<T1, T2,
+             ::boost::details::compressed_pair_switch<
+                    T1,
+                    T2,
+                    ::boost::is_same<typename remove_cv<T1>::type, typename remove_cv<T2>::type>::value,
+                    ::boost::is_empty<T1>::value,
+                    ::boost::is_empty<T2>::value>::value> base;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair() : base() {}
+            compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
+   explicit compressed_pair(first_param_type x) : base(x) {}
+   explicit compressed_pair(second_param_type y) : base(y) {}
+
+   first_reference       first()       {return base::first();}
+   first_const_reference first() const {return base::first();}
+
+   second_reference       second()       {return base::second();}
+   second_const_reference second() const {return base::second();}
+
+   void swap(compressed_pair& y) { base::swap(y); }
+};
+
+// JM
+// Partial specialisation for case where T1 == T2:
+//
+template <class T>
+class compressed_pair<T, T>
+   : private details::compressed_pair_imp<T, T,
+             ::boost::details::compressed_pair_switch<
+                    T,
+                    T,
+                    ::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value,
+                    ::boost::is_empty<T>::value,
+                    ::boost::is_empty<T>::value>::value>
+{
+private:
+   typedef details::compressed_pair_imp<T, T,
+             ::boost::details::compressed_pair_switch<
+                    T,
+                    T,
+                    ::boost::is_same<typename remove_cv<T>::type, typename remove_cv<T>::type>::value,
+                    ::boost::is_empty<T>::value,
+                    ::boost::is_empty<T>::value>::value> base;
+public:
+   typedef T                                                  first_type;
+   typedef T                                                  second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair() : base() {}
+            compressed_pair(first_param_type x, second_param_type y) : base(x, y) {}
+#if !(defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x530))
+   explicit 
+#endif
+      compressed_pair(first_param_type x) : base(x) {}
+
+   first_reference       first()       {return base::first();}
+   first_const_reference first() const {return base::first();}
+
+   second_reference       second()       {return base::second();}
+   second_const_reference second() const {return base::second();}
+
+   void swap(::boost::compressed_pair<T,T>& y) { base::swap(y); }
+};
+
+template <class T1, class T2>
+inline
+void
+swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
+{
+   x.swap(y);
+}
+
+} // boost
+
+#endif // BOOST_DETAIL_COMPRESSED_PAIR_HPP
+
+
+
diff --git a/boost/boost/detail/iterator.hpp b/boost/boost/detail/iterator.hpp
new file mode 100644 (file)
index 0000000..c485a4d
--- /dev/null
@@ -0,0 +1,389 @@
+// (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.
+
+// Boost versions of
+//
+//    std::iterator_traits<>::iterator_category
+//    std::iterator_traits<>::difference_type
+//    std::distance()
+//
+// ...for all compilers and iterators
+//
+// Additionally, if X is a pointer
+//    std::iterator_traits<X>::pointer
+
+// Otherwise, if partial specialization is supported or X is not a pointer
+//    std::iterator_traits<X>::value_type
+//    std::iterator_traits<X>::pointer
+//    std::iterator_traits<X>::reference
+//
+// CAVEAT: When using the VC6 standard library, an iterator derived from
+// std::iterator but not boost::iterator or from one supplied by the standard
+// will always have pointer == const value_type* and reference == const
+// value_type&, whether that's correct or not.
+
+// See http://www.boost.org for most recent version including documentation.
+
+// Revision History
+// 04 Mar 2001 - More attempted fixes for Intel C++ (David Abrahams)
+// 03 Mar 2001 - Put all implementation into namespace
+//               boost::detail::iterator_traits_. Some progress made on fixes
+//               for Intel compiler. (David Abrahams)
+// 02 Mar 2001 - Changed BOOST_MSVC to BOOST_MSVC_STD_ITERATOR in a few
+//               places. (Jeremy Siek)
+// 19 Feb 2001 - Improved workarounds for stock MSVC6; use yes_type and
+//               no_type from type_traits.hpp; stopped trying to remove_cv
+//               before detecting is_pointer, in honor of the new type_traits
+//               semantics. (David Abrahams)
+// 13 Feb 2001 - Make it work with nearly all standard-conforming iterators
+//               under raw VC6. The one category remaining which will fail is
+//               that of iterators derived from std::iterator but not
+//               boost::iterator and which redefine difference_type.
+// 11 Feb 2001 - Clean away code which can never be used (David Abrahams)
+// 09 Feb 2001 - Always have a definition for each traits member, even if it
+//               can't be properly deduced. These will be incomplete types in
+//               some cases (undefined<void>), but it helps suppress MSVC errors
+//               elsewhere (David Abrahams)
+// 07 Feb 2001 - Support for more of the traits members where possible, making
+//               this useful as a replacement for std::iterator_traits<T> when
+//               used as a default template parameter.
+// 06 Feb 2001 - Removed useless #includes of standard library headers
+//               (David Abrahams)
+
+#ifndef ITERATOR_DWA122600_HPP_
+# define ITERATOR_DWA122600_HPP_
+
+# include <boost/config.hpp>
+# include <boost/type_traits.hpp>
+# include <boost/iterator.hpp>
+# include <iterator>
+# include <cstddef>
+
+# if defined(BOOST_MSVC_STD_ITERATOR)
+#  include <xtree>
+#  include <deque>
+#  include <list>
+#  if 0 && defined(__ICL) // Re-enable this to pick up the Intel fixes where they left off
+#   include <iosfwd>
+#   include <memory>
+#  endif
+# endif
+
+
+// STLPort 4.0 and betas have a bug when debugging is enabled and there is no
+// partial specialization: instead of an iterator_category typedef, the standard
+// container iterators have _Iterator_category.
+//
+// Also, whether debugging is enabled or not, there is a broken specialization
+// of std::iterator<output_iterator_tag,void,void,void,void> which has no
+// typedefs but iterator_category.
+# if defined(__SGI_STL_PORT) && (__SGI_STL_PORT <= 0x410) && !defined(__STL_CLASS_PARTIAL_SPECIALIZATION)
+
+#  ifdef __STL_DEBUG
+#   define BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+#  endif
+
+#  define BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
+
+# endif // STLPort <= 4.1b4 && no partial specialization
+
+namespace boost { namespace detail {
+# if !defined(BOOST_NO_STD_ITERATOR_TRAITS) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
+using std::iterator_traits;
+using std::distance;
+# else
+
+namespace iterator_traits_ {
+
+// Workarounds for less-capable implementations
+template <bool is_ptr> struct iterator_traits_select;
+
+template <class T> struct undefined;
+template <> struct iterator_traits_select<true>
+{
+    template <class Ptr>
+    struct traits
+    {
+        typedef std::ptrdiff_t difference_type;
+        typedef std::random_access_iterator_tag iterator_category;
+        typedef Ptr pointer;
+#ifdef BOOST_MSVC
+// Keeps MSVC happy under certain circumstances. It seems class template default
+// arguments are partly instantiated even when not used when the class template
+// is the return type of a function template.
+        typedef undefined<void> value_type;
+        typedef undefined<void> reference;
+#endif
+    };
+};
+
+
+typedef char yes_type;
+typedef double no_type;
+
+# ifdef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+
+no_type bad_category_helper(...);
+template <class C, class T> yes_type bad_category_helper(std::_DBG_iter<C,T>*);
+
+template <bool has_bad_category_typedef> struct bad_category_select;
+template <>
+struct bad_category_select<true>
+{
+    template <class Iterator>
+    struct category { typedef typename Iterator::_Iterator_category type; };
+};
+template <>
+struct bad_category_select<false>
+{
+    template <class Iterator>
+    struct category { typedef typename Iterator::iterator_category type; };
+};
+
+template <class Iterator>
+struct iterator_category_select
+{
+ private:
+    static Iterator p;
+    enum { has_bad_category
+           = sizeof(bad_category_helper(&p)) == sizeof(yes_type) };
+    typedef bad_category_select<has_bad_category> category_select;
+ public:
+    typedef typename category_select::template category<Iterator>::type type;
+};
+
+# endif
+
+# ifdef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
+template <bool is_bad_output_iterator> struct bad_output_iterator_select;
+template <>
+struct bad_output_iterator_select<true>
+{
+    template <class Iterator>
+    struct non_category_traits {
+        typedef void value_type;
+        typedef void difference_type;
+        typedef void pointer;
+        typedef void reference;
+    };
+};
+template <>
+struct bad_output_iterator_select<false>
+{
+    template <class Iterator>
+    struct non_category_traits {
+        typedef typename Iterator::value_type value_type;
+        typedef typename Iterator::difference_type difference_type;
+        typedef typename Iterator::pointer pointer;
+        typedef typename Iterator::reference reference;
+    };
+};
+# endif
+
+# if defined(BOOST_MSVC_STD_ITERATOR)
+
+// We'll sort iterator types into one of these classifications, from which we
+// can determine the difference_type, pointer, reference, and value_type
+enum {
+    not_msvc_stdlib_iterator,
+    msvc_stdlib_const_iterator,
+    msvc_stdlib_mutable_iterator,
+    msvc_stdlib_ostream_iterator
+};
+       
+template <unsigned> struct msvc_traits_select;
+
+template <> struct msvc_traits_select<not_msvc_stdlib_iterator>
+{
+    template <class Iterator>
+    struct traits_     // calling this "traits" will confuse VC.
+    {
+        typedef typename Iterator::difference_type difference_type;
+        typedef typename Iterator::value_type value_type;
+        typedef typename Iterator::pointer pointer;
+        typedef typename Iterator::reference reference;
+    };
+};
+
+template <> struct msvc_traits_select<msvc_stdlib_mutable_iterator>
+{
+    template <class Iterator>
+    struct traits_
+    {
+        typedef typename Iterator::distance_type difference_type;
+        typedef typename Iterator::value_type value_type;
+        typedef value_type* pointer;
+        typedef value_type& reference;
+    };
+};
+
+template <> struct msvc_traits_select<msvc_stdlib_const_iterator>
+{
+    template <class Iterator>
+    struct traits_
+    {
+        typedef typename Iterator::distance_type difference_type;
+        typedef typename Iterator::value_type value_type;
+        typedef const value_type* pointer;
+        typedef const value_type& reference;
+    };
+};
+
+template <> struct msvc_traits_select<msvc_stdlib_ostream_iterator>
+{
+    template <class Iterator>
+    struct traits_
+    {
+        typedef typename Iterator::distance_type difference_type;
+        typedef typename Iterator::value_type value_type;
+        typedef void pointer;
+        typedef void reference;
+    };
+};
+
+// These functions allow us to detect which classification a given iterator type
+// falls into.
+
+// Is the iterator derived from std::iterator?
+no_type is_std_iterator_helper(...);
+template <class V, class D, class C>
+yes_type is_std_iterator_helper(const volatile std::iterator<V,D,C>*);
+
+// Is the iterator derived from boost::iterator?
+template <class C, class T, class D, class P, class R>
+yes_type is_boost_iterator_helper(const volatile boost::iterator<C,T,D,P,R>*);
+no_type is_boost_iterator_helper(...);
+
+// Is the iterator one of the known mutable container iterators?
+template<class K, class Ty, class Kfn, class Pr, class A>
+yes_type is_mutable_iterator_helper(const volatile typename std::_Tree<K,Ty,Kfn,Pr,A>::iterator*);
+template<class Ty, class A>
+yes_type is_mutable_iterator_helper(const volatile typename std::list<Ty,A>::iterator*);
+template<class Ty, class A>
+yes_type is_mutable_iterator_helper(const volatile typename std::deque<Ty,A>::iterator*);
+no_type is_mutable_iterator_helper(...);
+
+// Is the iterator an ostream_iterator?
+template<class T, class CharT, class Traits>
+yes_type is_ostream_iterator_helper(const volatile std::ostream_iterator<T,CharT,Traits>*);
+no_type is_ostream_iterator_helper(...);
+
+template <class T>
+struct msvc_iterator_classification {
+    BOOST_STATIC_CONSTANT(unsigned,
+        value = (sizeof(is_ostream_iterator_helper((T*)0)) == sizeof(yes_type))
+          ? msvc_stdlib_ostream_iterator
+        : (sizeof(is_mutable_iterator_helper((T*)0)) == sizeof(yes_type))
+          ? msvc_stdlib_mutable_iterator
+        : (sizeof(is_std_iterator_helper((T*)0)) == sizeof(yes_type)
+           && sizeof(is_boost_iterator_helper((T*)0)) == sizeof(no_type))
+        ? msvc_stdlib_const_iterator
+        : not_msvc_stdlib_iterator
+        );
+};
+# endif
+
+template <> struct iterator_traits_select<false>
+{
+    template <class Iterator>
+    struct traits
+    {
+#   if defined(BOOST_MSVC_STD_ITERATOR)
+        typedef msvc_traits_select<(
+            msvc_iterator_classification<Iterator>::value
+        )>::template traits_<Iterator> inner_traits;
+        
+        typedef typename inner_traits::difference_type difference_type;
+        typedef typename inner_traits::value_type value_type;
+        typedef typename inner_traits::pointer pointer;
+        typedef typename inner_traits::reference reference;
+#   elif !defined(BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION)
+        typedef typename Iterator::difference_type difference_type;
+        typedef typename Iterator::value_type value_type;
+        typedef typename Iterator::pointer pointer;
+        typedef typename Iterator::reference reference;
+#   else
+        typedef bad_output_iterator_select<
+          is_convertible<const volatile Iterator*,
+            const volatile std::iterator<std::output_iterator_tag,void,void,void,void>*
+          >::value> non_category_traits_select;
+        typedef non_category_traits_select::template non_category_traits<Iterator> non_category_traits;
+     public:
+        typedef typename non_category_traits::value_type value_type;
+        typedef typename non_category_traits::difference_type difference_type;
+        typedef typename non_category_traits::pointer pointer;
+        typedef typename non_category_traits::reference reference;
+#   endif
+        
+#   if !defined(BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF)
+        typedef typename Iterator::iterator_category iterator_category;
+#   else
+        typedef typename iterator_category_select<Iterator>::type iterator_category;
+#   endif
+    };
+};
+
+} // namespace boost::detail::iterator_traits_
+
+template <class Iterator>
+struct iterator_traits
+    : iterator_traits_::iterator_traits_select<is_pointer<Iterator>::value>::template traits<Iterator>
+{
+ private:
+    typedef typename iterator_traits_::iterator_traits_select<
+        is_pointer<remove_cv<Iterator>::type>::value>::template traits<Iterator> traits;
+ public:
+    // Why do I need to define these typedefs? It keeps MSVC happy somehow.
+    // Why don't I need to define the other typedefs? Who knows?!?
+    typedef typename traits::difference_type difference_type;
+    typedef typename traits::iterator_category iterator_category;
+};
+
+namespace iterator_traits_ {
+
+template <class Category>
+struct distance_select {
+    template <class Iterator>
+    static typename ::boost::detail::iterator_traits<Iterator>::difference_type
+    distance(Iterator i1, const Iterator i2)
+    {
+        typename ::boost::detail::iterator_traits<Iterator>::difference_type result = 0;
+        while (i1 != i2)
+        {
+            ++i1;
+            ++result;
+        }
+        return result;
+    }
+};
+
+template <>
+struct distance_select<std::random_access_iterator_tag> {
+    template <class Iterator>
+    static typename ::boost::detail::iterator_traits<Iterator>::difference_type
+    distance(const Iterator i1, const Iterator i2)
+    {
+        return i2 - i1;
+    }
+};
+
+} // namespace boost::detail::iterator_traits_
+
+template <class Iterator>
+inline typename ::boost::detail::iterator_traits<Iterator>::difference_type
+distance(const Iterator& first, const Iterator& last)
+{
+    typedef typename ::boost::detail::iterator_traits<Iterator>::iterator_category iterator_category;
+    return iterator_traits_::distance_select<iterator_category>::distance(first, last);
+}
+# endif // workarounds
+
+}} // namespace boost::detail
+
+# undef BOOST_BAD_CONTAINER_ITERATOR_CATEGORY_TYPEDEF
+# undef BOOST_BAD_OUTPUT_ITERATOR_SPECIALIZATION
+
+#endif // ITERATOR_DWA122600_HPP_
diff --git a/boost/boost/detail/lightweight_mutex.hpp b/boost/boost/detail/lightweight_mutex.hpp
new file mode 100644 (file)
index 0000000..b92b576
--- /dev/null
@@ -0,0 +1,73 @@
+#ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
+#define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lightweight_mutex.hpp - lightweight mutex
+//
+//  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.
+//
+//  typedef <implementation-defined> boost::detail::lightweight_mutex;
+//
+//  boost::detail::lightweight_mutex meets the Mutex concept requirements
+//  See http://www.boost.org/libs/thread/doc/mutex_concept.html#Mutex
+//
+//  * Used by the smart pointer library
+//  * Performance oriented
+//  * Header-only implementation
+//  * Small memory footprint
+//  * Not a general purpose mutex, use boost::mutex, CRITICAL_SECTION or
+//    pthread_mutex instead.
+//  * Never spin in a tight lock/do-something/unlock loop, since
+//    lightweight_mutex does not guarantee fairness.
+//  * Never keep a lightweight_mutex locked for long periods.
+//
+
+//  Note: lwm_linux.hpp has been disabled by default; see the comments
+//        inside for more info.
+
+
+#include <boost/config.hpp>
+
+//
+//  Note to implementors: if you write a platform-specific lightweight_mutex
+//  for a platform that supports pthreads, be sure to test its performance
+//  against the pthreads-based version using shared_ptr_timing_test.cpp and
+//  shared_ptr_mt_test.cpp. Custom versions are usually not worth the trouble
+//  _unless_ the performance gains are substantial.
+//
+//  Be sure to compare against a "real" pthreads library;
+//  shared_ptr_timing_test.cpp will compile succesfully with a stub do-nothing
+//  pthreads library, since it doesn't create any threads.
+//
+
+#ifndef BOOST_HAS_THREADS
+#  include <boost/detail/lwm_nop.hpp>
+#elif defined(BOOST_USE_ASM_ATOMIC_H)
+#  include <boost/detail/lwm_linux.hpp>
+#elif defined(BOOST_LWM_USE_CRITICAL_SECTION)
+#  include <boost/detail/lwm_win32_cs.hpp>
+#elif defined(BOOST_LWM_USE_PTHREADS)
+#  include <boost/detail/lwm_pthreads.hpp>
+#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+#  include <boost/detail/lwm_win32.hpp>
+#elif defined(__sgi)
+#  include <boost/detail/lwm_irix.hpp>
+#elif defined(__GLIBCPP__)
+#  include <boost/detail/lwm_gcc.hpp>
+#elif defined(BOOST_HAS_PTHREADS)
+#  define BOOST_LWM_USE_PTHREADS
+#  include <boost/detail/lwm_pthreads.hpp>
+#else
+#  include <boost/detail/lwm_nop.hpp>
+#endif
+
+#endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED
index cb296ca85761c6fbfa55b3165c9b9016ce4c17b6..91d4d669fa455185c7038fbb05d12efd4a4a8e9e 100644 (file)
  * are almost certainly incorrect for any other platform.
  */
 
+/* The above comment is almost certainly out of date. This file works
+ * on systems other than SGI MIPSpro C++ now.
+ */
+
 /*
  * Revision history:
+ * 21 Sep 2001:
+ *    Only include <cwchar> if BOOST_NO_CWCHAR is defined. (Darin Adler)
  * 10 Aug 2001:
  *    Added MIPS (big endian) to the big endian family. (Jens Maurer)
  * 13 Apr 2001:
@@ -27,7 +33,7 @@
  * 5 Apr 2001:
  *    Added sparc (big endian) processor support (John Maddock).
  * Initial sub:
- *     Modified by Jens Maurer for gcc 2.95 on x86.
+ *      Modified by Jens Maurer for gcc 2.95 on x86.
  */
 
 #ifndef BOOST_SGI_CPP_LIMITS
 
 #include <climits>
 #include <cfloat>
-#include <cwchar>             // for WCHAR_MIN and WCHAR_MAX
 #include <boost/config.hpp>
 
+#ifndef BOOST_NO_CWCHAR
+#include <cwchar> // for WCHAR_MIN and WCHAR_MAX
+#endif
+
+// The macros are not named appropriately.  We don't care about integer
+// bit layout, but about floating-point NaN (etc.) bit patterns.
 #if defined(__sparc) || defined(__sparc__) || defined(__powerpc__) || defined(__ppc__) || defined(__hppa) || defined(_MIPSEB)
 #define BOOST_BIG_ENDIAN
 #elif defined(__i386__)
@@ -83,8 +94,16 @@ enum float_denorm_style {
   static const __mem_type __mem_name = __mem_value
 #endif /* BOOST_NO_INCLASS_MEMBER_INITIALIZATION */
 
-// Base class for all specializations of numeric_limits.
+// Deal with min/max for MinGW
+#ifdef min
+# undef min
+#endif
 
+#ifdef max
+# undef max
+#endif
+
+// Base class for all specializations of numeric_limits.
 template <class __number>
 class _Numeric_limits_base {
 public:
@@ -185,7 +204,7 @@ public:
     const unsigned int _S_word[4] = { 0, 0, 0, Word };
     return *reinterpret_cast<const Number*>(
         reinterpret_cast<const char *>(&_S_word)+16-
-               (sizeof(Number) == 12 ? 10 : sizeof(Number)));
+                (sizeof(Number) == 12 ? 10 : sizeof(Number)));
   } 
 };
 
@@ -274,24 +293,23 @@ class numeric_limits<unsigned char>
 {};
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
-#if !defined(WCHAR_MAX) || !defined(WCHAR_MIN)
-#if !defined(_WIN32) && !defined(__CYGWIN__)
-template<>
-class numeric_limits<wchar_t>
-  : public _Integer_limits<wchar_t, INT_MIN, INT_MAX>
-{};
-#else
 template<>
 class numeric_limits<wchar_t>
+#if !defined(WCHAR_MAX) || !defined(WCHAR_MIN)
+#if defined(_WIN32) || defined(__CYGWIN__)
   : public _Integer_limits<wchar_t, 0, USHRT_MAX>
-{};
+#elif defined(__hppa)
+// wchar_t has "unsigned int" as the underlying type
+  : public _Integer_limits<wchar_t, 0, UINT_MAX>
+#else
+// assume that wchar_t has "int" as the underlying type
+  : public _Integer_limits<wchar_t, INT_MIN, INT_MAX>
 #endif
 #else
-template<>
-class numeric_limits<wchar_t>
+// we have WCHAR_MIN and WCHAR_MAX defined, so use it
   : public _Integer_limits<wchar_t, WCHAR_MIN, WCHAR_MAX>
-{};
 #endif
+{};
 #endif
 
 template<>
@@ -329,15 +347,17 @@ class numeric_limits<unsigned long>
 // Some compilers have long long, but don't define the
 // LONGLONG_MIN and LONGLONG_MAX macros in limits.h.  This
 // assumes that long long is 64 bits.
-#if !defined(LONGLONG_MIN) && !defined(LONGLONG_MAX) \
-                           && !defined(ULONGLONG_MAX)
+#if !defined(LONGLONG_MAX) && !defined(ULONGLONG_MAX)
 
-#define ULONGLONG_MAX 0xffffffffffffffffLLU
-#define LONGLONG_MAX 0x7fffffffffffffffLL
-#define LONGLONG_MIN (-LONGLONG_MAX - 1)
+# define ULONGLONG_MAX 0xffffffffffffffffLLU
+# define LONGLONG_MAX 0x7fffffffffffffffLL
 
 #endif
 
+#if !defined(LONGLONG_MIN)
+# define LONGLONG_MIN (-LONGLONG_MAX - 1)
+#endif 
+
 template<>
 class numeric_limits<long long>
   : public _Integer_limits<long long, LONGLONG_MIN, LONGLONG_MAX>
diff --git a/boost/boost/detail/lwm_gcc.hpp b/boost/boost/detail/lwm_gcc.hpp
new file mode 100644 (file)
index 0000000..bf8a09a
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_GCC_HPP_INCLUDED
+
+//
+//  boost/detail/lwm_gcc.hpp
+//
+//  lightweight_mutex for GNU libstdc++ v3
+//
+//  http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html
+//
+//  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//  Copyright (c) 2002 Lars Gullik Bjønnes <larsbj@lyx.org>
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+#include <bits/atomicity.h>
+#include <sched.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+private:
+
+    _Atomic_word a_;
+
+    lightweight_mutex(lightweight_mutex const &);
+    lightweight_mutex & operator=(lightweight_mutex const &);
+
+public:
+
+    lightweight_mutex(): a_(1)
+    {
+    }
+
+    class scoped_lock;
+    friend class scoped_lock;
+
+    class scoped_lock
+    {
+    private:
+
+        lightweight_mutex & m_;
+
+        scoped_lock(scoped_lock const &);
+        scoped_lock & operator=(scoped_lock const &);
+
+    public:
+
+        explicit scoped_lock(lightweight_mutex & m): m_(m)
+        {
+            while( !__exchange_and_add(&m_.a_, -1) )
+            {
+                __atomic_add(&m_.a_, 1);
+                sched_yield();
+            }
+        }
+
+        ~scoped_lock()
+        {
+            __atomic_add(&m_.a_, 1);
+        }
+    };
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_GCC_HPP_INCLUDED
diff --git a/boost/boost/detail/lwm_irix.hpp b/boost/boost/detail/lwm_irix.hpp
new file mode 100644 (file)
index 0000000..2a55161
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lwm_irix.hpp
+//
+//  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.
+//
+
+#include <sgidefs.h>
+#include <mutex.h>
+#include <sched.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+private:
+
+    __uint32_t l_;
+
+    lightweight_mutex(lightweight_mutex const &);
+    lightweight_mutex & operator=(lightweight_mutex const &);
+
+public:
+
+    lightweight_mutex(): l_(0)
+    {
+    }
+
+    class scoped_lock;
+    friend class scoped_lock;
+
+    class scoped_lock
+    {
+    private:
+
+        lightweight_mutex & m_;
+
+        scoped_lock(scoped_lock const &);
+        scoped_lock & operator=(scoped_lock const &);
+
+    public:
+
+        explicit scoped_lock(lightweight_mutex & m): m_(m)
+        {
+            while( test_and_set32(&m_.l_, 1) )
+            {
+                sched_yield();
+            }
+        }
+
+        ~scoped_lock()
+        {
+            m_.l_ = 0;
+        }
+    };
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_IRIX_HPP_INCLUDED
diff --git a/boost/boost/detail/lwm_linux.hpp b/boost/boost/detail/lwm_linux.hpp
new file mode 100644 (file)
index 0000000..62d8e64
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lwm_linux.hpp
+//
+//  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.
+//
+
+//
+//  This implementation uses <asm/atomic.h>. This is a kernel header;
+//  using kernel headers in a user program may cause a number of problems,
+//  and not all flavors of Linux provide the atomic instructions.
+//
+//  This file is only provided because the performance of this implementation
+//  is about 3.5 times higher than the pthreads version. Use at your own risk
+//  (by defining BOOST_USE_ASM_ATOMIC_H.)
+//
+
+#include <asm/atomic.h>
+#include <sched.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+private:
+
+    atomic_t a_;
+
+    lightweight_mutex(lightweight_mutex const &);
+    lightweight_mutex & operator=(lightweight_mutex const &);
+
+public:
+
+    lightweight_mutex()
+    {
+        atomic_t a = ATOMIC_INIT(1);
+        a_ = a;
+    }
+
+    class scoped_lock;
+    friend class scoped_lock;
+
+    class scoped_lock
+    {
+    private:
+
+        lightweight_mutex & m_;
+
+        scoped_lock(scoped_lock const &);
+        scoped_lock & operator=(scoped_lock const &);
+
+    public:
+
+        explicit scoped_lock(lightweight_mutex & m): m_(m)
+        {
+            while( !atomic_dec_and_test(&m_.a_) )
+            {
+                atomic_inc(&m_.a_);
+                sched_yield();
+            }
+        }
+
+        ~scoped_lock()
+        {
+            atomic_inc(&m_.a_);
+        }
+    };
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_LINUX_HPP_INCLUDED
diff --git a/boost/boost/detail/lwm_nop.hpp b/boost/boost/detail/lwm_nop.hpp
new file mode 100644 (file)
index 0000000..671a5b0
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_NOP_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lwm_nop.hpp
+//
+//  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.
+//
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+public:
+
+    typedef lightweight_mutex scoped_lock;
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_NOP_HPP_INCLUDED
diff --git a/boost/boost/detail/lwm_pthreads.hpp b/boost/boost/detail/lwm_pthreads.hpp
new file mode 100644 (file)
index 0000000..ba8d762
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lwm_pthreads.hpp
+//
+//  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.
+//
+
+#include <pthread.h>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+private:
+
+    pthread_mutex_t m_;
+
+    lightweight_mutex(lightweight_mutex const &);
+    lightweight_mutex & operator=(lightweight_mutex const &);
+
+public:
+
+    lightweight_mutex()
+    {
+        pthread_mutex_init(&m_, 0);
+    }
+
+    ~lightweight_mutex()
+    {
+        pthread_mutex_destroy(&m_);
+    }
+
+    class scoped_lock;
+    friend class scoped_lock;
+
+    class scoped_lock
+    {
+    private:
+
+        pthread_mutex_t & m_;
+
+        scoped_lock(scoped_lock const &);
+        scoped_lock & operator=(scoped_lock const &);
+
+    public:
+
+        scoped_lock(lightweight_mutex & m): m_(m.m_)
+        {
+            pthread_mutex_lock(&m_);
+        }
+
+        ~scoped_lock()
+        {
+            pthread_mutex_unlock(&m_);
+        }
+    };
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_PTHREADS_HPP_INCLUDED
diff --git a/boost/boost/detail/lwm_win32.hpp b/boost/boost/detail/lwm_win32.hpp
new file mode 100644 (file)
index 0000000..a54aefc
--- /dev/null
@@ -0,0 +1,81 @@
+#ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lwm_win32.hpp
+//
+//  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.
+//
+
+#include <boost/detail/winapi.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+private:
+
+    long l_;
+
+    lightweight_mutex(lightweight_mutex const &);
+    lightweight_mutex & operator=(lightweight_mutex const &);
+
+public:
+
+    lightweight_mutex(): l_(0)
+    {
+    }
+
+    class scoped_lock;
+    friend class scoped_lock;
+
+    class scoped_lock
+    {
+    private:
+
+        lightweight_mutex & m_;
+
+        scoped_lock(scoped_lock const &);
+        scoped_lock & operator=(scoped_lock const &);
+
+    public:
+
+        explicit scoped_lock(lightweight_mutex & m): m_(m)
+        {
+            while( winapi::InterlockedExchange(&m_.l_, 1) )
+            {
+                winapi::Sleep(0);
+            }
+        }
+
+        ~scoped_lock()
+        {
+            winapi::InterlockedExchange(&m_.l_, 0);
+
+            // Note: adding a Sleep(0) here will make
+            // the mutex more fair and will increase the overall
+            // performance of some applications substantially in
+            // high contention situations, but will penalize the
+            // low contention / single thread case up to 5x
+        }
+    };
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_WIN32_HPP_INCLUDED
diff --git a/boost/boost/detail/lwm_win32_cs.hpp b/boost/boost/detail/lwm_win32_cs.hpp
new file mode 100644 (file)
index 0000000..3127004
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
+#define BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/lwm_win32_cs.hpp
+//
+//  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.
+//
+
+#include <boost/detail/winapi.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class lightweight_mutex
+{
+private:
+
+    winapi::critical_section cs_;
+
+    lightweight_mutex(lightweight_mutex const &);
+    lightweight_mutex & operator=(lightweight_mutex const &);
+
+public:
+
+    lightweight_mutex()
+    {
+        winapi::InitializeCriticalSection(&cs_);
+    }
+
+    ~lightweight_mutex()
+    {
+        winapi::DeleteCriticalSection(&cs_);
+    }
+
+    class scoped_lock;
+    friend class scoped_lock;
+
+    class scoped_lock
+    {
+    private:
+
+        lightweight_mutex & m_;
+
+        scoped_lock(scoped_lock const &);
+        scoped_lock & operator=(scoped_lock const &);
+
+    public:
+
+        explicit scoped_lock(lightweight_mutex & m): m_(m)
+        {
+            winapi::EnterCriticalSection(&m_.cs_);
+        }
+
+        ~scoped_lock()
+        {
+            winapi::LeaveCriticalSection(&m_.cs_);
+        }
+    };
+};
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
diff --git a/boost/boost/detail/named_template_params.hpp b/boost/boost/detail/named_template_params.hpp
new file mode 100644 (file)
index 0000000..2af39cc
--- /dev/null
@@ -0,0 +1,178 @@
+// (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.
+
+// Revision History:
+
+// 04 Oct 2001   David Abrahams
+//      Changed name of "bind" to "select" to avoid problems with MSVC.
+
+#ifndef BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
+#define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
+
+#include <boost/type_traits/conversion_traits.hpp>
+#include <boost/type_traits/composite_traits.hpp> // for is_reference
+#if defined(__BORLANDC__)
+#include <boost/type_traits/ice.hpp>
+#endif
+
+namespace boost {
+  namespace detail {
+    
+    struct default_argument { };
+
+    struct dummy_default_gen {
+      template <class Base, class Traits>
+      struct select {
+        typedef default_argument type;
+      };
+    };
+
+   // This class template is a workaround for MSVC.
+   template <class Gen> struct default_generator {
+     typedef detail::dummy_default_gen type;
+   };
+
+    template <class T> struct is_default { 
+      enum { value = false };  
+      typedef type_traits::no_type type;
+    };
+    template <> struct is_default<default_argument> { 
+      enum { value = true }; 
+      typedef type_traits::yes_type type;
+    };
+
+    struct choose_default {
+      template <class Arg, class DefaultGen, class Base, class Traits>
+      struct select {
+        typedef typename default_generator<DefaultGen>::type Gen;
+        typedef typename Gen::template select<Base,Traits>::type type;
+      };
+    };
+    struct choose_arg {
+      template <class Arg, class DefaultGen, class Base, class Traits>
+      struct select {
+        typedef Arg type;
+      };
+    };
+
+#if defined(__BORLANDC__)
+    template <class UseDefault>
+    struct choose_arg_or_default { typedef choose_arg type; };
+    template <>
+    struct choose_arg_or_default<type_traits::yes_type> {
+      typedef choose_default type;
+    };
+#else
+    template <bool UseDefault>
+    struct choose_arg_or_default { typedef choose_arg type; };
+    template <>
+    struct choose_arg_or_default<true> {
+      typedef choose_default type;
+    };
+#endif
+    
+    template <class Arg, class DefaultGen, class Base, class Traits>
+    class resolve_default {
+#if defined(__BORLANDC__)
+      typedef typename choose_arg_or_default<typename is_default<Arg>::type>::type Selector;
+#else
+      // This usually works for Borland, but I'm seeing weird errors in
+      // iterator_adaptor_test.cpp when using this method.
+      enum { is_def = is_default<Arg>::value };
+      typedef typename choose_arg_or_default<is_def>::type Selector;
+#endif
+    public:
+      typedef typename Selector
+        ::template select<Arg, DefaultGen, Base, Traits>::type type;
+    };
+
+    // To differentiate an unnamed parameter from a traits generator
+    // we use is_convertible<X, iter_traits_gen_base>.
+    struct named_template_param_base { };
+
+    template <class X>
+    struct is_named_param_list {
+      enum { value  = is_convertible<X, named_template_param_base>::value };
+    };
+    
+    struct choose_named_params {
+      template <class Prev> struct select { typedef Prev type; };
+    };
+    struct choose_default_arg {
+      template <class Prev> struct select { 
+        typedef detail::default_argument type;
+      };
+    };
+
+    template <bool Named> struct choose_default_dispatch_;
+    template <> struct choose_default_dispatch_<true> {
+      typedef choose_named_params type;
+    };
+    template <> struct choose_default_dispatch_<false> {
+      typedef choose_default_arg type;
+    };
+    // The use of inheritance here is a Solaris Forte 6 workaround.
+    template <bool Named> struct choose_default_dispatch
+      : public choose_default_dispatch_<Named> { };
+
+    template <class PreviousArg>
+    struct choose_default_argument {
+      enum { is_named = is_named_param_list<PreviousArg>::value };
+      typedef typename choose_default_dispatch<is_named>::type Selector;
+      typedef typename Selector::template select<PreviousArg>::type type;
+    };
+
+    // This macro assumes that there is a class named default_##TYPE
+    // defined before the application of the macro.  This class should
+    // have a single member class template named "select" with two
+    // template parameters: the type of the class being created (e.g.,
+    // the iterator_adaptor type when creating iterator adaptors) and
+    // a traits class. The select class should have a single typedef
+    // named "type" that produces the default for TYPE.  See
+    // boost/iterator_adaptors.hpp for an example usage.  Also,
+    // applications of this macro must be placed in namespace
+    // boost::detail.
+
+#define BOOST_NAMED_TEMPLATE_PARAM(TYPE) \
+    struct get_##TYPE##_from_named { \
+      template <class Base, class NamedParams, class Traits> \
+      struct select { \
+          typedef typename NamedParams::traits NamedTraits; \
+          typedef typename NamedTraits::TYPE TYPE; \
+          typedef typename resolve_default<TYPE, \
+            default_##TYPE, Base, NamedTraits>::type type; \
+      }; \
+    }; \
+    struct pass_thru_##TYPE { \
+      template <class Base, class Arg, class Traits> struct select { \
+          typedef typename resolve_default<Arg, \
+            default_##TYPE, Base, Traits>::type type; \
+      };\
+    }; \
+    template <int NamedParam> \
+    struct get_##TYPE##_dispatch { }; \
+    template <> struct get_##TYPE##_dispatch<1> { \
+      typedef get_##TYPE##_from_named type; \
+    }; \
+    template <> struct get_##TYPE##_dispatch<0> { \
+      typedef pass_thru_##TYPE type; \
+    }; \
+    template <class Base, class X, class Traits>  \
+    class get_##TYPE { \
+      enum { is_named = is_named_param_list<X>::value }; \
+      typedef typename get_##TYPE##_dispatch<is_named>::type Selector; \
+    public: \
+      typedef typename Selector::template select<Base, X, Traits>::type type; \
+    }; \
+    template <> struct default_generator<default_##TYPE> { \
+      typedef default_##TYPE type; \
+    }
+
+    
+  } // namespace detail
+} // namespace boost
+
+#endif // BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP
diff --git a/boost/boost/detail/numeric_traits.hpp b/boost/boost/detail/numeric_traits.hpp
new file mode 100644 (file)
index 0000000..f44ba2d
--- /dev/null
@@ -0,0 +1,198 @@
+// (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.
+//
+// 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.
+//
+// Template class numeric_traits<Number> --
+//
+//    Supplies:
+//
+//      typedef difference_type -- a type used to represent the difference
+//      between any two values of Number.
+//
+//    Support:
+//      1. Not all specializations are supplied
+//
+//      2. Use of specializations that are not supplied will cause a
+//      compile-time error
+//
+//      3. Users are free to specialize numeric_traits for any type.
+//
+//      4. Right now, specializations are only supplied for integer types.
+//
+//      5. On implementations which do not supply compile-time constants in
+//      std::numeric_limits<>, only specializations for built-in integer types
+//      are supplied.
+//
+//      6. Handling of numbers whose range of representation is at least as
+//      great as boost::intmax_t can cause some differences to be
+//      unrepresentable in difference_type:
+//
+//        Number    difference_type
+//        ------    ---------------
+//        signed    Number
+//        unsigned  intmax_t
+//
+// template <class Number> typename numeric_traits<Number>::difference_type
+// numeric_distance(Number x, Number y)
+//    computes (y - x), attempting to avoid overflows.
+//
+
+// See http://www.boost.org for most recent version including documentation.
+
+// Revision History
+// 11 Feb 2001 - Use BOOST_STATIC_CONSTANT (David Abrahams)
+// 11 Feb 2001 - Rolled back ineffective Borland-specific code
+//               (David Abrahams)
+// 10 Feb 2001 - Rolled in supposed Borland fixes from John Maddock, but
+//               not seeing any improvement yet (David Abrahams)
+// 06 Feb 2001 - Factored if_true out into boost/detail/select_type.hpp
+//               (David Abrahams)
+// 23 Jan 2001 - Fixed logic of difference_type selection, which was
+//               completely wack. In the process, added digit_traits<>
+//               to compute the number of digits in intmax_t even when
+//               not supplied by numeric_limits<>. (David Abrahams)
+// 21 Jan 2001 - Created (David Abrahams)
+
+#ifndef BOOST_NUMERIC_TRAITS_HPP_DWA20001901
+# define BOOST_NUMERIC_TRAITS_HPP_DWA20001901
+
+# include <boost/config.hpp>
+# include <boost/cstdint.hpp>
+# include <boost/static_assert.hpp>
+# include <boost/type_traits.hpp>
+# include <boost/detail/select_type.hpp>
+# include <boost/limits.hpp>
+
+namespace boost { namespace detail {
+
+  // Template class is_signed -- determine whether a numeric type is signed
+  // Requires that T is constructable from the literals -1 and 0.  Compile-time
+  // error results if that requirement is not met (and thus signedness is not
+  // likely to have meaning for that type).
+  template <class Number>
+  struct is_signed
+  {
+#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC)
+    BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
+#else
+    BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
+#endif
+  };
+
+# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+  // digit_traits - compute the number of digits in a built-in integer
+  // type. Needed for implementations on which numeric_limits is not specialized
+  // for intmax_t (e.g. VC6).
+  template <bool is_specialized> struct digit_traits_select;
+
+  // numeric_limits is specialized; just select that version of digits
+  template <> struct digit_traits_select<true>
+  {
+      template <class T> struct traits
+      {
+          BOOST_STATIC_CONSTANT(int, digits = std::numeric_limits<T>::digits);
+      };
+  };
+
+  // numeric_limits is not specialized; compute digits from sizeof(T)
+  template <> struct digit_traits_select<false>
+  {
+      template <class T> struct traits
+      {
+          BOOST_STATIC_CONSTANT(int, digits = (
+              sizeof(T) * std::numeric_limits<unsigned char>::digits
+              - (is_signed<T>::value ? 1 : 0))
+              );
+      };
+  };
+
+  // here's the "usable" template
+  template <class T> struct digit_traits
+  {
+      typedef digit_traits_select<
+                ::std::numeric_limits<T>::is_specialized> selector;
+      typedef typename selector::template traits<T> traits;
+      BOOST_STATIC_CONSTANT(int, digits = traits::digits);
+  };
+#endif
+
+  // Template class integer_traits<Integer> -- traits of various integer types
+  // This should probably be rolled into boost::integer_traits one day, but I
+  // need it to work without <limits>
+  template <class Integer>
+  struct integer_traits
+  {
+# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+   private:
+      typedef Integer integer_type;
+      typedef std::numeric_limits<integer_type> x;
+#   ifdef BOOST_MSVC
+      // for some reason, MSVC asserts when it shouldn't unless we make these
+      // local definitions
+      BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer);
+      BOOST_STATIC_CONSTANT(bool, is_specialized = x::is_specialized);
+      
+      BOOST_STATIC_ASSERT(is_integer);
+      BOOST_STATIC_ASSERT(is_specialized);
+#   endif
+   public:
+      typedef typename
+      if_true<(int(x::is_signed)
+              && (!int(x::is_bounded)
+                 // digits is the number of no-sign bits
+                  || (int(x::digits) + 1 >= digit_traits<boost::intmax_t>::digits)))>::template then<
+        Integer,
+          
+      typename if_true<(int(x::digits) + 1 < digit_traits<signed int>::digits)>::template then<
+        signed int,
+
+      typename if_true<(int(x::digits) + 1 < digit_traits<signed long>::digits)>::template then<
+        signed long,
+
+   // else
+        intmax_t
+      >::type>::type>::type difference_type;
+#else
+      BOOST_STATIC_ASSERT(boost::is_integral<Integer>::value);
+
+      typedef typename
+      if_true<(sizeof(Integer) >= sizeof(intmax_t))>::template then<
+               
+        typename if_true<(is_signed<Integer>::value)>::template then<
+          Integer,
+          intmax_t
+        >::type,
+
+        typename if_true<(sizeof(Integer) < sizeof(std::ptrdiff_t))>::template then<
+          std::ptrdiff_t,
+          intmax_t
+        >::type
+      >::type difference_type;
+# endif
+  };
+
+  // Right now, only supports integers, but should be expanded.
+  template <class Number>
+  struct numeric_traits
+  {
+      typedef typename integer_traits<Number>::difference_type difference_type;
+  };
+
+  template <class Number>
+  typename numeric_traits<Number>::difference_type numeric_distance(Number x, Number y)
+  {
+      typedef typename numeric_traits<Number>::difference_type difference_type;
+      return difference_type(y) - difference_type(x);
+  }
+}}
+
+#endif // BOOST_NUMERIC_TRAITS_HPP_DWA20001901
diff --git a/boost/boost/detail/ob_call_traits.hpp b/boost/boost/detail/ob_call_traits.hpp
new file mode 100644 (file)
index 0000000..9cb58ad
--- /dev/null
@@ -0,0 +1,169 @@
+//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+//  Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+//
+//  Crippled version for crippled compilers:
+//  see libs/utility/call_traits.htm
+//
+
+/* Release notes:
+   01st October 2000:
+      Fixed call_traits on VC6, using "poor man's partial specialisation",
+      using ideas taken from "Generative programming" by Krzysztof Czarnecki 
+      & Ulrich Eisenecker.
+*/
+
+#ifndef BOOST_OB_CALL_TRAITS_HPP
+#define BOOST_OB_CALL_TRAITS_HPP
+
+#ifndef BOOST_CONFIG_HPP
+#include <boost/config.hpp>
+#endif
+
+#ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
+#include <boost/type_traits/arithmetic_traits.hpp>
+#endif
+#ifndef BOOST_COMPOSITE_TYPE_TRAITS_HPP
+#include <boost/type_traits/composite_traits.hpp>
+#endif
+
+namespace boost{
+
+#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
+//
+// use member templates to emulate
+// partial specialisation:
+//
+namespace detail{
+
+template <class T>
+struct standard_call_traits
+{
+   typedef T value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef const T& param_type;
+};
+template <class T>
+struct simple_call_traits
+{
+   typedef T value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef const T param_type;
+};
+template <class T>
+struct reference_call_traits
+{
+   typedef T value_type;
+   typedef T reference;
+   typedef T const_reference;
+   typedef T param_type;
+};
+
+template <bool pointer, bool arithmetic, bool reference>
+struct call_traits_chooser
+{
+   template <class T>
+   struct rebind
+   {
+      typedef standard_call_traits<T> type;
+   };
+};
+
+template <>
+struct call_traits_chooser<true, false, false>
+{
+   template <class T>
+   struct rebind
+   {
+      typedef simple_call_traits<T> type;
+   };
+};
+
+template <>
+struct call_traits_chooser<false, false, true>
+{
+   template <class T>
+   struct rebind
+   {
+      typedef reference_call_traits<T> type;
+   };
+};
+
+template <bool size_is_small> 
+struct call_traits_sizeof_chooser2
+{
+   template <class T>
+   struct small_rebind
+   {
+      typedef simple_call_traits<T> small_type;
+   };
+};
+
+template<> 
+struct call_traits_sizeof_chooser2<false>
+{
+   template <class T>
+   struct small_rebind
+   {
+      typedef standard_call_traits<T> small_type;
+   };
+};
+
+template <>
+struct call_traits_chooser<false, true, false>
+{
+   template <class T>
+   struct rebind
+   {
+      enum { sizeof_choice = (sizeof(T) <= sizeof(void*)) };
+      typedef call_traits_sizeof_chooser2<(sizeof(T) <= sizeof(void*))> chooser;
+      typedef typename chooser::template small_rebind<T> bound_type;
+      typedef typename bound_type::small_type type;
+   };
+};
+
+} // namespace detail
+template <typename T>
+struct call_traits
+{
+private:
+    typedef detail::call_traits_chooser<
+         ::boost::is_pointer<T>::value,
+         ::boost::is_arithmetic<T>::value, 
+         ::boost::is_reference<T>::value
+      > chooser;
+   typedef typename chooser::template rebind<T> bound_type;
+   typedef typename bound_type::type call_traits_type;
+public:
+   typedef typename call_traits_type::value_type       value_type;
+   typedef typename call_traits_type::reference        reference;
+   typedef typename call_traits_type::const_reference  const_reference;
+   typedef typename call_traits_type::param_type       param_type;
+};
+
+#else
+//
+// sorry call_traits is completely non-functional
+// blame your broken compiler:
+//
+
+template <typename T>
+struct call_traits
+{
+   typedef T value_type;
+   typedef T& reference;
+   typedef const T& const_reference;
+   typedef const T& param_type;
+};
+
+#endif // member templates
+
+}
+
+#endif // BOOST_OB_CALL_TRAITS_HPP
diff --git a/boost/boost/detail/ob_compressed_pair.hpp b/boost/boost/detail/ob_compressed_pair.hpp
new file mode 100644 (file)
index 0000000..f8efbb1
--- /dev/null
@@ -0,0 +1,509 @@
+//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+//  Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+//  see libs/utility/compressed_pair.hpp
+//
+/* Release notes:
+   20 Jan 2001:
+        Fixed obvious bugs (David Abrahams)
+   07 Oct 2000:
+      Added better single argument constructor support.
+   03 Oct 2000:
+      Added VC6 support (JM).
+   23rd July 2000:
+      Additional comments added. (JM)
+   Jan 2000:
+      Original version: this version crippled for use with crippled compilers
+      - John Maddock Jan 2000.
+*/
+
+
+#ifndef BOOST_OB_COMPRESSED_PAIR_HPP
+#define BOOST_OB_COMPRESSED_PAIR_HPP
+
+#include <algorithm>
+#ifndef BOOST_OBJECT_TYPE_TRAITS_HPP
+#include <boost/type_traits/object_traits.hpp>
+#endif
+#ifndef BOOST_SAME_TRAITS_HPP
+#include <boost/type_traits/same_traits.hpp>
+#endif
+#ifndef BOOST_CALL_TRAITS_HPP
+#include <boost/call_traits.hpp>
+#endif
+
+namespace boost
+{
+#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
+//
+// use member templates to emulate
+// partial specialisation.  Note that due to
+// problems with overload resolution with VC6
+// each of the compressed_pair versions that follow
+// have one template single-argument constructor
+// in place of two specific constructors:
+//
+
+template <class T1, class T2>
+class compressed_pair;
+
+namespace detail{
+
+template <class A, class T1, class T2>
+struct best_conversion_traits
+{
+   typedef char one;
+   typedef char (&two)[2];
+   static A a;
+   static one test(T1);
+   static two test(T2);
+
+   enum { value = sizeof(test(a)) };
+};
+
+template <int>
+struct init_one;
+
+template <>
+struct init_one<1>
+{
+   template <class A, class T1, class T2>
+   static void init(const A& a, T1* p1, T2*)
+   {
+      *p1 = a;
+   }
+};
+
+template <>
+struct init_one<2>
+{
+   template <class A, class T1, class T2>
+   static void init(const A& a, T1*, T2* p2)
+   {
+      *p2 = a;
+   }
+};
+
+
+// T1 != T2, both non-empty
+template <class T1, class T2>
+class compressed_pair_0
+{
+private:
+   T1 _first;
+   T2 _second;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair_0() : _first(), _second() {}
+            compressed_pair_0(first_param_type x, second_param_type y) : _first(x), _second(y) {}
+   template <class A>
+   explicit compressed_pair_0(const A& val)
+   {
+      init_one<best_conversion_traits<A, T1, T2>::value>::init(val, &_first, &_second);
+   }
+   compressed_pair_0(const ::boost::compressed_pair<T1,T2>& x)
+      : _first(x.first()), _second(x.second()) {}
+
+#if 0
+  compressed_pair_0& operator=(const compressed_pair_0& x) {
+    cout << "assigning compressed pair 0" << endl;
+    _first = x._first;
+    _second = x._second;
+    cout << "finished assigning compressed pair 0" << endl;
+    return *this;
+  }
+#endif
+
+   first_reference       first()       { return _first; }
+   first_const_reference first() const { return _first; }
+
+   second_reference       second()       { return _second; }
+   second_const_reference second() const { return _second; }
+
+   void swap(compressed_pair_0& y)
+   {
+      using std::swap;
+      swap(_first, y._first);
+      swap(_second, y._second);
+   }
+};
+
+// T1 != T2, T2 empty
+template <class T1, class T2>
+class compressed_pair_1 : T2
+{
+private:
+   T1 _first;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair_1() : T2(), _first() {}
+            compressed_pair_1(first_param_type x, second_param_type y) : T2(y), _first(x) {}
+
+   template <class A>
+   explicit compressed_pair_1(const A& val)
+   {
+      init_one<best_conversion_traits<A, T1, T2>::value>::init(val, &_first, static_cast<T2*>(this));
+   }
+
+   compressed_pair_1(const ::boost::compressed_pair<T1,T2>& x)
+      : T2(x.second()), _first(x.first()) {}
+
+#ifdef BOOST_MSVC
+  // Total weirdness. If the assignment to _first is moved after
+  // the call to the inherited operator=, then this breaks graph/test/graph.cpp
+  // by way of iterator_adaptor.
+  compressed_pair_1& operator=(const compressed_pair_1& x) {
+    _first = x._first;
+    T2::operator=(x);
+    return *this;
+  }
+#endif
+
+   first_reference       first()       { return _first; }
+   first_const_reference first() const { return _first; }
+
+   second_reference       second()       { return *this; }
+   second_const_reference second() const { return *this; }
+
+   void swap(compressed_pair_1& y)
+   {
+      // no need to swap empty base class:
+      using std::swap;
+      swap(_first, y._first);
+   }
+};
+
+// T1 != T2, T1 empty
+template <class T1, class T2>
+class compressed_pair_2 : T1
+{
+private:
+   T2 _second;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair_2() : T1(), _second() {}
+            compressed_pair_2(first_param_type x, second_param_type y) : T1(x), _second(y) {}
+   template <class A>
+   explicit compressed_pair_2(const A& val)
+   {
+      init_one<best_conversion_traits<A, T1, T2>::value>::init(val, static_cast<T1*>(this), &_second);
+   }
+   compressed_pair_2(const ::boost::compressed_pair<T1,T2>& x)
+      : T1(x.first()), _second(x.second()) {}
+
+#if 0
+  compressed_pair_2& operator=(const compressed_pair_2& x) {
+    cout << "assigning compressed pair 2" << endl;
+    T1::operator=(x);
+    _second = x._second;
+    cout << "finished assigning compressed pair 2" << endl;
+    return *this;
+  }
+#endif
+   first_reference       first()       { return *this; }
+   first_const_reference first() const { return *this; }
+
+   second_reference       second()       { return _second; }
+   second_const_reference second() const { return _second; }
+
+   void swap(compressed_pair_2& y)
+   {
+      // no need to swap empty base class:
+      using std::swap;
+      swap(_second, y._second);
+   }
+};
+
+// T1 != T2, both empty
+template <class T1, class T2>
+class compressed_pair_3 : T1, T2
+{
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair_3() : T1(), T2() {}
+            compressed_pair_3(first_param_type x, second_param_type y) : T1(x), T2(y) {}
+   template <class A>
+   explicit compressed_pair_3(const A& val)
+   {
+      init_one<best_conversion_traits<A, T1, T2>::value>::init(val, static_cast<T1*>(this), static_cast<T2*>(this));
+   }
+   compressed_pair_3(const ::boost::compressed_pair<T1,T2>& x)
+      : T1(x.first()), T2(x.second()) {}
+
+   first_reference       first()       { return *this; }
+   first_const_reference first() const { return *this; }
+
+   second_reference       second()       { return *this; }
+   second_const_reference second() const { return *this; }
+
+   void swap(compressed_pair_3& y)
+   {
+      // no need to swap empty base classes:
+   }
+};
+
+// T1 == T2, and empty
+template <class T1, class T2>
+class compressed_pair_4 : T1
+{
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair_4() : T1() {}
+            compressed_pair_4(first_param_type x, second_param_type) : T1(x) {}
+   // only one single argument constructor since T1 == T2
+   explicit compressed_pair_4(first_param_type x) : T1(x) {}
+   compressed_pair_4(const ::boost::compressed_pair<T1,T2>& x)
+      : T1(x.first()){}
+
+   first_reference       first()       { return *this; }
+   first_const_reference first() const { return *this; }
+
+   second_reference       second()       { return *this; }
+   second_const_reference second() const { return *this; }
+
+   void swap(compressed_pair_4& y)
+   {
+      // no need to swap empty base classes:
+   }
+};
+
+// T1 == T2, not empty
+template <class T1, class T2>
+class compressed_pair_5
+{
+private:
+   T1 _first;
+   T2 _second;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair_5() : _first(), _second() {}
+            compressed_pair_5(first_param_type x, second_param_type y) : _first(x), _second(y) {}
+   // only one single argument constructor since T1 == T2
+   explicit compressed_pair_5(first_param_type x) : _first(x), _second(x) {}
+   compressed_pair_5(const ::boost::compressed_pair<T1,T2>& c) 
+      : _first(c.first()), _second(c.second()) {}
+
+   first_reference       first()       { return _first; }
+   first_const_reference first() const { return _first; }
+
+   second_reference       second()       { return _second; }
+   second_const_reference second() const { return _second; }
+
+   void swap(compressed_pair_5& y)
+   {
+      using std::swap;
+      swap(_first, y._first);
+      swap(_second, y._second);
+   }
+};
+
+template <bool e1, bool e2, bool same>
+struct compressed_pair_chooser
+{
+   template <class T1, class T2>
+   struct rebind
+   {
+      typedef compressed_pair_0<T1, T2> type;
+   };
+};
+
+template <>
+struct compressed_pair_chooser<false, true, false>
+{
+   template <class T1, class T2>
+   struct rebind
+   {
+      typedef compressed_pair_1<T1, T2> type;
+   };
+};
+
+template <>
+struct compressed_pair_chooser<true, false, false>
+{
+   template <class T1, class T2>
+   struct rebind
+   {
+      typedef compressed_pair_2<T1, T2> type;
+   };
+};
+
+template <>
+struct compressed_pair_chooser<true, true, false>
+{
+   template <class T1, class T2>
+   struct rebind
+   {
+      typedef compressed_pair_3<T1, T2> type;
+   };
+};
+
+template <>
+struct compressed_pair_chooser<true, true, true>
+{
+   template <class T1, class T2>
+   struct rebind
+   {
+      typedef compressed_pair_4<T1, T2> type;
+   };
+};
+
+template <>
+struct compressed_pair_chooser<false, false, true>
+{
+   template <class T1, class T2>
+   struct rebind
+   {
+      typedef compressed_pair_5<T1, T2> type;
+   };
+};
+
+template <class T1, class T2>
+struct compressed_pair_traits
+{
+private:
+   typedef compressed_pair_chooser<is_empty<T1>::value, is_empty<T2>::value, is_same<T1,T2>::value> chooser;
+   typedef typename chooser::template rebind<T1, T2> bound_type;
+public:
+   typedef typename bound_type::type type;
+};
+
+} // namespace detail
+
+template <class T1, class T2>
+class compressed_pair : public detail::compressed_pair_traits<T1, T2>::type
+{
+private:
+   typedef typename detail::compressed_pair_traits<T1, T2>::type base_type;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair() : base_type() {}
+            compressed_pair(first_param_type x, second_param_type y) : base_type(x, y) {}
+   template <class A>
+   explicit compressed_pair(const A& x) : base_type(x){}
+
+   first_reference       first()       { return base_type::first(); }
+   first_const_reference first() const { return base_type::first(); }
+
+   second_reference       second()       { return base_type::second(); }
+   second_const_reference second() const { return base_type::second(); }
+};
+
+template <class T1, class T2>
+inline void swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
+{
+   x.swap(y);
+}
+
+#else
+// no partial specialisation, no member templates:
+
+template <class T1, class T2>
+class compressed_pair
+{
+private:
+   T1 _first;
+   T2 _second;
+public:
+   typedef T1                                                 first_type;
+   typedef T2                                                 second_type;
+   typedef typename call_traits<first_type>::param_type       first_param_type;
+   typedef typename call_traits<second_type>::param_type      second_param_type;
+   typedef typename call_traits<first_type>::reference        first_reference;
+   typedef typename call_traits<second_type>::reference       second_reference;
+   typedef typename call_traits<first_type>::const_reference  first_const_reference;
+   typedef typename call_traits<second_type>::const_reference second_const_reference;
+
+            compressed_pair() : _first(), _second() {}
+            compressed_pair(first_param_type x, second_param_type y) : _first(x), _second(y) {}
+   explicit compressed_pair(first_param_type x) : _first(x), _second() {}
+   // can't define this in case T1 == T2:
+   // explicit compressed_pair(second_param_type y) : _first(), _second(y) {}
+
+   first_reference       first()       { return _first; }
+   first_const_reference first() const { return _first; }
+
+   second_reference       second()       { return _second; }
+   second_const_reference second() const { return _second; }
+
+   void swap(compressed_pair& y)
+   {
+      using std::swap;
+      swap(_first, y._first);
+      swap(_second, y._second);
+   }
+};
+
+template <class T1, class T2>
+inline void swap(compressed_pair<T1, T2>& x, compressed_pair<T1, T2>& y)
+{
+   x.swap(y);
+}
+
+#endif
+
+} // boost
+
+#endif // BOOST_OB_COMPRESSED_PAIR_HPP
+
+
+
diff --git a/boost/boost/detail/select_type.hpp b/boost/boost/detail/select_type.hpp
new file mode 100644 (file)
index 0000000..3d15a97
--- /dev/null
@@ -0,0 +1,37 @@
+// (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.
+//
+// See http://www.boost.org for most recent version including documentation.
+
+// Revision History
+// 09 Feb 01  Applied John Maddock's Borland patch Moving <true>
+//            specialization to unspecialized template (David Abrahams)
+// 06 Feb 01  Created (David Abrahams)
+
+#ifndef SELECT_TYPE_DWA20010206_HPP
+# define SELECT_TYPE_DWA20010206_HPP
+
+namespace boost { namespace detail {
+
+  // Template class if_true -- select among 2 types based on a bool constant expression
+  // Usage:
+  //   typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
+
+  // HP aCC cannot deal with missing names for template value parameters
+  template <bool b> struct if_true
+  {
+      template <class T, class F>
+      struct then { typedef T type; };
+  };
+
+  template <>
+  struct if_true<false>
+  {
+      template <class T, class F>
+      struct then { typedef F type; };
+  };
+}}
+#endif // SELECT_TYPE_DWA20010206_HPP
diff --git a/boost/boost/detail/shared_array_nmt.hpp b/boost/boost/detail/shared_array_nmt.hpp
new file mode 100644 (file)
index 0000000..3ff1954
--- /dev/null
@@ -0,0 +1,136 @@
+#ifndef BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED
+#define BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED
+
+//
+//  detail/shared_array_nmt.hpp - shared_array.hpp without member templates
+//
+//  (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.
+//
+//  See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
+//
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+#include <boost/detail/atomic_count.hpp>
+
+#include <cstddef>            // for std::ptrdiff_t
+#include <algorithm>          // for std::swap
+#include <functional>         // for std::less
+
+namespace boost
+{
+
+template<class T> class shared_array
+{
+private:
+
+    typedef detail::atomic_count count_type;
+
+public:
+
+    typedef T element_type;
+      
+    explicit shared_array(T * p = 0): px(p)
+    {
+        try  // prevent leak if new throws
+        {
+            pn = new count_type(1);
+        }
+        catch(...)
+        {
+            checked_array_delete(p);
+            throw;
+        } 
+    }
+      
+    ~shared_array()
+    {
+        if(--*pn == 0)
+        {
+            checked_array_delete(px);
+            delete pn;
+        }
+    }
+
+    shared_array(shared_array const & r) : px(r.px)  // never throws
+    {
+        pn = r.pn;
+        ++*pn;
+    }
+      
+    shared_array & operator=(shared_array const & r)
+    {
+        shared_array(r).swap(*this);
+        return *this;
+    }
+      
+    void reset(T * p = 0)
+    {
+        BOOST_ASSERT(p == 0 || p != px);
+        shared_array(p).swap(*this);
+    }
+      
+    T * get() const  // never throws
+    {
+        return px;
+    }
+
+    T & operator[](std::ptrdiff_t i) const  // never throws
+    {
+        BOOST_ASSERT(px != 0);
+        BOOST_ASSERT(i >= 0);
+        return px[i];
+    }
+      
+    long use_count() const  // never throws
+    {
+        return *pn;
+    }
+
+    bool unique() const  // never throws
+    {
+        return *pn == 1;
+    }
+    
+    void swap(shared_array<T> & other)  // never throws
+    {
+        std::swap(px, other.px);
+        std::swap(pn, other.pn);
+    }
+      
+private:
+      
+    T * px;            // contained pointer
+    count_type * pn;   // ptr to reference counter
+      
+};  // shared_array
+
+template<class T, class U> inline bool operator==(shared_array<T> const & a, shared_array<U> const & b)
+{
+    return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(shared_array<T> const & a, shared_array<U> const & b)
+{
+    return a.get() != b.get();
+}
+
+template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b)
+{
+    return std::less<T*>()(a.get(), b.get());
+}
+
+template<class T> void swap(shared_array<T> & a, shared_array<T> & b)
+{
+    a.swap(b);
+}
+
+} // namespace boost
+
+#endif  // #ifndef BOOST_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED
diff --git a/boost/boost/detail/shared_count.hpp b/boost/boost/detail/shared_count.hpp
new file mode 100644 (file)
index 0000000..63316f4
--- /dev/null
@@ -0,0 +1,392 @@
+#ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
+#define BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  detail/shared_count.hpp
+//
+//  Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+#include <boost/config.hpp>
+
+#ifndef BOOST_NO_AUTO_PTR
+# include <memory>
+#endif
+
+#include <boost/checked_delete.hpp>
+#include <boost/detail/lightweight_mutex.hpp>
+
+#include <functional>       // for std::less
+#include <exception>        // for std::exception
+
+namespace boost
+{
+
+class use_count_is_zero: public std::exception
+{
+public:
+
+    virtual char const * what() const throw()
+    {
+        return "use_count_is_zero";
+    }
+};
+
+class counted_base
+{
+private:
+
+    typedef detail::lightweight_mutex mutex_type;
+
+public:
+
+    counted_base():
+        use_count_(0), weak_count_(0), self_deleter_(&self_delete)
+    {
+    }
+
+    // pre: initial_use_count <= initial_weak_count
+
+    explicit counted_base(long initial_use_count, long initial_weak_count):
+        use_count_(initial_use_count), weak_count_(initial_weak_count), self_deleter_(&self_delete)
+    {
+    }
+
+    virtual ~counted_base() // nothrow
+    {
+    }
+
+    // dispose() is called when use_count_ drops to zero, to release
+    // the resources managed by *this.
+    //
+    // counted_base doesn't manage any resources except itself, and
+    // the default implementation is a no-op.
+    //
+    // dispose() is not pure virtual since weak_ptr instantiates a
+    // counted_base in its default constructor.
+
+    virtual void dispose() // nothrow
+    {
+    }
+
+    void add_ref()
+    {
+#ifdef BOOST_HAS_THREADS
+        mutex_type::scoped_lock lock(mtx_);
+#endif
+        if(use_count_ == 0 && weak_count_ != 0) throw use_count_is_zero();
+        ++use_count_;
+        ++weak_count_;
+    }
+
+    void release() // nothrow
+    {
+        long new_use_count;
+        long new_weak_count;
+
+        {
+#ifdef BOOST_HAS_THREADS
+            mutex_type::scoped_lock lock(mtx_);
+#endif
+            new_use_count = --use_count_;
+            new_weak_count = --weak_count_;
+        }
+
+        if(new_use_count == 0)
+        {
+            dispose();
+        }
+
+        if(new_weak_count == 0)
+        {
+            // not a direct 'delete this', because the inlined
+            // release() may use a different heap manager
+            self_deleter_(this);
+        }
+    }
+
+    void weak_add_ref() // nothrow
+    {
+#ifdef BOOST_HAS_THREADS
+        mutex_type::scoped_lock lock(mtx_);
+#endif
+        ++weak_count_;
+    }
+
+    void weak_release() // nothrow
+    {
+        long new_weak_count;
+
+        {
+#ifdef BOOST_HAS_THREADS
+            mutex_type::scoped_lock lock(mtx_);
+#endif
+            new_weak_count = --weak_count_;
+        }
+
+        if(new_weak_count == 0)
+        {
+            self_deleter_(this);
+        }
+    }
+
+    long use_count() const // nothrow
+    {
+#ifdef BOOST_HAS_THREADS
+        mutex_type::scoped_lock lock(mtx_);
+#endif
+        return use_count_;
+    }
+
+private:
+
+    counted_base(counted_base const &);
+    counted_base & operator= (counted_base const &);
+
+    static void self_delete(counted_base * p)
+    {
+        delete p;
+    }
+
+    // inv: use_count_ <= weak_count_
+
+    long use_count_;
+    long weak_count_;
+#ifdef BOOST_HAS_THREADS
+    mutable mutex_type mtx_;
+#endif
+    void (*self_deleter_) (counted_base *);
+};
+
+inline void intrusive_ptr_add_ref(counted_base * p)
+{
+    p->add_ref();
+}
+
+inline void intrusive_ptr_release(counted_base * p)
+{
+    p->release();
+}
+
+namespace detail
+{
+
+template<class P, class D> class counted_base_impl: public counted_base
+{
+private:
+
+    P ptr; // copy constructor must not throw
+    D del; // copy constructor must not throw
+
+    counted_base_impl(counted_base_impl const &);
+    counted_base_impl & operator= (counted_base_impl const &);
+
+public:
+
+    // pre: initial_use_count <= initial_weak_count, d(p) must not throw
+
+    counted_base_impl(P p, D d, long initial_use_count, long initial_weak_count):
+        counted_base(initial_use_count, initial_weak_count), ptr(p), del(d)
+    {
+    }
+
+    virtual void dispose() // nothrow
+    {
+        del(ptr);
+    }
+};
+
+class weak_count;
+
+class shared_count
+{
+private:
+
+    counted_base * pi_;
+
+    friend class weak_count;
+
+    template<class P, class D> shared_count(P, D, counted_base const *);
+
+public:
+
+    shared_count(): pi_(new counted_base(1, 1))
+    {
+    }
+
+    explicit shared_count(counted_base * pi): pi_(pi) // never throws
+    {
+        pi_->add_ref();
+    }
+
+    template<class P, class D> shared_count(P p, D d, void const * = 0): pi_(0)
+    {
+        try
+        {
+            pi_ = new counted_base_impl<P, D>(p, d, 1, 1);
+        }
+        catch(...)
+        {
+            d(p); // delete p
+            throw;
+        }
+    }
+
+    template<class P, class D> shared_count(P, D, counted_base * pi): pi_(pi)
+    {
+        pi_->add_ref();
+    }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+    // auto_ptr<Y> is special cased to provide the strong guarantee
+
+    template<typename Y>
+    explicit shared_count(std::auto_ptr<Y> & r): pi_(new counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>(), 1, 1))
+    {
+        r.release();
+    }
+
+#endif 
+
+    ~shared_count() // nothrow
+    {
+        pi_->release();
+    }
+
+    shared_count(shared_count const & r): pi_(r.pi_) // nothrow
+    {
+        pi_->add_ref();
+    }
+
+    explicit shared_count(weak_count const & r); // throws use_count_is_zero when r.use_count() == 0
+
+    shared_count & operator= (shared_count const & r) // nothrow
+    {
+        counted_base * tmp = r.pi_;
+        tmp->add_ref();
+        pi_->release();
+        pi_ = tmp;
+
+        return *this;
+    }
+
+    void swap(shared_count & r) // nothrow
+    {
+        counted_base * tmp = r.pi_;
+        r.pi_ = pi_;
+        pi_ = tmp;
+    }
+
+    long use_count() const // nothrow
+    {
+        return pi_->use_count();
+    }
+
+    bool unique() const // nothrow
+    {
+        return pi_->use_count() == 1;
+    }
+
+    friend inline bool operator==(shared_count const & a, shared_count const & b)
+    {
+        return a.pi_ == b.pi_;
+    }
+
+    friend inline bool operator<(shared_count const & a, shared_count const & b)
+    {
+        return std::less<counted_base *>()(a.pi_, b.pi_);
+    }
+};
+
+class weak_count
+{
+private:
+
+    counted_base * pi_;
+
+    friend class shared_count;
+
+public:
+
+    weak_count(): pi_(new counted_base(0, 1)) // can throw
+    {
+    }
+
+    weak_count(shared_count const & r): pi_(r.pi_) // nothrow
+    {
+        pi_->weak_add_ref();
+    }
+
+    weak_count(weak_count const & r): pi_(r.pi_) // nothrow
+    {
+        pi_->weak_add_ref();
+    }
+
+    ~weak_count() // nothrow
+    {
+        pi_->weak_release();
+    }
+
+    weak_count & operator= (shared_count const & r) // nothrow
+    {
+        counted_base * tmp = r.pi_;
+        tmp->weak_add_ref();
+        pi_->weak_release();
+        pi_ = tmp;
+
+        return *this;
+    }
+
+    weak_count & operator= (weak_count const & r) // nothrow
+    {
+        counted_base * tmp = r.pi_;
+        tmp->weak_add_ref();
+        pi_->weak_release();
+        pi_ = tmp;
+
+        return *this;
+    }
+
+    void swap(weak_count & r) // nothrow
+    {
+        counted_base * tmp = r.pi_;
+        r.pi_ = pi_;
+        pi_ = tmp;
+    }
+
+    long use_count() const // nothrow
+    {
+        return pi_->use_count();
+    }
+
+    friend inline bool operator==(weak_count const & a, weak_count const & b)
+    {
+        return a.pi_ == b.pi_;
+    }
+
+    friend inline bool operator<(weak_count const & a, weak_count const & b)
+    {
+        return std::less<counted_base *>()(a.pi_, b.pi_);
+    }
+};
+
+inline shared_count::shared_count(weak_count const & r): pi_(r.pi_)
+{
+    pi_->add_ref();
+}
+
+} // namespace detail
+
+} // namespace boost
+
+#endif  // #ifndef BOOST_DETAIL_SHARED_COUNT_HPP_INCLUDED
diff --git a/boost/boost/detail/shared_ptr_nmt.hpp b/boost/boost/detail/shared_ptr_nmt.hpp
new file mode 100644 (file)
index 0000000..79d5b5d
--- /dev/null
@@ -0,0 +1,166 @@
+#ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED
+#define BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED
+
+//
+//  detail/shared_ptr_nmt.hpp - shared_ptr.hpp without member templates
+//
+//  (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.
+//
+//  See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
+//
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+#include <boost/detail/atomic_count.hpp>
+
+#ifndef BOOST_NO_AUTO_PTR
+#include <memory>             // for std::auto_ptr
+#endif
+
+#include <algorithm>          // for std::swap
+#include <functional>         // for std::less
+
+namespace boost
+{
+
+template<class T> class shared_ptr
+{
+private:
+
+    typedef detail::atomic_count count_type;
+
+public:
+
+    typedef T element_type;
+
+    explicit shared_ptr(T * p = 0): px(p)
+    {
+        try  // prevent leak if new throws
+        {
+            pn = new count_type(1);
+        }
+        catch(...)
+        {
+            checked_delete(p);
+            throw;
+        } 
+    }
+
+    ~shared_ptr()
+    {
+        if(--*pn == 0)
+        {
+            checked_delete(px);
+            delete pn;
+        }
+    }
+
+    shared_ptr(shared_ptr const & r): px(r.px)  // never throws
+    {
+        pn = r.pn;
+        ++*pn;
+    }
+
+    shared_ptr & operator=(shared_ptr const & r)
+    {
+        shared_ptr(r).swap(*this);
+        return *this;
+    }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+    explicit shared_ptr(std::auto_ptr<T> & r)
+    { 
+        pn = new count_type(1); // may throw
+        px = r.release(); // fix: moved here to stop leak if new throws
+    } 
+
+    shared_ptr & operator=(std::auto_ptr<T> & r)
+    {
+        shared_ptr(r).swap(*this);
+        return *this;
+    }
+
+#endif
+
+    void reset(T * p = 0)
+    {
+        BOOST_ASSERT(p == 0 || p != px);
+        shared_ptr(p).swap(*this);
+    }
+
+    T & operator*() const  // never throws
+    {
+        BOOST_ASSERT(px != 0);
+        return *px;
+    }
+
+    T * operator->() const  // never throws
+    {
+        BOOST_ASSERT(px != 0);
+        return px;
+    }
+
+    T * get() const  // never throws
+    {
+        return px;
+    }
+
+    long use_count() const  // never throws
+    {
+        return *pn;
+    }
+
+    bool unique() const  // never throws
+    {
+        return *pn == 1;
+    }
+    
+    void swap(shared_ptr<T> & other)  // never throws
+    {
+        std::swap(px, other.px);
+        std::swap(pn, other.pn);
+    }
+
+private:
+
+    T * px;            // contained pointer
+    count_type * pn;   // ptr to reference counter
+};
+
+template<class T, class U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b)
+{
+    return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b)
+{
+    return a.get() != b.get();
+}
+
+template<class T> inline bool operator<(shared_ptr<T> const & a, shared_ptr<T> const & b)
+{
+    return std::less<T*>()(a.get(), b.get());
+}
+
+template<class T> void swap(shared_ptr<T> & a, shared_ptr<T> & b)
+{
+    a.swap(b);
+}
+
+// get_pointer() enables boost::mem_fn to recognize shared_ptr
+
+template<class T> inline T * get_pointer(shared_ptr<T> const & p)
+{
+    return p.get();
+}
+
+} // namespace boost
+
+#endif  // #ifndef BOOST_DETAIL_SHARED_PTR_NMT_HPP_INCLUDED
diff --git a/boost/boost/detail/winapi.hpp b/boost/boost/detail/winapi.hpp
new file mode 100644 (file)
index 0000000..0e9bb72
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED
+#define BOOST_DETAIL_WINAPI_HPP_INCLUDED
+
+#if _MSC_VER >= 1020
+#pragma once
+#endif
+
+//
+//  boost/detail/winapi.hpp - a lightweight version of <windows.h>
+//
+//  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+
+namespace boost
+{
+
+namespace detail
+{
+
+namespace winapi
+{
+
+typedef long long_type;
+typedef unsigned long dword_type;
+typedef void * handle_type;
+
+#if defined(_WIN64)
+
+typedef __int64 int_ptr_type;
+typedef unsigned __int64 uint_ptr_type;
+typedef __int64 long_ptr_type;
+typedef unsigned __int64 ulong_ptr_type;
+
+#else
+
+typedef int int_ptr_type;
+typedef unsigned int uint_ptr_type;
+typedef long long_ptr_type;
+typedef unsigned long ulong_ptr_type;
+
+#endif
+
+struct critical_section
+{
+    struct critical_section_debug * DebugInfo;
+    long_type LockCount;
+    long_type RecursionCount;
+    handle_type OwningThread;
+    handle_type LockSemaphore;
+    ulong_ptr_type SpinCount;
+};
+
+extern "C" __declspec(dllimport) long_type __stdcall InterlockedIncrement(long_type volatile *);
+extern "C" __declspec(dllimport) long_type __stdcall InterlockedDecrement(long_type volatile *);
+extern "C" __declspec(dllimport) long_type __stdcall InterlockedExchange(long_type volatile *, long_type);
+
+extern "C" __declspec(dllimport) void __stdcall Sleep(dword_type);
+
+extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *);
+extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *);
+extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *);
+extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *);
+
+} // namespace winapi
+
+} // namespace detail
+
+} // namespace boost
+
+#endif // #ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED
diff --git a/boost/boost/function.hpp b/boost/boost/function.hpp
new file mode 100644 (file)
index 0000000..01e3fb3
--- /dev/null
@@ -0,0 +1,517 @@
+// Boost.Function library
+
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
+// design of this library.
+
+#ifndef BOOST_FUNCTION_HPP
+#define BOOST_FUNCTION_HPP
+
+#include <boost/function/function_base.hpp>
+#include <boost/function/function0.hpp>
+#include <boost/function/function1.hpp>
+#include <boost/function/function2.hpp>
+#include <boost/function/function3.hpp>
+#include <boost/function/function4.hpp>
+#include <boost/function/function5.hpp>
+#include <boost/function/function6.hpp>
+#include <boost/function/function7.hpp>
+#include <boost/function/function8.hpp>
+#include <boost/function/function9.hpp>
+#include <boost/function/function10.hpp>
+
+namespace boost {
+  namespace detail {
+    namespace function {
+      // Choose the appropriate underlying implementation
+      template<int Args> struct real_get_function_impl {};
+
+      template<>
+      struct real_get_function_impl<0>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function0<R, Policy, Mixin, Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<1>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function1<R, T1, Policy, Mixin, Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<2>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function2<R, T1, T2, Policy, Mixin, Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<3>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function3<R, T1, T2, T3, Policy, Mixin, Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<4>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function4<R, T1, T2, T3, T4, Policy, Mixin, Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<5>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function5<R, T1, T2, T3, T4, T5, Policy, Mixin, Allocator> 
+          type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<6>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function6<R, T1, T2, T3, T4, T5, T6, Policy, Mixin, Allocator>
+          type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<7>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function7<R, T1, T2, T3, T4, T5, T6, T7, Policy, Mixin, 
+                            Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<8>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function8<R, T1, T2, T3, T4, T5, T6, T7, T8, Policy, Mixin, 
+                            Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<9>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function9<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, Policy, 
+                            Mixin, Allocator> type;
+        };
+      };
+
+      template<>
+      struct real_get_function_impl<10>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Policy,
+          typename Mixin,
+          typename Allocator
+        >
+        struct params
+        {
+          typedef function10<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 
+                             Policy, Mixin, Allocator> type;
+        };
+      };
+
+      template<
+        typename R, 
+        typename T1, 
+        typename T2, 
+        typename T3, 
+        typename T4,
+        typename T5, 
+        typename T6, 
+        typename T7, 
+        typename T8, 
+        typename T9,
+        typename T10,
+        typename Policy = empty_function_policy,
+        typename Mixin = empty_function_mixin,
+        typename Allocator = std::allocator<function_base> 
+      >
+      struct get_function_impl
+      {
+        typedef typename real_get_function_impl<
+          (count_used_args<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value)
+          >::template params<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 
+                             Policy, Mixin, Allocator>::type
+        type;
+      };
+
+  template<
+    typename R, 
+    typename T1, 
+    typename T2, 
+    typename T3, 
+    typename T4,
+    typename T5, 
+    typename T6, 
+    typename T7, 
+    typename T8, 
+    typename T9,
+    typename T10,
+    typename MyPolicy = empty_function_policy,
+    typename MyMixin = empty_function_mixin,
+    typename MyAllocator = std::allocator<function_base> 
+  >
+  struct function_traits_builder
+  {
+    typedef typename get_function_impl<R, T1, T2, T3, T4, T5, T6, T7, 
+                                       T8, T9, T10, MyPolicy, MyMixin, 
+                                       MyAllocator>::type
+      type;
+
+    typedef MyPolicy    policy_type;
+    typedef MyMixin     mixin_type;
+    typedef MyAllocator allocator_type;
+
+#ifndef BOOST_NO_DEPENDENT_NESTED_DERIVATIONS
+    template<typename Policy>
+    struct policy : 
+        public function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7, T8, T9,
+                                       T10, Policy, mixin_type, 
+                                       allocator_type> {};
+
+    template<typename Mixin>
+    struct mixin : 
+        public function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7, T8, T9,
+                                       T10, policy_type, Mixin, 
+                                       allocator_type> {};
+
+    template<typename Allocator>
+    struct allocator : 
+        public function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7, T8, T9,
+                                       T10, policy_type, mixin_type, 
+                                       Allocator> {};
+#else
+    template<typename Policy>
+    struct policy 
+    {
+      typedef typename function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7,
+                                               T8, T9, T10, Policy, 
+                                               mixin_type, 
+                                               allocator_type>::type
+        type;
+    };
+
+    template<typename Mixin>
+    struct mixin
+    {
+      typedef typename function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7,
+                                               T8, T9, T10, policy_type, Mixin,
+                                               allocator_type>::type
+        type;
+    };
+
+    template<typename Allocator>
+    struct allocator
+    {
+      typedef typename function_traits_builder<R, T1, T2, T3, T4, T5, T6, T7,
+                                               T8, T9, T10, policy_type, 
+                                               mixin_type, Allocator>::type
+        type;
+    };
+#endif
+  };
+
+    } // end namespace function
+  } // end namespace detail
+
+  template<
+    typename R, 
+    typename T1 = detail::function::unusable, 
+    typename T2 = detail::function::unusable,
+    typename T3 = detail::function::unusable,
+    typename T4 = detail::function::unusable,
+    typename T5 = detail::function::unusable,
+    typename T6 = detail::function::unusable,
+    typename T7 = detail::function::unusable,
+    typename T8 = detail::function::unusable,
+    typename T9 = detail::function::unusable,
+    typename T10 = detail::function::unusable
+  >
+  class function :
+    public detail::function::get_function_impl<R, T1, T2, T3, T4, T5, T6, T7, 
+                                               T8, T9, T10>::type,
+    public detail::function::function_traits_builder<R, T1, T2, T3, T4, T5, T6,
+                                                     T7, T8, T9, T10>
+  {
+    typedef typename detail::function::get_function_impl<R, T1, T2, T3, T4, T5,
+                                                         T6, T7, T8, T9, T10
+                                                         >::type 
+      base_type;
+
+  public:
+    typedef typename base_type::policy_type policy_type;
+    typedef typename base_type::mixin_type mixin_type;
+    typedef typename base_type::allocator_type allocator_type;              
+    typedef function self_type;                                     
+                                                                            
+    function() : base_type() {}                                     
+                                                                            
+    template<typename Functor>                                              
+    function(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) : base_type(f) {}
+                      
+    function(const self_type& f) : base_type(static_cast<const base_type&>(f)){}
+         
+    template<typename Functor>
+    self_type& operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
+    {
+      self_type(f).swap(*this);
+      return *this;
+    }
+
+    self_type& operator=(const base_type& f)
+    {
+      self_type(f).swap(*this);
+      return *this;
+    }
+
+    self_type& operator=(const self_type& f)
+    {   
+      self_type(f).swap(*this);
+      return *this;
+    }
+
+    template<typename Functor>
+    void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
+    {
+      self_type(f).swap(*this);
+    }
+
+    void set(const base_type& f)
+    {
+      self_type(f).swap(*this);
+    }
+
+    void set(const self_type& f)                             
+    {
+      self_type(f).swap(*this);
+    }   
+  };
+
+  template<typename R,
+           typename T1, 
+           typename T2,
+           typename T3,
+           typename T4,
+           typename T5,
+           typename T6,
+           typename T7,
+           typename T8,
+           typename T9,
+           typename T10>
+  inline void swap(function<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& f1,
+                   function<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& f2)
+  {
+    f1.swap(f2);
+  }
+}
+
+#endif
diff --git a/boost/boost/function/function0.hpp b/boost/boost/function/function0.hpp
new file mode 100644 (file)
index 0000000..8f913d5
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION0_HEADER
+#define BOOST_FUNCTION_FUNCTION0_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 0
+#define BOOST_FUNCTION_TEMPLATE_PARMS 
+#define BOOST_FUNCTION_TEMPLATE_ARGS 
+#define BOOST_FUNCTION_PARMS 
+#define BOOST_FUNCTION_ARGS 
+#define BOOST_FUNCTION_NOT_0_PARMS 
+#define BOOST_FUNCTION_NOT_0_ARGS 
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION0_HEADER
diff --git a/boost/boost/function/function1.hpp b/boost/boost/function/function1.hpp
new file mode 100644 (file)
index 0000000..7d41f1d
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION1_HEADER
+#define BOOST_FUNCTION_FUNCTION1_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 1
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0
+#define BOOST_FUNCTION_PARMS T0 a0
+#define BOOST_FUNCTION_ARGS a0
+#define BOOST_FUNCTION_NOT_0_PARMS 
+#define BOOST_FUNCTION_NOT_0_ARGS 
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION1_HEADER
diff --git a/boost/boost/function/function10.hpp b/boost/boost/function/function10.hpp
new file mode 100644 (file)
index 0000000..53fe784
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION10_HEADER
+#define BOOST_FUNCTION_FUNCTION10_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 10
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3, T4, T5, T6, T7, T8, T9
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3, a4, a5, a6, a7, a8, a9
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION10_HEADER
diff --git a/boost/boost/function/function2.hpp b/boost/boost/function/function2.hpp
new file mode 100644 (file)
index 0000000..6e41629
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION2_HEADER
+#define BOOST_FUNCTION_FUNCTION2_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 2
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1
+#define BOOST_FUNCTION_ARGS a0, a1
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1
+#define BOOST_FUNCTION_NOT_0_ARGS a1
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION2_HEADER
diff --git a/boost/boost/function/function3.hpp b/boost/boost/function/function3.hpp
new file mode 100644 (file)
index 0000000..7659374
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION3_HEADER
+#define BOOST_FUNCTION_FUNCTION3_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 3
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2
+#define BOOST_FUNCTION_ARGS a0, a1, a2
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION3_HEADER
diff --git a/boost/boost/function/function4.hpp b/boost/boost/function/function4.hpp
new file mode 100644 (file)
index 0000000..a266ec3
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION4_HEADER
+#define BOOST_FUNCTION_FUNCTION4_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 4
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION4_HEADER
diff --git a/boost/boost/function/function5.hpp b/boost/boost/function/function5.hpp
new file mode 100644 (file)
index 0000000..abc6f70
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION5_HEADER
+#define BOOST_FUNCTION_FUNCTION5_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 5
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3, typename T4
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3, T4
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3, T4 a4
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3, a4
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3, T4 a4
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3, a4
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION5_HEADER
diff --git a/boost/boost/function/function6.hpp b/boost/boost/function/function6.hpp
new file mode 100644 (file)
index 0000000..422d213
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION6_HEADER
+#define BOOST_FUNCTION_FUNCTION6_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 6
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3, typename T4, typename T5
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3, T4, T5
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3, a4, a5
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3, a4, a5
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION6_HEADER
diff --git a/boost/boost/function/function7.hpp b/boost/boost/function/function7.hpp
new file mode 100644 (file)
index 0000000..f8c4d09
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION7_HEADER
+#define BOOST_FUNCTION_FUNCTION7_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 7
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3, T4, T5, T6
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3, a4, a5, a6
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3, a4, a5, a6
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION7_HEADER
diff --git a/boost/boost/function/function8.hpp b/boost/boost/function/function8.hpp
new file mode 100644 (file)
index 0000000..1ea7dea
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION8_HEADER
+#define BOOST_FUNCTION_FUNCTION8_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 8
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3, T4, T5, T6, T7
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3, a4, a5, a6, a7
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3, a4, a5, a6, a7
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION8_HEADER
diff --git a/boost/boost/function/function9.hpp b/boost/boost/function/function9.hpp
new file mode 100644 (file)
index 0000000..bf590b7
--- /dev/null
@@ -0,0 +1,37 @@
+// Boost.Function library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_FUNCTION9_HEADER
+#define BOOST_FUNCTION_FUNCTION9_HEADER
+
+#define BOOST_FUNCTION_NUM_ARGS 9
+#define BOOST_FUNCTION_TEMPLATE_PARMS typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8
+#define BOOST_FUNCTION_TEMPLATE_ARGS T0, T1, T2, T3, T4, T5, T6, T7, T8
+#define BOOST_FUNCTION_PARMS T0 a0, T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8
+#define BOOST_FUNCTION_ARGS a0, a1, a2, a3, a4, a5, a6, a7, a8
+#define BOOST_FUNCTION_NOT_0_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8
+#define BOOST_FUNCTION_NOT_0_ARGS a1, a2, a3, a4, a5, a6, a7, a8
+
+#include <boost/function/function_template.hpp>
+
+#undef BOOST_FUNCTION_NOT_0_ARGS
+#undef BOOST_FUNCTION_NOT_0_PARMS
+#undef BOOST_FUNCTION_ARGS
+#undef BOOST_FUNCTION_PARMS
+#undef BOOST_FUNCTION_TEMPLATE_ARGS
+#undef BOOST_FUNCTION_TEMPLATE_PARMS
+#undef BOOST_FUNCTION_NUM_ARGS
+
+#endif // BOOST_FUNCTION_FUNCTION9_HEADER
diff --git a/boost/boost/function/function_base.hpp b/boost/boost/function/function_base.hpp
new file mode 100644 (file)
index 0000000..70b4eef
--- /dev/null
@@ -0,0 +1,378 @@
+// Boost.Function library
+
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_FUNCTION_BASE_HEADER
+#define BOOST_FUNCTION_BASE_HEADER
+
+#include <string>
+#include <stdexcept>
+#include <memory>
+#include <new>
+#include <typeinfo>
+#include <boost/config.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/ref.hpp>
+
+#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406
+#  define BOOST_FUNCTION_TARGET_FIX(x) x
+#else
+#  define BOOST_FUNCTION_TARGET_FIX(x)
+#endif // not MSVC
+
+namespace boost {
+  namespace detail {
+    namespace function {
+      template<bool> struct truth {};
+
+      /*
+       * The ct_if implementation is temporary code. When a Boost metaprogramming
+       * library is introduced, Boost.Function will use it instead. 
+       */
+      namespace intimate {
+        struct SelectThen 
+        {       
+          template<typename Then, typename Else>
+          struct Result
+          {       
+            typedef Then type;
+          };
+        };
+        struct SelectElse
+        {
+          template<typename Then, typename Else>
+          struct Result
+          { 
+            typedef Else type;
+          };
+        };
+        template<bool Condition>
+        struct Selector
+        {
+          typedef SelectThen type;
+        };
+        template<>
+        struct Selector<false>
+        {
+          typedef SelectElse type;
+        };
+      } // end namespace intimate 
+      template<bool Condition, typename Then, typename Else>
+      struct ct_if
+      {
+        typedef typename intimate::Selector<Condition>::type select;
+        typedef typename select::template Result<Then,Else>::type type;
+      };
+
+      /**
+       * A union of a function pointer and a void pointer. This is necessary
+       * because 5.2.10/6 allows reinterpret_cast<> to safely cast between 
+       * function pointer types and 5.2.9/10 allows static_cast<> to safely
+       * cast between a void pointer and an object pointer. But it is not legal
+       * to cast between a function pointer and a void* (in either direction),
+       * so function requires a union of the two. */
+      union any_pointer 
+      {
+        void* obj_ptr;
+        const void* const_obj_ptr;
+        void (*func_ptr)();
+
+        explicit any_pointer(void* p) : obj_ptr(p) {}
+        explicit any_pointer(const void* p) : const_obj_ptr(p) {}
+        explicit any_pointer(void (*p)()) : func_ptr(p) {}
+      };
+
+      /**
+       * The unusable class is a placeholder for unused function arguments
+       * It is also completely unusable except that it constructable from
+       * anything. This helps compilers without partial specialization to
+       * handle Boost.Function objects returning void.
+       */
+      struct unusable 
+      {
+        unusable() {}
+        template<typename T> unusable(const T&) {}
+      };
+
+      /* Determine the return type. This supports compilers that do not support
+       * void returns or partial specialization by silently changing the return
+       * type to "unusable". 
+       */
+      template<typename T> struct function_return_type { typedef T type; };
+
+      template<> 
+      struct function_return_type<void> 
+      {
+        typedef unusable type;
+      };
+
+      // The operation type to perform on the given functor/function pointer
+      enum functor_manager_operation_type { 
+        clone_functor_tag, 
+        destroy_functor_tag
+      };
+
+      // Tags used to decide between different types of functions
+      struct function_ptr_tag {};
+      struct function_obj_tag {};
+      struct member_ptr_tag {};
+      struct function_obj_ref_tag {};
+      struct stateless_function_obj_tag {};
+
+      template<typename F>
+      class get_function_tag
+      {
+        typedef typename ct_if<(is_pointer<F>::value),
+                            function_ptr_tag,
+                            function_obj_tag>::type ptr_or_obj_tag;
+
+        typedef typename ct_if<(is_member_pointer<F>::value),
+                            member_ptr_tag,
+                            ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
+
+        typedef typename ct_if<(is_reference_wrapper<F>::value),
+                             function_obj_ref_tag,
+                             ptr_or_obj_or_mem_tag>::type or_ref_tag;
+
+      public:
+        typedef typename ct_if<(is_stateless<F>::value),
+                            stateless_function_obj_tag,
+                            or_ref_tag>::type type;
+      };
+
+      // 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)
+      {
+        if (op == clone_functor_tag)
+          return f;
+        else
+          return any_pointer(reinterpret_cast<void*>(0));
+      }
+
+      /**
+       * The functor_manager class contains a static function "manage" which
+       * can clone or destroy the given function/function object pointer. 
+       */
+      template<typename Functor, typename Allocator>
+      struct functor_manager
+      {
+      private:
+        typedef Functor functor_type;
+
+        // For function pointers, the manager is trivial
+        static inline any_pointer
+        manager(any_pointer function_ptr, 
+                functor_manager_operation_type op,
+                function_ptr_tag)
+        {
+          if (op == clone_functor_tag)
+            return function_ptr;
+          else
+            return any_pointer(static_cast<void (*)()>(0));
+        }
+
+        // For function object pointers, we clone the pointer to each 
+        // function has its own version.
+        static inline any_pointer
+        manager(any_pointer function_obj_ptr, 
+                functor_manager_operation_type op,
+                function_obj_tag)
+        {
+#ifndef BOOST_NO_STD_ALLOCATOR
+        typedef typename Allocator::template rebind<functor_type>::other 
+          allocator_type;
+        typedef typename allocator_type::pointer pointer_type;
+#else
+        typedef functor_type* pointer_type;
+#endif // BOOST_NO_STD_ALLOCATOR
+
+#  ifndef BOOST_NO_STD_ALLOCATOR
+          allocator_type allocator;
+#  endif // BOOST_NO_STD_ALLOCATOR
+
+          if (op == clone_functor_tag) {
+            functor_type* f = 
+              static_cast<functor_type*>(function_obj_ptr.obj_ptr);
+
+            // Clone the functor
+#  ifndef BOOST_NO_STD_ALLOCATOR
+            pointer_type copy = allocator.allocate(1);
+            allocator.construct(copy, *f);
+
+            // Get back to the original pointer type
+            functor_type* new_f = static_cast<functor_type*>(copy);
+#  else
+            functor_type* new_f = new functor_type(*f);
+#  endif // BOOST_NO_STD_ALLOCATOR
+            return any_pointer(static_cast<void*>(new_f));
+          }
+          else {
+            /* Cast from the void pointer to the functor pointer type */
+            functor_type* f = 
+              reinterpret_cast<functor_type*>(function_obj_ptr.obj_ptr);
+
+#  ifndef BOOST_NO_STD_ALLOCATOR
+            /* Cast from the functor pointer type to the allocator's pointer
+               type */
+            pointer_type victim = static_cast<pointer_type>(f);
+
+            // Destroy and deallocate the functor
+            allocator.destroy(victim);
+            allocator.deallocate(victim, 1);
+#  else
+            delete f;
+#  endif // BOOST_NO_STD_ALLOCATOR
+
+            return any_pointer(static_cast<void*>(0));
+          }
+        }
+      public:
+        /* Dispatch to an appropriate manager based on whether we have a
+           function pointer or a function object pointer. */
+        static any_pointer
+        manage(any_pointer functor_ptr, functor_manager_operation_type op)
+        {
+          typedef typename get_function_tag<functor_type>::type tag_type;
+          return manager(functor_ptr, op, tag_type());
+        }
+      };
+
+      // value=1 if the given type is not "unusable"
+      template<typename T>
+      struct count_if_used
+      {
+        BOOST_STATIC_CONSTANT(int, value = 1);
+      };
+    
+      // value=0 for unusable types
+      template<>
+      struct count_if_used<unusable>
+      {
+        BOOST_STATIC_CONSTANT(int, value = 0);
+      };
+    
+      // Count the number of arguments (from the given set) which are not 
+      // "unusable" (therefore, count those arguments that are used).
+      template<typename T1, typename T2, typename T3, typename T4, 
+               typename T5, typename T6, typename T7, typename T8, 
+               typename T9, typename T10>
+      struct count_used_args
+      {
+        BOOST_STATIC_CONSTANT(int, value = 
+                              (count_if_used<T1>::value + 
+                               count_if_used<T2>::value +
+                               count_if_used<T3>::value + 
+                               count_if_used<T4>::value +
+                               count_if_used<T5>::value + 
+                               count_if_used<T6>::value +
+                               count_if_used<T7>::value + 
+                               count_if_used<T8>::value +
+                               count_if_used<T9>::value +
+                               count_if_used<T10>::value));
+      };
+    } // end namespace function
+  } // end namespace detail
+
+  /**
+   * The function_base class contains the basic elements needed for the
+   * function1, function2, function3, etc. classes. It is common to all
+   * functions (and as such can be used to tell if we have one of the
+   * functionN objects). 
+   */
+  class function_base 
+  {
+  public:
+    function_base() : manager(0), functor(static_cast<void*>(0)) {}
+    
+    // Is this function empty?
+    bool empty() const { return !manager; }
+    
+  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;
+
+#if (defined __SUNPRO_CC) && (__SUNPRO_CC <= 0x530) && !(defined BOOST_NO_COMPILER_CONFIG)
+    // Sun C++ 5.3 can't handle the safe_bool idiom, so don't use it
+    operator bool () const { return !this->empty(); }
+#else
+  private:
+    struct dummy {
+      void nonnull() {};
+    };
+
+    typedef void (dummy::*safe_bool)();
+
+  public:
+    operator safe_bool () const 
+      { return (this->empty())? 0 : &dummy::nonnull; }
+
+    safe_bool operator!() const
+      { return (this->empty())? &dummy::nonnull : 0; }
+#endif
+  };
+
+  /* Poison comparison between Boost.Function objects (because it is 
+   * meaningless). The comparisons would otherwise be allowed because of the
+   * conversion required to allow syntax such as:
+   *   boost::function<int, int> f;
+   *   if (f) { f(5); }
+   */
+  void operator==(const function_base&, const function_base&);
+  void operator!=(const function_base&, const function_base&);
+
+  namespace detail {
+    namespace function {
+      inline bool has_empty_target(const function_base* f)
+      {
+        return f->empty();
+      }
+
+      inline bool has_empty_target(...)
+      {
+        return false;
+      }
+    } // end namespace function
+  } // end namespace detail
+
+  // The default function policy is to do nothing before and after the call.
+  struct empty_function_policy
+  {
+    inline void precall(const function_base*) {}
+    inline void postcall(const function_base*) {}
+  };
+
+  // The default function mixin does nothing. The assignment and
+  // copy-construction operators are all defined because MSVC defines broken
+  // versions.
+  struct empty_function_mixin 
+  {
+    empty_function_mixin() {}
+    empty_function_mixin(const empty_function_mixin&) {}
+
+    empty_function_mixin& operator=(const empty_function_mixin&) 
+    {
+      return *this; 
+    }
+  };
+}
+
+#endif // BOOST_FUNCTION_BASE_HEADER
diff --git a/boost/boost/function/function_template.hpp b/boost/boost/function/function_template.hpp
new file mode 100644 (file)
index 0000000..0613cb4
--- /dev/null
@@ -0,0 +1,538 @@
+// Boost.Function library
+
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+
+// For more information, see http://www.boost.org
+
+// Note: this header is a header template and must NOT have multiple-inclusion
+// protection. 
+
+#ifndef BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
+#define BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
+#  include <cassert>
+#  include <algorithm>
+#  include <boost/config.hpp>
+#  include <boost/function/function_base.hpp>
+#  include <boost/mem_fn.hpp>
+#endif // BOOST_FUNCTION_FUNCTION_TEMPLATE_HPP
+
+// Type of the default allocator
+#ifndef BOOST_NO_STD_ALLOCATOR
+#  define BOOST_FUNCTION_DEFAULT_ALLOCATOR std::allocator<function_base>
+#else
+#  define BOOST_FUNCTION_DEFAULT_ALLOCATOR int
+#endif // BOOST_NO_STD_ALLOCATOR
+
+// Comma if nonzero number of arguments
+#if BOOST_FUNCTION_NUM_ARGS == 0
+#  define BOOST_FUNCTION_COMMA 
+#else
+#  define BOOST_FUNCTION_COMMA ,
+#endif // BOOST_FUNCTION_NUM_ARGS > 0
+
+// Class names used in this version of the code
+#define BOOST_FUNCTION_FUNCTION BOOST_JOIN(function,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_FUNCTION_INVOKER \
+  BOOST_JOIN(function_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_VOID_FUNCTION_INVOKER \
+  BOOST_JOIN(void_function_invoker,BOOST_FUNCTION_NUM_ARGS) 
+#define BOOST_FUNCTION_FUNCTION_OBJ_INVOKER \
+  BOOST_JOIN(function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER \
+  BOOST_JOIN(void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER \
+  BOOST_JOIN(stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER \
+  BOOST_JOIN(stateless_void_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_GET_FUNCTION_INVOKER \
+  BOOST_JOIN(get_function_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER \
+  BOOST_JOIN(get_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
+#define BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER \
+  BOOST_JOIN(get_stateless_function_obj_invoker,BOOST_FUNCTION_NUM_ARGS)
+
+namespace boost {
+  namespace detail {
+    namespace function {
+      template<
+        typename FunctionPtr,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+        >
+      struct BOOST_FUNCTION_FUNCTION_INVOKER
+      {
+        static R invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
+                        BOOST_FUNCTION_PARMS)
+        {
+          FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
+          return f(BOOST_FUNCTION_ARGS);
+        }
+      };
+
+      template<
+        typename FunctionPtr,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+        >
+      struct BOOST_FUNCTION_VOID_FUNCTION_INVOKER
+      {
+        static unusable invoke(any_pointer function_ptr BOOST_FUNCTION_COMMA
+                               BOOST_FUNCTION_PARMS)
+
+        {
+          FunctionPtr f = reinterpret_cast<FunctionPtr>(function_ptr.func_ptr);
+          f(BOOST_FUNCTION_ARGS);
+          return unusable();
+        }
+      };
+
+      template<
+        typename FunctionObj,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+      >
+      struct BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
+      {
+        static R invoke(any_pointer function_obj_ptr BOOST_FUNCTION_COMMA
+                        BOOST_FUNCTION_PARMS)
+
+        {
+          FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
+          return (*f)(BOOST_FUNCTION_ARGS);
+        }
+      };
+
+      template<
+        typename FunctionObj,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+      >
+      struct BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
+      {
+        static unusable invoke(any_pointer function_obj_ptr 
+                               BOOST_FUNCTION_COMMA
+                               BOOST_FUNCTION_PARMS)
+
+        {
+          FunctionObj* f = (FunctionObj*)(function_obj_ptr.obj_ptr);
+          (*f)(BOOST_FUNCTION_ARGS);
+          return unusable();
+        }
+      };
+
+      template<
+        typename FunctionObj,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+      >
+      struct BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER
+      {
+        static R invoke(any_pointer BOOST_FUNCTION_COMMA BOOST_FUNCTION_PARMS)
+        {
+          FunctionObj f = FunctionObj();
+          return f(BOOST_FUNCTION_ARGS);
+        }
+      };
+
+      template<
+        typename FunctionObj,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+      >
+      struct BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
+      {
+        static unusable invoke(any_pointer BOOST_FUNCTION_COMMA 
+                               BOOST_FUNCTION_PARMS)
+
+        {
+          FunctionObj f = FunctionObj();
+          f(BOOST_FUNCTION_ARGS);
+          return unusable();
+        }
+      };
+
+      template<
+        typename FunctionPtr,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+      >
+      struct BOOST_FUNCTION_GET_FUNCTION_INVOKER
+      {
+        typedef typename ct_if<(is_void<R>::value),
+                            BOOST_FUNCTION_VOID_FUNCTION_INVOKER<
+                            FunctionPtr,
+                            R BOOST_FUNCTION_COMMA
+                            BOOST_FUNCTION_TEMPLATE_ARGS
+                          >,
+                          BOOST_FUNCTION_FUNCTION_INVOKER<
+                            FunctionPtr,
+                            R BOOST_FUNCTION_COMMA
+                            BOOST_FUNCTION_TEMPLATE_ARGS
+                          >
+                       >::type type;
+      };
+
+      template<
+        typename FunctionObj,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+       >
+      struct BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
+      {
+        typedef typename ct_if<(is_void<R>::value),
+                            BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER<
+                            FunctionObj,
+                            R BOOST_FUNCTION_COMMA
+                            BOOST_FUNCTION_TEMPLATE_ARGS
+                          >,
+                          BOOST_FUNCTION_FUNCTION_OBJ_INVOKER<
+                            FunctionObj,
+                            R BOOST_FUNCTION_COMMA
+                            BOOST_FUNCTION_TEMPLATE_ARGS
+                          >
+                       >::type type;
+      };
+
+      template<
+        typename FunctionObj,
+        typename R BOOST_FUNCTION_COMMA
+        BOOST_FUNCTION_TEMPLATE_PARMS
+       >
+      struct BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER
+      {
+        typedef typename ct_if<(is_void<R>::value),
+                            BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER<
+                            FunctionObj,
+                            R BOOST_FUNCTION_COMMA
+                            BOOST_FUNCTION_TEMPLATE_ARGS
+                          >,
+                          BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER<
+                            FunctionObj,
+                            R BOOST_FUNCTION_COMMA
+                            BOOST_FUNCTION_TEMPLATE_ARGS
+                          >
+                       >::type type;
+      };
+
+    } // end namespace function
+  } // end namespace detail
+
+  template<
+    typename R BOOST_FUNCTION_COMMA
+    BOOST_FUNCTION_TEMPLATE_PARMS,
+    typename Policy    = empty_function_policy,
+    typename Mixin     = empty_function_mixin,
+    typename Allocator = BOOST_FUNCTION_DEFAULT_ALLOCATOR
+  >
+  class BOOST_FUNCTION_FUNCTION : public function_base, public Mixin
+  {
+    typedef typename detail::function::function_return_type<R>::type 
+      internal_result_type;
+
+  public:
+    BOOST_STATIC_CONSTANT(int, args = BOOST_FUNCTION_NUM_ARGS);
+    
+#if BOOST_FUNCTION_NUM_ARGS == 1
+    typedef T0 argument_type;
+#elif BOOST_FUNCTION_NUM_ARGS == 2
+    typedef T0 first_argument_type;
+    typedef T1 second_argument_type;
+#endif
+
+#ifndef BOOST_NO_VOID_RETURNS
+    typedef R         result_type;
+#else
+    typedef internal_result_type result_type;
+#endif // BOOST_NO_VOID_RETURNS
+    typedef Policy    policy_type;
+    typedef Mixin     mixin_type;
+    typedef Allocator allocator_type;
+    typedef BOOST_FUNCTION_FUNCTION self_type;
+
+    BOOST_FUNCTION_FUNCTION() : function_base(), Mixin(), invoker(0) {}
+
+    explicit BOOST_FUNCTION_FUNCTION(const Mixin& m) : 
+      function_base(), Mixin(m), invoker(0) 
+    {
+    }
+
+    // MSVC chokes if the following two constructors are collapsed into
+    // one with a default parameter.
+    template<typename Functor>
+    BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) :
+      function_base(), Mixin(), invoker(0)
+    {
+      this->assign_to(f);
+    }
+
+    template<typename Functor>
+    BOOST_FUNCTION_FUNCTION(Functor f, const Mixin& m) :
+      function_base(), Mixin(m), invoker(0)
+    {
+      this->assign_to(f);
+    }
+
+    BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) :
+      function_base(), Mixin(static_cast<const Mixin&>(f)), invoker(0)
+    {
+      this->assign_to_own(f);
+    }
+
+    ~BOOST_FUNCTION_FUNCTION() { clear(); }
+
+    result_type operator()(BOOST_FUNCTION_PARMS) const
+    {
+      assert(!this->empty());
+
+      policy_type policy;
+      policy.precall(this);
+
+      internal_result_type result = invoker(function_base::functor 
+                                            BOOST_FUNCTION_COMMA
+                                            BOOST_FUNCTION_ARGS);
+
+      policy.postcall(this);
+#ifndef BOOST_NO_VOID_RETURNS
+      return static_cast<result_type>(result);
+#else
+      return result;
+#endif // BOOST_NO_VOID_RETURNS
+    }
+
+    // The distinction between when to use BOOST_FUNCTION_FUNCTION and
+    // when to use self_type is obnoxious. MSVC cannot handle self_type as
+    // the return type of these assignment operators, but Borland C++ cannot
+    // handle BOOST_FUNCTION_FUNCTION as the type of the temporary to 
+    // construct.
+    template<typename Functor>
+    BOOST_FUNCTION_FUNCTION& 
+    operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
+    {
+      self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
+      return *this;
+    }
+
+    template<typename Functor>
+    void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
+    {
+      self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
+    }
+
+    // Assignment from another BOOST_FUNCTION_FUNCTION
+    BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)
+    {
+      if (&f == this)
+        return *this;
+
+      self_type(f).swap(*this);
+      return *this;
+    }
+
+    // Assignment from another BOOST_FUNCTION_FUNCTION
+    void set(const BOOST_FUNCTION_FUNCTION& f)
+    {
+      if (&f == this)
+        return;
+
+      self_type(f).swap(*this);
+    }
+
+    void swap(BOOST_FUNCTION_FUNCTION& other)
+    {
+      if (&other == this)
+        return;
+
+      std::swap(function_base::manager, other.manager);
+      std::swap(function_base::functor, other.functor);
+      std::swap(invoker, other.invoker);
+      std::swap(static_cast<Mixin&>(*this), static_cast<Mixin&>(other));
+    }
+
+    // Clear out a target, if there is one
+    void clear()
+    {
+      if (function_base::manager) {
+        function_base::functor = 
+          function_base::manager(function_base::functor, 
+                                 detail::function::destroy_functor_tag);
+      }
+
+      function_base::manager = 0;
+      invoker = 0;
+    }
+
+  private:
+    void assign_to_own(const BOOST_FUNCTION_FUNCTION& f)
+    {
+      if (!f.empty()) {
+        invoker = f.invoker;
+        function_base::manager = f.manager;
+        function_base::functor = 
+          f.manager(f.functor, detail::function::clone_functor_tag);
+      }          
+    }
+
+    template<typename Functor>
+    void assign_to(Functor f)
+    {
+      typedef typename detail::function::get_function_tag<Functor>::type tag;
+      this->assign_to(f, tag());
+    }
+
+    template<typename FunctionPtr>
+    void assign_to(FunctionPtr f, detail::function::function_ptr_tag)
+    {
+      clear();
+        
+      if (f) {
+        typedef typename detail::function::BOOST_FUNCTION_GET_FUNCTION_INVOKER<
+                           FunctionPtr,
+                           R BOOST_FUNCTION_COMMA
+                           BOOST_FUNCTION_TEMPLATE_ARGS
+                         >::type
+          invoker_type;
+    
+        invoker = &invoker_type::invoke;
+        function_base::manager = 
+          &detail::function::functor_manager<FunctionPtr, Allocator>::manage;
+        function_base::functor = 
+          function_base::manager(detail::function::any_pointer(
+                            // should be a reinterpret cast, but some compilers
+                            // insist on giving cv-qualifiers to free functions
+                            (void (*)())(f)
+                          ),
+                          detail::function::clone_functor_tag);
+      }
+    }  
+
+#if BOOST_FUNCTION_NUM_ARGS > 0
+    template<typename MemberPtr>
+    void assign_to(MemberPtr f, detail::function::member_ptr_tag)
+    {
+      this->assign_to(mem_fn(f));
+    }
+#endif // BOOST_FUNCTION_NUM_ARGS > 0
+        
+    template<typename FunctionObj>
+    void assign_to(FunctionObj f, detail::function::function_obj_tag)
+    {
+      if (!detail::function::has_empty_target(addressof(f))) {
+        typedef 
+          typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
+                                       FunctionObj,
+                                       R BOOST_FUNCTION_COMMA
+                                       BOOST_FUNCTION_TEMPLATE_ARGS
+                                     >::type
+          invoker_type;
+    
+        invoker = &invoker_type::invoke;
+        function_base::manager = &detail::function::functor_manager<
+                                    FunctionObj, Allocator>::manage;
+#ifndef BOOST_NO_STD_ALLOCATOR
+        typedef typename Allocator::template rebind<FunctionObj>::other 
+          allocator_type;
+        typedef typename allocator_type::pointer pointer_type;
+        allocator_type allocator;
+        pointer_type copy = allocator.allocate(1);
+        allocator.construct(copy, f);
+
+        // Get back to the original pointer type
+        FunctionObj* new_f = static_cast<FunctionObj*>(copy);
+#else
+        FunctionObj* new_f = new FunctionObj(f);
+#endif // BOOST_NO_STD_ALLOCATOR
+        function_base::functor = 
+          detail::function::any_pointer(static_cast<void*>(new_f));
+      }
+    }
+    
+    template<typename FunctionObj>
+    void assign_to(const reference_wrapper<FunctionObj>& f, 
+                   detail::function::function_obj_ref_tag)
+    {
+      if (!detail::function::has_empty_target(f.get_pointer())) {
+        typedef 
+          typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
+                                       FunctionObj,
+                                       R BOOST_FUNCTION_COMMA
+                                       BOOST_FUNCTION_TEMPLATE_ARGS
+                                     >::type
+          invoker_type;
+    
+        invoker = &invoker_type::invoke;
+        function_base::manager = &detail::function::trivial_manager;
+        function_base::functor = 
+          function_base::manager(
+            detail::function::any_pointer(
+              const_cast<FunctionObj*>(f.get_pointer())),
+            detail::function::clone_functor_tag);
+      }
+    }
+    
+    template<typename FunctionObj>
+    void assign_to(FunctionObj, detail::function::stateless_function_obj_tag)
+    {
+      typedef 
+          typename detail::function::
+                     BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER<
+                       FunctionObj,
+                       R BOOST_FUNCTION_COMMA
+                       BOOST_FUNCTION_TEMPLATE_ARGS
+                     >::type
+          invoker_type;
+      invoker = &invoker_type::invoke;
+      function_base::manager = &detail::function::trivial_manager;
+      function_base::functor = detail::function::any_pointer(this);
+    }
+
+    typedef internal_result_type (*invoker_type)(detail::function::any_pointer
+                                                 BOOST_FUNCTION_COMMA
+                                                 BOOST_FUNCTION_TEMPLATE_ARGS);
+    
+    invoker_type invoker;
+  };
+
+  template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS ,
+           typename Policy, typename Mixin, typename Allocator>
+  inline void swap(BOOST_FUNCTION_FUNCTION<
+                     R BOOST_FUNCTION_COMMA
+                     BOOST_FUNCTION_TEMPLATE_ARGS ,
+                     Policy,
+                     Mixin,
+                     Allocator
+                   >& f1,
+                   BOOST_FUNCTION_FUNCTION<
+                     R BOOST_FUNCTION_COMMA 
+                     BOOST_FUNCTION_TEMPLATE_ARGS,
+                     Policy,
+                     Mixin,
+                     Allocator
+                   >& f2)
+  {
+    f1.swap(f2);
+  }
+}
+
+// Cleanup after ourselves...
+#undef BOOST_FUNCTION_DEFAULT_ALLOCATOR
+#undef BOOST_FUNCTION_COMMA
+#undef BOOST_FUNCTION_FUNCTION
+#undef BOOST_FUNCTION_FUNCTION_INVOKER
+#undef BOOST_FUNCTION_VOID_FUNCTION_INVOKER
+#undef BOOST_FUNCTION_FUNCTION_OBJ_INVOKER
+#undef BOOST_FUNCTION_VOID_FUNCTION_OBJ_INVOKER
+#undef BOOST_FUNCTION_STATELESS_FUNCTION_OBJ_INVOKER
+#undef BOOST_FUNCTION_STATELESS_VOID_FUNCTION_OBJ_INVOKER
+#undef BOOST_FUNCTION_GET_FUNCTION_INVOKER
+#undef BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER
+#undef BOOST_FUNCTION_GET_STATELESS_FUNCTION_OBJ_INVOKER
+#undef BOOST_FUNCTION_GET_MEM_FUNCTION_INVOKER
diff --git a/boost/boost/function/gen_function_N.pl b/boost/boost/function/gen_function_N.pl
new file mode 100755 (executable)
index 0000000..a159272
--- /dev/null
@@ -0,0 +1,111 @@
+#!/usr/bin/perl -w
+#
+# Boost.Function library
+#
+# Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+#
+# Permission to copy, use, sell and distribute this software is granted
+# provided this copyright notice appears in all copies.
+# Permission to modify the code and to distribute modified code is granted
+# provided this copyright notice appears in all copies, and a notice
+# that the code was modified is included with the copyright notice.
+#
+# This software is provided "as is" without express or implied warranty,
+# and with no claim as to its suitability for any purpose.
+#
+# For more information, see http://www.boost.org
+use English;
+
+if ($#ARGV < 0) {
+  print "Usage: perl gen_function_N <number of arguments>\n";
+  exit;
+}
+
+
+$totalNumArgs = $ARGV[0];
+for ($numArgs = 0; $numArgs <= $totalNumArgs; ++$numArgs) {
+  open OUT, ">function$numArgs.hpp";
+  print OUT "// Boost.Function library\n";
+  print OUT "//\n";
+  print OUT "// Copyright (C) 2001 Doug Gregor (gregod\@cs.rpi.edu)\n";
+  print OUT "//\n";
+  print OUT "// Permission to copy, use, sell and distribute this software is granted\n";
+  print OUT "// provided this copyright notice appears in all copies.\n";
+  print OUT "// Permission to modify the code and to distribute modified code is granted\n";
+  print OUT "// provided this copyright notice appears in all copies, and a notice\n";
+  print OUT "// that the code was modified is included with the copyright notice.\n";
+  print OUT "//\n";
+  print OUT "// This software is provided \"as is\" without express or implied warranty,\n";
+  print OUT "// and with no claim as to its suitability for any purpose.\n";
+  print OUT " \n";
+  print OUT "// For more information, see http://www.boost.org\n";
+  print OUT "\n";
+  print OUT "#ifndef BOOST_FUNCTION_FUNCTION" . $numArgs . "_HEADER\n";
+  print OUT "#define BOOST_FUNCTION_FUNCTION" , $numArgs . "_HEADER\n";
+  print OUT "\n";
+  print OUT "#define BOOST_FUNCTION_NUM_ARGS $numArgs\n";
+
+  $templateParms = "";
+  for ($i = 0; $i < $numArgs; ++$i) {
+    if ($i > 0) {
+      $templateParms .= ", ";
+    }
+    $templateParms .= "typename T$i";
+  }
+  print OUT "#define BOOST_FUNCTION_TEMPLATE_PARMS $templateParms\n";
+
+  $_ = $templateParms;
+  s/typename //g;
+  $templateArgs = $_;
+  print OUT "#define BOOST_FUNCTION_TEMPLATE_ARGS $templateArgs\n";
+
+  $parms = "";
+  for ($i = 0; $i < $numArgs; ++$i) {
+    if ($i > 0) {
+      $parms .= ", ";
+    }
+    $parms .= "T$i a$i";
+  }
+  print OUT "#define BOOST_FUNCTION_PARMS $parms\n";
+
+  $args = "";
+  for ($i = 0; $i < $numArgs; ++$i) {
+    if ($i > 0) {
+      $args .= ", ";
+    }
+    $args .= "a$i";
+  }
+  print OUT "#define BOOST_FUNCTION_ARGS $args\n";
+
+  $not0Parms = "";
+  for ($i = 1; $i < $numArgs; ++$i) {
+    if ($i > 1) {
+      $not0Parms .= ", ";
+    }
+    $not0Parms .= "T$i a$i";
+  }
+  print OUT "#define BOOST_FUNCTION_NOT_0_PARMS $not0Parms\n";
+
+  $not0Args = "";
+  for ($i = 1; $i < $numArgs; ++$i) {
+    if ($i > 1) {
+      $not0Args .= ", ";
+    }
+    $not0Args .= "a$i";
+  }
+  print OUT "#define BOOST_FUNCTION_NOT_0_ARGS $not0Args\n";
+
+  print OUT "\n";
+  print OUT "#include <boost/function/function_template.hpp>\n";
+  print OUT "\n";
+  print OUT "#undef BOOST_FUNCTION_NOT_0_ARGS\n";
+  print OUT "#undef BOOST_FUNCTION_NOT_0_PARMS\n";
+  print OUT "#undef BOOST_FUNCTION_ARGS\n";
+  print OUT "#undef BOOST_FUNCTION_PARMS\n";
+  print OUT "#undef BOOST_FUNCTION_TEMPLATE_ARGS\n";
+  print OUT "#undef BOOST_FUNCTION_TEMPLATE_PARMS\n";
+  print OUT "#undef BOOST_FUNCTION_NUM_ARGS\n";
+  print OUT "\n";
+  print OUT "#endif // BOOST_FUNCTION_FUNCTION" . $numArgs . "_HEADER\n";
+  close OUT;
+}
diff --git a/boost/boost/function_output_iterator.hpp b/boost/boost/function_output_iterator.hpp
new file mode 100644 (file)
index 0000000..764c118
--- /dev/null
@@ -0,0 +1,55 @@
+// (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.
+
+// Revision History:
+
+// 27 Feb 2001   Jeremy Siek
+//      Initial checkin.
+
+#ifndef BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
+#define BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
+
+#include <iterator>
+
+namespace boost {
+
+  template <class UnaryFunction>
+  class function_output_iterator {
+    typedef function_output_iterator self;
+  public:
+    typedef std::output_iterator_tag iterator_category;
+    typedef void                value_type;
+    typedef void                difference_type;
+    typedef void                pointer;
+    typedef void                reference;
+
+    explicit function_output_iterator(const UnaryFunction& f = UnaryFunction())
+      : m_f(f) {}
+
+    struct output_proxy {
+      output_proxy(UnaryFunction& f) : m_f(f) { }
+      template <class T> output_proxy& operator=(const T& value) {
+        m_f(value); 
+        return *this; 
+      }
+      UnaryFunction& m_f;
+    };
+    output_proxy operator*() { return output_proxy(m_f); }
+    self& operator++() { return *this; } 
+    self& operator++(int) { return *this; }
+  private:
+    UnaryFunction m_f;
+  };
+
+  template <class UnaryFunction>
+  inline function_output_iterator<UnaryFunction>
+  make_function_output_iterator(const UnaryFunction& f = UnaryFunction()) {
+    return function_output_iterator<UnaryFunction>(f);
+  }
+
+} // namespace boost
+
+#endif // BOOST_FUNCTION_OUTPUT_ITERATOR_HPP
diff --git a/boost/boost/functional.hpp b/boost/boost/functional.hpp
new file mode 100644 (file)
index 0000000..6e7efbe
--- /dev/null
@@ -0,0 +1,556 @@
+// ------------------------------------------------------------------------------
+// Boost functional.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+// ------------------------------------------------------------------------------
+// Copyright (c) 2000
+// Cadenza New Zealand Ltd
+//
+// 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.  Cadenza New Zealand Ltd makes
+// no representations about the suitability of this software for any
+// purpose.  It is provided "as is" without express or implied
+// warranty.
+// ------------------------------------------------------------------------------
+// $Id: functional.hpp,v 1.3 2000/11/22 09:04:28 mark_rodgers Exp $
+// ------------------------------------------------------------------------------
+
+#ifndef BOOST_FUNCTIONAL_HPP
+#define BOOST_FUNCTIONAL_HPP
+
+#include <boost/config.hpp>
+#include <boost/call_traits.hpp>
+#include <functional>
+
+namespace boost
+{
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+    // --------------------------------------------------------------------------
+    // The following traits classes allow us to avoid the need for ptr_fun
+    // because the types of arguments and the result of a function can be 
+    // deduced.
+    //
+    // In addition to the standard types defined in unary_function and 
+    // binary_function, we add
+    //
+    // - function_type, the type of the function or function object itself.
+    //
+    // - param_type, the type that should be used for passing the function or
+    //   function object as an argument.
+    // --------------------------------------------------------------------------
+    namespace detail
+    {
+        template <class Operation>
+        struct unary_traits_imp;
+        
+        template <class Operation>
+        struct unary_traits_imp<Operation*>
+        {
+            typedef Operation                         function_type;
+            typedef const function_type &             param_type;
+            typedef typename Operation::result_type   result_type;
+            typedef typename Operation::argument_type argument_type;
+        };
+
+        template <class R, class A>
+        struct unary_traits_imp<R(*)(A)>
+        {
+            typedef R (*function_type)(A);
+            typedef R (*param_type)(A);
+            typedef R result_type;
+            typedef A argument_type;
+        };
+
+        template <class Operation>
+        struct binary_traits_imp;
+
+        template <class Operation>
+        struct binary_traits_imp<Operation*>
+        {
+            typedef Operation                                function_type;
+            typedef const function_type &                    param_type;
+            typedef typename Operation::result_type          result_type;
+            typedef typename Operation::first_argument_type  first_argument_type;
+            typedef typename Operation::second_argument_type second_argument_type;
+        };
+        
+        template <class R, class A1, class A2>
+        struct binary_traits_imp<R(*)(A1,A2)>
+        {
+            typedef R (*function_type)(A1,A2);
+            typedef R (*param_type)(A1,A2);
+            typedef R result_type;
+            typedef A1 first_argument_type;
+            typedef A2 second_argument_type;
+        };
+    } // namespace detail
+    
+    template <class Operation>
+    struct unary_traits
+    {
+        typedef typename detail::unary_traits_imp<Operation*>::function_type function_type;
+        typedef typename detail::unary_traits_imp<Operation*>::param_type    param_type;
+        typedef typename detail::unary_traits_imp<Operation*>::result_type   result_type;
+        typedef typename detail::unary_traits_imp<Operation*>::argument_type argument_type;
+    }; 
+
+    template <class R, class A>
+    struct unary_traits<R(*)(A)>
+    {
+        typedef R (*function_type)(A);
+        typedef R (*param_type)(A);
+        typedef R result_type;
+        typedef A argument_type;
+    };
+
+    template <class Operation>
+    struct binary_traits
+    {
+        typedef typename detail::binary_traits_imp<Operation*>::function_type        function_type;
+        typedef typename detail::binary_traits_imp<Operation*>::param_type           param_type;
+        typedef typename detail::binary_traits_imp<Operation*>::result_type          result_type;
+        typedef typename detail::binary_traits_imp<Operation*>::first_argument_type  first_argument_type;
+        typedef typename detail::binary_traits_imp<Operation*>::second_argument_type second_argument_type;
+    };
+    
+    template <class R, class A1, class A2>
+    struct binary_traits<R(*)(A1,A2)>
+    {
+        typedef R (*function_type)(A1,A2);
+        typedef R (*param_type)(A1,A2);
+        typedef R result_type;
+        typedef A1 first_argument_type;
+        typedef A2 second_argument_type;
+    };
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+    // --------------------------------------------------------------------------
+    // If we have no partial specialisation available, decay to a situation
+    // that is no worse than in the Standard, i.e., ptr_fun will be required.
+    // --------------------------------------------------------------------------
+
+    template <class Operation>
+    struct unary_traits
+    {
+        typedef Operation                         function_type;
+        typedef const Operation&                  param_type;
+        typedef typename Operation::result_type   result_type;
+        typedef typename Operation::argument_type argument_type;
+    }; 
+    
+    template <class Operation>
+    struct binary_traits
+    {
+        typedef Operation                                function_type;
+        typedef const Operation &                        param_type;
+        typedef typename Operation::result_type          result_type;
+        typedef typename Operation::first_argument_type  first_argument_type;
+        typedef typename Operation::second_argument_type second_argument_type;
+    };    
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+    
+    // --------------------------------------------------------------------------
+    // unary_negate, not1
+    // --------------------------------------------------------------------------
+    template <class Predicate>
+    class unary_negate
+        : public std::unary_function<typename unary_traits<Predicate>::argument_type,bool>
+    {
+      public:
+        explicit unary_negate(typename unary_traits<Predicate>::param_type x)
+            :
+            pred(x)
+        {}
+        bool operator()(typename call_traits<typename unary_traits<Predicate>::argument_type>::param_type x) const
+        {
+            return !pred(x);
+        }
+      private:
+        typename unary_traits<Predicate>::function_type pred;
+    };
+
+    template <class Predicate>
+    unary_negate<Predicate> not1(const Predicate &pred)
+    {
+        // The cast is to placate Borland C++Builder in certain circumstances.
+        // I don't think it should be necessary.
+        return unary_negate<Predicate>((typename unary_traits<Predicate>::param_type)pred);
+    }
+
+    template <class Predicate>
+    unary_negate<Predicate> not1(Predicate &pred)
+    {
+        return unary_negate<Predicate>(pred);
+    }
+
+    // --------------------------------------------------------------------------
+    // binary_negate, not2
+    // --------------------------------------------------------------------------
+    template <class Predicate>
+    class binary_negate
+        : public std::binary_function<typename binary_traits<Predicate>::first_argument_type,
+                                      typename binary_traits<Predicate>::second_argument_type,
+                                      bool>
+    {
+      public:
+        explicit binary_negate(typename binary_traits<Predicate>::param_type x)
+            :
+            pred(x)
+        {}
+        bool operator()(typename call_traits<typename binary_traits<Predicate>::first_argument_type>::param_type x,
+                        typename call_traits<typename binary_traits<Predicate>::second_argument_type>::param_type y) const
+        {
+            return !pred(x,y);
+        }
+      private:
+        typename binary_traits<Predicate>::function_type pred;
+    };
+
+    template <class Predicate>
+    binary_negate<Predicate> not2(const Predicate &pred)
+    {
+        // The cast is to placate Borland C++Builder in certain circumstances.
+        // I don't think it should be necessary.
+        return binary_negate<Predicate>((typename binary_traits<Predicate>::param_type)pred);
+    }
+
+    template <class Predicate>
+    binary_negate<Predicate> not2(Predicate &pred)
+    {
+        return binary_negate<Predicate>(pred);
+    }
+        
+    // --------------------------------------------------------------------------
+    // binder1st, bind1st
+    // --------------------------------------------------------------------------
+    template <class Operation>
+    class binder1st
+        : public std::unary_function<typename binary_traits<Operation>::second_argument_type,
+                                     typename binary_traits<Operation>::result_type>
+    {       
+      public:
+        binder1st(typename binary_traits<Operation>::param_type x,
+                  typename call_traits<typename binary_traits<Operation>::first_argument_type>::param_type y)
+            :
+            op(x), value(y)
+        {}
+        
+        typename binary_traits<Operation>::result_type
+        operator()(typename call_traits<typename binary_traits<Operation>::second_argument_type>::param_type x) const
+        {
+            return op(value, x);
+        }
+        
+      protected:
+        typename binary_traits<Operation>::function_type op;
+        typename binary_traits<Operation>::first_argument_type value;
+    };
+
+    template <class Operation>
+    inline binder1st<Operation> bind1st(const Operation &op,
+                                        typename call_traits<
+                                                    typename binary_traits<Operation>::first_argument_type
+                                        >::param_type x)
+    {
+        // The cast is to placate Borland C++Builder in certain circumstances.
+        // I don't think it should be necessary.
+        return binder1st<Operation>((typename binary_traits<Operation>::param_type)op, x);
+    }
+
+    template <class Operation>
+    inline binder1st<Operation> bind1st(Operation &op,
+                                        typename call_traits<
+                                                    typename binary_traits<Operation>::first_argument_type
+                                        >::param_type x)
+    {
+        return binder1st<Operation>(op, x);
+    }
+
+    // --------------------------------------------------------------------------
+    // binder2nd, bind2nd
+    // --------------------------------------------------------------------------
+    template <class Operation>
+    class binder2nd
+        : public std::unary_function<typename binary_traits<Operation>::first_argument_type,
+                                     typename binary_traits<Operation>::result_type>
+    {
+      public:
+        binder2nd(typename binary_traits<Operation>::param_type x,
+                  typename call_traits<typename binary_traits<Operation>::second_argument_type>::param_type y)
+            :
+            op(x), value(y)
+        {}
+        
+        typename binary_traits<Operation>::result_type
+        operator()(typename call_traits<typename binary_traits<Operation>::first_argument_type>::param_type x) const
+        {
+            return op(x, value);
+        }               
+        
+      protected:
+        typename binary_traits<Operation>::function_type op;
+        typename binary_traits<Operation>::second_argument_type value;
+    };
+
+    template <class Operation>
+    inline binder2nd<Operation> bind2nd(const Operation &op,
+                                        typename call_traits<
+                                                    typename binary_traits<Operation>::second_argument_type
+                                        >::param_type x)
+    {
+        // The cast is to placate Borland C++Builder in certain circumstances.
+        // I don't think it should be necessary.
+        return binder2nd<Operation>((typename binary_traits<Operation>::param_type)op, x);
+    }
+
+    template <class Operation>
+    inline binder2nd<Operation> bind2nd(Operation &op,
+                                        typename call_traits<
+                                                    typename binary_traits<Operation>::second_argument_type
+                                        >::param_type x)
+    {
+        return binder2nd<Operation>(op, x);
+    }
+
+    // --------------------------------------------------------------------------
+    // mem_fun, etc
+    // --------------------------------------------------------------------------
+    template <class S, class T>
+    class mem_fun_t : public std::unary_function<T*, S>
+    {
+      public:
+        explicit mem_fun_t(S (T::*p)())
+            :
+            ptr(p)
+        {}
+        S operator()(T* p) const
+        {
+            return (p->*ptr)();
+        }
+      private:
+        S (T::*ptr)();
+    };
+
+    template <class S, class T, class A>
+    class mem_fun1_t : public std::binary_function<T*, A, S>
+    {
+      public:   
+        explicit mem_fun1_t(S (T::*p)(A))
+            :
+            ptr(p)
+        {}
+        S operator()(T* p, typename call_traits<A>::param_type x) const
+        {
+            return (p->*ptr)(x);
+        }
+      private:
+        S (T::*ptr)(A);
+    };
+
+    template <class S, class T>
+    class const_mem_fun_t : public std::unary_function<const T*, S>
+    {
+      public:
+        explicit const_mem_fun_t(S (T::*p)() const)
+            :
+            ptr(p)
+        {}
+        S operator()(const T* p) const
+        {
+            return (p->*ptr)();
+        }
+      private:
+        S (T::*ptr)() const;        
+    };
+
+    template <class S, class T, class A>
+    class const_mem_fun1_t : public std::binary_function<const T*, A, S>
+    {
+      public:
+        explicit const_mem_fun1_t(S (T::*p)(A) const)
+            :
+            ptr(p)
+        {}
+        S operator()(const T* p, typename call_traits<A>::param_type x) const
+        {
+            return (p->*ptr)(x);
+        }
+      private:
+        S (T::*ptr)(A) const;
+    };
+    
+    template<class S, class T>
+    inline mem_fun_t<S,T> mem_fun(S (T::*f)())
+    {
+        return mem_fun_t<S,T>(f);
+    }
+    
+    template<class S, class T, class A>
+    inline mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A))
+    {
+        return mem_fun1_t<S,T,A>(f);
+    }
+
+#ifndef BOOST_NO_POINTER_TO_MEMBER_CONST
+    template<class S, class T>
+    inline const_mem_fun_t<S,T> mem_fun(S (T::*f)() const)
+    {
+        return const_mem_fun_t<S,T>(f);
+    }
+    
+    template<class S, class T, class A>
+    inline const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const)
+    {
+        return const_mem_fun1_t<S,T,A>(f);
+    }
+#endif // BOOST_NO_POINTER_TO_MEMBER_CONST
+
+    // --------------------------------------------------------------------------
+    // mem_fun_ref, etc
+    // --------------------------------------------------------------------------
+    template <class S, class T>
+    class mem_fun_ref_t : public std::unary_function<T&, S>
+    {
+      public:
+        explicit mem_fun_ref_t(S (T::*p)())
+            :
+            ptr(p)
+        {}
+        S operator()(T& p) const
+        {
+            return (p.*ptr)();
+        }
+      private:
+        S (T::*ptr)();
+    };
+
+    template <class S, class T, class A>
+    class mem_fun1_ref_t : public std::binary_function<T&, A, S>
+    {
+      public:
+        explicit mem_fun1_ref_t(S (T::*p)(A))
+            :
+            ptr(p)
+        {}
+        S operator()(T& p, typename call_traits<A>::param_type x) const
+        {
+            return (p.*ptr)(x);
+        }
+      private:
+        S (T::*ptr)(A);
+    };
+    
+    template <class S, class T>
+    class const_mem_fun_ref_t : public std::unary_function<const T&, S>
+    {
+      public:
+        explicit const_mem_fun_ref_t(S (T::*p)() const)
+            :
+            ptr(p)
+        {}
+        
+        S operator()(const T &p) const
+        {
+            return (p.*ptr)();
+        }
+      private:
+        S (T::*ptr)() const;
+    };
+
+    template <class S, class T, class A>
+    class const_mem_fun1_ref_t : public std::binary_function<const T&, A, S>
+    {
+      public:
+        explicit const_mem_fun1_ref_t(S (T::*p)(A) const)
+            :
+            ptr(p)
+        {}
+
+        S operator()(const T& p, typename call_traits<A>::param_type x) const
+        {
+            return (p.*ptr)(x);
+        }
+      private:
+        S (T::*ptr)(A) const;
+    };
+    
+    template<class S, class T>
+    inline mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)())
+    {
+        return mem_fun_ref_t<S,T>(f);
+    }
+
+    template<class S, class T, class A>
+    inline mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A))
+    {
+        return mem_fun1_ref_t<S,T,A>(f);
+    }
+
+#ifndef BOOST_NO_POINTER_TO_MEMBER_CONST
+    template<class S, class T>
+    inline const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const)
+    {
+        return const_mem_fun_ref_t<S,T>(f);
+    }
+
+    template<class S, class T, class A>
+    inline const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const)
+    {
+        return const_mem_fun1_ref_t<S,T,A>(f);
+    }   
+#endif // BOOST_NO_POINTER_TO_MEMBER_CONST
+
+    // --------------------------------------------------------------------------
+    // ptr_fun
+    // --------------------------------------------------------------------------
+    template <class Arg, class Result>
+    class pointer_to_unary_function : public std::unary_function<Arg,Result>
+    {
+      public:
+        explicit pointer_to_unary_function(Result (*f)(Arg))
+            :
+            func(f)
+        {}
+
+        Result operator()(typename call_traits<Arg>::param_type x) const
+        {
+            return func(x);
+        }
+        
+      private:
+        Result (*func)(Arg);
+    };
+
+    template <class Arg, class Result>
+    inline pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg))
+    {
+        return pointer_to_unary_function<Arg,Result>(f);
+    }
+
+    template <class Arg1, class Arg2, class Result>
+    class pointer_to_binary_function : public std::binary_function<Arg1,Arg2,Result>
+    {
+      public:
+        explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2))
+            :
+            func(f)
+        {}
+        
+        Result operator()(typename call_traits<Arg1>::param_type x, typename call_traits<Arg2>::param_type y) const
+        {
+            return func(x,y);
+        }
+        
+      private:
+        Result (*func)(Arg1, Arg2);
+    };
+
+    template <class Arg1, class Arg2, class Result>
+    inline pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1, Arg2))
+    {
+        return pointer_to_binary_function<Arg1,Arg2,Result>(f);
+    }
+} // namespace boost
+
+#endif
diff --git a/boost/boost/generator_iterator.hpp b/boost/boost/generator_iterator.hpp
new file mode 100644 (file)
index 0000000..5f4c0a9
--- /dev/null
@@ -0,0 +1,73 @@
+// (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.
+//
+// Revision History:
+
+// 15 Nov 2001   Jens Maurer
+//      created.
+
+#ifndef BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
+#define BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
+
+#include <boost/iterator_adaptors.hpp>
+#include <boost/ref.hpp>
+
+namespace boost {
+
+template<class Generator>
+class generator_iterator_policies
+{
+public:
+    generator_iterator_policies() { }
+
+    template<class Base>
+    void initialize(Base& base) {
+      m_value = (*base)();
+    }
+
+    // The Iter template argument is necessary for compatibility with a MWCW
+    // bug workaround
+    template <class IteratorAdaptor>
+    void increment(IteratorAdaptor& iter) {
+      m_value = (*iter.base())();
+    }
+
+    template <class IteratorAdaptor>
+    const typename Generator::result_type&
+    dereference(const IteratorAdaptor&) const
+        { return m_value; }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+        { return x.base() == y.base() &&
+            x.policies().m_value == y.policies().m_value; }
+
+private:
+  typename Generator::result_type m_value;
+};
+
+template<class Generator>
+struct generator_iterator_generator
+{
+  typedef iterator_adaptor<Generator*, generator_iterator_policies<Generator>,
+    typename Generator::result_type, const typename Generator::result_type&,
+    const typename Generator::result_type*, std::input_iterator_tag,
+    long>       type;
+};
+
+template <class Generator>
+inline typename generator_iterator_generator<Generator>::type
+make_generator_iterator(Generator & gen)
+{
+  typedef typename generator_iterator_generator<Generator>::type result_t;
+  return result_t(&gen);
+}
+
+} // namespace boost
+
+
+#endif // BOOST_ITERATOR_ADAPTOR_GENERATOR_ITERATOR_HPP
+
diff --git a/boost/boost/half_open_range.hpp b/boost/boost/half_open_range.hpp
new file mode 100644 (file)
index 0000000..c281846
--- /dev/null
@@ -0,0 +1,426 @@
+// (C) Copyright Jeremy Siek and David Abrahams 2000-2001. Permission to copy,
+// use, modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided "as is"
+// without express or implied warranty, and with no claim as to its suitability
+// for any purpose.
+//
+// Revision History:
+// 11 Feb 2001  Use new iterator_adaptor interface, Fixes for Borland.
+//              (Dave Abrahams)
+// 04 Feb 2001  Support for user-defined iterator categories (Dave Abrahams)
+// 30 Jan 2001  Initial Checkin (Dave Abrahams)
+
+#ifndef BOOST_HALF_OPEN_RANGE_HPP_
+# define BOOST_HALF_OPEN_RANGE_HPP_
+
+# include <boost/counting_iterator.hpp>
+# include <functional>
+# include <cassert>
+# include <boost/operators.hpp>
+# include <string>
+# include <stdexcept>
+# include <iterator>
+
+namespace boost {
+
+namespace detail {
+
+  // Template class choose_finish -- allows us to maintain the invariant that
+  // start() <= finish() on half_open_range specializations that support random
+  // access.
+#ifdef __MWERKS__
+  template <class T>
+  const T& choose_finish(const T&, const T& finish, std::input_iterator_tag)
+  {
+      return finish;
+  }
+
+  template <class T>
+  const T& choose_finish(const T&, const T& finish, std::output_iterator_tag)
+  {
+      return finish;
+  }
+
+  template <class T>
+  const T& choose_finish(const T& start, const T& finish, std::random_access_iterator_tag)
+  {
+      return finish < start ? start : finish;
+  }
+#else
+  template <bool is_random_access> struct finish_chooser;
+
+  template <>
+  struct finish_chooser<false>
+  {
+      template <class T>
+      struct rebind
+      {
+          static T choose(const T&, const T& finish)
+              { return finish; }
+      };
+  };
+
+  template <>
+  struct finish_chooser<true>
+  {
+      template <class T>
+      struct rebind
+      {
+          static T choose(const T& start, const T& finish)
+              { return finish < start ? start : finish; }
+      };
+  };
+
+  template <class Category, class Incrementable>
+  struct choose_finish
+  {
+      static const Incrementable choose(const Incrementable& start, const Incrementable& finish)
+      {
+          return finish_chooser<(
+              ::boost::is_convertible<Category*,std::random_access_iterator_tag*>::value
+              )>::template rebind<Incrementable>::choose(start, finish);
+      }
+  };
+#endif
+}
+
+template <class Incrementable>
+struct half_open_range
+{
+    typedef typename counting_iterator_generator<Incrementable>::type iterator;
+
+ private: // utility type definitions
+    // Using iter_t prevents compiler confusion with boost::iterator
+    typedef typename counting_iterator_generator<Incrementable>::type iter_t;
+
+    typedef std::less<Incrementable> less_value;
+    typedef typename iter_t::iterator_category category;
+    typedef half_open_range<Incrementable> self;
+
+ public:
+    typedef iter_t const_iterator;
+    typedef typename iterator::value_type value_type;
+    typedef typename iterator::difference_type difference_type;
+    typedef typename iterator::reference reference;
+    typedef typename iterator::reference const_reference;
+    typedef typename iterator::pointer pointer;
+    typedef typename iterator::pointer const_pointer;
+    
+    // It would be nice to select an unsigned type, but this is appropriate
+    // since the library makes an attempt to select a difference_type which can
+    // hold the difference between any two iterators.
+    typedef typename iterator::difference_type size_type;
+
+    half_open_range(Incrementable start, Incrementable finish)
+        : m_start(start),
+          m_finish(
+#ifndef __MWERKS__
+            detail::choose_finish<category,Incrementable>::choose(start, finish)
+#else
+            detail::choose_finish(start, finish, category())
+#endif
+              )
+        {}
+
+    // Implicit conversion from std::pair<Incrementable,Incrementable> allows us
+    // to accept the results of std::equal_range(), for example.
+    half_open_range(const std::pair<Incrementable,Incrementable>& x)
+        : m_start(x.first),
+          m_finish(
+#ifndef __MWERKS__
+              detail::choose_finish<category,Incrementable>::choose(x.first, x.second)
+#else
+            detail::choose_finish(x.first, x.second, category())
+#endif
+              )
+        {}
+
+    half_open_range& operator=(const self& x)
+    {
+        m_start = x.m_start;
+        m_finish = x.m_finish;
+        return *this;
+    }
+    
+    half_open_range& operator=(const std::pair<Incrementable,Incrementable>& x)
+    {
+        m_start = x.first;
+        m_finish =
+#ifndef __MWERKS__
+            detail::choose_finish<category,Incrementable>::choose(x.first, x.second);
+#else
+            detail::choose_finish(x.first, x.second, category();
+#endif
+    }
+        
+    iterator begin() const { return iterator(m_start); }
+    iterator end() const { return iterator(m_finish); }
+    
+    Incrementable front() const { assert(!this->empty()); return m_start; }
+    Incrementable back() const { assert(!this->empty()); return boost::prior(m_finish); }
+                                     
+    Incrementable start() const { return m_start; }
+    Incrementable finish() const { return m_finish; }
+    
+    size_type size() const { return boost::detail::distance(begin(), end()); }
+
+    bool empty() const
+    {
+        return m_finish == m_start;
+    }
+
+    void swap(half_open_range& x) {
+        std::swap(m_start, x.m_start);
+        std::swap(m_finish, x.m_finish);
+    }
+    
+ public: // functions requiring random access elements
+    
+    // REQUIRES: x is reachable from this->front()
+    bool contains(const value_type& x) const
+    {
+        BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
+        return !less_value()(x, m_start) && less_value()(x, m_finish);
+    }
+
+    bool contains(const half_open_range& x) const
+    {
+        BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
+        return x.empty() || !less_value()(x.m_start, m_start) && !less_value()(m_finish, x.m_finish);
+    }
+
+    bool intersects(const half_open_range& x) const
+    {
+        BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
+        return less_value()(
+            less_value()(this->m_start, x.m_start) ? x.m_start : this->m_start,
+            less_value()(this->m_finish, x.m_finish) ? this->m_finish : x.m_finish);
+    }
+
+    half_open_range& operator&=(const half_open_range& x)
+    {
+        BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
+        
+        if (less_value()(this->m_start, x.m_start))
+            this->m_start = x.m_start;
+        
+        if (less_value()(x.m_finish, this->m_finish))
+            this->m_finish = x.m_finish;
+
+        if (less_value()(this->m_finish, this->m_start))
+            this->m_start = this->m_finish;
+
+        return *this;
+    }
+
+    half_open_range& operator|=(const half_open_range& x)
+    {
+        BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
+
+        if (!x.empty())
+        {
+            if (this->empty())
+            {
+                *this = x;
+            }
+            else
+            {
+                if (less_value()(x.m_start, this->m_start))
+                    this->m_start = x.m_start;
+        
+                if (less_value()(this->m_finish, x.m_finish))
+                    this->m_finish = x.m_finish;
+            }
+        }
+        return *this;
+    }
+
+    // REQUIRES: x is reachable from this->front()
+    const_iterator find(const value_type& x) const
+    {
+        BOOST_STATIC_ASSERT((boost::is_same<category, std::random_access_iterator_tag>::value));
+        
+        return const_iterator(this->contains(x) ? x : m_finish);
+    }
+
+    // REQUIRES: index >= 0 && index < size()
+    value_type operator[](size_type index) const
+    {
+        assert(index >= 0 && index < size());
+        return m_start + index;
+    }
+    
+    value_type at(size_type index) const
+    {
+        if (index < 0 || index >= size())
+            throw std::out_of_range(std::string("half_open_range"));
+        return m_start + index;
+    }
+    
+ private: // data members
+    Incrementable m_start, m_finish;
+};
+
+template <class Incrementable>
+half_open_range<Incrementable> operator|(
+    half_open_range<Incrementable> x,
+    const half_open_range<Incrementable>& y)
+{
+    return x |= y;
+}
+
+template <class Incrementable>
+half_open_range<Incrementable> operator&(
+    half_open_range<Incrementable> x,
+    const half_open_range<Incrementable>& y)
+{
+    return x &= y;
+}
+
+template <class Incrementable>
+inline bool operator==(
+    const half_open_range<Incrementable>& x,
+    const half_open_range<Incrementable>& y)
+{
+    const bool y_empty = y.empty();
+    return x.empty() ? y_empty : !y_empty && x.start() == y.start() && x.finish() == y.finish();
+}
+
+template <class Incrementable>
+inline bool operator!=(
+    const half_open_range<Incrementable>& x,
+    const half_open_range<Incrementable>& y)
+{
+    return !(x == y);
+}
+
+template <class Incrementable>
+inline half_open_range<Incrementable>
+make_half_open_range(Incrementable first, Incrementable last)
+{
+  return half_open_range<Incrementable>(first, last);
+}
+
+template <class Incrementable>
+bool intersects(
+    const half_open_range<Incrementable>& x,
+    const half_open_range<Incrementable>& y)
+{
+    return x.intersects(y);
+}
+    
+template <class Incrementable>
+bool contains(
+    const half_open_range<Incrementable>& x,
+    const half_open_range<Incrementable>& y)
+{
+    return x.contains(y);
+}
+    
+} // namespace boost
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace std {
+template <class Incrementable> struct less<boost::half_open_range<Incrementable> >
+        : binary_function<
+            boost::half_open_range<Incrementable>,
+            boost::half_open_range<Incrementable>,bool>
+{
+    bool operator()(
+        const boost::half_open_range<Incrementable>& x,
+        const boost::half_open_range<Incrementable>& y) const
+    {
+        less<Incrementable> cmp;
+        return !y.empty() && (
+            cmp(x.start(), y.start())
+            || !cmp(y.start(), x.start())
+               && cmp(x.finish(), y.finish()));
+    }
+};
+
+template <class Incrementable> struct less_equal<boost::half_open_range<Incrementable> >
+        : binary_function<
+            boost::half_open_range<Incrementable>,
+            boost::half_open_range<Incrementable>,bool>
+{
+    bool operator()(
+        const boost::half_open_range<Incrementable>& x,
+        const boost::half_open_range<Incrementable>& y) const
+    {
+        typedef boost::half_open_range<Incrementable> range;
+        less<range> cmp;
+        return !cmp(y,x);
+    }
+};
+template <class Incrementable> struct greater<boost::half_open_range<Incrementable> >
+        : binary_function<
+            boost::half_open_range<Incrementable>,
+            boost::half_open_range<Incrementable>,bool>
+{
+    bool operator()(
+        const boost::half_open_range<Incrementable>& x,
+        const boost::half_open_range<Incrementable>& y) const
+    {
+        typedef boost::half_open_range<Incrementable> range;
+        less<range> cmp;
+        return cmp(y,x);
+    }
+};
+
+template <class Incrementable> struct greater_equal<boost::half_open_range<Incrementable> >
+        : binary_function<
+            boost::half_open_range<Incrementable>,
+            boost::half_open_range<Incrementable>,bool>
+{
+    bool operator()(
+        const boost::half_open_range<Incrementable>& x,
+        const boost::half_open_range<Incrementable>& y) const
+    {
+        typedef boost::half_open_range<Incrementable> range;
+        less<range> cmp;
+        return !cmp(x,y);
+    }
+};
+} // namespace std
+
+#else
+
+namespace boost {
+// Can't partially specialize std::less et al, so we must provide the operators
+template <class Incrementable>
+bool operator<(const half_open_range<Incrementable>& x,
+               const half_open_range<Incrementable>& y)
+{
+    return !y.empty() && (
+        x.empty() || std::less<Incrementable>()(x.start(), y.start())
+        || !std::less<Incrementable>()(y.start(), x.start())
+                && std::less<Incrementable>()(x.finish(), y.finish()));
+}
+
+template <class Incrementable>
+bool operator>(const half_open_range<Incrementable>& x,
+               const half_open_range<Incrementable>& y)
+{
+    return y < x;
+}
+
+template <class Incrementable>
+bool operator<=(const half_open_range<Incrementable>& x,
+               const half_open_range<Incrementable>& y)
+{
+    return !(y < x);
+}
+
+template <class Incrementable>
+bool operator>=(const half_open_range<Incrementable>& x,
+               const half_open_range<Incrementable>& y)
+{
+    return !(x < y);
+}
+} // namespace boost
+
+#endif
+    
+
+#endif // BOOST_HALF_OPEN_RANGE_HPP_
index c5516fe69a25cbbc9e2fa22d30b02bb56f4e5591..ec232c7cef549b4107b97809307c3abe460ce7f2 100644 (file)
@@ -9,6 +9,7 @@
 //  See http://www.boost.org for most recent version including documentation.
 
 //  Revision History
+//   22 Sep 01  Added value-based integer templates. (Daryle Walker)
 //   01 Apr 01  Modified to use new <boost/limits.hpp> header. (John Maddock)
 //   30 Jul 00  Add typename syntax fix (Jens Maurer)
 //   28 Aug 99  Initial version
 #ifndef BOOST_INTEGER_HPP
 #define BOOST_INTEGER_HPP
 
-#include <boost/limits.hpp>
+#include <boost/integer_fwd.hpp>  // self include
+
+#include <boost/integer_traits.hpp>  // for boost::integer_traits
+#include <boost/limits.hpp>          // for std::numeric_limits
 
 namespace boost
 {
@@ -75,11 +79,51 @@ namespace boost
       // int_fast_t<> works correctly for unsigned too, in spite of the name.
   };
 
-//  The same dispatching technique can be used to select types based on
-//  values.  That will be added once boost::integer_traits is available.
+  //  integer templates specifying extreme value  ----------------------------//
+
+  //  signed
+  template< long MaxValue >   // maximum value to require support
+  struct int_max_value_t 
+  {
+      typedef typename int_least_helper
+        <
+          (MaxValue <= integer_traits<long>::const_max) +
+          (MaxValue <= integer_traits<int>::const_max) +
+          (MaxValue <= integer_traits<short>::const_max) +
+          (MaxValue <= integer_traits<signed char>::const_max)
+        >::least  least;
+      typedef typename int_fast_t<least>::fast  fast;
+  };
+
+  template< long MinValue >   // minimum value to require support
+  struct int_min_value_t 
+  {
+      typedef typename int_least_helper
+        <
+          (MinValue >= integer_traits<long>::const_min) +
+          (MinValue >= integer_traits<int>::const_min) +
+          (MinValue >= integer_traits<short>::const_min) +
+          (MinValue >= integer_traits<signed char>::const_min)
+        >::least  least;
+      typedef typename int_fast_t<least>::fast  fast;
+  };
+
+  //  unsigned
+  template< unsigned long Value >   // maximum value to require support
+  struct uint_value_t 
+  {
+      typedef typename int_least_helper
+        < 
+          5 +
+          (Value <= integer_traits<unsigned long>::const_max) +
+          (Value <= integer_traits<unsigned int>::const_max) +
+          (Value <= integer_traits<unsigned short>::const_max) +
+          (Value <= integer_traits<unsigned char>::const_max)
+        >::least  least;
+      typedef typename int_fast_t<least>::fast  fast;
+  };
 
 
 } // namespace boost
 
 #endif  // BOOST_INTEGER_HPP
-
diff --git a/boost/boost/integer/integer_mask.hpp b/boost/boost/integer/integer_mask.hpp
new file mode 100644 (file)
index 0000000..30f6340
--- /dev/null
@@ -0,0 +1,93 @@
+//  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. 
+
+//  See http://www.boost.org for updates, documentation, and revision history. 
+
+#ifndef BOOST_INTEGER_INTEGER_MASK_HPP
+#define BOOST_INTEGER_INTEGER_MASK_HPP
+
+#include <boost/integer_fwd.hpp>  // self include
+
+#include <boost/config.hpp>   // for BOOST_STATIC_CONSTANT
+#include <boost/integer.hpp>  // for boost::uint_t
+
+#include <climits>  // for UCHAR_MAX, etc.
+#include <cstddef>  // for std::size_t
+
+#include <boost/limits.hpp>  // for std::numeric_limits
+
+
+namespace boost
+{
+
+
+//  Specified single-bit mask class declaration  -----------------------------//
+//  (Lowest bit starts counting at 0.)
+
+template < std::size_t Bit >
+struct high_bit_mask_t
+{
+    typedef typename uint_t<(Bit + 1)>::least  least;
+    typedef typename uint_t<(Bit + 1)>::fast   fast;
+
+    BOOST_STATIC_CONSTANT( least, high_bit = (least( 1u ) << Bit) );
+    BOOST_STATIC_CONSTANT( fast, high_bit_fast = (fast( 1u ) << Bit) );
+
+    BOOST_STATIC_CONSTANT( std::size_t, bit_position = Bit );
+
+};  // boost::high_bit_mask_t
+
+
+//  Specified bit-block mask class declaration  ------------------------------//
+//  Makes masks for the lowest N bits
+//  (Specializations are needed when N fills up a type.)
+
+template < std::size_t Bits >
+struct low_bits_mask_t
+{
+    typedef typename uint_t<Bits>::least  least;
+    typedef typename uint_t<Bits>::fast   fast;
+
+    BOOST_STATIC_CONSTANT( least, sig_bits = (~( ~(least( 0u )) << Bits )) );
+    BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) );
+
+    BOOST_STATIC_CONSTANT( std::size_t, bit_count = Bits );
+
+};  // boost::low_bits_mask_t
+
+
+#define BOOST_LOW_BITS_MASK_SPECIALIZE( Type )                                  \
+  template <  >  struct low_bits_mask_t< std::numeric_limits<Type>::digits >  { \
+      typedef std::numeric_limits<Type>           limits_type;                  \
+      typedef uint_t<limits_type::digits>::least  least;                        \
+      typedef uint_t<limits_type::digits>::fast   fast;                         \
+      BOOST_STATIC_CONSTANT( least, sig_bits = (~( least(0u) )) );              \
+      BOOST_STATIC_CONSTANT( fast, sig_bits_fast = fast(sig_bits) );            \
+      BOOST_STATIC_CONSTANT( std::size_t, bit_count = limits_type::digits );    \
+  }
+
+BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned char );
+
+#if USHRT_MAX > UCHAR_MAX
+BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned short );
+#endif
+
+#if UINT_MAX > USHRT_MAX
+BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int );
+#endif
+
+#if ULONG_MAX > UINT_MAX
+BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long );
+#endif
+
+#undef BOOST_LOW_BITS_MASK_SPECIALIZE
+
+
+}  // namespace boost
+
+
+#endif  // BOOST_INTEGER_INTEGER_MASK_HPP
diff --git a/boost/boost/integer/static_log2.hpp b/boost/boost/integer/static_log2.hpp
new file mode 100644 (file)
index 0000000..436250e
--- /dev/null
@@ -0,0 +1,91 @@
+//  Boost integer/static_log2.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. 
+
+//  See http://www.boost.org for updates, documentation, and revision history. 
+
+#ifndef BOOST_INTEGER_STATIC_LOG2_HPP
+#define BOOST_INTEGER_STATIC_LOG2_HPP
+
+#include <boost/integer_fwd.hpp>  // self include
+
+#include <boost/config.hpp>  // for BOOST_STATIC_CONSTANT
+#include <boost/limits.hpp>  // for std::numeric_limits
+
+
+namespace boost
+{
+
+
+//  Implementation details  --------------------------------------------------//
+
+namespace detail
+{
+
+// Forward declarations
+template < unsigned long Val, int Place = 0, int Index
+ = std::numeric_limits<unsigned long>::digits >
+    struct static_log2_helper_t;
+
+template < unsigned long Val, int Place >
+    struct static_log2_helper_t< Val, Place, 1 >;
+
+// 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 );
+
+    typedef static_log2_helper_t<new_val, new_place, new_index>  next_step_type;
+
+public:
+    BOOST_STATIC_CONSTANT( int, value = next_step_type::value );
+
+};  // boost::detail::static_log2_helper_t
+
+// Non-recursive case
+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
+
+}  // namespace 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>::value );
+};
+
+template < >
+struct static_log2< 0ul >
+{
+    // The logarithm of zero is undefined.
+};
+
+
+}  // namespace boost
+
+
+#endif  // BOOST_INTEGER_STATIC_LOG2_HPP
diff --git a/boost/boost/integer/static_min_max.hpp b/boost/boost/integer/static_min_max.hpp
new file mode 100644 (file)
index 0000000..216a3e3
--- /dev/null
@@ -0,0 +1,56 @@
+//  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. 
+
+//  See http://www.boost.org for updates, documentation, and revision history. 
+
+#ifndef BOOST_INTEGER_STATIC_MIN_MAX_HPP
+#define BOOST_INTEGER_STATIC_MIN_MAX_HPP
+
+#include <boost/integer_fwd.hpp>  // self include
+
+#include <boost/config.hpp>  // for BOOST_STATIC_CONSTANT
+
+
+namespace boost
+{
+
+
+//  Compile-time extrema class declarations  ---------------------------------//
+//  Get the minimum or maximum of two values, signed or unsigned.
+
+template < long Value1, long Value2 >
+struct static_signed_min
+{
+    BOOST_STATIC_CONSTANT( long, value = (Value1 > Value2) ? Value2 : Value1 );
+};
+
+template < long Value1, long Value2 >
+struct static_signed_max
+{
+    BOOST_STATIC_CONSTANT( long, value = (Value1 < Value2) ? Value2 : Value1 );
+};
+
+template < unsigned long Value1, unsigned long Value2 >
+struct static_unsigned_min
+{
+    BOOST_STATIC_CONSTANT( unsigned long, value
+     = (Value1 > Value2) ? Value2 : Value1 );
+};
+
+template < unsigned long Value1, unsigned long Value2 >
+struct static_unsigned_max
+{
+    BOOST_STATIC_CONSTANT( unsigned long, value
+     = (Value1 < Value2) ? Value2 : Value1 );
+};
+
+
+}  // namespace boost
+
+
+#endif  // BOOST_INTEGER_STATIC_MIN_MAX_HPP
diff --git a/boost/boost/integer_fwd.hpp b/boost/boost/integer_fwd.hpp
new file mode 100644 (file)
index 0000000..7af9a4b
--- /dev/null
@@ -0,0 +1,154 @@
+//  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.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+#ifndef BOOST_INTEGER_FWD_HPP
+#define BOOST_INTEGER_FWD_HPP
+
+#include <climits>  // for UCHAR_MAX, etc.
+#include <cstddef>  // for std::size_t
+
+#include <boost/config.hpp>  // for BOOST_NO_INTRINSIC_WCHAR_T
+#include <boost/limits.hpp>  // for std::numeric_limits
+
+
+namespace boost
+{
+
+
+//  From <boost/cstdint.hpp>  ------------------------------------------------//
+
+// Only has typedefs or using statements, with #conditionals
+
+
+//  From <boost/integer_traits.hpp>  -----------------------------------------//
+
+template < class T >
+    class integer_traits;
+
+template <  >
+    class integer_traits< bool >;
+
+template <  >
+    class integer_traits< char >;
+
+template <  >
+    class integer_traits< signed char >;
+
+template <  >
+    class integer_traits< unsigned char >;
+
+#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+template <  >
+    class integer_traits< wchar_t >;
+#endif
+
+template <  >
+    class integer_traits< short >;
+
+template <  >
+    class integer_traits< unsigned short >;
+
+template <  >
+    class integer_traits< int >;
+
+template <  >
+    class integer_traits< unsigned int >;
+
+template <  >
+    class integer_traits< long >;
+
+template <  >
+    class integer_traits< unsigned long >;
+
+#ifdef ULLONG_MAX
+template <  >
+    class integer_traits< long long >;
+
+template <  >
+    class integer_traits< unsigned long long >;
+#endif
+
+
+//  From <boost/integer.hpp>  ------------------------------------------------//
+
+template < typename LeastInt >
+    struct int_fast_t;
+
+template< int Bits >
+    struct int_t;
+
+template< int Bits >
+    struct uint_t;
+
+template< long MaxValue >
+    struct int_max_value_t;
+
+template< long MinValue >
+    struct int_min_value_t;
+
+template< unsigned long Value >
+    struct uint_value_t;
+
+
+//  From <boost/integer/integer_mask.hpp>  -----------------------------------//
+
+template < std::size_t Bit >
+    struct high_bit_mask_t;
+
+template < std::size_t Bits >
+    struct low_bits_mask_t;
+
+template <  >
+    struct low_bits_mask_t< ::std::numeric_limits<unsigned char>::digits >;
+
+#if USHRT_MAX > UCHAR_MAX
+template <  >
+    struct low_bits_mask_t< ::std::numeric_limits<unsigned short>::digits >;
+#endif
+
+#if UINT_MAX > USHRT_MAX
+template <  >
+    struct low_bits_mask_t< ::std::numeric_limits<unsigned int>::digits >;
+#endif
+
+#if ULONG_MAX > UINT_MAX
+template <  >
+    struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >;
+#endif
+
+
+//  From <boost/integer/static_log2.hpp>  ------------------------------------//
+
+template < unsigned long Value >
+    struct static_log2;
+
+template <  >
+    struct static_log2< 0ul >;
+
+
+//  From <boost/integer/static_min_max.hpp>  ---------------------------------//
+
+template < long Value1, long Value2 >
+    struct static_signed_min;
+
+template < long Value1, long Value2 >
+    struct static_signed_max;
+
+template < unsigned long Value1, unsigned long Value2 >
+    struct static_unsigned_min;
+
+template < unsigned long Value1, unsigned long Value2 >
+    struct static_unsigned_max;
+
+
+}  // namespace boost
+
+
+#endif  // BOOST_INTEGER_FWD_HPP
diff --git a/boost/boost/integer_traits.hpp b/boost/boost/integer_traits.hpp
new file mode 100644 (file)
index 0000000..7fdeb28
--- /dev/null
@@ -0,0 +1,188 @@
+/* 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,
+ *
+ * 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.18 2002/01/23 19:56:07 dgregor Exp $
+ *
+ * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
+ */
+
+#ifndef BOOST_INTEGER_TRAITS_HPP
+#define BOOST_INTEGER_TRAITS_HPP
+
+#include <boost/config.hpp>
+#include <boost/limits.hpp>
+
+// These are an implementation detail and not part of the interface
+#include <limits.h>
+#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && !defined(BOOST_NO_CWCHAR)
+#include <wchar.h>
+#endif
+
+
+namespace boost {
+template<class T>
+class integer_traits : public std::numeric_limits<T>
+{
+public:
+  BOOST_STATIC_CONSTANT(bool, is_integral = false);
+};
+
+namespace detail {
+template<class T, T min_val, T max_val>
+class integer_traits_base
+{
+public:
+  BOOST_STATIC_CONSTANT(bool, is_integral = true);
+  BOOST_STATIC_CONSTANT(T, const_min = min_val);
+  BOOST_STATIC_CONSTANT(T, const_max = max_val);
+};
+
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+//  A definition is required even for integral static constants
+template<class T, T min_val, T max_val>
+const bool integer_traits_base<T, min_val, max_val>::is_integral;
+
+template<class T, T min_val, T max_val>
+const T integer_traits_base<T, min_val, max_val>::const_min;
+
+template<class T, T min_val, T max_val>
+const T integer_traits_base<T, min_val, max_val>::const_max;
+#endif
+
+} // namespace detail
+
+template<>
+class integer_traits<bool>
+  : public std::numeric_limits<bool>,
+    public detail::integer_traits_base<bool, false, true>
+{ };
+
+template<>
+class integer_traits<char>
+  : public std::numeric_limits<char>,
+    public detail::integer_traits_base<char, CHAR_MIN, CHAR_MAX>
+{ };
+
+template<>
+class integer_traits<signed char>
+  : public std::numeric_limits<signed char>,
+    public detail::integer_traits_base<signed char, SCHAR_MIN, SCHAR_MAX>
+{ };
+
+template<>
+class integer_traits<unsigned char>
+  : public std::numeric_limits<unsigned char>,
+    public detail::integer_traits_base<unsigned char, 0, UCHAR_MAX>
+{ };
+
+#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+template<>
+class integer_traits<wchar_t>
+  : public std::numeric_limits<wchar_t>,
+#if defined(WCHAR_MIN) && defined(WCHAR_MAX)
+    public detail::integer_traits_base<wchar_t, WCHAR_MIN, WCHAR_MAX>
+#elif defined(__BORLANDC__) || defined(__CYGWIN__) || defined(__MINGW32__) || (defined(__BEOS__) && defined(__GNUC__))
+    // No WCHAR_MIN and WCHAR_MAX, whar_t is short and unsigned:
+    public detail::integer_traits_base<wchar_t, 0, 0xffff>
+#elif (defined(__sgi) && (!defined(__SGI_STL_PORT) || __SGI_STL_PORT < 0x400)) || (defined __APPLE__) || (defined(__FreeBSD__) && defined(__GNUC__)) || (defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 3) && !defined(__SGI_STL_PORT))
+    // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as int.
+    //  - SGI MIPSpro with native library
+    //  - gcc 3.x on HP-UX
+    //  - Mac OS X with native library
+    //  - gcc on FreeBSD
+    public detail::integer_traits_base<wchar_t, INT_MIN, INT_MAX>
+#elif defined(__hpux) && defined(__GNUC__) && (__GNUC__ == 2) && !defined(__SGI_STL_PORT)
+    // No WCHAR_MIN and WCHAR_MAX, wchar_t has the same range as unsigned int.
+    //  - gcc 2.95.x on HP-UX
+    // (also, std::numeric_limits<wchar_t> appears to return the wrong values).
+    public detail::integer_traits_base<wchar_t, 0, UINT_MAX>
+#else
+#error No WCHAR_MIN and WCHAR_MAX present, please adjust integer_traits<> for your compiler.
+#endif
+{ };
+#endif // BOOST_NO_INTRINSIC_WCHAR_T
+
+template<>
+class integer_traits<short>
+  : public std::numeric_limits<short>,
+    public detail::integer_traits_base<short, SHRT_MIN, SHRT_MAX>
+{ };
+
+template<>
+class integer_traits<unsigned short>
+  : public std::numeric_limits<unsigned short>,
+    public detail::integer_traits_base<unsigned short, 0, USHRT_MAX>
+{ };
+
+template<>
+class integer_traits<int>
+  : public std::numeric_limits<int>,
+    public detail::integer_traits_base<int, INT_MIN, INT_MAX>
+{ };
+
+template<>
+class integer_traits<unsigned int>
+  : public std::numeric_limits<unsigned int>,
+    public detail::integer_traits_base<unsigned int, 0, UINT_MAX>
+{ };
+
+template<>
+class integer_traits<long>
+  : public std::numeric_limits<long>,
+    public detail::integer_traits_base<long, LONG_MIN, LONG_MAX>
+{ };
+
+template<>
+class integer_traits<unsigned long>
+  : public std::numeric_limits<unsigned long>,
+    public detail::integer_traits_base<unsigned long, 0, ULONG_MAX>
+{ };
+
+#if defined(ULLONG_MAX) && !defined(__SUNPRO_CC)
+template<>
+class integer_traits<long long>
+  : public std::numeric_limits<long long>,
+    public detail::integer_traits_base<long long, LLONG_MIN, LLONG_MAX>
+{ };
+template<>
+class integer_traits<unsigned long long>
+  : public std::numeric_limits<unsigned long long>,
+    public detail::integer_traits_base<unsigned long long, 0, ULLONG_MAX>
+{ };
+#elif defined(ULONG_LONG_MAX)
+template<>
+class integer_traits<long long>
+  : public std::numeric_limits<long long>,
+    public detail::integer_traits_base<long long, LONG_LONG_MIN, LONG_LONG_MAX>
+{ };
+template<>
+class integer_traits<unsigned long long>
+  : public std::numeric_limits<unsigned long long>,
+    public detail::integer_traits_base<unsigned long long, 0, ULONG_LONG_MAX>
+{ };
+#elif defined(ULONGLONG_MAX) && !defined(BOOST_MSVC) && !defined(__BORLANDC__)
+template<>
+class integer_traits<long long>
+  : public std::numeric_limits<long long>,
+    public detail::integer_traits_base<long long, LONGLONG_MIN, LONGLONG_MAX>
+{ };
+template<>
+class integer_traits<unsigned long long>
+  : public std::numeric_limits<unsigned long long>,
+    public detail::integer_traits_base<unsigned long long, 0, ULONGLONG_MAX>
+{ };
+#endif
+
+} // namespace boost
+
+#endif /* BOOST_INTEGER_TRAITS_HPP */
+
diff --git a/boost/boost/intrusive_ptr.hpp b/boost/boost/intrusive_ptr.hpp
new file mode 100644 (file)
index 0000000..780fe78
--- /dev/null
@@ -0,0 +1,202 @@
+#ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED
+#define BOOST_INTRUSIVE_PTR_HPP_INCLUDED
+
+//
+//  intrusive_ptr.hpp
+//
+//  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.
+//
+//  See http://www.boost.org/libs/smart_ptr/intrusive_ptr.html for documentation.
+//
+
+#ifdef BOOST_MSVC  // moved here to work around VC++ compiler crash
+# pragma warning(push)
+# pragma warning(disable:4284) // odd return type for operator->
+#endif
+
+#include <functional> // std::less
+
+namespace boost
+{
+
+//
+//  intrusive_ptr
+//
+//  A smart pointer that uses intrusive reference counting.
+//
+//  Relies on unqualified calls to
+//  
+//      void intrusive_ptr_add_ref(T * p);
+//      void intrusive_ptr_release(T * p);
+//
+//          (p != 0)
+//
+//  The object is responsible for destroying itself.
+//
+
+template<class T> class intrusive_ptr
+{
+private:
+
+    typedef intrusive_ptr this_type;
+
+public:
+
+    intrusive_ptr(): p_(0)
+    {
+    }
+
+    intrusive_ptr(T * p): p_(p)
+    {
+        if(p_ != 0) intrusive_ptr_add_ref(p_);
+    }
+
+    ~intrusive_ptr()
+    {
+        if(p_ != 0) intrusive_ptr_release(p_);
+    }
+
+#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
+
+    template<class U> intrusive_ptr(intrusive_ptr<U> const & rhs): p_(rhs.get())
+    {
+        if(p_ != 0) intrusive_ptr_add_ref(p_);
+    }
+
+#endif
+
+    intrusive_ptr(intrusive_ptr const & rhs): p_(rhs.p_)
+    {
+        if(p_ != 0) intrusive_ptr_add_ref(p_);
+    }
+
+#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
+
+    template<class U> intrusive_ptr & operator=(intrusive_ptr<U> const & rhs)
+    {
+        this_type(rhs).swap(*this);
+        return *this;
+    }
+
+#endif
+
+    intrusive_ptr & operator=(intrusive_ptr const & rhs)
+    {
+        this_type(rhs).swap(*this);
+        return *this;
+    }
+
+    intrusive_ptr & operator=(T * rhs)
+    {
+        this_type(rhs).swap(*this);
+        return *this;
+    }
+
+    void swap(intrusive_ptr & rhs)
+    {
+        T * tmp = p_;
+        p_ = rhs.p_;
+        rhs.p_ = tmp;
+    }
+
+    T * get() const
+    {
+        return p_;
+    }
+
+    T & operator*() const
+    {
+        return *p_;
+    }
+
+    T * operator->() const
+    {
+        return p_;
+    }
+
+    bool empty() const
+    {
+        return p_ == 0;
+    }
+
+    typedef bool (intrusive_ptr::*bool_type) () const;
+
+    operator bool_type () const
+    {
+        return p_ == 0? 0: &intrusive_ptr::empty;
+    }
+
+private:
+
+    T * p_;
+};
+
+template<class T> void swap(intrusive_ptr<T> & lhs, intrusive_ptr<T> & rhs)
+{
+    lhs.swap(rhs);
+}
+
+template<class T, class U> intrusive_ptr<T> shared_dynamic_cast(intrusive_ptr<U> const & p)
+{
+    return dynamic_cast<T *>(p.get());
+}
+
+template<class T, class U> intrusive_ptr<T> shared_static_cast(intrusive_ptr<U> const & p)
+{
+    return static_cast<T *>(p.get());
+}
+
+template<class T, class U> inline bool operator==(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b)
+{
+    return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(intrusive_ptr<T> const & a, intrusive_ptr<U> const & b)
+{
+    return a.get() != b.get();
+}
+
+template<class T> inline bool operator<(intrusive_ptr<T> const & a, intrusive_ptr<T> const & b)
+{
+    return std::less<T *>(a.get(), b.get());
+}
+
+template<class T> inline bool operator==(intrusive_ptr<T> const & a, T * b)
+{
+    return a.get() == b;
+}
+
+template<class T> inline bool operator!=(intrusive_ptr<T> const & a, T * b)
+{
+    return a.get() != b;
+}
+
+template<class T> inline bool operator==(T * a, intrusive_ptr<T> const & b)
+{
+    return a == b.get();
+}
+
+template<class T> inline bool operator!=(T * a, intrusive_ptr<T> const & b)
+{
+    return a != b.get();
+}
+
+// mem_fn support
+
+template<class T> T * get_pointer(intrusive_ptr<T> const & p)
+{
+    return p.get();
+}
+
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif    
+
+#endif  // #ifndef BOOST_INTRUSIVE_PTR_HPP_INCLUDED
diff --git a/boost/boost/iterator.hpp b/boost/boost/iterator.hpp
new file mode 100644 (file)
index 0000000..0e2ef72
--- /dev/null
@@ -0,0 +1,60 @@
+//  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.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Revision History
+//  12 Jan 01 added <cstddef> for std::ptrdiff_t (Jens Maurer)
+//  28 Jun 00 Workarounds to deal with known MSVC bugs (David Abrahams)
+//  26 Jun 00 Initial version (Jeremy Siek)
+
+#ifndef BOOST_ITERATOR_HPP
+#define BOOST_ITERATOR_HPP
+
+#include <iterator>
+#include <cstddef>           // std::ptrdiff_t
+#include <boost/config.hpp>
+
+namespace boost
+{
+# if defined(BOOST_NO_STD_ITERATOR) && !defined(BOOST_MSVC_STD_ITERATOR)
+  template <class Category, class T,
+    class Distance = std::ptrdiff_t,
+    class Pointer = T*, class Reference = T&>
+  struct iterator
+  {
+    typedef T         value_type;
+    typedef Distance  difference_type;
+    typedef Pointer   pointer;
+    typedef Reference reference;
+    typedef Category  iterator_category;
+  };
+# else
+
+  // declare iterator_base in namespace detail to work around MSVC bugs which
+  // prevent derivation from an identically-named class in a different namespace.
+  namespace detail {
+   template <class Category, class T, class Distance, class Pointer, class Reference>
+#  if !defined(BOOST_MSVC_STD_ITERATOR)
+   struct iterator_base : std::iterator<Category, T, Distance, Pointer, Reference> {};
+#  else
+   struct iterator_base : std::iterator<Category, T, Distance>
+   {
+     typedef Reference reference;
+     typedef Pointer pointer;
+     typedef Distance difference_type;
+   };
+#  endif
+  }
+
+  template <class Category, class T, class Distance = std::ptrdiff_t,
+            class Pointer = T*, class Reference = T&>
+   struct iterator : detail::iterator_base<Category, T, Distance, Pointer, Reference> {};
+# endif
+} // namespace boost
+
+#endif // BOOST_ITERATOR_HPP
diff --git a/boost/boost/iterator_adaptors.hpp b/boost/boost/iterator_adaptors.hpp
new file mode 100644 (file)
index 0000000..7da2738
--- /dev/null
@@ -0,0 +1,1430 @@
+// (C) Copyright David Abrahams 2000. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+// Revision History:
+
+// 01 Feb 2002   Jeremy Siek
+//      Added more comments in default_iterator_policies.
+// 08 Jan 2001   David Abrahams
+//      Moved concept checks into a separate class, which makes MSVC
+//      better at dealing with them.
+// 07 Jan 2001   David Abrahams
+//      Choose proxy for operator->() only if the reference type is not a reference.
+//      Updated workarounds for __MWERKS__ == 0x2406
+// 20 Dec 2001   David Abrahams
+//      Adjusted is_convertible workarounds for __MWERKS__ == 0x2406
+// 03 Nov 2001   Jeremy Siek
+//      Changed the named template parameter interface and internal.
+// 04 Oct 2001   Jeremy Siek
+//      Changed projection_iterator to not rely on the default reference,
+//      working around a limitation of detail::iterator_traits.
+// 04 Oct 2001   David Abrahams
+//      Applied indirect_iterator patch from George A. Heintzelman <georgeh@aya.yale.edu>
+//      Changed name of "bind" to "select" to avoid problems with MSVC.
+// 26 Sep 2001   David Abrahams
+//      Added borland bug fix
+// 08 Mar 2001   Jeremy Siek
+//      Added support for optional named template parameters.
+// 19 Feb 2001   David Abrahams
+//      Rolled back reverse_iterator_pair_generator again, as it doesn't
+//      save typing on a conforming compiler.
+// 18 Feb 2001   David Abrahams
+//      Reinstated reverse_iterator_pair_generator
+// 16 Feb 2001   David Abrahams
+//      Add an implicit conversion operator to operator_arrow_proxy
+//      as CW and BCC workarounds.
+// 11 Feb 2001   David Abrahams
+//      Switch to use of BOOST_STATIC_CONSTANT where possible
+// 11 Feb 2001   Jeremy Siek
+//      Removed workaround for older MIPSpro compiler. The workaround
+//        was preventing the proper functionality of the underlying
+//        iterator being carried forward into the iterator adaptor.
+//        Also added is_bidirectional enum to avoid EDG compiler error.
+// 11 Feb 2001   David Abrahams
+//      Borland fixes up the wazoo. It finally works!
+// 10 Feb 2001   David Abrahams
+//      Removed traits argument from iterator_adaptor<> and switched to
+//        explicit trait specification for maximum ease-of-use.
+//      Added comments to detail::iterator_defaults<>
+//      Began using detail::iterator_defaults<> unconditionally for code clarity
+//      Changed uses of `Iterator' to `Base' where non-iterators can be used.
+//
+// 10 Feb 2001   David Abrahams
+//      Rolled in supposed Borland fixes from John Maddock, but not seeing any
+//        improvement yet
+//      Changed argument order to indirect_ generator, for convenience in the
+//        case of input iterators (where Reference must be a value type).
+//      Removed derivation of filter_iterator_policies from
+//        default_iterator_policies, since the iterator category is likely to be
+//        reduced (we don't want to allow illegal operations like decrement).
+//      Support for a simpler filter iterator interface.
+//
+// 09 Feb 2001   David Abrahams
+//      Improved interface to indirect_ and reverse_ iterators
+//      Rolled back Jeremy's new constructor for now; it was causing
+//        problems with counting_iterator_test
+//      Attempted fix for Borland
+//
+// 09 Feb 2001   Jeremy Siek
+//      Added iterator constructor to allow const adaptor
+//        from non-const adaptee.
+//      Changed make_xxx to pass iterators by-value to
+//        get arrays converted to pointers.
+//      Removed InnerIterator template parameter from
+//        indirect_iterator_generator.
+//      Rearranged parameters for make_filter_iterator
+//
+// 07 Feb 2001   Jeremy Siek
+//      Removed some const iterator adaptor generators.
+//      Added make_xxx_iterator() helper functions for remaining
+//        iterator adaptors.
+//      Removed some traits template parameters where they
+//        where no longer needed thanks to detail::iterator_traits.
+//      Moved some of the compile-time logic into enums for
+//      EDG compatibility.
+//
+// 07 Feb 2001  David Abrahams
+//      Removed iterator_adaptor_pair_generator and
+//        reverse_iterator_pair_generator (more such culling to come)
+//      Improved comments
+//      Changed all uses of std::iterator_traits as default arguments
+//        to boost::detail::iterator_traits for improved utility in
+//        non-generic contexts
+//      Fixed naming convention of non-template parameter names
+//
+// 06 Feb 2001   David Abrahams
+//      Produce operator-> proxy objects for InputIterators
+//      Added static assertions to do some basic concept checks
+//      Renamed single-type generators -> xxx_generator
+//      Renamed const/nonconst iterator generators -> xxx_pair_generator
+//      Added make_transform_iterator(iter, function)
+//      The existence of boost::detail::iterator_traits allowed many
+//        template arguments to be defaulted. Some arguments had to be
+//        moved to accomplish it.
+//
+// 04 Feb 2001  MWERKS bug workaround, concept checking for proper
+//              reference types (David Abrahams)
+
+#ifndef BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_
+# define BOOST_ITERATOR_ADAPTOR_DWA053000_HPP_
+
+# include <boost/iterator.hpp>
+# include <boost/utility.hpp>
+# include <boost/compressed_pair.hpp>
+# include <boost/concept_check.hpp>
+# include <boost/type.hpp>
+# include <boost/static_assert.hpp>
+# include <boost/type_traits.hpp>
+# include <boost/detail/iterator.hpp>
+# include <boost/detail/select_type.hpp>
+
+// I was having some problems with VC6. I couldn't tell whether our hack for
+// stock GCC was causing problems so I needed an easy way to turn it on and
+// off. Now we can test the hack with various compilers and still have an
+// "out" if it doesn't work. -dwa 7/31/00
+# if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 && !defined(__STL_USE_NAMESPACES)
+#  define BOOST_RELOPS_AMBIGUITY_BUG 1
+# endif
+
+namespace boost {
+
+//============================================================================
+// Concept checking classes that express the requirements for iterator
+// policies and adapted types. These classes are mostly for
+// documentation purposes, and are not used in this header file. They
+// merely provide a more succinct statement of what is expected of the
+// iterator policies.
+
+template <class Policies, class Adapted, class Traits>
+struct TrivialIteratorPoliciesConcept
+{
+  typedef typename Traits::reference Reference;
+  void constraints() {
+    function_requires< AssignableConcept<Policies> >();
+    function_requires< DefaultConstructibleConcept<Policies> >();
+    function_requires< AssignableConcept<Adapted> >();
+    function_requires< DefaultConstructibleConcept<Adapted> >();
+
+    const_constraints();
+  }
+  void const_constraints() const {
+    Reference r = p.dereference(x);
+    b = p.equal(x, x);
+    ignore_unused_variable_warning(r);
+  }
+  Policies p;
+  Adapted x;
+  mutable bool b;
+};
+
+// Add InputIteratorPoliciesConcept?
+
+template <class Policies, class Adapted, class Traits>
+struct ForwardIteratorPoliciesConcept
+{
+  typedef typename Traits::iterator_category iterator_category;
+  void constraints() {
+    function_requires<
+      TrivialIteratorPoliciesConcept<Policies, Adapted, Traits>
+      >();
+
+    p.increment(x);
+    std::forward_iterator_tag t = iterator_category();
+    ignore_unused_variable_warning(t);
+  }
+  Policies p;
+  Adapted x;
+  iterator_category category;
+};
+
+template <class Policies, class Adapted, class Traits>
+struct BidirectionalIteratorPoliciesConcept
+{
+  typedef typename Traits::iterator_category iterator_category;
+  void constraints() {
+    function_requires<
+      ForwardIteratorPoliciesConcept<Policies, Adapted, Traits>
+      >();
+
+    p.decrement(x);
+    std::bidirectional_iterator_tag t = iterator_category();
+    ignore_unused_variable_warning(t);
+  }
+  Policies p;
+  Adapted x;
+};
+
+template <class Policies, class Adapted, class Traits>
+struct RandomAccessIteratorPoliciesConcept
+{
+  typedef typename Traits::difference_type DifferenceType;
+  typedef typename Traits::iterator_category iterator_category;
+  void constraints() {
+    function_requires<
+      BidirectionalIteratorPoliciesConcept<Policies, Adapted, Traits>
+      >();
+
+    p.advance(x, n);
+    std::random_access_iterator_tag t = iterator_category();
+    const_constraints();
+    ignore_unused_variable_warning(t);
+  }
+  void const_constraints() const {
+    n = p.distance(x, x);
+  }
+  Policies p;
+  Adapted x;
+  mutable DifferenceType n;
+  mutable bool b;
+};
+
+
+//============================================================================
+// Default policies for iterator adaptors. You can use this as a base
+// class if you want to customize particular policies.
+struct default_iterator_policies
+{
+    // Some of the member functions were defined static, but Borland
+    // got confused and thought they were non-const. Also, Sun C++
+    // does not like static function templates. 
+    //
+    // The reason some members were defined static is because there is
+    // not state (data members) needed by those members of the
+    // default_iterator_policies class. If your policies class member
+    // functions need to access state stored in the policies object,
+    // then the member functions should not be static (they can't be).
+
+    template <class Base>
+    void initialize(Base&)
+        { }
+
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
+        { return *x.base(); }
+
+    template <class IteratorAdaptor>
+    void increment(IteratorAdaptor& x)
+        { ++x.base(); }
+
+    template <class IteratorAdaptor>
+    void decrement(IteratorAdaptor& x)
+        { --x.base(); }
+
+    template <class IteratorAdaptor, class DifferenceType>
+    void advance(IteratorAdaptor& x, DifferenceType n)
+        { x.base() += n; }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    typename IteratorAdaptor1::difference_type
+    distance(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+        { return y.base() - x.base(); }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+        { return x.base() == y.base(); }
+};
+
+// putting the comparisons in a base class avoids the g++
+// ambiguous overload bug due to the relops operators
+
+#ifdef BOOST_RELOPS_AMBIGUITY_BUG
+template <class Derived, class Base>
+struct iterator_comparisons : Base { };
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator==(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+        const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().equal(x, y);
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator!=(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return !x.policies().equal(x, y);
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator<(const iterator_comparisons<D1,Base1>& xb,
+                      const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) < 0;
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator>(const iterator_comparisons<D1,Base1>& xb,
+                      const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) > 0;
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator>=(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) >= 0;
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator<=(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) <= 0;
+}
+#endif
+
+namespace detail {
+
+  // operator->() needs special support for input iterators to strictly meet the
+  // standard's requirements. If *i is not a reference type, we must still
+  // produce a (constant) lvalue to which a pointer can be formed. We do that by
+  // returning an instantiation of this special proxy class template.
+
+  template <class T>
+  struct operator_arrow_proxy
+  {
+      operator_arrow_proxy(const T& x) : m_value(x) {}
+      const T* operator->() const { return &m_value; }
+      // This function is needed for MWCW and BCC, which won't call operator->
+      // again automatically per 13.3.1.2 para 8
+      operator const T*() const { return &m_value; }
+      T m_value;
+  };
+
+  template <class Iter>
+  inline operator_arrow_proxy<typename Iter::value_type>
+  operator_arrow(const Iter& i, std::input_iterator_tag) {
+    typedef typename Iter::value_type value_t; // VC++ needs this typedef
+    return operator_arrow_proxy<value_t>(*i);
+  }
+
+  template <class Iter>
+  inline typename Iter::pointer
+  operator_arrow(const Iter& i, std::forward_iterator_tag) {
+    return &(*i);
+  }
+
+  template <class Value, class Reference, class Pointer>
+  struct operator_arrow_result_generator
+  {
+      typedef operator_arrow_proxy<Value> proxy;
+      // Borland chokes unless it's an actual enum (!)
+      enum { use_proxy = !boost::is_reference<Reference>::value };
+
+      typedef typename boost::detail::if_true<(use_proxy)>::template
+      then<
+        proxy,
+   // else
+        Pointer
+      >::type type;
+  };
+
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+   // Select default pointer and reference types for adapted non-pointer
+   // iterators based on the iterator and the value_type. Poor man's partial
+   // specialization is in use here.
+   template <bool is_pointer>
+   struct iterator_defaults_select
+   {
+       template <class Iterator,class Value>
+       struct traits
+       {
+           // The assumption is that iterator_traits can deduce these types
+           // properly as long as the iterator is not a pointer.
+           typedef typename boost::detail::iterator_traits<Iterator>::pointer pointer;
+           typedef typename boost::detail::iterator_traits<Iterator>::reference reference;
+       };
+   };
+
+   // Select default pointer and reference types for adapted pointer iterators
+   // given a (possibly-const) value_type.
+   template <>
+   struct iterator_defaults_select<true>
+   {
+       template <class Iterator,class Value>
+       struct traits
+       {
+           typedef Value* pointer;
+           typedef Value& reference;
+       };
+   };
+
+   // Consolidate selection of the default pointer and reference type
+   template <class Iterator,class Value>
+   struct iterator_defaults
+   {
+       BOOST_STATIC_CONSTANT(bool, is_ptr = boost::is_pointer<Iterator>::value);
+
+       typedef typename iterator_defaults_select<is_ptr>::template traits<Iterator,Value> traits;
+       typedef typename traits::pointer pointer;
+       typedef typename traits::reference reference;
+   };
+# else
+   template <class Iterator,class Value>
+   struct iterator_defaults : iterator_traits<Iterator>
+   {
+       // Trying to factor the common is_same expression into an enum or a
+       // static bool constant confused Borland.
+       typedef typename if_true<(
+               ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
+           )>::template then<
+                typename iterator_traits<Iterator>::pointer,
+                Value*
+       >::type pointer;
+
+       typedef typename if_true<(
+               ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
+           )>::template then<
+                typename iterator_traits<Iterator>::reference,
+                Value&
+       >::type reference;
+
+   };
+# endif
+
+  //===========================================================================
+  // Specify the defaults for iterator_adaptor's template parameters
+
+  struct default_argument { };
+  // This class template is a workaround for MSVC.
+  struct dummy_default_gen {
+    template <class Base, class Traits>
+    struct select { typedef default_argument type; };
+  };
+  // This class template is a workaround for MSVC.
+  template <class Gen> struct default_generator {
+    typedef dummy_default_gen type;
+  };
+
+  struct default_value_type {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename boost::detail::iterator_traits<Base>::value_type type;
+    };
+  };
+  template <> struct default_generator<default_value_type>
+  { typedef default_value_type type; }; // VC++ workaround
+
+  struct default_difference_type {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename boost::detail::iterator_traits<Base>::difference_type type;
+    };
+  };
+  template <> struct default_generator<default_difference_type>
+  { typedef default_difference_type type; }; // VC++ workaround
+
+  struct default_iterator_category {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename boost::detail::iterator_traits<Base>::iterator_category type;
+    };
+  };
+  template <> struct default_generator<default_iterator_category>
+  { typedef default_iterator_category type; }; // VC++ workaround
+
+  struct default_pointer {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename Traits::value_type Value;
+      typedef typename boost::detail::iterator_defaults<Base,Value>::pointer
+        type;
+    };
+  };
+  template <> struct default_generator<default_pointer>
+  { typedef default_pointer type; }; // VC++ workaround
+
+  struct default_reference {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename Traits::value_type Value;
+      typedef typename boost::detail::iterator_defaults<Base,Value>::reference
+        type;
+    };
+  };
+  template <> struct default_generator<default_reference>
+  { typedef default_reference type; }; // VC++ workaround
+
+} // namespace detail
+
+
+  //===========================================================================
+  // Support for named template parameters
+
+struct named_template_param_base { };
+
+namespace detail {
+  struct value_type_tag { };
+  struct reference_tag { };
+  struct pointer_tag { };
+  struct difference_type_tag { };
+  struct iterator_category_tag { };
+
+  // avoid using std::pair because A or B might be a reference type, and g++
+  // complains about forming references to references inside std::pair
+  template <class A, class B>
+  struct cons_type {
+    typedef A first_type;
+    typedef B second_type;
+  };
+
+} // namespace detail
+
+template <class Value> struct value_type_is : public named_template_param_base
+{
+  typedef detail::cons_type<detail::value_type_tag, Value> type;
+};
+template <class Reference> struct reference_is : public named_template_param_base
+{
+  typedef detail::cons_type<detail::reference_tag, Reference> type;
+};
+template <class Pointer> struct pointer_is : public named_template_param_base
+{
+  typedef detail::cons_type<detail::pointer_tag, Pointer> type;
+};
+template <class Difference> struct difference_type_is
+  : public named_template_param_base
+{
+  typedef detail::cons_type<detail::difference_type_tag, Difference> type;
+};
+template <class IteratorCategory> struct iterator_category_is
+  : public named_template_param_base
+{
+  typedef detail::cons_type<detail::iterator_category_tag, IteratorCategory> type;
+};
+
+namespace detail {
+
+  struct end_of_list { };
+
+  // Given an associative list, find the value with the matching key.
+  // An associative list is a list of key-value pairs. The list is
+  // built out of cons_type's and is terminated by end_of_list.
+
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(__BORLANDC__)
+  template <class AssocList, class Key>
+  struct find_param;
+
+  struct find_param_continue {
+    template <class AssocList, class Key2> struct select {
+      typedef typename AssocList::first_type Head;
+      typedef typename Head::first_type Key1;
+      typedef typename Head::second_type Value;
+      typedef typename if_true<(is_same<Key1, Key2>::value)>::template
+      then<Value,
+        typename find_param<typename AssocList::second_type, Key2>::type
+      >::type type;
+    };
+  };
+  struct find_param_end {
+    template <class AssocList, class Key>
+    struct select { typedef detail::default_argument type; };
+  };
+  template <class AssocList> struct find_param_helper1
+  { typedef find_param_continue type; };
+  template <> struct find_param_helper1<end_of_list>
+  { typedef find_param_end type; };
+
+  template <class AssocList, class Key>
+  struct find_param {
+    typedef typename find_param_helper1<AssocList>::type select1;
+    typedef typename select1::template select<AssocList, Key>::type type;
+  };
+# else
+  template <class AssocList, class Key> struct find_param;
+
+  template <class Key>
+  struct find_param<end_of_list, Key> { typedef default_argument type; };
+
+  // Found a matching Key, return the associated Value
+  template <class Key, class Value, class Rest>
+  struct find_param<detail::cons_type< detail::cons_type<Key, Value>, Rest>, Key> {
+    typedef Value type;
+  };
+
+  // Non-matching keys, continue the search
+  template <class Key1, class Value, class Rest, class Key2>
+  struct find_param<detail::cons_type< detail::cons_type<Key1, Value>, Rest>, Key2> {
+    typedef typename find_param<Rest, Key2>::type type;
+  };
+# endif
+
+  struct make_named_arg {
+    template <class Key, class Value>
+    struct select { typedef typename Value::type type; };
+  };
+  struct make_key_value {
+    template <class Key, class Value>
+    struct select { typedef detail::cons_type<Key, Value> type; };
+  };
+
+  template <class Value>
+  struct is_named_parameter
+  {
+      enum { value = is_convertible< typename add_reference< Value >::type, add_reference< named_template_param_base >::type >::value };
+  };
+
+# if defined(__MWERKS__) && __MWERKS__ <= 0x2406 // workaround for broken is_convertible implementation
+  template <class T> struct is_named_parameter<value_type_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<reference_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<pointer_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<difference_type_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<iterator_category_is<T> > { enum { value = true }; };
+# endif
+
+  template <class Key, class Value>
+  struct make_arg {
+# ifdef __BORLANDC__
+    // Borland C++ doesn't like the extra indirection of is_named_parameter
+    typedef typename
+      if_true<(is_convertible<Value,named_template_param_base>::value)>::
+      template then<make_named_arg, make_key_value>::type Make;
+# else
+    enum { is_named = is_named_parameter<Value>::value };
+    typedef typename if_true<(is_named)>::template
+      then<make_named_arg, make_key_value>::type Make;
+# endif
+    typedef typename Make::template select<Key, Value>::type type;
+  };
+
+  // Mechanism for resolving the default argument for a template parameter.
+
+  template <class T> struct is_default { typedef type_traits::no_type type; };
+  template <> struct is_default<default_argument>
+  { typedef type_traits::yes_type type; };
+
+  struct choose_default {
+    template <class Arg, class DefaultGen, class Base, class Traits>
+    struct select {
+      typedef typename default_generator<DefaultGen>::type Gen;
+      typedef typename Gen::template select<Base,Traits>::type type;
+    };
+  };
+  struct choose_arg {
+    template <class Arg, class DefaultGen, class Base, class Traits>
+    struct select {
+      typedef Arg type;
+    };
+  };
+
+  template <class UseDefault>
+  struct choose_arg_or_default { typedef choose_arg type; };
+  template <> struct choose_arg_or_default<type_traits::yes_type> {
+    typedef choose_default type;
+  };
+
+  template <class Arg, class DefaultGen, class Base, class Traits>
+  class resolve_default {
+    typedef typename choose_arg_or_default<typename is_default<Arg>::type>::type
+      Selector;
+  public:
+    typedef typename Selector
+      ::template select<Arg, DefaultGen, Base, Traits>::type type;
+  };
+
+  template <class Base, class Value, class Reference, class Pointer,
+            class Category, class Distance>
+  class iterator_adaptor_traits_gen
+  {
+    // Form an associative list out of the template parameters
+    // If the argument is a normal parameter (not named) then make_arg
+    // creates a key-value pair. If the argument is a named parameter,
+    // then make_arg extracts the key-value pair defined inside the
+    // named parameter.
+    typedef detail::cons_type< typename make_arg<value_type_tag, Value>::type,
+      detail::cons_type<typename make_arg<reference_tag, Reference>::type,
+      detail::cons_type<typename make_arg<pointer_tag, Pointer>::type,
+      detail::cons_type<typename make_arg<iterator_category_tag, Category>::type,
+      detail::cons_type<typename make_arg<difference_type_tag, Distance>::type,
+                end_of_list> > > > > ArgList;
+
+    // Search the list for particular parameters
+    typedef typename find_param<ArgList, value_type_tag>::type Val;
+    typedef typename find_param<ArgList, difference_type_tag>::type Diff;
+    typedef typename find_param<ArgList, iterator_category_tag>::type Cat;
+    typedef typename find_param<ArgList, pointer_tag>::type Ptr;
+    typedef typename find_param<ArgList, reference_tag>::type Ref;
+
+    typedef boost::iterator<Category, Value, Distance, Pointer, Reference>
+      Traits0;
+
+    // Compute the defaults if necessary
+    typedef typename resolve_default<Val, default_value_type, Base, Traits0>::type
+      value_type;
+    // if getting default value type from iterator_traits, then it won't be const
+    typedef typename resolve_default<Diff, default_difference_type, Base,
+      Traits0>::type difference_type;
+    typedef typename resolve_default<Cat, default_iterator_category, Base,
+      Traits0>::type iterator_category;
+
+    typedef boost::iterator<iterator_category, value_type, difference_type,
+      Pointer, Reference> Traits1;
+
+    // Compute the defaults for pointer and reference. This is done as a
+    // separate step because the defaults for pointer and reference depend
+    // on value_type.
+    typedef typename resolve_default<Ptr, default_pointer, Base, Traits1>::type
+      pointer;
+    typedef typename resolve_default<Ref, default_reference, Base, Traits1>::type
+      reference;
+
+  public:
+    typedef boost::iterator<iterator_category,
+      typename remove_const<value_type>::type,
+      difference_type, pointer, reference> type;
+  };
+
+  // This is really a partial concept check for iterators. Should it
+  // be moved or done differently?
+  template <class Category, class Value, class Difference, class Pointer, class Reference>
+  struct validator
+  {
+      BOOST_STATIC_CONSTANT(
+          bool, is_input_or_output_iter
+          = (boost::is_convertible<Category*,std::input_iterator_tag*>::value
+             | boost::is_convertible<Category*,std::output_iterator_tag*>::value));
+
+      // Iterators should satisfy one of the known categories
+      BOOST_STATIC_ASSERT(is_input_or_output_iter);
+
+      // Iterators >= ForwardIterator must produce real references
+      // as required by the C++ standard requirements in Table 74.
+      BOOST_STATIC_CONSTANT(
+          bool, forward_iter_with_real_reference
+          = ((!boost::is_convertible<Category*,std::forward_iterator_tag*>::value)
+             | boost::is_same<Reference,Value&>::value
+             | boost::is_same<Reference,typename add_const<Value>::type&>::value));
+
+      BOOST_STATIC_ASSERT(forward_iter_with_real_reference);
+  };
+} // namespace detail
+
+
+
+// This macro definition is only temporary in this file
+# if !defined(BOOST_MSVC)
+#  define BOOST_ARG_DEPENDENT_TYPENAME typename
+# else
+#  define BOOST_ARG_DEPENDENT_TYPENAME
+# endif
+
+//============================================================================
+//iterator_adaptor - Adapts a generic piece of data as an iterator. Adaptation
+//      is especially easy if the data being adapted is itself an iterator
+//
+//   Base - the base (usually iterator) type being wrapped.
+//
+//   Policies - a set of policies determining how the resulting iterator
+//      works.
+//
+//   Value - if supplied, the value_type of the resulting iterator, unless
+//      const. If const, a conforming compiler strips constness for the
+//      value_type. If not supplied, iterator_traits<Base>::value_type is used
+//
+//   Reference - the reference type of the resulting iterator, and in
+//      particular, the result type of operator*(). If not supplied but
+//      Value is supplied, Value& is used. Otherwise
+//      iterator_traits<Base>::reference is used.
+//
+//   Pointer - the pointer type of the resulting iterator, and in
+//      particular, the result type of operator->(). If not
+//      supplied but Value is supplied, Value* is used. Otherwise
+//      iterator_traits<Base>::pointer is used.
+//
+//   Category - the iterator_category of the resulting iterator. If not
+//      supplied, iterator_traits<Base>::iterator_category is used.
+//
+//   Distance - the difference_type of the resulting iterator. If not
+//      supplied, iterator_traits<Base>::difference_type is used.
+template <class Base, class Policies,
+    class Value = ::boost::detail::default_argument,
+    class Reference = ::boost::detail::default_argument,
+    class Pointer = ::boost::detail::default_argument,
+    class Category = ::boost::detail::default_argument,
+    class Distance = ::boost::detail::default_argument
+         >
+struct iterator_adaptor :
+#ifdef BOOST_RELOPS_AMBIGUITY_BUG
+    iterator_comparisons<
+          iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance>,
+    typename detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category, Distance>::type
+ >
+#else
+    detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance>::type
+#endif
+{
+    typedef iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance> self;
+ public:
+    typedef detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance> TraitsGen;
+    typedef typename TraitsGen::type Traits;
+
+    typedef typename Traits::difference_type difference_type;
+    typedef typename Traits::value_type value_type;
+    typedef typename Traits::pointer pointer;
+    typedef typename Traits::reference reference;
+    typedef typename Traits::iterator_category iterator_category;
+
+    typedef Base base_type;
+    typedef Policies policies_type;
+
+ private:
+    typedef detail::validator<
+        iterator_category,value_type,difference_type,pointer,reference
+        > concept_check;
+
+ public:
+    iterator_adaptor()
+    {
+    }
+
+    explicit
+    iterator_adaptor(const Base& it, const Policies& p = Policies())
+        : m_iter_p(it, p) {
+        policies().initialize(base());
+    }
+
+    template <class Iter2, class Value2, class Pointer2, class Reference2>
+    iterator_adaptor (
+        const iterator_adaptor<Iter2,Policies,Value2,Reference2,Pointer2,Category,Distance>& src)
+            : m_iter_p(src.base(), src.policies())
+    {
+        policies().initialize(base());
+    }
+
+#if defined(BOOST_MSVC) || defined(__BORLANDC__)
+    // This is required to prevent a bug in how VC++ generates
+    // the assignment operator for compressed_pairv
+    iterator_adaptor& operator= (const iterator_adaptor& x) {
+        m_iter_p = x.m_iter_p;
+        return *this;
+    }
+#endif
+    reference operator*() const {
+         return policies().dereference(*this);
+    }
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning( disable : 4284 )
+#endif
+
+    typename boost::detail::operator_arrow_result_generator<value_type,reference,pointer>::type
+    operator->() const
+        { return detail::operator_arrow(*this, iterator_category()); }
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+    value_type operator[](difference_type n) const
+        { return *(*this + n); }
+
+    self& operator++() {
+#if !defined(__MWERKS__) || __MWERKS__ >= 0x2405
+        policies().increment(*this);
+#else
+        // Odd bug, MWERKS couldn't  deduce the type for the member template
+        // Workaround by explicitly specifying the type.
+        policies().increment<self>(*this);
+#endif
+        return *this;
+    }
+
+    self operator++(int) { self tmp(*this); ++*this; return tmp; }
+
+    self& operator--() {
+#if !defined(__MWERKS__) || __MWERKS__ >= 0x2405
+        policies().decrement(*this);
+#else
+        policies().decrement<self>(*this);
+#endif
+        return *this;
+    }
+
+    self operator--(int) { self tmp(*this); --*this; return tmp; }
+
+    self& operator+=(difference_type n) {
+        policies().advance(*this, n);
+        return *this;
+    }
+
+    self& operator-=(difference_type n) {
+        policies().advance(*this, -n);
+        return *this;
+    }
+
+    base_type const& base() const { return m_iter_p.first(); }
+
+    // Moved from global scope to avoid ambiguity with the operator-() which
+    // subtracts iterators from one another.
+    self operator-(difference_type x) const
+        { self result(*this); return result -= x; }
+private:
+    compressed_pair<Base,Policies> m_iter_p;
+
+public: // implementation details (too many compilers have trouble when these are private).
+    base_type& base() { return m_iter_p.first(); }
+    Policies& policies() { return m_iter_p.second(); }
+    const Policies& policies() const { return m_iter_p.second(); }
+};
+
+template <class Base, class Policies, class Value, class Reference, class Pointer,
+    class Category, class Distance1, class Distance2>
+iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
+operator+(
+    iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p,
+    Distance2 x)
+{
+    return p += x;
+}
+
+template <class Base, class Policies, class Value, class Reference, class Pointer,
+    class Category, class Distance1, class Distance2>
+iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
+operator+(
+    Distance2 x,
+    iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p)
+{
+    return p += x;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2, class Category,
+    class Distance>
+typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>::difference_type
+operator-(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+  typedef typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,
+    Pointer1,Category,Distance>::difference_type difference_type;
+  return x.policies().distance(y, x);
+}
+
+#ifndef BOOST_RELOPS_AMBIGUITY_BUG
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator==(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().equal(x, y);
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator<(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) < 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator>(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) > 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator>=(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) >= 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator<=(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) <= 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator!=(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return !x.policies().equal(x, y);
+}
+#endif
+
+//=============================================================================
+// Transform Iterator Adaptor
+//
+// Upon deference, apply some unary function object and return the
+// result by value.
+
+template <class AdaptableUnaryFunction>
+struct transform_iterator_policies : public default_iterator_policies
+{
+    transform_iterator_policies() { }
+    transform_iterator_policies(const AdaptableUnaryFunction& f) : m_f(f) { }
+
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference
+    dereference(const IteratorAdaptor& iter) const
+        { return m_f(*iter.base()); }
+
+    AdaptableUnaryFunction m_f;
+};
+
+template <class AdaptableUnaryFunction, class Iterator>
+class transform_iterator_generator
+{
+    typedef typename AdaptableUnaryFunction::result_type value_type;
+public:
+    typedef iterator_adaptor<Iterator,
+      transform_iterator_policies<AdaptableUnaryFunction>,
+        value_type, value_type, value_type*, std::input_iterator_tag>
+      type;
+};
+
+template <class AdaptableUnaryFunction, class Iterator>
+inline typename transform_iterator_generator<AdaptableUnaryFunction,Iterator>::type
+make_transform_iterator(
+    Iterator base,
+    const AdaptableUnaryFunction& f = AdaptableUnaryFunction())
+{
+    typedef typename transform_iterator_generator<AdaptableUnaryFunction,Iterator>::type result_t;
+    return result_t(base, f);
+}
+
+//=============================================================================
+// Indirect Iterators Adaptor
+
+// Given a pointer to pointers (or iterator to iterators),
+// apply a double dereference inside operator*().
+//
+// We use the term "outer" to refer to the first level iterator type
+// and "inner" to refer to the second level iterator type.  For
+// example, given T**, T* is the inner iterator type and T** is the
+// outer iterator type. Also, const T* would be the const inner
+// iterator.
+
+// We tried to implement this with transform_iterator, but that required
+// using boost::remove_ref, which is not compiler portable.
+
+struct indirect_iterator_policies : public default_iterator_policies
+{
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
+        { return **x.base(); }
+};
+
+namespace detail {
+# if !defined(BOOST_MSVC) // stragely instantiated even when unused! Maybe try a recursive template someday ;-)
+  template <class T>
+  struct traits_of_value_type {
+      typedef typename boost::detail::iterator_traits<T>::value_type outer_value;
+      typedef typename boost::detail::iterator_traits<outer_value>::value_type value_type;
+      typedef typename boost::detail::iterator_traits<outer_value>::reference reference;
+      typedef typename boost::detail::iterator_traits<outer_value>::pointer pointer;
+  };
+# endif
+}
+
+template <class OuterIterator,      // Mutable or Immutable, does not matter
+          class Value
+#if !defined(BOOST_MSVC)
+                = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
+                        OuterIterator>::value_type
+#endif
+          , class Reference
+#if !defined(BOOST_MSVC)
+                = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
+                        OuterIterator>::reference
+#else
+                = Value &
+#endif
+          , class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<
+                        OuterIterator>::iterator_category
+          , class Pointer
+#if !defined(BOOST_MSVC)
+                = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
+                        OuterIterator>::pointer
+#else
+                = Value*
+#endif
+         >
+struct indirect_iterator_generator
+{
+    typedef iterator_adaptor<OuterIterator,
+        indirect_iterator_policies,Value,Reference,Pointer,Category> type;
+};
+
+template <class OuterIterator,      // Mutable or Immutable, does not matter
+          class Value
+#if !defined(BOOST_MSVC)
+                = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
+                        OuterIterator>::value_type
+#endif
+          , class Reference
+#if !defined(BOOST_MSVC)
+                = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
+                        OuterIterator>::reference
+#else
+                = Value &
+#endif
+          , class ConstReference = const Value&
+          , class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<
+                OuterIterator>::iterator_category
+          , class Pointer
+#if !defined(BOOST_MSVC)
+                = BOOST_ARG_DEPENDENT_TYPENAME detail::traits_of_value_type<
+                        OuterIterator>::pointer
+#else
+                = Value*
+#endif
+          , class ConstPointer = const Value*
+           >
+struct indirect_iterator_pair_generator
+{
+  typedef typename indirect_iterator_generator<OuterIterator,
+    Value, Reference,Category,Pointer>::type iterator;
+  typedef typename indirect_iterator_generator<OuterIterator,
+    Value, ConstReference,Category,ConstPointer>::type const_iterator;
+};
+
+#ifndef BOOST_MSVC
+template <class OuterIterator>
+inline typename indirect_iterator_generator<OuterIterator>::type
+make_indirect_iterator(OuterIterator base)
+{
+    typedef typename indirect_iterator_generator
+        <OuterIterator>::type result_t;
+    return result_t(base);
+}
+#endif
+
+//=============================================================================
+// Reverse Iterators Adaptor
+
+struct reverse_iterator_policies : public default_iterator_policies
+{
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
+        { return *boost::prior(x.base()); }
+
+    template <class BidirectionalIterator>
+    void increment(BidirectionalIterator& x) const
+        { --x.base(); }
+
+    template <class BidirectionalIterator>
+    void decrement(BidirectionalIterator& x) const
+        { ++x.base(); }
+
+    template <class BidirectionalIterator, class DifferenceType>
+    void advance(BidirectionalIterator& x, DifferenceType n) const
+        { x.base() -= n; }
+
+    template <class Iterator1, class Iterator2>
+    typename Iterator1::difference_type distance(
+        const Iterator1& x, const Iterator2& y) const
+        { return x.base() - y.base(); }
+
+    template <class Iterator1, class Iterator2>
+    bool equal(const Iterator1& x, const Iterator2& y) const
+        { return x.base() == y.base(); }
+};
+
+template <class BidirectionalIterator,
+    class Value = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<BidirectionalIterator>::value_type,
+    class Reference = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<BidirectionalIterator,Value>::reference,
+    class Pointer = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<BidirectionalIterator,Value>::pointer,
+    class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<BidirectionalIterator>::iterator_category,
+    class Distance = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<BidirectionalIterator>::difference_type
+         >
+struct reverse_iterator_generator
+{
+    typedef iterator_adaptor<BidirectionalIterator,reverse_iterator_policies,
+        Value,Reference,Pointer,Category,Distance> type;
+};
+
+template <class BidirectionalIterator>
+inline typename reverse_iterator_generator<BidirectionalIterator>::type
+make_reverse_iterator(BidirectionalIterator base)
+{
+    typedef typename reverse_iterator_generator<BidirectionalIterator>::type result_t;
+    return result_t(base);
+}
+
+//=============================================================================
+// Projection Iterators Adaptor
+
+template <class AdaptableUnaryFunction>
+struct projection_iterator_policies : public default_iterator_policies
+{
+    projection_iterator_policies() { }
+    projection_iterator_policies(const AdaptableUnaryFunction& f) : m_f(f) { }
+
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(IteratorAdaptor const& iter) const {
+        return m_f(*iter.base());
+    }
+
+    AdaptableUnaryFunction m_f;
+};
+
+template <class AdaptableUnaryFunction, class Iterator>
+class projection_iterator_generator {
+    typedef typename AdaptableUnaryFunction::result_type value_type;
+    typedef projection_iterator_policies<AdaptableUnaryFunction> policies;
+public:
+    typedef iterator_adaptor<Iterator,policies,value_type,value_type&,value_type*> type;
+};
+
+template <class AdaptableUnaryFunction, class Iterator>
+class const_projection_iterator_generator {
+    typedef typename AdaptableUnaryFunction::result_type value_type;
+    typedef projection_iterator_policies<AdaptableUnaryFunction> policies;
+public:
+    typedef iterator_adaptor<Iterator,policies,value_type,const value_type&,const value_type*> type;
+};
+
+template <class AdaptableUnaryFunction, class Iterator, class ConstIterator>
+struct projection_iterator_pair_generator {
+    typedef typename projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type iterator;
+    typedef typename const_projection_iterator_generator<AdaptableUnaryFunction, ConstIterator>::type const_iterator;
+};
+
+
+template <class AdaptableUnaryFunction, class Iterator>
+inline typename projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type
+make_projection_iterator(
+    Iterator iter,
+    const AdaptableUnaryFunction& f = AdaptableUnaryFunction())
+{
+    typedef typename projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type result_t;
+    return result_t(iter, f);
+}
+
+template <class AdaptableUnaryFunction, class Iterator>
+inline typename const_projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type
+make_const_projection_iterator(
+    Iterator iter,
+    const AdaptableUnaryFunction& f = AdaptableUnaryFunction())
+{
+    typedef typename const_projection_iterator_generator<AdaptableUnaryFunction, Iterator>::type result_t;
+    return result_t(iter, f);
+}
+
+//=============================================================================
+// Filter Iterator Adaptor
+
+template <class Predicate, class Iterator>
+class filter_iterator_policies
+{
+public:
+    filter_iterator_policies() { }
+
+    filter_iterator_policies(const Predicate& p, const Iterator& end)
+        : m_predicate(p), m_end(end) { }
+
+    void initialize(Iterator& x) {
+        satisfy_predicate(x);
+    }
+
+    // The Iter template argument is neccessary for compatibility with a MWCW
+    // bug workaround
+    template <class IteratorAdaptor>
+    void increment(IteratorAdaptor& x) {
+        ++x.base();
+        satisfy_predicate(x.base());
+    }
+
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
+        { return *x.base(); }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+        { return x.base() == y.base(); }
+
+ private:
+    void satisfy_predicate(Iterator& iter);
+    Predicate m_predicate;
+    Iterator m_end;
+};
+
+template <class Predicate, class Iterator>
+void filter_iterator_policies<Predicate,Iterator>::satisfy_predicate(
+    Iterator& iter)
+{
+    while (m_end != iter && !m_predicate(*iter))
+        ++iter;
+}
+
+
+
+namespace detail {
+  // A type generator returning Base if T is derived from Base, and T otherwise.
+  template <class Base, class T>
+  struct reduce_to_base_class
+  {
+      typedef typename if_true<(
+            ::boost::is_convertible<T*,Base*>::value
+          )>::template then<Base,T>::type type;
+  };
+
+  // "Steps down" the category of iterators below bidirectional so the category
+  // can be used with filter iterators.
+  template <class Iterator>
+  struct non_bidirectional_category
+  {
+# if !defined(__MWERKS__) || __MWERKS__ > 0x2406
+      typedef typename reduce_to_base_class<
+              std::forward_iterator_tag,
+                   typename iterator_traits<Iterator>::iterator_category
+      >::type type;
+   private:
+      // For some reason, putting this assertion in filter_iterator_generator fails inexplicably under MSVC
+      BOOST_STATIC_CONSTANT(
+          bool, is_bidirectional
+          = (!boost::is_convertible<type*, std::bidirectional_iterator_tag*>::value));
+      BOOST_STATIC_ASSERT(is_bidirectional);
+# else
+      // is_convertible doesn't work with MWERKS
+      typedef typename iterator_traits<Iterator>::iterator_category input_category;
+  public:
+      typedef typename if_true<(
+          boost::is_same<input_category,std::random_access_iterator_tag>::value
+          || boost::is_same<input_category,std::bidirectional_iterator_tag>::value
+        )>::template then<
+          std::forward_iterator_tag,
+          input_category
+      >::type type;
+# endif
+  };
+}
+
+template <class Predicate, class Iterator,
+    class Value = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<Iterator>::value_type,
+    class Reference = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<Iterator,Value>::reference,
+    class Pointer = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_defaults<Iterator,Value>::pointer,
+    class Category = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::non_bidirectional_category<Iterator>::type,
+    class Distance = BOOST_ARG_DEPENDENT_TYPENAME boost::detail::iterator_traits<Iterator>::difference_type
+         >
+class filter_iterator_generator {
+    BOOST_STATIC_CONSTANT(bool, is_bidirectional
+        = (boost::is_convertible<Category*, std::bidirectional_iterator_tag*>::value));
+#ifndef BOOST_MSVC // I don't have any idea why this occurs, but it doesn't seem to hurt too badly.
+    BOOST_STATIC_ASSERT(!is_bidirectional);
+#endif
+    typedef filter_iterator_policies<Predicate,Iterator> policies_type;
+ public:
+    typedef iterator_adaptor<Iterator,policies_type,
+        Value,Reference,Pointer,Category,Distance> type;
+};
+
+// This keeps MSVC happy; it doesn't like to deduce default template arguments
+// for template function return types
+namespace detail {
+  template <class Predicate, class Iterator>
+  struct filter_generator {
+    typedef typename boost::filter_iterator_generator<Predicate,Iterator>::type type;
+  };
+}
+
+template <class Predicate, class Iterator>
+inline typename detail::filter_generator<Predicate, Iterator>::type
+make_filter_iterator(Iterator first, Iterator last, const Predicate& p = Predicate())
+{
+  typedef filter_iterator_generator<Predicate, Iterator> Gen;
+  typedef filter_iterator_policies<Predicate,Iterator> policies_t;
+  typedef typename Gen::type result_t;
+  return result_t(first, policies_t(p, last));
+}
+
+} // namespace boost
+# undef BOOST_ARG_DEPENDENT_TYPENAME
+
+
+#endif
+
+
+
diff --git a/boost/boost/last_value.hpp b/boost/boost/last_value.hpp
new file mode 100644 (file)
index 0000000..a992065
--- /dev/null
@@ -0,0 +1,54 @@
+// last_value function object (documented as part of Boost.Signals)
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_LAST_VALUE_HPP
+#define BOOST_LAST_VALUE_HPP
+
+#include <cassert>
+
+namespace boost {
+  template<typename T>
+  struct last_value {
+    typedef T result_type;
+    
+    template<typename InputIterator>
+    T operator()(InputIterator first, InputIterator last) const
+    {
+      assert(first != last);
+      T value = *first++;
+      while (first != last)
+        value = *first++;
+      return value;
+    }
+  };
+  
+  template<>
+  class last_value<void> {
+    struct unusable {};
+
+  public:
+    typedef unusable result_type;
+    
+    template<typename InputIterator>
+    result_type
+    operator()(InputIterator first, InputIterator last) const
+    {
+      while (first != last)
+        *first++;
+      return result_type();
+    }
+  };
+}
+#endif // BOOST_SIGNALS_LAST_VALUE_HPP
diff --git a/boost/boost/lexical_cast.hpp b/boost/boost/lexical_cast.hpp
new file mode 100644 (file)
index 0000000..83464af
--- /dev/null
@@ -0,0 +1,76 @@
+//  boost lexical_cast.hpp header  -------------------------------------------//
+
+//  See http://www.boost.org for most recent version including documentation.
+
+#ifndef BOOST_LEXICAL_CAST_INCLUDED
+#define BOOST_LEXICAL_CAST_INCLUDED
+
+// what:  lexical_cast custom keyword cast
+// who:   contributed by Kevlin Henney, with alternative naming, behaviors
+//        and fixes contributed by Dave Abrahams, Daryle Walker and other
+//        Boosters on the list
+// when:  November 2000
+// where: tested with MSVC 6.0, BCC 5.5, and g++ 2.91
+
+#include <boost/config.hpp>
+
+// Some sstream implementations are broken for the purposes of lexical cast.
+# if defined(BOOST_NO_STRINGSTREAM)
+#  define BOOST_LEXICAL_CAST_USE_STRSTREAM
+# endif
+
+#ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM
+# include <strstream>
+#else
+# include <sstream>
+#endif
+
+#include <typeinfo>
+
+namespace boost
+{
+    // exception used to indicate runtime lexical_cast failure
+    class bad_lexical_cast : public std::bad_cast
+    {
+    public:
+        // constructors, destructors, and assignment operator defaulted
+
+        // function inlined for brevity and consistency with rest of library
+        virtual const char * what() const throw()
+        {
+            return "bad lexical cast: "
+                   "source type value could not be interpreted as target";
+        }
+    };
+
+    template<typename Target, typename Source>
+    Target lexical_cast(Source arg)
+    {
+# ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM
+        std::strstream interpreter; // for out-of-the-box g++ 2.95.2
+# else
+        std::stringstream interpreter;
+# endif
+        Target result;
+
+        if(!(interpreter << arg) || !(interpreter >> result) ||
+           !(interpreter >> std::ws).eof())
+            throw bad_lexical_cast();
+
+        return result;
+    }
+}
+
+// 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.
+
+#ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM
+# undef BOOST_LEXICAL_CAST_USE_STRSTREAM
+#endif
+
+#endif
diff --git a/boost/boost/mem_fn.hpp b/boost/boost/mem_fn.hpp
new file mode 100644 (file)
index 0000000..f59fff4
--- /dev/null
@@ -0,0 +1,265 @@
+#ifndef BOOST_MEM_FN_HPP_INCLUDED
+#define BOOST_MEM_FN_HPP_INCLUDED
+
+#if _MSC_VER+0 >= 1020
+#pragma once
+#endif
+
+//
+//  mem_fn.hpp - a generalization of std::mem_fun[_ref]
+//
+//  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.
+//
+//  See http://www.boost.org/libs/bind/mem_fn.html for documentation.
+//
+
+#include <boost/config.hpp>
+
+namespace boost
+{
+
+// get_pointer(p) extracts a ->* capable pointer from p
+
+template<class T> T * get_pointer(T * p)
+{
+    return p;
+}
+
+// get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
+
+#if defined(BOOST_NO_VOID_RETURNS)
+
+#define BOOST_MEM_FN_CLASS_F , class F
+#define BOOST_MEM_FN_TYPEDEF(X)
+
+namespace _mfi // mem_fun_impl
+{
+
+template<class V> struct mf
+{
+
+#define BOOST_MEM_FN_RETURN return
+
+#define BOOST_MEM_FN_NAME(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+}; // struct mf<V>
+
+template<> struct mf<void>
+{
+
+#define BOOST_MEM_FN_RETURN
+
+#define BOOST_MEM_FN_NAME(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+}; // struct mf<void>
+
+#undef BOOST_MEM_FN_CLASS_F
+#undef BOOST_MEM_FN_TYPEDEF_F
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_NAME2(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+} // namespace _mfi
+
+#else // #ifdef BOOST_NO_VOID_RETURNS
+
+#define BOOST_MEM_FN_CLASS_F
+#define BOOST_MEM_FN_TYPEDEF(X) typedef X;
+
+namespace _mfi
+{
+
+#define BOOST_MEM_FN_RETURN return
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+} // namespace _mfi
+
+#undef BOOST_MEM_FN_CLASS_F
+#undef BOOST_MEM_FN_TYPEDEF
+
+#endif // #ifdef BOOST_NO_VOID_RETURNS
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+// data member support
+
+namespace _mfi
+{
+
+template<class R, class T> class dm
+{
+public:
+
+    typedef R const & result_type;
+    typedef T const * argument_type;
+
+private:
+    
+    typedef R (T::*F);
+    F f_;
+
+    template<class U> R const & call(U & u, T const *) const
+    {
+        return (u.*f_);
+    }
+
+    template<class U> R & call(U & u, T *) const
+    {
+        return (u.*f_);
+    }
+
+    template<class U> R const & call(U & u, void const *) const
+    {
+        return (get_pointer(u)->*f_);
+    }
+
+public:
+    
+    explicit dm(F f): f_(f) {}
+
+    R & operator()(T * p) const
+    {
+        return (p->*f_);
+    }
+
+    R const & operator()(T const * p) const
+    {
+        return (p->*f_);
+    }
+
+    template<class U> R const & operator()(U & u) const
+    {
+        return call(u, &u);
+    }
+
+#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1300)
+
+    R & operator()(T & t) const
+    {
+        return (t.*f_);
+    }
+
+#endif
+
+    R const & operator()(T const & t) const
+    {
+        return (t.*f_);
+    }
+};
+
+} // namespace _mfi
+
+template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
+{
+    return _mfi::dm<R, T>(f);
+}
+
+} // namespace boost
+
+#endif // #ifndef BOOST_MEM_FN_HPP_INCLUDED
diff --git a/boost/boost/min_rand.hpp b/boost/boost/min_rand.hpp
new file mode 100644 (file)
index 0000000..960b5dd
--- /dev/null
@@ -0,0 +1,71 @@
+//  Boost min_rand.hpp header file  ------------------------------------------//
+
+//  (C) Copyright Beman Dawes 1998. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  Version 1.1, 25 May 99  Add operator()() to meet Generator requirements
+//  Version 1.0,  9 Nov 98  Initial version
+
+#ifndef BOOST_MIN_RAND_HPP
+#define BOOST_MIN_RAND_HPP
+
+#include <cassert>
+
+namespace boost {
+
+//  min_rand  ----------------------------------------------------------------//
+
+//  see min_rand.html for documentation
+
+class min_rand {
+
+  //  Don't even think about changing the values of the constants below.
+  //  See the article cited in the documentation for rationale.
+  enum constants {
+    modulus = 2147483647L,
+    multiplier = 48271L,          // 16807L for original "minimal standard"
+    validation = 399268537L,      // 1043618065L for original "minimal standard"
+    q = modulus / multiplier, 
+    r = modulus % multiplier
+    };
+
+  long value;                     // invariant: 0 < value <= modulus
+
+ public:
+
+  //  compiler generated copy constructor and operator= are valid and useful
+
+  explicit min_rand( long seed_value=1 ) : value( seed_value )
+                              { assert( value > 0 && value <= modulus ); }
+
+  operator long() const       { return value; }
+  double fvalue() const       { return double(value) / modulus; }
+
+  min_rand& operator=( long new_value ) {
+                                value = new_value;
+                                assert( value > 0 && value <= modulus );
+                                return *this;
+                              }
+
+  long operator++()           { value = multiplier*(value%q) - r*(value/q);
+                                if ( value <= 0 ) value += modulus;
+                                assert( value > 0 && value <= modulus );
+                                return value;
+                              }
+  long operator++(int)        { long temp = value; operator++(); return temp; }
+
+  long ten_thousandth() const { return validation; }
+
+  //  satisfy std::RandomNumberGenerator and std::Generator requirements:
+  typedef long  argument_type;
+  typedef long  result_type;
+  long operator()( long n )   { return operator++() % n; }
+  long operator()()           { return operator++(); }
+
+  }; // min_rand
+
+} // namespace boost
+
+#endif  // BOOST_MIN_RAND_HPP
diff --git a/boost/boost/multi_array.hpp b/boost/boost/multi_array.hpp
new file mode 100644 (file)
index 0000000..a9481b9
--- /dev/null
@@ -0,0 +1,185 @@
+#ifndef BOOST_MULTI_ARRAY_RG071801_HPP
+#define BOOST_MULTI_ARRAY_RG071801_HPP
+
+//
+// multi_array.hpp - contains the multi_array class template
+// declaration and definition
+//
+
+#include "boost/multi_array/base.hpp"
+#include "boost/multi_array/collection_concept.hpp"
+#include "boost/multi_array/copy_array.hpp"
+#include "boost/multi_array/iterator.hpp"
+#include "boost/multi_array/subarray.hpp"
+#include "boost/multi_array/multi_array_ref.hpp"
+#include "boost/multi_array/algorithm.hpp"
+#include "boost/array.hpp"
+#include "boost/type_traits.hpp"
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <numeric>
+#include <vector>
+
+namespace boost {
+
+template<typename T, std::size_t NumDims,
+  typename Allocator>
+class multi_array : 
+  public multi_array_ref<T,NumDims>
+{
+  typedef multi_array_ref<T,NumDims> super_type;
+public: 
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::reference reference;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::iterator iterator;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::iter_base iter_base;
+  typedef typename super_type::const_iter_base const_iter_base;
+  typedef typename super_type::reverse_iterator reverse_iterator;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::element element;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::difference_type difference_type;
+  typedef typename super_type::index index;
+  typedef typename super_type::extent_range extent_range;
+
+
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  template <class ExtentList>
+  explicit multi_array(ExtentList const& extents) :
+    super_type((T*)initial_base_,extents) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+    allocate_space();
+  }
+
+  template <class ExtentList>
+  explicit multi_array(ExtentList const& extents,
+                      const general_storage_order<NumDims>& so) : 
+    super_type((T*)initial_base_,extents,so) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+    allocate_space();
+  }
+
+  template <class ExtentList>
+  explicit multi_array(ExtentList const& extents,
+                      const general_storage_order<NumDims>& so,
+                      Allocator const& alloc) :
+    super_type((T*)initial_base_,extents,so), allocator_(alloc) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+    allocate_space();
+  }
+
+
+  explicit multi_array(const detail::multi_array
+                      ::extent_gen<NumDims>& ranges) :
+    super_type((T*)initial_base_,ranges) {
+
+    allocate_space();
+  }
+
+
+  explicit multi_array(const detail::multi_array
+                      ::extent_gen<NumDims>& ranges,
+                      const general_storage_order<NumDims>& so) :
+    super_type((T*)initial_base_,ranges,so) {
+
+    allocate_space();
+  }
+
+
+  explicit multi_array(const detail::multi_array
+                      ::extent_gen<NumDims>& ranges,
+                      const general_storage_order<NumDims>& so,
+                      Allocator const& alloc) :
+    super_type((T*)initial_base_,ranges,so), allocator_(alloc) {
+
+    allocate_space();
+  }
+
+  multi_array(const multi_array& rhs) :
+  super_type(rhs), allocator_(rhs.allocator_) {
+    allocate_space();
+    boost::copy_n(rhs.base_,rhs.num_elements(),base_);
+  }
+
+  template <typename OPtr>
+  multi_array(const detail::multi_array::
+             const_sub_array<T,NumDims,OPtr>& rhs) :
+    super_type(rhs) {
+    allocate_space();
+    std::copy(rhs.begin(),rhs.end(),begin());
+  }
+
+  // For some reason, gcc 2.95.2 doesn't pick the above template
+  // member function when passed a subarray, so i was forced to
+  // duplicate the functionality here...
+  multi_array(const detail::multi_array::
+             sub_array<T,NumDims>& rhs) :
+    super_type(rhs) {
+    allocate_space();
+    std::copy(rhs.begin(),rhs.end(),begin());
+  }
+
+  // Since assignment is a deep copy, multi_array_ref 
+  // contains all the necessary code.
+  template <typename ConstMultiArray>
+  multi_array& operator=(const ConstMultiArray& other) {
+    super_type::operator=(other);
+    return *this;
+  }
+
+  multi_array& operator=(const multi_array& other) {
+    if (&other != this) {
+      super_type::operator=(other);
+    }
+    return *this;
+  }
+
+
+  ~multi_array() {
+    deallocate_space();
+  }
+
+private:
+  void allocate_space() {
+    typename Allocator::const_pointer no_hint=0;
+    base_ = allocator_.allocate(super_type::num_elements(),no_hint);
+    super_type::set_base_ptr(base_);
+    allocated_elements_ = super_type::num_elements();
+    std::uninitialized_fill_n(base_,allocated_elements_,T());
+  }
+
+  void deallocate_space() {
+    if(base_) {
+      for(T* i = base_; i != base_+allocated_elements_; ++i)
+       allocator_.destroy(i);
+      allocator_.deallocate(base_,allocated_elements_);
+    }
+  }    
+  
+  typedef boost::array<size_type,NumDims> size_list;
+  typedef boost::array<index,NumDims> index_list;
+
+  Allocator allocator_;
+  T* base_;
+  size_type allocated_elements_;
+  enum {initial_base_ = 0};
+};
+
+} // namespace boost
+
+#endif // BOOST_MULTI_ARRAY_RG071801_HPP
diff --git a/boost/boost/multi_array/algorithm.hpp b/boost/boost/multi_array/algorithm.hpp
new file mode 100644 (file)
index 0000000..71e07e7
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef BOOST_ALGORITHM_RG071801_HPP
+#define BOOST_ALGORITHM_RG071801_HPP
+
+//
+//
+// Copyright (c) 1994
+// Hewlett-Packard Company
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation.  Hewlett-Packard Company makes no
+// representations about the suitability of this software for any
+// purpose.  It is provided "as is" without express or implied warranty.
+//
+//
+// Copyright (c) 1996-1998
+// Silicon Graphics Computer Systems, Inc.
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation.  Silicon Graphics makes no
+// representations about the suitability of this software for any
+// purpose.  It is provided "as is" without express or implied warranty.
+//
+
+#include "boost/iterator.hpp"
+
+namespace boost {
+
+//--------------------------------------------------
+// copy_n (not part of the C++ standard)
+#if 1
+
+template <class InputIter, class Size, class OutputIter>
+OutputIter copy_n(InputIter first, Size count,
+                 OutputIter result) {
+  for ( ; count > 0; --count) {
+    *result = *first;
+    ++first;
+    ++result;
+  }
+  return result;
+}
+#else // !1
+
+template <class InputIter, class Size, class OutputIter>
+OutputIter copy_n__(InputIter first, Size count,
+                                       OutputIter result,
+                                       std::input_iterator_tag) {
+  for ( ; count > 0; --count) {
+    *result = *first;
+    ++first;
+    ++result;
+  }
+  return result;
+}
+
+template <class RAIter, class Size, class OutputIter>
+inline OutputIter
+copy_n__(RAIter first, Size count,
+         OutputIter result,
+         std::random_access_iterator_tag) {
+  RAIter last = first + count;
+  return std::copy(first, last, result);
+}
+
+template <class InputIter, class Size, class OutputIter>
+inline OutputIter
+copy_n__(InputIter first, Size count, OutputIter result) {
+  typedef std::iterator_traits<InputIter>::iterator_category cat;
+  return copy_n__(first, count, result, cat());
+}
+
+template <class InputIter, class Size, class OutputIter>
+inline OutputIter
+copy_n(InputIter first, Size count, OutputIter result) {
+  return copy_n__(first, count, result);
+}
+
+#endif // 1
+
+} // namespace boost
+
+#endif // BOOST_ALGORITHM_RG071801_HPP
diff --git a/boost/boost/multi_array/base.hpp b/boost/boost/multi_array/base.hpp
new file mode 100644 (file)
index 0000000..67807d2
--- /dev/null
@@ -0,0 +1,448 @@
+#ifndef BASE_RG071801_HPP
+#define BASE_RG071801_HPP
+
+//
+// base.hpp - some implementation base classes for from which
+// functionality is acquired
+//
+
+#include "boost/multi_array/extent_range.hpp"
+#include "boost/multi_array/extent_gen.hpp"
+#include "boost/multi_array/index_range.hpp"
+#include "boost/multi_array/index_gen.hpp"
+#include "boost/multi_array/storage_order.hpp"
+#include "boost/multi_array/types.hpp"
+#include "boost/config.hpp"
+#include "boost/multi_array/iterator_adaptors.hpp"
+#include "boost/static_assert.hpp"
+#include "boost/type.hpp"
+#include <cassert>
+#include <cstddef>
+#include <memory>
+
+namespace boost {
+
+/////////////////////////////////////////////////////////////////////////
+// class declarations
+/////////////////////////////////////////////////////////////////////////
+
+template<typename T, std::size_t NumDims,
+  typename Allocator = std::allocator<T> >
+class multi_array;
+
+// This is a public interface for use by end users!
+namespace multi_array_types {
+  typedef boost::detail::multi_array::size_type size_type;
+  typedef std::ptrdiff_t difference_type;
+  typedef boost::detail::multi_array::index index;
+  typedef detail::multi_array::index_range<index,size_type> index_range;
+  typedef detail::multi_array::extent_range<index,size_type> extent_range;
+  typedef detail::multi_array::index_gen<0,0> index_gen;
+  typedef detail::multi_array::extent_gen<0> extent_gen;
+}
+
+
+// boost::extents and boost::indices are now a part of the public
+// interface.  That way users don't necessarily have to create their 
+// own objects.  On the other hand, one may not want the overhead of 
+// object creation in small-memory environments.  Thus, the objects
+// can be left undefined by defining BOOST_MULTI_ARRAY_NO_GENERATORS 
+// before loading multi_array.hpp.
+#if !BOOST_MULTI_ARRAY_NO_GENERATORS
+namespace {
+  multi_array_types::extent_gen extents;
+  multi_array_types::index_gen indices;
+}
+#endif // BOOST_MULTI_ARRAY_NO_GENERATORS
+
+namespace detail {
+namespace multi_array {
+
+template <typename T, std::size_t NumDims>
+class sub_array;
+
+template <typename T, std::size_t NumDims, typename TPtr = const T*>
+class const_sub_array;
+
+template <typename T, std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct iterator_generator;
+
+template <typename T, std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct const_iterator_generator;
+
+template <typename T, std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct reverse_iterator_generator;
+
+template <typename T, std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct const_reverse_iterator_generator;
+
+template <typename T,typename TPtr>
+struct iterator_base;
+
+template <typename T, std::size_t NumDims>
+struct iterator_policies;
+
+template <typename T, std::size_t NumDims, typename TPtr = const T*>
+class const_multi_array_view;
+
+template <typename T, std::size_t NumDims>
+class multi_array_view;
+
+/////////////////////////////////////////////////////////////////////////
+// class interfaces
+/////////////////////////////////////////////////////////////////////////
+
+class multi_array_base {
+public:
+  typedef multi_array_types::size_type size_type;
+  typedef multi_array_types::difference_type difference_type;
+  typedef multi_array_types::index index;
+  typedef multi_array_types::index_range index_range;
+  typedef multi_array_types::extent_range extent_range;
+  typedef multi_array_types::index_gen index_gen;
+  typedef multi_array_types::extent_gen extent_gen;
+};
+
+//
+// value_accessor_n
+//  contains the routines for accessing elements from
+//  N-dimensional views.
+//
+template<typename T, std::size_t NumDims>
+class value_accessor_n : public multi_array_base {
+  typedef multi_array_base super_type;
+public:
+  typedef typename super_type::index index;
+
+  // 
+  // public typedefs used by classes that inherit from this base
+  //
+  typedef T element;
+  typedef boost::multi_array<T,NumDims-1> value_type;
+  typedef sub_array<T,NumDims-1> reference;
+  typedef const_sub_array<T,NumDims-1> const_reference;
+
+protected:
+  // used by array operator[] and iterators to get reference types.
+  template <typename Reference, typename TPtr>
+  Reference access(boost::type<Reference>,index idx,TPtr base,
+                  const size_type* extents,
+                  const index* strides,
+                  const index* index_base) const {
+
+    // return a sub_array<T,NDims-1> proxy object
+    TPtr newbase = base + idx * strides[0];
+    return Reference(newbase,extents+1,strides+1,index_base+1);
+
+  }
+
+  value_accessor_n() { }
+  ~value_accessor_n() { }
+};
+
+
+
+//
+// value_accessor_one
+//  contains the routines for accessing reference elements from
+//  1-dimensional views.
+//
+template<typename T>
+class value_accessor_one : public multi_array_base {
+  typedef multi_array_base super_type;
+public:
+  typedef typename super_type::index index;
+  //
+  // public typedefs for use by classes that inherit it.
+  //
+  typedef T element;
+  typedef T value_type;
+  typedef T& reference;
+  typedef T const& const_reference;
+
+protected:
+  // used by array operator[] and iterators to get reference types.
+  template <typename Reference, typename TPtr>
+  Reference access(boost::type<Reference>,index idx,TPtr base,
+                  const size_type*,
+                  const index* strides,
+                  const index*) const {
+    return *(base + idx * strides[0]);
+  }
+
+  value_accessor_one() { }
+  ~value_accessor_one() { }
+};
+
+
+/////////////////////////////////////////////////////////////////////////
+// choose value accessor begins
+//
+
+struct choose_value_accessor_n {
+  template <typename T, std::size_t NumDims>
+  struct bind {
+    typedef value_accessor_n<T,NumDims> type;
+  };
+};
+
+struct choose_value_accessor_one {
+  template <typename T, std::size_t NumDims>
+  struct bind {
+    typedef value_accessor_one<T> type;
+  };
+};
+
+
+template <std::size_t NumDims>
+struct value_accessor_gen_helper {
+  typedef choose_value_accessor_n choice;
+};
+
+template <>
+struct value_accessor_gen_helper<1> {
+  typedef choose_value_accessor_one choice;
+};
+
+template <typename T, std::size_t NumDims>
+struct value_accessor_generator {
+private:
+  typedef typename value_accessor_gen_helper<NumDims>::choice Choice;
+public:
+  typedef typename Choice::template bind<T,NumDims>::type type;
+};
+
+//
+// choose value accessor ends
+/////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////
+// multi_array/sub_array base stuffs
+/////////////////////////////////////////////////////////////////////////
+template <std::size_t NumDims>
+struct iterator_tag_selector {
+  typedef std::input_iterator_tag type;
+};
+
+template <>
+struct iterator_tag_selector<1> {
+  typedef std::random_access_iterator_tag type;
+};
+
+
+////////////////////////////////////////////////////////////////////////
+// multi_array_base
+////////////////////////////////////////////////////////////////////////
+template <typename T, std::size_t NumDims>
+class multi_array_impl_base :
+  public value_accessor_generator<T,NumDims>::type {
+  typedef typename value_accessor_generator<T,NumDims>::type super_type;
+public:
+  typedef typename super_type::index index;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::element element;
+  typedef typename super_type::index_range index_range;
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::reference reference;
+  typedef typename super_type::const_reference const_reference;
+
+  template <std::size_t NDims>
+  struct subarray {
+    typedef boost::detail::multi_array::sub_array<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct const_subarray {
+    typedef boost::detail::multi_array::const_sub_array<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct const_array_view {
+  public:
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  //
+  // iterator support
+  //
+
+  typedef typename iterator_tag_selector<NumDims>::type iterator_tag;
+
+  typedef typename
+    iterator_generator<T,NumDims,value_type,
+    reference,iterator_tag,index>::type iterator;
+
+  typedef typename
+    const_iterator_generator<T,NumDims,value_type,
+    const_reference,iterator_tag,index>::type const_iterator;
+
+  typedef typename
+    reverse_iterator_generator<T,NumDims,value_type,
+    reference,iterator_tag,index>::type reverse_iterator;
+
+  typedef typename
+    const_reverse_iterator_generator<T,NumDims,value_type,
+    const_reference,iterator_tag,index>::type const_reverse_iterator;
+
+protected:
+  typedef iterator_base<T,T*> iter_base;
+  typedef iterator_base<T,const T*> const_iter_base;
+
+  multi_array_impl_base() { }
+  ~multi_array_impl_base() { }
+
+  // Used by operator() in our array classes
+  template <typename Reference, typename IndexList, typename TPtr>
+  Reference access_element(boost::type<Reference>, TPtr base,
+                          const IndexList& indices,
+                          const index* strides) const {
+    index offset = 0;
+    for (size_type n = 0; n != NumDims; ++n) 
+      offset += indices[n] * strides[n];
+    
+    return base[offset];
+  }
+
+  template <typename StrideList, typename ExtentList>
+  void compute_strides(StrideList& stride_list, ExtentList& extent_list,
+                      const general_storage_order<NumDims>& storage)
+  {
+    // invariant: stride = the stride for dimension n
+    index stride = 1;
+    for (size_type n = 0; n != NumDims; ++n) {
+      index stride_sign = +1;
+      
+      if (!storage.ascending(storage.ordering(n)))
+       stride_sign = -1;
+      
+      // The stride for this dimension is the product of the
+      // lengths of the ranks minor to it.
+      stride_list[storage.ordering(n)] = stride * stride_sign;
+      
+      stride *= extent_list[storage.ordering(n)];
+    } 
+  }
+
+  // This calculates the offset to the array base pointer due to:
+  // 1. dimensions stored in descending order
+  // 2. non-zero dimension index bases
+  template <typename StrideList, typename ExtentList, typename BaseList>
+  index
+  calculate_origin_offset(const StrideList& stride_list,
+                         const ExtentList& extent_list,
+                         const general_storage_order<NumDims>& storage,
+                         const BaseList& index_base_list)
+  {
+    return
+      calculate_descending_dimension_offset(stride_list,extent_list,
+                                           storage) +
+      calculate_indexing_offset(stride_list,index_base_list);
+  }
+
+  // This calculates the offset added to the base pointer that are
+  // caused by descending dimensions
+  template <typename StrideList, typename ExtentList>
+  index
+  calculate_descending_dimension_offset(const StrideList& stride_list,
+                               const ExtentList& extent_list,
+                               const general_storage_order<NumDims>& storage)
+  {
+    index offset = 0;
+    if (!storage.all_dims_ascending()) 
+      for (size_type n = 0; n != NumDims; ++n)
+       if (!storage.ascending(n))
+         offset -= (extent_list[n] - 1) * stride_list[n];
+
+    return offset;
+  }
+
+  // This is used to reindex array_views, which are no longer
+  // concerned about storage order (specifically, whether dimensions
+  // are ascending or descending) since the viewed array handled it.
+
+  template <typename StrideList, typename BaseList>
+  index
+  calculate_indexing_offset(const StrideList& stride_list,
+                         const BaseList& index_base_list)
+  {
+    index offset = 0;
+    for (size_type n = 0; n != NumDims; ++n)
+       offset -= stride_list[n] * index_base_list[n];
+    return offset;
+  }
+
+  // Slicing using an index_gen.
+  // Note that populating an index_gen creates a type that encodes
+  // both the number of dimensions in the current Array (NumDims), and 
+  // the Number of dimensions for the resulting view.  This allows the 
+  // compiler to fail if the dimensions aren't completely accounted
+  // for.  For reasons unbeknownst to me, a BOOST_STATIC_ASSERT
+  // within the member function template does not work. I should add a 
+  // note to the documentation specifying that you get a damn ugly
+  // error message if you screw up in your slicing code.
+  template <typename ArrayRef, int NDims, typename TPtr>
+  ArrayRef
+  generate_array_view(boost::type<ArrayRef>,
+                     const boost::detail::multi_array::
+                     index_gen<NumDims,NDims>& indices,
+                     const size_type* extents,
+                     const index* strides,
+                     const index* index_bases,
+                     TPtr base) const {
+
+    boost::array<index,NDims> new_strides;
+    boost::array<index,NDims> new_extents;
+
+    index offset = 0;
+    size_type dim = 0;
+    for (size_type n = 0; n != NumDims; ++n) {
+      const index default_start = index_bases[n];
+      const index default_finish = default_start+extents[n];
+      const index_range& current_range = indices.ranges_[n];
+      index start = current_range.get_start(default_start);
+      index finish = current_range.get_finish(default_finish);
+      index index_factor = current_range.stride();
+      index len = (finish - start) / index_factor;
+
+      // the array data pointer is modified to account for non-zero
+      // bases during slicing (see [Garcia] for the math involved)
+      offset += start * strides[n];
+
+      if (!current_range.is_degenerate()) {
+
+       // The index_factor for each dimension is included into the
+       // strides for the array_view (see [Garcia] for the math involved).
+       new_strides[dim] = index_factor * strides[n];
+       
+       // calculate new extents
+       new_extents[dim] = len;
+       ++dim;
+      }
+    }
+    assert (dim == NDims);
+
+    return
+      ArrayRef(base+offset,
+              new_extents,
+              new_strides);
+  }
+                    
+
+};
+
+} // namespace multi_array
+} // namespace detail
+
+} // namespace boost
+
+#endif // BASE_RG071801_HPP
diff --git a/boost/boost/multi_array/collection_concept.hpp b/boost/boost/multi_array/collection_concept.hpp
new file mode 100644 (file)
index 0000000..36195f5
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef COLLECTION_CONCEPT_RG103101_HPP
+#define COLLECTION_CONCEPT_RG103101_HPP
+
+#include "boost/concept_check.hpp"
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+  //===========================================================================
+  // Collection Concept
+
+  template <class Collection>
+  struct CollectionConcept
+  {
+    typedef typename Collection::value_type value_type;
+    typedef typename Collection::iterator iterator;
+    typedef typename Collection::const_iterator const_iterator;
+    typedef typename Collection::reference reference;
+    typedef typename Collection::const_reference const_reference;
+    // typedef typename Collection::pointer pointer;
+    typedef typename Collection::difference_type difference_type;
+    typedef typename Collection::size_type size_type;
+
+    void constraints() {
+      boost::function_requires<boost::InputIteratorConcept<iterator> >();
+      boost::function_requires<boost::InputIteratorConcept<const_iterator> >();
+      boost::function_requires<boost::CopyConstructibleConcept<value_type> >();
+      const_constraints(c);
+      i = c.begin();
+      i = c.end();
+      c.swap(c);
+    }
+    void const_constraints(const Collection& c) {
+      ci = c.begin();
+      ci = c.end();
+      n = c.size();
+      b = c.empty();
+    }
+    Collection c;
+    bool b;
+    iterator i;
+    const_iterator ci;
+    size_type n;
+  };
+
+}
+}
+}
+#endif // COLLECTION_CONCEPT_RG103101_HPP
diff --git a/boost/boost/multi_array/concept_checks.hpp b/boost/boost/multi_array/concept_checks.hpp
new file mode 100644 (file)
index 0000000..2e470ad
--- /dev/null
@@ -0,0 +1,191 @@
+#ifndef BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
+#define BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
+
+//
+// concept-checks.hpp - Checks out Const MultiArray and MultiArray
+// concepts
+//
+
+#include "boost/concept_check.hpp"
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+  //
+  // idgen_helper -
+  //   This is a helper for generating index_gen instantiations with
+  //   the right type in order to test the call to
+  //   operator[](index_gen).  Since one would normally write:
+  //      A[ indices[range1][range2] ]; // or
+  //      B[ indices[index1][index2][range1] ];
+  //   idgen helper allows us to generate the "indices" type by
+  //   creating it through recursive calls.
+  template <std::size_t N>
+  struct idgen_helper {
+
+    template <typename Array, typename IdxGen, typename Call_Type>
+    static void call(Array& a, const IdxGen& idgen, Call_Type c) {
+      typedef typename Array::index_range index_range;
+      typedef typename Array::index index;
+      idgen_helper<N-1>::call(a,idgen[c],c);
+    }
+  };
+
+  template <>
+  struct idgen_helper<0> {
+
+    template <typename Array, typename IdxGen, typename Call_Type>
+    static void call(Array& a, const IdxGen& idgen, Call_Type) {
+      typedef typename Array::index_range index_range;
+      typedef typename Array::index index;
+      a[ idgen ];
+    }
+  };
+
+
+  template <typename Array, std::size_t NumDims >
+  struct ConstMultiArrayConcept
+  {
+    void constraints() {
+      //    function_requires< CopyConstructibleConcept<Array> >();
+
+      // RG - a( CollectionArchetype) when available...
+      a[ id ];
+      // Test slicing, keeping only the first dimension, losing the rest
+      idgen_helper<NumDims-1>::call(a,idgen[range],id);
+
+      // Test slicing, keeping all dimensions.
+      idgen_helper<NumDims-1>::call(a,idgen[range],range);
+
+      st = a.size();
+      st = a.num_dimensions();
+      st = a.num_elements();
+      stp = a.shape();
+      idp = a.strides();
+      idp = a.index_bases();
+      cit = a.begin();
+      cit = a.end();
+      crit = a.rbegin();
+      crit = a.rend();
+      eltp = a.origin();
+    }
+
+    typedef typename Array::value_type value_type;
+    typedef typename Array::reference reference;
+    typedef typename Array::const_reference const_reference;
+    typedef typename Array::size_type size_type;
+    typedef typename Array::difference_type difference_type;
+    typedef typename Array::iterator iterator;
+    typedef typename Array::const_iterator const_iterator;
+    typedef typename Array::reverse_iterator reverse_iterator;
+    typedef typename Array::const_reverse_iterator const_reverse_iterator;
+    typedef typename Array::element element;
+    typedef typename Array::index index;
+    typedef typename Array::index_gen index_gen;
+    typedef typename Array::index_range index_range;
+    typedef typename Array::extent_gen extent_gen;
+    typedef typename Array::extent_range extent_range;
+
+    Array a;
+    size_type st;
+    const size_type* stp;
+    index id;
+    const index* idp;
+    const_iterator cit;
+    const_reverse_iterator crit;
+    const element* eltp;
+    index_gen idgen;
+    index_range range;
+  };
+
+
+  template <typename Array, std::size_t NumDims >
+  struct MutableMultiArrayConcept
+  {
+    void constraints() {
+      //    function_requires< CopyConstructibleConcept<Array> >();
+
+      // RG - a( CollectionArchetype) when available...
+      value_type vt = a[ id ];
+
+      // Test slicing, keeping only the first dimension, losing the rest
+      idgen_helper<NumDims-1>::call(a,idgen[range],id);
+
+      // Test slicing, keeping all dimensions.
+      idgen_helper<NumDims-1>::call(a,idgen[range],range);
+
+      st = a.size();
+      st = a.num_dimensions();
+      st = a.num_elements();
+      stp = a.shape();
+      idp = a.strides();
+      idp = a.index_bases();
+      it = a.begin();
+      it = a.end();
+      rit = a.rbegin();
+      rit = a.rend();
+      eltp = a.origin();
+      const_constraints(a);
+    }
+
+    void const_constraints(const Array& a) {
+
+      //      value_type vt = a[ id ];
+
+      // Test slicing, keeping only the first dimension, losing the rest
+      idgen_helper<NumDims-1>::call(a,idgen[range],id);
+
+      // Test slicing, keeping all dimensions.
+      idgen_helper<NumDims-1>::call(a,idgen[range],range);
+
+      st = a.size();
+      st = a.num_dimensions();
+      st = a.num_elements();
+      stp = a.shape();
+      idp = a.strides();
+      idp = a.index_bases();
+      cit = a.begin();
+      cit = a.end();
+      crit = a.rbegin();
+      crit = a.rend();
+      eltp = a.origin();
+    }
+
+    typedef typename Array::value_type value_type;
+    typedef typename Array::reference reference;
+    typedef typename Array::const_reference const_reference;
+    typedef typename Array::size_type size_type;
+    typedef typename Array::difference_type difference_type;
+    typedef typename Array::iterator iterator;
+    typedef typename Array::const_iterator const_iterator;
+    typedef typename Array::reverse_iterator reverse_iterator;
+    typedef typename Array::const_reverse_iterator const_reverse_iterator;
+    typedef typename Array::element element;
+    typedef typename Array::index index;
+    typedef typename Array::index_gen index_gen;
+    typedef typename Array::index_range index_range;
+    typedef typename Array::extent_gen extent_gen;
+    typedef typename Array::extent_range extent_range;
+
+    Array a;
+    size_type st;
+    const size_type* stp;
+    index id;
+    const index* idp;
+    iterator it;
+    const_iterator cit;
+    reverse_iterator rit;
+    const_reverse_iterator crit;
+    const element* eltp;
+    index_gen idgen;
+    index_range range;
+  };
+
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+
+
+#endif // BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP
diff --git a/boost/boost/multi_array/copy_array.hpp b/boost/boost/multi_array/copy_array.hpp
new file mode 100644 (file)
index 0000000..5e47d8a
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef COPY_ARRAY_RG092101_HPP
+#define COPY_ARRAY_RG092101_HPP
+
+//
+// copy_array.hpp - generic code for copying the contents of one
+// Basic_MultiArray to another.  We assume that they are of the same
+// shape
+//
+#include "boost/type.hpp"
+#include <cassert>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+template <typename Element>
+class copy_dispatch {
+public:
+  template <typename SourceIterator, typename DestIterator>
+  static void copy_array (SourceIterator first, SourceIterator last,
+                  DestIterator result) {
+    while (first != last) {
+      copy_array(*first++,*result++);
+    }
+  }
+private:
+  // Array2 has to be passed by VALUE here because subarray
+  // pseudo-references are temporaries created by iterator::operator*()
+  template <typename Array1, typename Array2>
+  static void copy_array (const Array1& source, Array2 dest) {
+    copy_array(source.begin(),source.end(),dest.begin());
+  }
+
+  static void copy_array (const Element& source, Element& dest) {
+    dest = source;
+  }
+
+};
+
+
+template <typename Array1, typename Array2>
+void copy_array (Array1& source, Array2& dest) {
+  assert(std::equal(source.shape(),source.shape()+source.num_dimensions(),
+                   dest.shape()));
+  // Dispatch to the proper function
+  typedef typename Array1::element element_type;
+  copy_dispatch<element_type>::
+    copy_array(source.begin(),source.end(),dest.begin());
+}
+
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+
+#endif // COPY_ARRAY_RG092101_HPP
diff --git a/boost/boost/multi_array/extent_gen.hpp b/boost/boost/multi_array/extent_gen.hpp
new file mode 100644 (file)
index 0000000..46429a4
--- /dev/null
@@ -0,0 +1,63 @@
+#ifndef BOOST_EXTENT_GEN_RG071801_HPP
+#define BOOST_EXTENT_GEN_RG071801_HPP
+
+#include "boost/multi_array/extent_range.hpp"
+#include "boost/multi_array/range_list.hpp"
+#include "boost/multi_array/types.hpp"
+#include "boost/array.hpp"
+#include <algorithm>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+
+template <std::size_t NumRanges>
+class extent_gen {
+public:
+  typedef boost::detail::multi_array::index index;
+  typedef boost::detail::multi_array::size_type size_type;
+private:
+  typedef extent_range<index,size_type> range;
+  typedef typename range_list_generator<range,NumRanges>::type range_list;
+public:
+  template <std::size_t Ranges>
+  struct gen_type {
+    typedef extent_gen<Ranges> type;
+  };
+
+  range_list ranges_;
+
+  extent_gen() { }
+
+  // Used by operator[] to expand extent_gens
+  extent_gen(const extent_gen<NumRanges-1>& rhs,
+           const range& a_range)
+  {
+    std::copy(rhs.ranges_.begin(),rhs.ranges_.end(),ranges_.begin());
+    *ranges_.rbegin() = a_range;
+  }
+
+  extent_gen<NumRanges+1>
+  operator[](const range& a_range)
+  {
+    return extent_gen<NumRanges+1>(*this,a_range);    
+  }
+
+  extent_gen<NumRanges+1>
+  operator[](index idx)
+  {
+    return extent_gen<NumRanges+1>(*this,range(0,idx));    
+  }    
+
+  static extent_gen<0> extents() {
+    return extent_gen<0>();
+  }
+};
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+
+
+#endif // BOOST_EXTENT_GEN_RG071801_HPP
diff --git a/boost/boost/multi_array/extent_range.hpp b/boost/boost/multi_array/extent_range.hpp
new file mode 100644 (file)
index 0000000..ddd9f68
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef BOOST_EXTENT_RANGE_RG071801_HPP
+#define BOOST_EXTENT_RANGE_RG071801_HPP
+
+#include <utility>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+template <typename Extent, typename SizeType>
+class extent_range : private std::pair<Extent,Extent> {
+  typedef std::pair<Extent,Extent> super_type;
+public:
+  typedef Extent index;
+  typedef SizeType size_type;
+
+  extent_range(index start, index finish) :
+    super_type(start,finish) { }
+
+  extent_range(index finish) :
+    super_type(0,finish) { }
+
+  extent_range() : super_type(0,0) { }
+
+  index start() const { return super_type::first; }
+
+  index finish() const { return super_type::second; }
+
+  size_type size() const { return super_type::second - super_type::first; }
+};
+
+} // namespace multi_array
+} // namespace detail 
+} // namespace boost
+
+
+#endif // BOOST_EXTENT_RANGE_RG071801_HPP
diff --git a/boost/boost/multi_array/index_gen.hpp b/boost/boost/multi_array/index_gen.hpp
new file mode 100644 (file)
index 0000000..d5c714e
--- /dev/null
@@ -0,0 +1,69 @@
+#ifndef BOOST_INDEX_GEN_RG071801_HPP
+#define BOOST_INDEX_GEN_RG071801_HPP
+
+#include "boost/array.hpp"
+#include "boost/multi_array/index_range.hpp"
+#include "boost/multi_array/range_list.hpp"
+#include "boost/multi_array/types.hpp"
+#include <algorithm> 
+#include <cstddef>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+
+template <int NumRanges, int NumDims>
+struct index_gen {
+private:
+  typedef index Index;
+  typedef std::size_t SizeType;
+  typedef index_range<Index,SizeType> range;
+public:
+  template <int Dims, int Ranges>
+  struct gen_type {
+    typedef index_gen<Ranges,Dims> type;
+  };
+
+  typedef typename range_list_generator<range,NumRanges>::type range_list;
+  range_list ranges_;
+
+  index_gen() { }
+
+  template <int ND>
+  explicit index_gen(const index_gen<NumRanges-1,ND>& rhs,
+           const index_range<Index,SizeType>& range)
+  {
+    std::copy(rhs.ranges_.begin(),rhs.ranges_.end(),ranges_.begin());
+    *ranges_.rbegin() = range;
+  }
+
+  index_gen<NumRanges+1,NumDims+1>
+  operator[](const index_range<Index,SizeType>& range) const
+  {
+    index_gen<NumRanges+1,NumDims+1> tmp;
+    std::copy(ranges_.begin(),ranges_.end(),tmp.ranges_.begin());
+    *tmp.ranges_.rbegin() = range;
+    return tmp;
+  }
+
+  index_gen<NumRanges+1,NumDims>
+  operator[](Index idx) const
+  {
+    index_gen<NumRanges+1,NumDims> tmp;
+    std::copy(ranges_.begin(),ranges_.end(),tmp.ranges_.begin());
+    *tmp.ranges_.rbegin() = index_range<Index,SizeType>(idx);
+    return tmp;
+  }    
+
+  static index_gen<0,0> indices() {
+    return index_gen<0,0>();
+  }
+};
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+
+
+#endif // BOOST_INDEX_GEN_RG071801_HPP
diff --git a/boost/boost/multi_array/index_range.hpp b/boost/boost/multi_array/index_range.hpp
new file mode 100644 (file)
index 0000000..7dfcbe3
--- /dev/null
@@ -0,0 +1,189 @@
+#ifndef BOOST_INDEX_RANGE_RG071801_HPP
+#define BOOST_INDEX_RANGE_RG071801_HPP
+
+#include <boost/config.hpp>
+#include <utility>
+#include <boost/limits.hpp>
+
+// For representing intervals, also with stride.
+// A degenerate range is a range with one element.
+
+// Thanks to Doug Gregor for the really cool idea of using the
+// comparison operators to express various interval types!
+
+// Internally, we represent the interval as half-open.
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+  template <typename Index,typename SizeType>
+  class index_range {
+  public:
+    typedef Index index;
+    typedef SizeType size_type;
+
+    index_range()
+    {
+      start_ = from_start();
+      finish_ = to_end();
+      stride_ = 1;
+      degenerate_ = false;
+    }
+
+    explicit index_range(index pos)
+    {
+      start_ = pos;
+      finish_ = pos;
+      stride_ = 1;
+      degenerate_ = true;
+    }
+
+    explicit index_range(index start, index finish, index stride=1)
+      : start_(start), finish_(finish), stride_(stride),
+       degenerate_(start_ == finish_)
+    { }
+
+
+    // These are for chaining assignments to an index_range
+    index_range& start(index s) {
+      start_ = s;
+      degenerate_ = (start_ == finish_);
+      return *this;
+    }
+
+    index_range& finish(index f) {
+      finish_ = f;
+      degenerate_ = (start_ == finish_);
+      return *this;
+    }
+
+    index_range& stride(index s) { stride_ = s; return *this; }
+
+    index start() const
+    { 
+      return start_; 
+    }
+
+    index get_start(index low_index_range = 0) const
+    { 
+      if (start_ == from_start())
+       return low_index_range;
+      return start_; 
+    }
+
+    index finish() const
+    {
+      return finish_;
+    }
+
+    index get_finish(index high_index_range = 0) const
+    {
+      if (finish_ == to_end())
+       return high_index_range;
+      return finish_;
+    }
+
+    size_type size(index recommended_length = 0) const
+    {
+      if ((start_ == from_start()) || (finish_ == to_end()))
+       return recommended_length;
+      else 
+       return (finish_ - start_) / stride_;
+    }
+
+    index stride() const { return stride_; }
+
+    bool is_ascending_contiguous() const
+    {
+      return (start_ < finish_) && is_unit_stride();
+    }
+
+    void set_index_range(index start, index finish, index stride=1)
+    {
+      start_ = start;
+      finish_ = finish;
+      stride_ = stride;
+    }
+
+    static index_range all() 
+    { return index_range(from_start(), to_end(), 1); }
+
+    bool is_unit_stride() const
+    { return stride_ == 1; }
+
+    bool is_degenerate() const { return degenerate_; }
+
+    index_range operator-(index shift) const
+    { 
+      return index_range(start_ - shift, finish_ - shift, stride_); 
+    }
+
+    index_range operator+(index shift) const
+    { 
+      return index_range(start_ + shift, finish_ + shift, stride_); 
+    }
+
+    index operator[](unsigned i) const
+    {
+      return start_ + i * stride_;
+    }
+
+    index operator()(unsigned i) const
+    {
+      return start_ + i * stride_;
+    }
+
+    // add conversion to std::slice?
+
+  private:
+    static index from_start()
+      { return std::numeric_limits<index>::min(); }
+
+    static index to_end()
+      { return std::numeric_limits<index>::max(); }
+  public:
+    index start_, finish_, stride_;
+    bool degenerate_;
+  };
+
+  // Express open and closed interval end-points using the comparison
+  // operators.
+
+  // left closed
+  template <typename Index, typename SizeType>
+  inline index_range<Index,SizeType>
+  operator<=(Index s, const index_range<Index,SizeType>& r)
+  {
+    return index_range<Index,SizeType>(s, r.finish(), r.stride());
+  }
+
+  // left open
+  template <typename Index, typename SizeType>
+  inline index_range<Index,SizeType>
+  operator<(Index s, const index_range<Index,SizeType>& r)
+  {
+    return index_range<Index,SizeType>(s + 1, r.finish(), r.stride());
+  }
+
+  // right open
+  template <typename Index, typename SizeType>
+  inline index_range<Index,SizeType>
+  operator<(const index_range<Index,SizeType>& r, Index f)
+  {
+    return index_range<Index,SizeType>(r.start(), f, r.stride());
+  }
+
+  // right closed
+  template <typename Index, typename SizeType>
+  inline index_range<Index,SizeType>
+  operator<=(const index_range<Index,SizeType>& r, Index f)
+  {
+    return index_range<Index,SizeType>(r.start(), f + 1, r.stride());
+  }
+
+} // namespace multi_array
+} // namespace detail  
+} // namespace boost
+
+#endif // BOOST_INDEX_RANGE_RG071801_HPP
diff --git a/boost/boost/multi_array/iterator.hpp b/boost/boost/multi_array/iterator.hpp
new file mode 100644 (file)
index 0000000..356fb56
--- /dev/null
@@ -0,0 +1,159 @@
+#ifndef ITERATOR_RG071801_HPP
+#define ITERATOR_RG071801_HPP
+
+//
+// iterator.hpp - implementation of iterators for the
+// multi-dimensional array class
+//
+
+#include "boost/multi_array/base.hpp"
+#include "boost/multi_array/iterator_adaptors.hpp"
+#include "boost/iterator_adaptors.hpp"
+#include <cstddef>
+#include <iterator>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+/////////////////////////////////////////////////////////////////////////
+// iterator components
+/////////////////////////////////////////////////////////////////////////
+
+template <typename T, typename TPtr>
+struct iterator_base : private multi_array_base {
+  typedef multi_array_base super_type;
+  typedef super_type::index index;
+  typedef super_type::size_type size_type;
+
+  index idx_;
+  TPtr base_;
+  const size_type* extents_;
+  const index* strides_;
+  const index* index_base_;
+
+  iterator_base(int idx, TPtr base, const size_type* extents,
+               const index* strides,
+               const index* index_base) :
+    idx_(idx), base_(base), extents_(extents),
+    strides_(strides), index_base_(index_base) {
+  }
+
+  template <typename OPtr>
+  iterator_base(const iterator_base<T,OPtr>& rhs) :
+    idx_(rhs.idx_), base_(rhs.base_), extents_(rhs.extents_),
+    strides_(rhs.strides_), index_base_(rhs.index_base_) {
+  }
+
+  // default constructor required
+  iterator_base() {}
+};
+
+template<typename T, std::size_t NumDims>
+struct iterator_policies :
+  public boost::detail::multi_array::default_iterator_policies,
+  private value_accessor_generator<T,NumDims>::type {
+private:
+  typedef typename value_accessor_generator<T,NumDims>::type super_type;
+public:
+  template <class IteratorAdaptor>
+  typename IteratorAdaptor::reference
+  dereference(const IteratorAdaptor& iter) const {
+    typedef typename IteratorAdaptor::reference reference;
+    return super_type::access(boost::type<reference>(),
+                             iter.base().idx_,
+                             iter.base().base_,
+                             iter.base().extents_,
+                             iter.base().strides_,
+                             iter.base().index_base_);
+  }
+  
+  template <class IteratorAdaptor>
+  static void increment(IteratorAdaptor& x) { ++x.base().idx_; }
+
+  template <class IteratorAdaptor>
+  static void decrement(IteratorAdaptor& x) { --x.base().idx_; }
+
+  template <class IteratorAdaptor1, class IteratorAdaptor2>
+  bool equal(IteratorAdaptor1& lhs, IteratorAdaptor2& rhs) const {
+    return (lhs.base().idx_ == rhs.base().idx_) &&
+      (lhs.base().base_ == rhs.base().base_) &&
+      (lhs.base().extents_ == rhs.base().extents_) &&
+      (lhs.base().strides_ == rhs.base().strides_) &&
+      (lhs.base().index_base_ == rhs.base().index_base_);
+  }
+
+  template <class IteratorAdaptor, class DifferenceType>
+  static void advance(IteratorAdaptor& x, DifferenceType n) {
+    x.idx_ += n;
+  }
+
+  template <class IteratorAdaptor1, class IteratorAdaptor2>
+  typename IteratorAdaptor1::difference_type
+  distance(IteratorAdaptor1& lhs, IteratorAdaptor2& rhs) const {
+    return rhs.base().idx_ - lhs.base().idx_;
+  }
+};
+
+
+template <typename T, typename base_type,
+  std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct iterator_gen_helper {
+private:
+  typedef iterator_policies<T,NumDims> policies;
+  typedef value_type* pointer_type;
+  typedef tag category;
+public:
+  typedef boost::detail::multi_array::iterator_adaptor<base_type,policies,value_type,
+    reference_type,pointer_type,category,difference_type> type;
+};
+
+
+template <typename T, std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct iterator_generator {
+private:
+  typedef iterator_base<T,T*> base_type;
+public:
+  typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
+    reference_type,tag,difference_type>::type type;
+};
+
+template <typename T,  std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct const_iterator_generator {
+private:
+  typedef iterator_base<T,const T*> base_type;
+public:
+  typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
+    reference_type,tag,difference_type>::type type;
+};
+
+template <typename T, std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct reverse_iterator_generator {
+private:
+  typedef iterator_base<T,T*> base_type;
+  typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
+    reference_type,tag,difference_type>::type it_type;
+public:
+  typedef typename boost::reverse_iterator_generator<it_type>::type type;
+};
+
+template <typename T,  std::size_t NumDims, typename value_type,
+  typename reference_type, typename tag, typename difference_type>
+struct const_reverse_iterator_generator {
+private:
+  typedef iterator_base<T,const T*> base_type;
+  typedef typename iterator_gen_helper<T,base_type,NumDims,value_type,
+    reference_type,tag,difference_type>::type it_type;
+public:
+  typedef typename boost::reverse_iterator_generator<it_type>::type type;
+};
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+
+#endif // ITERATOR_RG071801_HPP
diff --git a/boost/boost/multi_array/iterator_adaptors.hpp b/boost/boost/multi_array/iterator_adaptors.hpp
new file mode 100644 (file)
index 0000000..2359c5a
--- /dev/null
@@ -0,0 +1,966 @@
+// (C) Copyright David Abrahams 2000. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+// (C) Copyright Jeremy Siek 2000. Permission to copy, use, modify,
+// sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+//
+// Revision History:
+
+// 27 Mar 2002  Ronald Garcia
+//      Forked from the main tree iterator adaptors. Necessary to
+//      allow iterator::operator->*() to work with multi_array iterators.
+// 01 Feb 2002   Jeremy Siek
+//      Added more comments in default_iterator_policies.
+// 08 Jan 2001   David Abrahams
+//      Moved concept checks into a separate class, which makes MSVC
+//      better at dealing with them.
+// 07 Jan 2001   David Abrahams
+//      Choose proxy for operator->() only if the reference type is not a reference.
+//      Updated workarounds for __MWERKS__ == 0x2406
+// 20 Dec 2001   David Abrahams
+//      Adjusted is_convertible workarounds for __MWERKS__ == 0x2406
+// 03 Nov 2001   Jeremy Siek
+//      Changed the named template parameter interface and internal.
+// 04 Oct 2001   Jeremy Siek
+//      Changed projection_iterator to not rely on the default reference,
+//      working around a limitation of detail::iterator_traits.
+// 04 Oct 2001   David Abrahams
+//      Applied indirect_iterator patch from George A. Heintzelman <georgeh@aya.yale.edu>
+//      Changed name of "bind" to "select" to avoid problems with MSVC.
+// 26 Sep 2001   David Abrahams
+//      Added borland bug fix
+// 08 Mar 2001   Jeremy Siek
+//      Added support for optional named template parameters.
+// 19 Feb 2001   David Abrahams
+//      Rolled back reverse_iterator_pair_generator again, as it doesn't
+//      save typing on a conforming compiler.
+// 18 Feb 2001   David Abrahams
+//      Reinstated reverse_iterator_pair_generator
+// 16 Feb 2001   David Abrahams
+//      Add an implicit conversion operator to operator_arrow_proxy
+//      as CW and BCC workarounds.
+// 11 Feb 2001   David Abrahams
+//      Switch to use of BOOST_STATIC_CONSTANT where possible
+// 11 Feb 2001   Jeremy Siek
+//      Removed workaround for older MIPSpro compiler. The workaround
+//        was preventing the proper functionality of the underlying
+//        iterator being carried forward into the iterator adaptor.
+//        Also added is_bidirectional enum to avoid EDG compiler error.
+// 11 Feb 2001   David Abrahams
+//      Borland fixes up the wazoo. It finally works!
+// 10 Feb 2001   David Abrahams
+//      Removed traits argument from iterator_adaptor<> and switched to
+//        explicit trait specification for maximum ease-of-use.
+//      Added comments to detail::iterator_defaults<>
+//      Began using detail::iterator_defaults<> unconditionally for code clarity
+//      Changed uses of `Iterator' to `Base' where non-iterators can be used.
+//
+// 10 Feb 2001   David Abrahams
+//      Rolled in supposed Borland fixes from John Maddock, but not seeing any
+//        improvement yet
+//      Changed argument order to indirect_ generator, for convenience in the
+//        case of input iterators (where Reference must be a value type).
+//      Removed derivation of filter_iterator_policies from
+//        default_iterator_policies, since the iterator category is likely to be
+//        reduced (we don't want to allow illegal operations like decrement).
+//      Support for a simpler filter iterator interface.
+//
+// 09 Feb 2001   David Abrahams
+//      Improved interface to indirect_ and reverse_ iterators
+//      Rolled back Jeremy's new constructor for now; it was causing
+//        problems with counting_iterator_test
+//      Attempted fix for Borland
+//
+// 09 Feb 2001   Jeremy Siek
+//      Added iterator constructor to allow const adaptor
+//        from non-const adaptee.
+//      Changed make_xxx to pass iterators by-value to
+//        get arrays converted to pointers.
+//      Removed InnerIterator template parameter from
+//        indirect_iterator_generator.
+//      Rearranged parameters for make_filter_iterator
+//
+// 07 Feb 2001   Jeremy Siek
+//      Removed some const iterator adaptor generators.
+//      Added make_xxx_iterator() helper functions for remaining
+//        iterator adaptors.
+//      Removed some traits template parameters where they
+//        where no longer needed thanks to detail::iterator_traits.
+//      Moved some of the compile-time logic into enums for
+//      EDG compatibility.
+//
+// 07 Feb 2001  David Abrahams
+//      Removed iterator_adaptor_pair_generator and
+//        reverse_iterator_pair_generator (more such culling to come)
+//      Improved comments
+//      Changed all uses of std::iterator_traits as default arguments
+//        to boost::detail::iterator_traits for improved utility in
+//        non-generic contexts
+//      Fixed naming convention of non-template parameter names
+//
+// 06 Feb 2001   David Abrahams
+//      Produce operator-> proxy objects for InputIterators
+//      Added static assertions to do some basic concept checks
+//      Renamed single-type generators -> xxx_generator
+//      Renamed const/nonconst iterator generators -> xxx_pair_generator
+//      Added make_transform_iterator(iter, function)
+//      The existence of boost::detail::iterator_traits allowed many
+//        template arguments to be defaulted. Some arguments had to be
+//        moved to accomplish it.
+//
+// 04 Feb 2001  MWERKS bug workaround, concept checking for proper
+//              reference types (David Abrahams)
+
+#ifndef BOOST_ITERATOR_ADAPTOR_RG032702_HPP_
+# define BOOST_ITERATOR_ADAPTOR_RG032702_HPP_
+
+# include <boost/iterator.hpp>
+# include <boost/utility.hpp>
+# include <boost/compressed_pair.hpp>
+# include <boost/concept_check.hpp>
+# include <boost/type.hpp>
+# include <boost/static_assert.hpp>
+# include <boost/type_traits.hpp>
+# include <boost/detail/iterator.hpp>
+# include <boost/detail/select_type.hpp>
+
+// I was having some problems with VC6. I couldn't tell whether our hack for
+// stock GCC was causing problems so I needed an easy way to turn it on and
+// off. Now we can test the hack with various compilers and still have an
+// "out" if it doesn't work. -dwa 7/31/00
+# if __GNUC__ == 2 && __GNUC_MINOR__ <= 96 && !defined(__STL_USE_NAMESPACES)
+#  define BOOST_RELOPS_AMBIGUITY_BUG 1
+# endif
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+//============================================================================
+// Default policies for iterator adaptors. You can use this as a base
+// class if you want to customize particular policies.
+struct default_iterator_policies
+{
+    // Some of the member functions were defined static, but Borland
+    // got confused and thought they were non-const. Also, Sun C++
+    // does not like static function templates. 
+    //
+    // The reason some members were defined static is because there is
+    // not state (data members) needed by those members of the
+    // default_iterator_policies class. If your policies class member
+    // functions need to access state stored in the policies object,
+    // then the member functions should not be static (they can't be).
+
+    template <class Base>
+    void initialize(Base&)
+        { }
+
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
+        { return *x.base(); }
+
+    template <class IteratorAdaptor>
+    void increment(IteratorAdaptor& x)
+        { ++x.base(); }
+
+    template <class IteratorAdaptor>
+    void decrement(IteratorAdaptor& x)
+        { --x.base(); }
+
+    template <class IteratorAdaptor, class DifferenceType>
+    void advance(IteratorAdaptor& x, DifferenceType n)
+        { x.base() += n; }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    typename IteratorAdaptor1::difference_type
+    distance(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+        { return y.base() - x.base(); }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+        { return x.base() == y.base(); }
+};
+
+// putting the comparisons in a base class avoids the g++
+// ambiguous overload bug due to the relops operators
+
+#ifdef BOOST_RELOPS_AMBIGUITY_BUG
+template <class Derived, class Base>
+struct iterator_comparisons : Base { };
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator==(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+        const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().equal(x, y);
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator!=(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return !x.policies().equal(x, y);
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator<(const iterator_comparisons<D1,Base1>& xb,
+                      const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) < 0;
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator>(const iterator_comparisons<D1,Base1>& xb,
+                      const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) > 0;
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator>=(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) >= 0;
+}
+
+template <class D1, class D2, class Base1, class Base2>
+inline bool operator<=(const iterator_comparisons<D1,Base1>& xb,
+                       const iterator_comparisons<D2,Base2>& yb)
+{
+    const D1& x = static_cast<const D1&>(xb);
+    const D2& y = static_cast<const D2&>(yb);
+    return x.policies().distance(y, x) <= 0;
+}
+#endif
+
+namespace detail {
+
+  // operator->() needs special support for input iterators to strictly meet the
+  // standard's requirements. If *i is not a reference type, we must still
+  // produce a (constant) lvalue to which a pointer can be formed. We do that by
+  // returning an instantiation of this special proxy class template.
+
+  template <class T>
+  struct operator_arrow_proxy
+  {
+      operator_arrow_proxy(const T& x) : m_value(x) {}
+    // RG removed const below
+      T* operator->() const { return &m_value; }
+      // This function is needed for MWCW and BCC, which won't call operator->
+      // again automatically per 13.3.1.2 para 8
+
+    // RG - removed const below
+      operator T*() const { return &m_value; }
+      mutable T m_value;
+  };
+
+  template <class Iter>
+  inline operator_arrow_proxy<typename Iter::reference>
+  operator_arrow(const Iter& i, std::input_iterator_tag) {
+    // RG - THIS is the change I needed to make!
+    // My input iterators need to return proxy references rather than values
+    typedef typename Iter::reference value_t; // VC++ needs this typedef
+    return operator_arrow_proxy<value_t>(*i);
+  }
+
+  template <class Iter>
+  inline typename Iter::pointer
+  operator_arrow(const Iter& i, std::forward_iterator_tag) {
+    return &(*i);
+  }
+
+  template <class Value, class Reference, class Pointer>
+  struct operator_arrow_result_generator
+  {
+    //RG - another important change!
+      typedef operator_arrow_proxy<Reference> proxy;
+      // Borland chokes unless it's an actual enum (!)
+      enum { use_proxy = !boost::is_reference<Reference>::value };
+
+      typedef typename boost::detail::if_true<(use_proxy)>::template
+      then<
+        proxy,
+   // else
+        Pointer
+      >::type type;
+  };
+
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+   // Select default pointer and reference types for adapted non-pointer
+   // iterators based on the iterator and the value_type. Poor man's partial
+   // specialization is in use here.
+   template <bool is_pointer>
+   struct iterator_defaults_select
+   {
+       template <class Iterator,class Value>
+       struct traits
+       {
+           // The assumption is that iterator_traits can deduce these types
+           // properly as long as the iterator is not a pointer.
+           typedef typename boost::detail::iterator_traits<Iterator>::pointer pointer;
+           typedef typename boost::detail::iterator_traits<Iterator>::reference reference;
+       };
+   };
+
+   // Select default pointer and reference types for adapted pointer iterators
+   // given a (possibly-const) value_type.
+   template <>
+   struct iterator_defaults_select<true>
+   {
+       template <class Iterator,class Value>
+       struct traits
+       {
+           typedef Value* pointer;
+           typedef Value& reference;
+       };
+   };
+
+   // Consolidate selection of the default pointer and reference type
+   template <class Iterator,class Value>
+   struct iterator_defaults
+   {
+       BOOST_STATIC_CONSTANT(bool, is_ptr = boost::is_pointer<Iterator>::value);
+
+       typedef typename iterator_defaults_select<is_ptr>::template traits<Iterator,Value> traits;
+       typedef typename traits::pointer pointer;
+       typedef typename traits::reference reference;
+   };
+# else
+   template <class Iterator,class Value>
+   struct iterator_defaults : iterator_traits<Iterator>
+   {
+       // Trying to factor the common is_same expression into an enum or a
+       // static bool constant confused Borland.
+       typedef typename if_true<(
+               ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
+           )>::template then<
+                typename iterator_traits<Iterator>::pointer,
+                Value*
+       >::type pointer;
+
+       typedef typename if_true<(
+               ::boost::is_same<Value,typename iterator_traits<Iterator>::value_type>::value
+           )>::template then<
+                typename iterator_traits<Iterator>::reference,
+                Value&
+       >::type reference;
+
+   };
+# endif
+
+  //===========================================================================
+  // Specify the defaults for iterator_adaptor's template parameters
+
+  struct default_argument { };
+  // This class template is a workaround for MSVC.
+  struct dummy_default_gen {
+    template <class Base, class Traits>
+    struct select { typedef default_argument type; };
+  };
+  // This class template is a workaround for MSVC.
+  template <class Gen> struct default_generator {
+    typedef dummy_default_gen type;
+  };
+
+  struct default_value_type {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename boost::detail::iterator_traits<Base>::value_type type;
+    };
+  };
+  template <> struct default_generator<default_value_type>
+  { typedef default_value_type type; }; // VC++ workaround
+
+  struct default_difference_type {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename boost::detail::iterator_traits<Base>::difference_type type;
+    };
+  };
+  template <> struct default_generator<default_difference_type>
+  { typedef default_difference_type type; }; // VC++ workaround
+
+  struct default_iterator_category {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename boost::detail::iterator_traits<Base>::iterator_category type;
+    };
+  };
+  template <> struct default_generator<default_iterator_category>
+  { typedef default_iterator_category type; }; // VC++ workaround
+
+  struct default_pointer {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename Traits::value_type Value;
+      typedef typename boost::detail::multi_array::detail::iterator_defaults<Base,Value>::pointer
+        type;
+    };
+  };
+  template <> struct default_generator<default_pointer>
+  { typedef default_pointer type; }; // VC++ workaround
+
+  struct default_reference {
+    template <class Base, class Traits>
+    struct select {
+      typedef typename Traits::value_type Value;
+      typedef typename boost::detail::multi_array::detail::iterator_defaults<Base,Value>::reference
+        type;
+    };
+  };
+  template <> struct default_generator<default_reference>
+  { typedef default_reference type; }; // VC++ workaround
+
+} // namespace detail
+
+
+  //===========================================================================
+  // Support for named template parameters
+
+struct named_template_param_base { };
+
+namespace detail {
+  struct value_type_tag { };
+  struct reference_tag { };
+  struct pointer_tag { };
+  struct difference_type_tag { };
+  struct iterator_category_tag { };
+
+  // avoid using std::pair because A or B might be a reference type, and g++
+  // complains about forming references to references inside std::pair
+  template <class A, class B>
+  struct cons_type {
+    typedef A first_type;
+    typedef B second_type;
+  };
+
+} // namespace detail
+
+template <class Value> struct value_type_is : public named_template_param_base
+{
+  typedef detail::cons_type<detail::value_type_tag, Value> type;
+};
+template <class Reference> struct reference_is : public named_template_param_base
+{
+  typedef detail::cons_type<detail::reference_tag, Reference> type;
+};
+template <class Pointer> struct pointer_is : public named_template_param_base
+{
+  typedef detail::cons_type<detail::pointer_tag, Pointer> type;
+};
+template <class Difference> struct difference_type_is
+  : public named_template_param_base
+{
+  typedef detail::cons_type<detail::difference_type_tag, Difference> type;
+};
+template <class IteratorCategory> struct iterator_category_is
+  : public named_template_param_base
+{
+  typedef detail::cons_type<detail::iterator_category_tag, IteratorCategory> type;
+};
+
+namespace detail {
+
+  struct end_of_list { };
+
+  // Given an associative list, find the value with the matching key.
+  // An associative list is a list of key-value pairs. The list is
+  // built out of cons_type's and is terminated by end_of_list.
+
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(__BORLANDC__)
+  template <class AssocList, class Key>
+  struct find_param;
+
+  struct find_param_continue {
+    template <class AssocList, class Key2> struct select {
+      typedef typename AssocList::first_type Head;
+      typedef typename Head::first_type Key1;
+      typedef typename Head::second_type Value;
+      typedef typename if_true<(is_same<Key1, Key2>::value)>::template
+      then<Value,
+        typename find_param<typename AssocList::second_type, Key2>::type
+      >::type type;
+    };
+  };
+  struct find_param_end {
+    template <class AssocList, class Key>
+    struct select { typedef detail::default_argument type; };
+  };
+  template <class AssocList> struct find_param_helper1
+  { typedef find_param_continue type; };
+  template <> struct find_param_helper1<end_of_list>
+  { typedef find_param_end type; };
+
+  template <class AssocList, class Key>
+  struct find_param {
+    typedef typename find_param_helper1<AssocList>::type select1;
+    typedef typename select1::template select<AssocList, Key>::type type;
+  };
+# else
+  template <class AssocList, class Key> struct find_param;
+
+  template <class Key>
+  struct find_param<end_of_list, Key> { typedef default_argument type; };
+
+  // Found a matching Key, return the associated Value
+  template <class Key, class Value, class Rest>
+  struct find_param<detail::cons_type< detail::cons_type<Key, Value>, Rest>, Key> {
+    typedef Value type;
+  };
+
+  // Non-matching keys, continue the search
+  template <class Key1, class Value, class Rest, class Key2>
+  struct find_param<detail::cons_type< detail::cons_type<Key1, Value>, Rest>, Key2> {
+    typedef typename find_param<Rest, Key2>::type type;
+  };
+# endif
+
+  struct make_named_arg {
+    template <class Key, class Value>
+    struct select { typedef typename Value::type type; };
+  };
+  struct make_key_value {
+    template <class Key, class Value>
+    struct select { typedef detail::cons_type<Key, Value> type; };
+  };
+
+  template <class Value>
+  struct is_named_parameter
+  {
+      enum { value = is_convertible<Value, named_template_param_base>::value };
+  };
+
+# if defined(__MWERKS__) && __MWERKS__ <= 0x2406 // workaround for broken is_convertible implementation
+  template <class T> struct is_named_parameter<value_type_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<reference_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<pointer_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<difference_type_is<T> > { enum { value = true }; };
+  template <class T> struct is_named_parameter<iterator_category_is<T> > { enum { value = true }; };
+# endif
+
+  template <class Key, class Value>
+  struct make_arg {
+# ifdef __BORLANDC__
+    // Borland C++ doesn't like the extra indirection of is_named_parameter
+    typedef typename
+      if_true<(is_convertible<Value,named_template_param_base>::value)>::
+      template then<make_named_arg, make_key_value>::type Make;
+# else
+    enum { is_named = is_named_parameter<Value>::value };
+    typedef typename if_true<(is_named)>::template
+      then<make_named_arg, make_key_value>::type Make;
+# endif
+    typedef typename Make::template select<Key, Value>::type type;
+  };
+
+  // Mechanism for resolving the default argument for a template parameter.
+
+  template <class T> struct is_default { typedef type_traits::no_type type; };
+  template <> struct is_default<default_argument>
+  { typedef type_traits::yes_type type; };
+
+  struct choose_default {
+    template <class Arg, class DefaultGen, class Base, class Traits>
+    struct select {
+      typedef typename default_generator<DefaultGen>::type Gen;
+      typedef typename Gen::template select<Base,Traits>::type type;
+    };
+  };
+  struct choose_arg {
+    template <class Arg, class DefaultGen, class Base, class Traits>
+    struct select {
+      typedef Arg type;
+    };
+  };
+
+  template <class UseDefault>
+  struct choose_arg_or_default { typedef choose_arg type; };
+  template <> struct choose_arg_or_default<type_traits::yes_type> {
+    typedef choose_default type;
+  };
+
+  template <class Arg, class DefaultGen, class Base, class Traits>
+  class resolve_default {
+    typedef typename choose_arg_or_default<typename is_default<Arg>::type>::type
+      Selector;
+  public:
+    typedef typename Selector
+      ::template select<Arg, DefaultGen, Base, Traits>::type type;
+  };
+
+  template <class Base, class Value, class Reference, class Pointer,
+            class Category, class Distance>
+  class iterator_adaptor_traits_gen
+  {
+    // Form an associative list out of the template parameters
+    // If the argument is a normal parameter (not named) then make_arg
+    // creates a key-value pair. If the argument is a named parameter,
+    // then make_arg extracts the key-value pair defined inside the
+    // named parameter.
+    typedef detail::cons_type< typename make_arg<value_type_tag, Value>::type,
+      detail::cons_type<typename make_arg<reference_tag, Reference>::type,
+      detail::cons_type<typename make_arg<pointer_tag, Pointer>::type,
+      detail::cons_type<typename make_arg<iterator_category_tag, Category>::type,
+      detail::cons_type<typename make_arg<difference_type_tag, Distance>::type,
+                end_of_list> > > > > ArgList;
+
+    // Search the list for particular parameters
+    typedef typename find_param<ArgList, value_type_tag>::type Val;
+    typedef typename find_param<ArgList, difference_type_tag>::type Diff;
+    typedef typename find_param<ArgList, iterator_category_tag>::type Cat;
+    typedef typename find_param<ArgList, pointer_tag>::type Ptr;
+    typedef typename find_param<ArgList, reference_tag>::type Ref;
+
+    typedef boost::iterator<Category, Value, Distance, Pointer, Reference>
+      Traits0;
+
+    // Compute the defaults if necessary
+    typedef typename resolve_default<Val, default_value_type, Base, Traits0>::type
+      value_type;
+    // if getting default value type from iterator_traits, then it won't be const
+    typedef typename resolve_default<Diff, default_difference_type, Base,
+      Traits0>::type difference_type;
+    typedef typename resolve_default<Cat, default_iterator_category, Base,
+      Traits0>::type iterator_category;
+
+    typedef boost::iterator<iterator_category, value_type, difference_type,
+      Pointer, Reference> Traits1;
+
+    // Compute the defaults for pointer and reference. This is done as a
+    // separate step because the defaults for pointer and reference depend
+    // on value_type.
+    typedef typename resolve_default<Ptr, default_pointer, Base, Traits1>::type
+      pointer;
+    typedef typename resolve_default<Ref, default_reference, Base, Traits1>::type
+      reference;
+
+  public:
+    typedef boost::iterator<iterator_category,
+      typename remove_const<value_type>::type,
+      difference_type, pointer, reference> type;
+  };
+
+  // This is really a partial concept check for iterators. Should it
+  // be moved or done differently?
+  template <class Category, class Value, class Difference, class Pointer, class Reference>
+  struct validator
+  {
+      BOOST_STATIC_CONSTANT(
+          bool, is_input_or_output_iter
+          = (boost::is_convertible<Category*,std::input_iterator_tag*>::value
+             | boost::is_convertible<Category*,std::output_iterator_tag*>::value));
+
+      // Iterators should satisfy one of the known categories
+      BOOST_STATIC_ASSERT(is_input_or_output_iter);
+
+      // Iterators >= ForwardIterator must produce real references
+      // as required by the C++ standard requirements in Table 74.
+      BOOST_STATIC_CONSTANT(
+          bool, forward_iter_with_real_reference
+          = ((!boost::is_convertible<Category*,std::forward_iterator_tag*>::value)
+             | boost::is_same<Reference,Value&>::value
+             | boost::is_same<Reference,typename add_const<Value>::type&>::value));
+
+      BOOST_STATIC_ASSERT(forward_iter_with_real_reference);
+  };
+} // namespace detail
+
+
+
+// This macro definition is only temporary in this file
+# if !defined(BOOST_MSVC)
+#  define BOOST_ARG_DEPENDENT_TYPENAME typename
+# else
+#  define BOOST_ARG_DEPENDENT_TYPENAME
+# endif
+
+//============================================================================
+//iterator_adaptor - Adapts a generic piece of data as an iterator. Adaptation
+//      is especially easy if the data being adapted is itself an iterator
+//
+//   Base - the base (usually iterator) type being wrapped.
+//
+//   Policies - a set of policies determining how the resulting iterator
+//      works.
+//
+//   Value - if supplied, the value_type of the resulting iterator, unless
+//      const. If const, a conforming compiler strips constness for the
+//      value_type. If not supplied, iterator_traits<Base>::value_type is used
+//
+//   Reference - the reference type of the resulting iterator, and in
+//      particular, the result type of operator*(). If not supplied but
+//      Value is supplied, Value& is used. Otherwise
+//      iterator_traits<Base>::reference is used.
+//
+//   Pointer - the pointer type of the resulting iterator, and in
+//      particular, the result type of operator->(). If not
+//      supplied but Value is supplied, Value* is used. Otherwise
+//      iterator_traits<Base>::pointer is used.
+//
+//   Category - the iterator_category of the resulting iterator. If not
+//      supplied, iterator_traits<Base>::iterator_category is used.
+//
+//   Distance - the difference_type of the resulting iterator. If not
+//      supplied, iterator_traits<Base>::difference_type is used.
+template <class Base, class Policies,
+    class Value = ::boost::detail::multi_array::detail::default_argument,
+    class Reference = ::boost::detail::multi_array::detail::default_argument,
+    class Pointer = ::boost::detail::multi_array::detail::default_argument,
+    class Category = ::boost::detail::multi_array::detail::default_argument,
+    class Distance = ::boost::detail::multi_array::detail::default_argument
+         >
+struct iterator_adaptor :
+#ifdef BOOST_RELOPS_AMBIGUITY_BUG
+    iterator_comparisons<
+          iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance>,
+    typename detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category, Distance>::type
+ >
+#else
+    detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance>::type
+#endif
+{
+    typedef iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance> self;
+ public:
+    typedef detail::iterator_adaptor_traits_gen<Base,Value,Reference,Pointer,Category,Distance> TraitsGen;
+    typedef typename TraitsGen::type Traits;
+
+    typedef typename Traits::difference_type difference_type;
+    typedef typename Traits::value_type value_type;
+    typedef typename Traits::pointer pointer;
+    typedef typename Traits::reference reference;
+    typedef typename Traits::iterator_category iterator_category;
+
+    typedef Base base_type;
+    typedef Policies policies_type;
+
+ private:
+    typedef detail::validator<
+        iterator_category,value_type,difference_type,pointer,reference
+        > concept_check;
+
+ public:
+    iterator_adaptor()
+    {
+    }
+
+    explicit
+    iterator_adaptor(const Base& it, const Policies& p = Policies())
+        : m_iter_p(it, p) {
+        policies().initialize(base());
+    }
+
+    template <class Iter2, class Value2, class Pointer2, class Reference2>
+    iterator_adaptor (
+        const iterator_adaptor<Iter2,Policies,Value2,Reference2,Pointer2,Category,Distance>& src)
+            : m_iter_p(src.base(), src.policies())
+    {
+        policies().initialize(base());
+    }
+
+#if defined(BOOST_MSVC) || defined(__BORLANDC__)
+    // This is required to prevent a bug in how VC++ generates
+    // the assignment operator for compressed_pairv
+    iterator_adaptor& operator= (const iterator_adaptor& x) {
+        m_iter_p = x.m_iter_p;
+        return *this;
+    }
+#endif
+    reference operator*() const {
+         return policies().dereference(*this);
+    }
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning( disable : 4284 )
+#endif
+
+    typename boost::detail::multi_array::detail::operator_arrow_result_generator<value_type,reference,pointer>::type
+    operator->() const
+        { return detail::operator_arrow(*this, iterator_category()); }
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+    value_type operator[](difference_type n) const
+        { return *(*this + n); }
+
+    self& operator++() {
+#if !defined(__MWERKS__) || __MWERKS__ >= 0x2405
+        policies().increment(*this);
+#else
+        // Odd bug, MWERKS couldn't  deduce the type for the member template
+        // Workaround by explicitly specifying the type.
+        policies().increment<self>(*this);
+#endif
+        return *this;
+    }
+
+    self operator++(int) { self tmp(*this); ++*this; return tmp; }
+
+    self& operator--() {
+#if !defined(__MWERKS__) || __MWERKS__ >= 0x2405
+        policies().decrement(*this);
+#else
+        policies().decrement<self>(*this);
+#endif
+        return *this;
+    }
+
+    self operator--(int) { self tmp(*this); --*this; return tmp; }
+
+    self& operator+=(difference_type n) {
+        policies().advance(*this, n);
+        return *this;
+    }
+
+    self& operator-=(difference_type n) {
+        policies().advance(*this, -n);
+        return *this;
+    }
+
+    base_type const& base() const { return m_iter_p.first(); }
+
+    // Moved from global scope to avoid ambiguity with the operator-() which
+    // subtracts iterators from one another.
+    self operator-(difference_type x) const
+        { self result(*this); return result -= x; }
+private:
+    compressed_pair<Base,Policies> m_iter_p;
+
+public: // implementation details (too many compilers have trouble when these are private).
+    base_type& base() { return m_iter_p.first(); }
+    Policies& policies() { return m_iter_p.second(); }
+    const Policies& policies() const { return m_iter_p.second(); }
+};
+
+template <class Base, class Policies, class Value, class Reference, class Pointer,
+    class Category, class Distance1, class Distance2>
+iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
+operator+(
+    iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p,
+    Distance2 x)
+{
+    return p += x;
+}
+
+template <class Base, class Policies, class Value, class Reference, class Pointer,
+    class Category, class Distance1, class Distance2>
+iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1>
+operator+(
+    Distance2 x,
+    iterator_adaptor<Base,Policies,Value,Reference,Pointer,Category,Distance1> p)
+{
+    return p += x;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2, class Category,
+    class Distance>
+typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>::difference_type
+operator-(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+  typedef typename iterator_adaptor<Iterator1,Policies,Value1,Reference1,
+    Pointer1,Category,Distance>::difference_type difference_type;
+  return x.policies().distance(y, x);
+}
+
+#ifndef BOOST_RELOPS_AMBIGUITY_BUG
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator==(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().equal(x, y);
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator<(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) < 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator>(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) > 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator>=(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) >= 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator<=(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return x.policies().distance(y, x) <= 0;
+}
+
+template <class Iterator1, class Iterator2, class Policies, class Value1, class Value2,
+    class Reference1, class Reference2, class Pointer1, class Pointer2,
+    class Category, class Distance>
+inline bool
+operator!=(
+    const iterator_adaptor<Iterator1,Policies,Value1,Reference1,Pointer1,Category,Distance>& x,
+    const iterator_adaptor<Iterator2,Policies,Value2,Reference2,Pointer2,Category,Distance>& y)
+{
+    return !x.policies().equal(x, y);
+}
+#endif
+
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+# undef BOOST_ARG_DEPENDENT_TYPENAME
+
+
+#endif
+
+
+
diff --git a/boost/boost/multi_array/multi_array_ref.hpp b/boost/boost/multi_array/multi_array_ref.hpp
new file mode 100644 (file)
index 0000000..43418df
--- /dev/null
@@ -0,0 +1,581 @@
+#ifndef BOOST_MULTI_ARRAY_REF_RG071801_HPP
+#define BOOST_MULTI_ARRAY_REF_RG071801_HPP
+
+//
+// multi_array_ref.hpp - code for creating "views" of array data.
+//
+
+#include "boost/multi_array/base.hpp"
+#include "boost/multi_array/collection_concept.hpp"
+#include "boost/multi_array/concept_checks.hpp"
+#include "boost/multi_array/iterator.hpp"
+#include "boost/multi_array/storage_order.hpp"
+#include "boost/multi_array/subarray.hpp"
+#include "boost/multi_array/view.hpp"
+#include "boost/multi_array/algorithm.hpp"
+#include "boost/array.hpp"
+#include "boost/concept_check.hpp"
+#include "boost/functional.hpp"
+#include "boost/limits.hpp"
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <functional>
+#include <numeric>
+
+namespace boost {
+
+template <typename T, std::size_t NumDims,
+  typename TPtr = const T*
+>
+class const_multi_array_ref :
+    public detail::multi_array::multi_array_impl_base<T,NumDims>
+{
+  typedef detail::multi_array::multi_array_impl_base<T,NumDims> super_type;
+public: 
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::const_iter_base const_iter_base;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::element element;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::difference_type difference_type;
+  typedef typename super_type::index index;
+  typedef typename super_type::extent_range extent_range;
+
+
+  // template typedefs
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+  // make const_multi_array_ref a friend of itself
+  template <typename,std::size_t,typename>
+  friend class const_multi_array_ref;
+#endif
+
+  template <typename OPtr>
+  const_multi_array_ref(const const_multi_array_ref<T,NumDims,
+                       OPtr>& other)
+    : base_(other.base_), storage_(other.storage_),
+      extent_list_(other.extent_list_),
+      stride_list_(other.stride_list_),
+      index_base_list_(other.index_base_list_),
+      origin_offset_(other.origin_offset_),
+      directional_offset_(other.directional_offset_),
+      num_elements_(other.num_elements_)  {  }
+
+  template <typename ExtentList>
+  explicit const_multi_array_ref(TPtr base, const ExtentList& extents) :
+    base_(base), storage_(c_storage_order()) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+
+    index_base_list_.assign(0);
+    init_multi_array_ref(extents.begin());
+  }
+  
+  template <typename ExtentList>
+  explicit const_multi_array_ref(TPtr base, const ExtentList& extents,
+                      const general_storage_order<NumDims>& so) : 
+    base_(base), storage_(so) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+
+    index_base_list_.assign(0);
+    init_multi_array_ref(extents.begin());
+  }
+  
+  explicit const_multi_array_ref(TPtr base,
+                        const detail::multi_array::
+                        extent_gen<NumDims>& ranges) :
+    base_(base), storage_(c_storage_order()) {
+
+    init_from_extent_gen(ranges);
+  }
+  
+  explicit const_multi_array_ref(TPtr base,
+                          const detail::multi_array::
+                          extent_gen<NumDims>& ranges,
+                          const general_storage_order<NumDims>& so) :
+    base_(base), storage_(so) {
+
+    init_from_extent_gen(ranges);
+  }
+  
+  template <class InputIterator>
+  void assign(InputIterator begin, InputIterator end) {
+    boost::function_requires<InputIteratorConcept<InputIterator> >();
+
+    InputIterator in_iter = begin;
+    T* out_iter = base_;
+    std::size_t copy_count=0;
+    while (in_iter != end && copy_count < num_elements_) {
+      *out_iter++ = *in_iter++;
+      copy_count++;      
+    }
+  }
+
+  template <class BaseList>
+  void reindex(const BaseList& values) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<BaseList> >();
+    boost::copy_n(values.begin(),num_dimensions(),index_base_list_.begin());
+    origin_offset_ =
+      calculate_origin_offset(stride_list_,extent_list_,
+                             storage_,index_base_list_);
+  }
+
+  void reindex(index value) {
+    index_base_list_.assign(value);
+    origin_offset_ =
+      calculate_origin_offset(stride_list_,extent_list_,
+                             storage_,index_base_list_);
+  }
+
+  template <typename SizeList>
+  void reshape(const SizeList& extents) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<SizeList> >();
+    assert(num_elements_ ==
+          std::accumulate(extents.begin(),extents.end(),
+                           size_type(1),std::multiplies<size_type>()));
+
+    std::copy(extents.begin(),extents.end(),extent_list_.begin());
+    compute_strides(stride_list_,extent_list_,storage_);
+
+    origin_offset_ =
+      calculate_origin_offset(stride_list_,extent_list_,
+                             storage_,index_base_list_);
+  }
+
+  size_type num_dimensions() const { return NumDims; }
+
+  size_type size() const { return extent_list_.front(); }
+
+  // given reshaping functionality, this is the max possible size.
+  size_type max_size() const { return num_elements(); }
+
+  bool empty() const { return size() == 0; }
+
+  const size_type* shape() const {
+    return extent_list_.data();
+  }
+
+  const index* strides() const {
+    return stride_list_.data();
+  }
+
+  const element* origin() const { return base_+origin_offset_; }
+  const element* data() const { return base_; }
+
+  size_type num_elements() const { return num_elements_; }
+
+  const index* index_bases() const {
+    return index_base_list_.data();
+  }
+
+  template <typename IndexList>
+  const element& operator()(IndexList indices) const {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<IndexList> >();
+    return super_type::access_element(boost::type<const element&>(),
+                                     origin(),
+                                     indices,strides());
+  }
+
+  // Only allow const element access
+  const_reference operator[](index idx) const {
+    return super_type::access(boost::type<const_reference>(),
+                             idx,origin(),
+                             shape(),strides(),index_bases());
+  }
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename const_array_view<NDims>::type 
+  operator[](const detail::multi_array::
+            index_gen<NumDims,NDims>& indices)
+    const {
+    typedef const_array_view<NDims>::type return_type;
+    return
+      super_type::generate_array_view(boost::type<return_type>(),
+                                     indices,
+                                     shape(),
+                                     strides(),
+                                     index_bases(),
+                                     origin());
+  }
+  
+  const_iterator begin() const {
+    return const_iterator(const_iter_base(*index_bases(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  const_iterator end() const {
+    return const_iterator(const_iter_base(*index_bases()+*shape(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  const_reverse_iterator rbegin() const {
+    return const_reverse_iterator(end());
+  }
+
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(begin());
+  }
+
+
+  template <typename OPtr>
+  bool operator==(const
+                 const_multi_array_ref<T,NumDims,OPtr>& rhs)
+    const {
+    if(std::equal(extent_list_.begin(),
+                 extent_list_.end(),
+                 rhs.extent_list_.begin()))
+      return std::equal(begin(),end(),rhs.begin());
+    else return false;
+  }
+
+  template <typename OPtr>
+  bool operator<(const
+                const_multi_array_ref<T,NumDims,OPtr>& rhs)
+    const {
+    return std::lexicographical_compare(begin(),end(),rhs.begin(),rhs.end());
+  }
+
+  template <typename OPtr>
+  bool operator!=(const
+                 const_multi_array_ref<T,NumDims,OPtr>& rhs)
+    const {
+    return !(*this == rhs);
+  }
+
+  template <typename OPtr>
+  bool operator>(const
+                const_multi_array_ref<T,NumDims,OPtr>& rhs)
+    const {
+    return rhs < *this;
+  }
+
+  template <typename OPtr>
+  bool operator<=(const
+                const_multi_array_ref<T,NumDims,OPtr>& rhs)
+    const {
+    return !(*this > rhs);
+  }
+
+  template <typename OPtr>
+  bool operator>=(const
+                const_multi_array_ref<T,NumDims,OPtr>& rhs)
+    const {
+    return !(*this < rhs);
+  }
+
+// This ensures that const_multi_array_ref types with different TPtr 
+// types can convert to each other
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+protected:
+#else
+public:
+#endif
+  // This is used by multi_array, which is a subclass of this
+  void set_base_ptr(TPtr new_base) { base_ = new_base; }
+
+  template <typename OPtr>
+  const_multi_array_ref(const detail::multi_array::
+                 const_sub_array<T,NumDims,OPtr>& rhs)
+    : base_(rhs.origin()),
+      storage_(c_storage_order()),
+      origin_offset_(0), directional_offset_(0),
+      num_elements_(rhs.num_elements())
+  {
+    using boost::copy_n;
+    copy_n(rhs.shape(),rhs.num_dimensions(),extent_list_.begin());
+    copy_n(rhs.strides(),rhs.num_dimensions(),stride_list_.begin());
+    copy_n(rhs.index_bases(),rhs.num_dimensions(),index_base_list_.begin());
+  }
+
+  typedef boost::array<size_type,NumDims> size_list;
+  typedef boost::array<index,NumDims> index_list;
+
+  TPtr base_;
+  general_storage_order<NumDims> storage_;
+  size_list extent_list_;
+  index_list stride_list_;
+  index_list index_base_list_;
+  index origin_offset_;
+  index directional_offset_;
+  size_type num_elements_;
+
+private:
+  // const_multi_array_ref cannot be assigned to (no deep copies!)
+  const_multi_array_ref& operator=(const const_multi_array_ref& other);
+
+  void init_from_extent_gen(const
+                       detail::multi_array::
+                       extent_gen<NumDims>& ranges) { 
+    
+    typedef boost::array<index,NumDims> extent_list;
+
+    // get the index_base values
+    std::transform(ranges.ranges_.begin(),ranges.ranges_.end(),
+             index_base_list_.begin(),
+             boost::mem_fun_ref(&extent_range::start));
+
+    // calculate the extents
+    extent_list extents;
+    std::transform(ranges.ranges_.begin(),ranges.ranges_.end(),
+             extents.begin(),
+             boost::mem_fun_ref(&extent_range::size));
+
+    init_multi_array_ref(extents.begin());
+  }
+
+
+  template <class InputIterator>
+  void init_multi_array_ref(InputIterator extents_iter) {
+    boost::function_requires<InputIteratorConcept<InputIterator> >();
+
+    boost::copy_n(extents_iter,num_dimensions(),extent_list_.begin());
+
+    // Calculate the array size
+    num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
+                           1,std::multiplies<index>());
+    assert(num_elements_ != 0);
+
+    compute_strides(stride_list_,extent_list_,storage_);
+
+    origin_offset_ =
+      calculate_origin_offset(stride_list_,extent_list_,
+                             storage_,index_base_list_);
+    directional_offset_ =
+      calculate_descending_dimension_offset(stride_list_,extent_list_,
+                                           storage_);
+  }
+};
+
+
+template <typename T, std::size_t NumDims>
+class multi_array_ref :
+  public const_multi_array_ref<T,NumDims,T*>
+{
+  typedef const_multi_array_ref<T,NumDims,T*> super_type;
+public: 
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::reference reference;
+  typedef typename super_type::iterator iterator;
+  typedef typename super_type::iter_base iter_base;
+  typedef typename super_type::reverse_iterator reverse_iterator;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::const_iter_base const_iter_base;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::element element;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::difference_type difference_type;
+  typedef typename super_type::index index;
+  typedef typename super_type::extent_range extent_range;
+
+
+
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  template <class ExtentList>
+  explicit multi_array_ref(T* base, const ExtentList& extents) :
+    super_type(base,extents) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+  }
+
+  template <class ExtentList>
+  explicit multi_array_ref(T* base, const ExtentList& extents,
+                          const general_storage_order<NumDims>& so) :
+    super_type(base,extents,so) {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<ExtentList> >();
+  }
+
+
+  explicit multi_array_ref(T* base,
+                          const detail::multi_array::
+                          extent_gen<NumDims>& ranges) :
+    super_type(base,ranges) { }
+
+
+  explicit multi_array_ref(T* base,
+                          const detail::multi_array::
+                          extent_gen<NumDims>&
+                            ranges,
+                          const general_storage_order<NumDims>& so) :
+    super_type(base,ranges,so) { }
+
+  template <typename OPtr>
+  multi_array_ref(const detail::multi_array::
+                 const_sub_array<T,NumDims,OPtr>& rhs)
+    : super_type(rhs) {} 
+
+  // Assignment from other ConstMultiArray types.
+  template <typename ConstMultiArray>
+  multi_array_ref& operator=(const ConstMultiArray& other) {
+    function_requires< 
+      detail::multi_array::
+      ConstMultiArrayConcept<ConstMultiArray,NumDims> >();
+
+    // make sure the dimensions agree
+    assert(other.num_dimensions() == num_dimensions());
+    assert(std::equal(other.shape(),other.shape()+num_dimensions(),
+                     shape()));
+    // iterator-based copy
+    std::copy(other.begin(),other.end(),begin());
+    return *this;
+  }
+
+  multi_array_ref& operator=(const multi_array_ref& other) {
+    if (&other != this) {
+      // make sure the dimensions agree
+      
+      assert(other.num_dimensions() == num_dimensions());
+      assert(std::equal(other.shape(),other.shape()+num_dimensions(),
+                       shape()));
+      // iterator-based copy
+      std::copy(other.begin(),other.end(),begin());
+    }
+    return *this;
+  }
+
+  element* origin() { return base_+origin_offset_; }
+
+  element* data() { return base_; }
+
+  template <class IndexList>
+  element& operator()(const IndexList& indices) {
+  boost::function_requires<
+    detail::multi_array::CollectionConcept<IndexList> >();
+  return super_type::access_element(boost::type<element&>(),
+                                     origin(),
+                                     indices,strides());
+  }
+
+
+  reference operator[](index idx) {
+    return super_type::access(boost::type<reference>(),
+                             idx,origin(),
+                             shape(),strides(),
+                             index_bases());
+  }
+
+
+  // See note attached to generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename array_view<NDims>::type 
+  operator[](const detail::multi_array::
+            index_gen<NumDims,NDims>& indices) {
+    typedef array_view<NDims>::type return_type;
+    return
+      super_type::generate_array_view(boost::type<return_type>(),
+                                     indices,
+                                     shape(),
+                                     strides(),
+                                     index_bases(),
+                                     origin());
+  }
+  
+  
+  iterator begin() {
+    return iterator(iter_base(*index_bases(),origin(),shape(),
+                             strides(),index_bases()));
+  }
+
+  iterator end() {
+    return iterator(iter_base(*index_bases()+*shape(),origin(),
+                             shape(),strides(),index_bases()));
+  }
+
+  // RG - rbegin() and rend() written naively to thwart MSVC ICE.
+  reverse_iterator rbegin() {
+    reverse_iterator ri(end());
+    return ri;
+  }
+
+  reverse_iterator rend() {
+    reverse_iterator ri(begin());
+    return ri;
+  }
+
+  // Using declarations don't seem to work for g++
+  // These are the proxies to work around this.
+
+  const element* origin() const { return super_type::origin(); }
+  const element* data() const { return super_type::data(); }
+
+  template <class IndexList>
+  const element& operator()(const IndexList& indices) const {
+    boost::function_requires<
+      detail::multi_array::CollectionConcept<IndexList> >();
+    return super_type::operator()(indices);
+  }
+
+  const_reference operator[](index idx) const {
+    return super_type::access(boost::type<const_reference>(),
+                             idx,origin(),
+                             shape(),strides(),index_bases());
+  }
+
+  // See note attached to generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename const_array_view<NDims>::type 
+  operator[](const detail::multi_array::
+            index_gen<NumDims,NDims>& indices)
+    const {
+    return super_type::operator[](indices);
+  }
+  
+  const_iterator begin() const {
+    return super_type::begin();
+  }
+
+  const_iterator end() const {
+    return super_type::end();
+  }
+
+  const_reverse_iterator rbegin() const {
+    return super_type::rbegin();
+  }
+
+  const_reverse_iterator rend() const {
+    return super_type::rend();
+  }
+};
+
+} // namespace boost
+
+#endif // BOOST_MULTI_ARRAY_REF_RG071801_HPP
diff --git a/boost/boost/multi_array/range_list.hpp b/boost/boost/multi_array/range_list.hpp
new file mode 100644 (file)
index 0000000..9d0aaec
--- /dev/null
@@ -0,0 +1,58 @@
+#ifndef RANGE_LIST_RG072501_HPP
+#define RANGE_LIST_RG072501_HPP
+//
+// range_list.hpp - helper to build boost::arrays for *_set types
+//
+
+#include "boost/array.hpp"
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+/////////////////////////////////////////////////////////////////////////
+// choose range list begins
+//
+
+struct choose_range_list_n {
+  template <typename T, std::size_t NumRanges>
+  struct bind {
+    typedef boost::array<T,NumRanges> type;
+  };
+};
+
+struct choose_range_list_zero {
+  template <typename T, std::size_t NumRanges>
+  struct bind {
+    typedef boost::array<T,1> type;
+  };
+};
+
+
+template <std::size_t NumRanges>
+struct range_list_gen_helper {
+  typedef choose_range_list_n choice;
+};
+
+template <>
+struct range_list_gen_helper<0> {
+  typedef choose_range_list_zero choice;
+};
+
+template <typename T, std::size_t NumRanges>
+struct range_list_generator {
+private:
+  typedef typename range_list_gen_helper<NumRanges>::choice Choice;
+public:
+  typedef typename Choice::template bind<T,NumRanges>::type type;
+};
+
+//
+// choose range list ends
+/////////////////////////////////////////////////////////////////////////
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+
+#endif // RANGE_LIST_RG072501_HPP
diff --git a/boost/boost/multi_array/storage_order.hpp b/boost/boost/multi_array/storage_order.hpp
new file mode 100644 (file)
index 0000000..85779c8
--- /dev/null
@@ -0,0 +1,112 @@
+#ifndef BOOST_STORAGE_ORDER_RG071801_HPP
+#define BOOST_STORAGE_ORDER_RG071801_HPP
+
+#include "boost/multi_array/types.hpp"
+#include "boost/array.hpp"
+#include "boost/multi_array/algorithm.hpp"
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <vector>
+
+namespace boost {
+
+  // RG - This is to make things work with VC++. So sad, so sad.
+  class c_storage_order; 
+  class fortran_storage_order;
+
+  template <std::size_t NumDims>
+  class general_storage_order
+  {
+  public:
+    typedef detail::multi_array::size_type size_type;
+    template <typename OrderingIter, typename AscendingIter>
+    general_storage_order(OrderingIter ordering,
+                         AscendingIter ascending) {
+      boost::copy_n(ordering,NumDims,ordering_.begin());
+      boost::copy_n(ascending,NumDims,ascending_.begin());
+    }
+
+    // RG - ideally these would not be necessary, but some compilers
+    // don't like template conversion operators.  I suspect that not
+    // too many folk will feel the need to use customized
+    // storage_order objects, I sacrifice that feature for compiler support.
+    general_storage_order(const c_storage_order&) {
+      for (size_type i=0; i != NumDims; ++i) {
+       ordering_[i] = NumDims - 1 - i;
+      }
+      ascending_.assign(true);
+    }
+
+    general_storage_order(const fortran_storage_order&) {
+      for (size_type i=0; i != NumDims; ++i) {
+       ordering_[i] = i;
+      }
+      ascending_.assign(true);
+    }
+
+    size_type ordering(size_type dim) const { return ordering_[dim]; }
+    bool ascending(size_type dim) const { return ascending_[dim]; }
+
+    bool all_dims_ascending() const {
+      return std::accumulate(ascending_.begin(),ascending_.end(),true,
+                     std::logical_and<bool>());
+    }
+
+    bool operator==(general_storage_order const& rhs) const {
+      return (ordering_ == rhs.ordering_) &&
+       (ascending_ == rhs.ascending_);
+    }
+
+  protected:
+    boost::array<size_type,NumDims> ordering_;
+    boost::array<bool,NumDims> ascending_;
+  };
+
+  class c_storage_order 
+  {
+    typedef detail::multi_array::size_type size_type;
+  public:
+    // This is the idiom for creating your own custom storage orders.
+    // Not supported by all compilers though!
+#ifndef __MWERKS__ // Metrowerks screams "ambiguity!"
+    template <std::size_t NumDims>
+    operator general_storage_order<NumDims>() const {
+      boost::array<size_type,NumDims> ordering;
+      boost::array<bool,NumDims> ascending;
+
+      for (size_type i=0; i != NumDims; ++i) {
+       ordering[i] = NumDims - 1 - i;
+       ascending[i] = true;
+      }
+      return general_storage_order<NumDims>(ordering.begin(),
+                                           ascending.begin());
+    }
+#endif
+  };
+
+  class fortran_storage_order
+  {
+    typedef detail::multi_array::size_type size_type;
+  public:
+    // This is the idiom for creating your own custom storage orders.
+    // Not supported by all compilers though! 
+#ifndef __MWERKS__ // Metrowerks screams "ambiguity!"
+    template <std::size_t NumDims>
+    operator general_storage_order<NumDims>() const {
+      boost::array<size_type,NumDims> ordering;
+      boost::array<bool,NumDims> ascending;
+
+      for (size_type i=0; i != NumDims; ++i) {
+       ordering[i] = i;
+       ascending[i] = true;
+      }
+      return general_storage_order<NumDims>(ordering.begin(),
+                                           ascending.begin());
+    }
+#endif
+  };
+
+} // namespace boost
+
+#endif // BOOST_ARRAY_STORAGE_RG071801_HPP
diff --git a/boost/boost/multi_array/subarray.hpp b/boost/boost/multi_array/subarray.hpp
new file mode 100644 (file)
index 0000000..5b1ab06
--- /dev/null
@@ -0,0 +1,380 @@
+#ifndef SUBARRAY_RG071801_HPP
+#define SUBARRAY_RG071801_HPP
+
+//
+// subarray.hpp - used to implement standard operator[] on
+// multi_arrays
+//
+
+#include "boost/multi_array/base.hpp"
+#include "boost/multi_array/concept_checks.hpp"
+#include "boost/limits.hpp"
+#include "boost/type.hpp"
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+//
+// const_sub_array
+//    multi_array's proxy class to allow multiple overloads of
+//    operator[] in order to provide a clean multi-dimensional array 
+//    interface.
+template <typename T, std::size_t NumDims, typename TPtr>
+class const_sub_array :
+  public boost::detail::multi_array::multi_array_impl_base<T,NumDims>
+{
+  typedef boost::detail::multi_array::multi_array_impl_base<T,NumDims> super_type;
+public: 
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::const_iter_base const_iter_base;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::element element;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::difference_type difference_type;
+  typedef typename super_type::index index;
+  typedef typename super_type::extent_range extent_range;
+
+  // template typedefs
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  // Allow default copy constructor as well.
+
+  template <typename OPtr>
+  const_sub_array (const const_sub_array<T,NumDims,OPtr>& rhs) :
+    base_(rhs.base_), extents_(rhs.extents_), strides_(rhs.strides_),
+    index_base_(rhs.index_base_) {
+  }
+
+  // const_sub_array always returns const types, regardless of its own
+  // constness.
+  const_reference operator[](index idx) const {
+    return super_type::access(boost::type<const_reference>(),
+                             idx,base_,shape(),strides(),index_bases());
+  }
+  
+  template <typename IndexList>
+  const element& operator()(const IndexList& indices) const {
+    return super_type::access_element(boost::type<const element&>(),
+                                     origin(),
+                                     indices,strides());
+  }
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename const_array_view<NDims>::type 
+  operator[](const boost::detail::multi_array::
+            index_gen<NumDims,NDims>& indices)
+    const {
+    typedef const_array_view<NDims>::type return_type;
+    return
+      super_type::generate_array_view(boost::type<return_type>(),
+                                     indices,
+                                     shape(),
+                                     strides(),
+                                     index_bases(),
+                                     base_);
+  }
+
+  template <typename OPtr>
+  bool operator<(const const_sub_array<T,NumDims,OPtr>& rhs) const {
+    return std::lexicographical_compare(begin(),end(),rhs.begin(),rhs.end());
+  }
+
+  template <typename OPtr>
+  bool operator==(const const_sub_array<T,NumDims,OPtr>& rhs) const {
+    if(std::equal(shape(),shape()+num_dimensions(),rhs.shape()))
+      return std::equal(begin(),end(),rhs.begin());
+    else return false;
+  }
+
+  template <typename OPtr>
+  bool operator!=(const const_sub_array<T,NumDims,OPtr>& rhs) const {
+    return !(*this == rhs);
+  }
+
+  template <typename OPtr>
+  bool operator>(const const_sub_array<T,NumDims,OPtr>& rhs) const {
+    return rhs < *this;
+  }
+
+  template <typename OPtr>
+  bool operator<=(const const_sub_array<T,NumDims,OPtr>& rhs) const {
+    return !(*this > rhs);
+  }
+
+  template <typename OPtr>
+  bool operator>=(const const_sub_array<T,NumDims,OPtr>& rhs) const {
+    return !(*this < rhs);
+  }
+
+  const_iterator begin() const {
+    return const_iterator(const_iter_base(*index_bases(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  const_iterator end() const {
+    return const_iterator(const_iter_base(*index_bases()+*shape(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  const_reverse_iterator rbegin() const {
+    return const_reverse_iterator(end());
+  }
+
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(begin());
+  }
+
+  TPtr origin() const { return base_; }
+  size_type size() const { return extents_[0]; }
+  size_type max_size() const { return num_elements(); }
+  bool empty() const { return size() == 0; }
+  size_type num_dimensions() const { return NumDims; }
+  const size_type*  shape() const { return extents_; }
+  const index* strides() const { return strides_; }
+  const index* index_bases() const { return index_base_; }
+
+  size_type num_elements() const { 
+    return std::accumulate(shape(),shape() + num_dimensions(),
+                          size_type(1), std::multiplies<size_type>());
+  }
+
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+protected:
+  template <typename,std::size_t> friend class value_accessor_n;  
+  template <typename,std::size_t,typename> friend class const_sub_array;
+#else    
+public:  // Should be protected
+#endif
+
+  const_sub_array (TPtr base,
+                const size_type* extents,
+                const index* strides,
+                const index* index_base) :
+    base_(base), extents_(extents), strides_(strides),
+    index_base_(index_base) {
+  }
+
+  TPtr base_;
+  const size_type* extents_;
+  const index* strides_;
+  const index* index_base_;
+private:
+  // const_sub_array cannot be assigned to (no deep copies!)
+  const_sub_array& operator=(const const_sub_array&);
+};
+
+//
+// sub_array
+//    multi_array's proxy class to allow multiple overloads of
+//    operator[] in order to provide a clean multi-dimensional array 
+//    interface.
+template <typename T, std::size_t NumDims>
+class sub_array : public const_sub_array<T,NumDims,T*>
+{
+  typedef const_sub_array<T,NumDims,T*> super_type;
+public: 
+  typedef typename super_type::element element;
+  typedef typename super_type::reference reference;
+  typedef typename super_type::index index;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::iterator iterator;
+  typedef typename super_type::reverse_iterator reverse_iterator;
+  typedef typename super_type::iter_base iter_base;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::const_iter_base const_iter_base;
+
+  // template typedefs
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  // Assignment from other ConstMultiArray types.
+  template <typename ConstMultiArray>
+  sub_array& operator=(const ConstMultiArray& other) {
+    function_requires< boost::detail::multi_array::ConstMultiArrayConcept< 
+        ConstMultiArray, NumDims> >();
+
+    // make sure the dimensions agree
+    assert(other.num_dimensions() == num_dimensions());
+    assert(std::equal(other.shape(),other.shape()+num_dimensions(),
+                     shape()));
+    // iterator-based copy
+    std::copy(other.begin(),other.end(),begin());
+    return *this;
+  }
+
+
+  sub_array& operator=(const sub_array& other) {
+    if (&other != this) {
+      // make sure the dimensions agree
+      assert(other.num_dimensions() == num_dimensions());
+      assert(std::equal(other.shape(),other.shape()+num_dimensions(),
+                       shape()));
+      // iterator-based copy
+      std::copy(other.begin(),other.end(),begin());
+    }
+    return *this;
+  }
+
+  T* origin() { return base_; }
+  const T* origin() const { return base_; }
+
+  reference operator[](index idx) {
+    return super_type::access(boost::type<reference>(),
+                             idx,base_,shape(),strides(),index_bases());
+  }
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename array_view<NDims>::type 
+  operator[](const boost::detail::multi_array::
+            index_gen<NumDims,NDims>& indices) {
+    typedef array_view<NDims>::type return_type;
+    return
+      super_type::generate_array_view(boost::type<return_type>(),
+                                     indices,
+                                     shape(),
+                                     strides(),
+                                     index_bases(),
+                                     origin());
+  }
+
+  template <class IndexList>
+  element& operator()(const IndexList& indices) {
+    return super_type::access_element(boost::type<element&>(),
+                                     origin(),
+                                     indices,strides());
+  }
+
+  iterator begin() {
+    return iterator(iter_base(*index_bases(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  iterator end() {
+    return iterator(iter_base(*index_bases()+*shape(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  // RG - rbegin() and rend() written naively to thwart MSVC ICE.
+  reverse_iterator rbegin() {
+    reverse_iterator ri(end());
+    return ri;
+  }
+
+  reverse_iterator rend() {
+    reverse_iterator ri(begin());
+    return ri;
+  }
+
+  //
+  // proxies
+  //
+
+  template <class IndexList>
+  const element& operator()(const IndexList& indices) const {
+    return super_type::operator()(indices);
+  }
+
+  const_reference operator[](index idx) const {
+    return super_type::operator[](idx);
+  }
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename const_array_view<NDims>::type 
+  operator[](const boost::detail::multi_array::
+            index_gen<NumDims,NDims>& indices)
+    const {
+    return super_type::operator[](indices);
+  }
+
+  const_iterator begin() const {
+    return super_type::begin();
+  }
+  
+  const_iterator end() const {
+    return super_type::end();
+  }
+
+  const_reverse_iterator rbegin() const {
+    return super_type::rbegin();
+  }
+
+  const_reverse_iterator rend() const {
+    return super_type::rend();
+  }
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+private:
+  template <typename,std::size_t> friend class value_accessor_n;
+#else
+public: // should be private
+#endif
+
+  sub_array (T* base,
+           const size_type* extents,
+           const index* strides,
+           const index* index_base) :
+    super_type(base,extents,strides,index_base) {
+  }
+
+};
+
+} // namespace multi_array
+} // namespace detail
+//
+// traits classes to get sub_array types
+//
+template <typename Array, int N>
+class subarray_gen {
+  typedef typename Array::element element;
+public:
+  typedef boost::detail::multi_array::sub_array<element,N> type;
+};
+
+template <typename Array, int N>
+class const_subarray_gen {
+  typedef typename Array::element element;
+public:
+  typedef boost::detail::multi_array::const_sub_array<element,N> type;  
+};
+} // namespace boost
+  
+#endif // SUBARRAY_RG071801_HPP
diff --git a/boost/boost/multi_array/types.hpp b/boost/boost/multi_array/types.hpp
new file mode 100644 (file)
index 0000000..2f1cb1e
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef BOOST_MULTI_ARRAY_TYPES_RG071801_HPP
+#define BOOST_MULTI_ARRAY_TYPES_RG071801_HPP
+
+//
+// types.hpp - supply types that are needed by several headers
+//
+#include "boost/config.hpp"
+#include <cstddef>
+
+namespace boost {
+namespace detail {
+namespace multi_array{
+
+// needed typedefs
+typedef std::size_t size_type;
+typedef int index;
+
+} // namespace multi_array
+} // namespace detail
+} // namespace boost
+  
+
+
+
+#endif // BOOST_MULTI_ARRAY_TYPES_RG071801_HPP
diff --git a/boost/boost/multi_array/view.hpp b/boost/boost/multi_array/view.hpp
new file mode 100644 (file)
index 0000000..fe69ba6
--- /dev/null
@@ -0,0 +1,442 @@
+#ifndef BOOST_MULTI_ARRAY_VIEW_RG071301_HPP
+#define BOOST_MULTI_ARRAY_VIEW_RG071301_HPP
+
+//
+// view.hpp - code for creating "views" of array data.
+//
+
+#include "boost/multi_array/base.hpp"
+#include "boost/multi_array/concept_checks.hpp"
+#include "boost/multi_array/iterator.hpp"
+#include "boost/multi_array/storage_order.hpp"
+#include "boost/multi_array/subarray.hpp"
+#include "boost/multi_array/algorithm.hpp"
+#include "boost/array.hpp"
+#include "boost/limits.hpp"
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <numeric>
+
+namespace boost {
+namespace detail {
+namespace multi_array {
+
+// TPtr = const T* defaulted in base.hpp
+template <typename T, std::size_t NumDims, typename TPtr>
+class const_multi_array_view :
+    public boost::detail::multi_array::multi_array_impl_base<T,NumDims>
+{
+  typedef boost::detail::multi_array::multi_array_impl_base<T,NumDims> super_type;
+public: 
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::const_iter_base const_iter_base;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::element element;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::difference_type difference_type;
+  typedef typename super_type::index index;
+  typedef typename super_type::extent_range extent_range;
+
+  // template typedefs
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  template <typename OPtr>
+  const_multi_array_view(const 
+                        const_multi_array_view<T,NumDims,OPtr>& other) :
+    base_(other.base_), origin_offset_(other.origin_offset_),
+    num_elements_(other.num_elements_), extent_list_(other.extent_list_),
+    stride_list_(other.stride_list_), index_base_list_(other.index_base_list_)
+  { }
+
+
+  template <class BaseList>
+  void reindex(const BaseList& values) {
+    boost::copy_n(values.begin(),num_dimensions(),index_base_list_.begin());
+    origin_offset_ =
+      calculate_indexing_offset(stride_list_,index_base_list_);
+  }
+
+  void reindex(index value) {
+    index_base_list_.assign(value);
+    origin_offset_ =
+      calculate_indexing_offset(stride_list_,index_base_list_);
+  }
+
+  size_type num_dimensions() const { return NumDims; }
+
+  size_type size() const { return extent_list_.front(); }
+  size_type max_size() const { return num_elements(); }
+  bool empty() const { return size() == 0; }
+
+  const size_type* shape() const {
+    return extent_list_.data();
+  }
+
+  const index* strides() const {
+    return stride_list_.data();
+  }
+
+  const T* origin() const { return base_+origin_offset_; }
+
+  size_type num_elements() const { return num_elements_; }
+
+  const index* index_bases() const {
+    return index_base_list_.data();
+  }
+
+  template <typename IndexList>
+  const element& operator()(IndexList indices) const {
+    return super_type::access_element(boost::type<const element&>(),
+                                     origin(),
+                                     indices,strides());
+  }
+
+  // Only allow const element access
+  const_reference operator[](index idx) const {
+    return super_type::access(boost::type<const_reference>(),
+                             idx,origin(),
+                             shape(),strides(),
+                             index_bases());
+  }
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename const_array_view<NDims>::type 
+  operator[](const boost::detail::multi_array::
+            index_gen<NumDims,NDims>& indices)
+    const {
+    typedef const_array_view<NDims>::type return_type;
+    return
+      super_type::generate_array_view(boost::type<return_type>(),
+                                     indices,
+                                     shape(),
+                                     strides(),
+                                     index_bases(),
+                                     origin());
+  }
+  const_iterator begin() const {
+    return const_iterator(const_iter_base(*index_bases(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  const_iterator end() const {
+    return const_iterator(const_iter_base(*index_bases()+*shape(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+  
+  const_reverse_iterator rbegin() const {
+    return const_reverse_iterator(end());
+  }
+
+  const_reverse_iterator rend() const {
+    return const_reverse_iterator(begin());
+  }
+
+
+  template <typename OPtr>
+  bool operator==(const
+                 const_multi_array_view<T,NumDims,OPtr>& rhs)
+    const {
+    if(std::equal(extent_list_.begin(),
+                 extent_list_.end(),
+                 rhs.extent_list_.begin()))
+      return std::equal(begin(),end(),rhs.begin());
+    else return false;
+  }
+
+  template <typename OPtr>
+  bool operator<(const
+                const_multi_array_view<T,NumDims,OPtr>& rhs)
+    const {
+    return std::lexicographical_compare(begin(),end(),rhs.begin(),rhs.end());
+  }
+
+  template <typename OPtr>
+  bool operator!=(const
+                 const_multi_array_view<T,NumDims,OPtr>& rhs)
+    const {
+    return !(*this == rhs);
+  }
+
+  template <typename OPtr>
+  bool operator>(const
+                const_multi_array_view<T,NumDims,OPtr>& rhs)
+    const {
+    return rhs < *this;
+  }
+
+  template <typename OPtr>
+  bool operator<=(const
+                const_multi_array_view<T,NumDims,OPtr>& rhs)
+    const {
+    return !(*this > rhs);
+  }
+
+  template <typename OPtr>
+  bool operator>=(const
+                const_multi_array_view<T,NumDims,OPtr>& rhs)
+    const {
+    return !(*this < rhs);
+  }
+
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+protected:
+  template <typename,std::size_t> friend class multi_array_impl_base;
+  template <typename,std::size_t,typename> friend class const_multi_array_view;
+#else
+public: // should be protected
+#endif
+
+  // This constructor is used by multi_array_impl_base::generate_array_view
+  // to create strides  
+  template <typename ExtentList, typename Index>
+  explicit const_multi_array_view(TPtr base,
+                          const ExtentList& extents,
+                          const boost::array<Index,NumDims>& strides): 
+    base_(base), origin_offset_(0) {
+
+    index_base_list_.assign(0);
+
+    // Get the extents and strides
+    boost::copy_n(extents.begin(),NumDims,extent_list_.begin());
+    boost::copy_n(strides.begin(),NumDims,stride_list_.begin());
+
+    // Calculate the array size
+    num_elements_ = std::accumulate(extent_list_.begin(),extent_list_.end(),
+                           size_type(1),std::multiplies<size_type>());
+    assert(num_elements_ != 0);
+  }
+
+  typedef boost::array<size_type,NumDims> size_list;
+  typedef boost::array<index,NumDims> index_list;
+
+  TPtr base_;
+  index origin_offset_;
+  size_type num_elements_;
+  size_list extent_list_;
+  index_list stride_list_;
+  index_list index_base_list_;
+
+private:
+  // const_multi_array_view cannot be assigned to (no deep copies!)
+  const_multi_array_view& operator=(const const_multi_array_view& other);
+};
+
+
+template <typename T, std::size_t NumDims>
+class multi_array_view :
+  public const_multi_array_view<T,NumDims,T*>
+{
+  typedef const_multi_array_view<T,NumDims,T*> super_type;
+public: 
+  typedef typename super_type::value_type value_type;
+  typedef typename super_type::reference reference;
+  typedef typename super_type::iterator iterator;
+  typedef typename super_type::iter_base iter_base;
+  typedef typename super_type::reverse_iterator reverse_iterator;
+  typedef typename super_type::const_reference const_reference;
+  typedef typename super_type::const_iterator const_iterator;
+  typedef typename super_type::const_iter_base const_iter_base;
+  typedef typename super_type::const_reverse_iterator const_reverse_iterator;
+  typedef typename super_type::element element;
+  typedef typename super_type::size_type size_type;
+  typedef typename super_type::difference_type difference_type;
+  typedef typename super_type::index index;
+  typedef typename super_type::extent_range extent_range;
+
+  // template typedefs
+  template <std::size_t NDims>
+  struct const_array_view {
+    typedef boost::detail::multi_array::const_multi_array_view<T,NDims> type;
+  };
+
+  template <std::size_t NDims>
+  struct array_view {
+    typedef boost::detail::multi_array::multi_array_view<T,NDims> type;
+  };
+
+  // Assignment from other ConstMultiArray types.
+  template <typename ConstMultiArray>
+  multi_array_view& operator=(const ConstMultiArray& other) {
+    function_requires< 
+      boost::detail::multi_array::
+      ConstMultiArrayConcept<ConstMultiArray,NumDims> >();
+
+    // make sure the dimensions agree
+    assert(other.num_dimensions() == num_dimensions());
+    assert(std::equal(other.shape(),other.shape()+num_dimensions(),
+                     shape()));
+    // iterator-based copy
+    std::copy(other.begin(),other.end(),begin());
+    return *this;
+  }
+
+
+  multi_array_view& operator=(const multi_array_view& other) {
+    if (&other != this) {
+      // make sure the dimensions agree
+      assert(other.num_dimensions() == num_dimensions());
+      assert(std::equal(other.shape(),other.shape()+num_dimensions(),
+                       shape()));
+      // iterator-based copy
+      std::copy(other.begin(),other.end(),begin());
+    }
+    return *this;
+  }
+
+  element* origin() { return base_+origin_offset_; }
+
+  template <class IndexList>
+  element& operator()(const IndexList& indices) {
+    return super_type::access_element(boost::type<element&>(),
+                                     origin(),
+                                     indices,strides());
+  }
+
+
+  reference operator[](index idx) {
+    return super_type::access(boost::type<reference>(),
+                             idx,origin(),
+                             shape(),strides(),
+                             index_bases());
+  }
+
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename array_view<NDims>::type 
+  operator[](const boost::detail::multi_array::
+            index_gen<NumDims,NDims>& indices) {
+    typedef array_view<NDims>::type return_type;
+    return
+      super_type::generate_array_view(boost::type<return_type>(),
+                                     indices,
+                                     shape(),
+                                     strides(),
+                                     index_bases(),
+                                     origin());
+  }
+  
+  
+  iterator begin() {
+    return iterator(iter_base(*index_bases(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  iterator end() {
+    return iterator(iter_base(*index_bases()+*shape(),origin(),
+                                  shape(),strides(),index_bases()));
+  }
+
+  reverse_iterator rbegin() {
+    return reverse_iterator(end());
+  }
+
+  reverse_iterator rend() {
+    return reverse_iterator(begin());
+  }
+
+  // Using declarations don't seem to work for g++
+  // These are the proxies to work around this.
+
+  const element* origin() const { return super_type::origin(); }
+
+  template <class IndexList>
+  const element& operator()(const IndexList& indices) const {
+    return super_type::operator()(indices);
+  }
+
+  const_reference operator[](index idx) const {
+    return super_type::operator[](idx);
+  }
+
+  // see generate_array_view in base.hpp
+#ifndef BOOST_MSVC
+  template <int NDims>
+#else
+  template <int NumDims, int NDims> // else ICE
+#endif // BOOST_MSVC
+  typename const_array_view<NDims>::type 
+  operator[](const boost::detail::multi_array::
+            index_gen<NumDims,NDims>& indices)
+    const {
+    return super_type::operator[](indices);
+  }
+  
+  const_iterator begin() const {
+    return super_type::begin();
+  }
+
+  const_iterator end() const {
+    return super_type::end();
+  }
+
+  const_reverse_iterator rbegin() const {
+    return super_type::rbegin();
+  }
+
+  const_reverse_iterator rend() const {
+    return super_type::rend();
+  }
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+private:
+  template <typename,std::size_t> friend class multi_array_impl_base;
+#else
+public: // should be private
+#endif
+
+  // constructor used by multi_array_impl_base::generate_array_view to
+  // generate array views
+  template <typename ExtentList, typename Index>
+  explicit multi_array_view(T* base,
+                           const ExtentList& extents,
+                           const boost::array<Index,NumDims>& strides) :
+    super_type(base,extents,strides) { }
+
+};
+
+} // namespace multi_array
+} // namespace detail
+
+//
+// traits classes to get array_view types
+//
+template <typename Array, int N>
+class array_view_gen {
+  typedef typename Array::element element;
+public:
+  typedef boost::detail::multi_array::multi_array_view<element,N> type;
+};
+
+template <typename Array, int N>
+class const_array_view_gen {
+  typedef typename Array::element element;
+public:
+  typedef boost::detail::multi_array::const_multi_array_view<element,N> type;  
+};
+
+} // namespace boost
+
+#endif // BOOST_MULTI_ARRAY_VIEW_RG071301_HPP
+
diff --git a/boost/boost/operators.hpp b/boost/boost/operators.hpp
new file mode 100644 (file)
index 0000000..bd571ec
--- /dev/null
@@ -0,0 +1,937 @@
+//  Boost operators.hpp header file  ----------------------------------------//
+
+//  (C) Copyright David Abrahams, Jeremy Siek, and Daryle Walker 1999-2001.
+//  Permission to copy, use, modify, sell and distribute this software is
+//  granted provided this copyright notice appears in all copies.  This
+//  software is provided "as is" without express or implied warranty, and
+//  with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Revision History
+//  02 Dec 01 Bug fixed in random_access_iteratable.  (Helmut Zeisel)
+//  28 Sep 01 Factored out iterator operator groups.  (Daryle Walker)
+//  27 Aug 01 'left' form for non commutative operators added;
+//            additional classes for groups of related operators added;
+//            workaround for empty base class optimization
+//            bug of GCC 3.0 (Helmut Zeisel)
+//  25 Jun 01 output_iterator_helper changes: removed default template 
+//            parameters, added support for self-proxying, additional 
+//            documentation and tests (Aleksey Gurtovoy)
+//  29 May 01 Added operator classes for << and >>.  Added input and output
+//            iterator helper classes.  Added classes to connect equality and
+//            relational operators.  Added classes for groups of related
+//            operators.  Reimplemented example operator and iterator helper
+//            classes in terms of the new groups.  (Daryle Walker, with help
+//            from Alexy Gurtovoy)
+//  11 Feb 01 Fixed bugs in the iterator helpers which prevented explicitly
+//            supplied arguments from actually being used (Dave Abrahams)
+//  04 Jul 00 Fixed NO_OPERATORS_IN_NAMESPACE bugs, major cleanup and
+//            refactoring of compiler workarounds, additional documentation
+//            (Alexy Gurtovoy and Mark Rodgers with some help and prompting from
+//            Dave Abrahams) 
+//  28 Jun 00 General cleanup and integration of bugfixes from Mark Rodgers and
+//            Jeremy Siek (Dave Abrahams)
+//  20 Jun 00 Changes to accommodate Borland C++Builder 4 and Borland C++ 5.5
+//            (Mark Rodgers)
+//  20 Jun 00 Minor fixes to the prior revision (Aleksey Gurtovoy)
+//  10 Jun 00 Support for the base class chaining technique was added
+//            (Aleksey Gurtovoy). See documentation and the comments below 
+//            for the details. 
+//  12 Dec 99 Initial version with iterator operators (Jeremy Siek)
+//  18 Nov 99 Change name "divideable" to "dividable", remove unnecessary
+//            specializations of dividable, subtractable, modable (Ed Brey) 
+//  17 Nov 99 Add comments (Beman Dawes)
+//            Remove unnecessary specialization of operators<> (Ed Brey)
+//  15 Nov 99 Fix less_than_comparable<T,U> second operand type for first two
+//            operators.(Beman Dawes)
+//  12 Nov 99 Add operators templates (Ed Brey)
+//  11 Nov 99 Add single template parameter version for compilers without
+//            partial specialization (Beman Dawes)
+//  10 Nov 99 Initial version
+
+// 10 Jun 00:
+// An additional optional template parameter was added to most of 
+// operator templates to support the base class chaining technique (see 
+// documentation for the details). Unfortunately, a straightforward
+// implementation of this change would have broken compatibility with the
+// previous version of the library by making it impossible to use the same
+// template name (e.g. 'addable') for both the 1- and 2-argument versions of
+// an operator template. This implementation solves the backward-compatibility
+// issue at the cost of some simplicity.
+//
+// One of the complications is an existence of special auxiliary class template
+// 'is_chained_base<>' (see 'detail' namespace below), which is used
+// to determine whether its template parameter is a library's operator template
+// or not. You have to specialize 'is_chained_base<>' for each new 
+// operator template you add to the library.
+//
+// However, most of the non-trivial implementation details are hidden behind 
+// several local macros defined below, and as soon as you understand them,
+// you understand the whole library implementation. 
+
+#ifndef BOOST_OPERATORS_HPP
+#define BOOST_OPERATORS_HPP
+
+#include <boost/config.hpp>
+#include <boost/iterator.hpp>
+
+#if defined(__sgi) && !defined(__GNUC__)
+#pragma set woff 1234
+#endif
+
+#if defined(BOOST_MSVC)
+#   pragma warning( disable : 4284 ) // complaint about return type of 
+#endif                               // operator-> not begin a UDT
+
+namespace boost {
+namespace detail {
+
+// Helmut Zeisel, empty base class optimization bug with GCC 3.0.0
+#if defined(__GNUC__) && __GNUC__==3 && __GNUC_MINOR__==0 && __GNU_PATCHLEVEL__==0
+class empty_base {
+  bool dummy; 
+};
+#else
+class empty_base {};
+#endif
+
+} // namespace detail
+} // namespace boost
+
+// In this section we supply the xxxx1 and xxxx2 forms of the operator
+// templates, which are explicitly targeted at the 1-type-argument and
+// 2-type-argument operator forms, respectively. Some compilers get confused
+// when inline friend functions are overloaded in namespaces other than the
+// global namespace. When BOOST_NO_OPERATORS_IN_NAMESPACE is defined, all of
+// these templates must go in the global namespace.
+
+#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
+namespace boost
+{
+#endif
+
+//  Basic operator classes (contributed by Dave Abrahams) ------------------//
+
+//  Note that friend functions defined in a class are implicitly inline.
+//  See the C++ std, 11.4 [class.friend] paragraph 5
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct less_than_comparable2 : B
+{
+     friend bool operator<=(const T& x, const U& y) { return !(x > y); }
+     friend bool operator>=(const T& x, const U& y) { return !(x < y); }
+     friend bool operator>(const U& x, const T& y)  { return y < x; }
+     friend bool operator<(const U& x, const T& y)  { return y > x; }
+     friend bool operator<=(const U& x, const T& y) { return !(y < x); }
+     friend bool operator>=(const U& x, const T& y) { return !(y > x); }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct less_than_comparable1 : B
+{
+     friend bool operator>(const T& x, const T& y)  { return y < x; }
+     friend bool operator<=(const T& x, const T& y) { return !(y < x); }
+     friend bool operator>=(const T& x, const T& y) { return !(x < y); }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct equality_comparable2 : B
+{
+     friend bool operator==(const U& y, const T& x) { return x == y; }
+     friend bool operator!=(const U& y, const T& x) { return !(x == y); }
+     friend bool operator!=(const T& y, const U& x) { return !(y == x); }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct equality_comparable1 : B
+{
+     friend bool operator!=(const T& x, const T& y) { return !(x == y); }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct multipliable2 : B
+{
+     friend T operator*(T x, const U& y) { return x *= y; }
+     friend T operator*(const U& y, T x) { return x *= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct multipliable1 : B
+{
+     friend T operator*(T x, const T& y) { return x *= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct addable2 : B
+{
+     friend T operator+(T x, const U& y) { return x += y; }
+     friend T operator+(const U& y, T x) { return x += y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct addable1 : B
+{
+     friend T operator+(T x, const T& y) { return x += y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct subtractable2 : B
+{
+     friend T operator-(T x, const U& y) { return x -= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct subtractable2_left : B
+{
+  friend T operator-(const U& x, const T& y)
+    { T result(x); return result -= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct subtractable1 : B
+{
+     friend T operator-(T x, const T& y) { return x -= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct dividable2 : B
+{
+     friend T operator/(T x, const U& y) { return x /= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct dividable2_left : B
+{
+  friend T operator/(const U& x, const T& y)
+    { T result(x); return result /= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct dividable1 : B
+{
+     friend T operator/(T x, const T& y) { return x /= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct modable2 : B
+{
+     friend T operator%(T x, const U& y) { return x %= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct modable2_left : B
+{
+  friend T operator%(const U& x, const T& y)
+    { T result(x); return result %= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct modable1 : B
+{
+     friend T operator%(T x, const T& y) { return x %= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct xorable2 : B
+{
+     friend T operator^(T x, const U& y) { return x ^= y; }
+     friend T operator^(const U& y, T x) { return x ^= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct xorable1 : B
+{
+     friend T operator^(T x, const T& y) { return x ^= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct andable2 : B
+{
+     friend T operator&(T x, const U& y) { return x &= y; }
+     friend T operator&(const U& y, T x) { return x &= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct andable1 : B
+{
+     friend T operator&(T x, const T& y) { return x &= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct orable2 : B
+{
+     friend T operator|(T x, const U& y) { return x |= y; }
+     friend T operator|(const U& y, T x) { return x |= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct orable1 : B
+{
+     friend T operator|(T x, const T& y) { return x |= y; }
+};
+
+//  incrementable and decrementable contributed by Jeremy Siek
+
+template <class T, class B = ::boost::detail::empty_base>
+struct incrementable : B
+{
+  friend T operator++(T& x, int)
+  {
+    incrementable_type tmp(x);
+    ++x;
+    return tmp;
+  }
+private: // The use of this typedef works around a Borland bug
+  typedef T incrementable_type;
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct decrementable : B
+{
+  friend T operator--(T& x, int)
+  {
+    decrementable_type tmp(x);
+    --x;
+    return tmp;
+  }
+private: // The use of this typedef works around a Borland bug
+  typedef T decrementable_type;
+};
+
+//  Iterator operator classes (contributed by Jeremy Siek) ------------------//
+
+template <class T, class P, class B = ::boost::detail::empty_base>
+struct dereferenceable : B
+{
+  P operator->() const
+  { 
+    return &*static_cast<const T&>(*this); 
+  }
+};
+
+template <class T, class I, class R, class B = ::boost::detail::empty_base>
+struct indexable : B
+{
+  R operator[](I n) const
+  {
+    return *(static_cast<const T&>(*this) + n);
+  }
+};
+
+//  More operator classes (contributed by Daryle Walker) --------------------//
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct left_shiftable2 : B
+{
+     friend T operator<<(T x, const U& y) { return x <<= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct left_shiftable1 : B
+{
+     friend T operator<<(T x, const T& y) { return x <<= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct right_shiftable2 : B
+{
+     friend T operator>>(T x, const U& y) { return x >>= y; }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct right_shiftable1 : B
+{
+     friend T operator>>(T x, const T& y) { return x >>= y; }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct equivalent2 : B
+{
+  friend bool operator==(const T& x, const U& y)
+  {
+    return !(x < y) && !(x > y);
+  }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct equivalent1 : B
+{
+  friend bool operator==(const T&x, const T&y)
+  {
+    return !(x < y) && !(y < x);
+  }
+};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct partially_ordered2 : B
+{
+  friend bool operator<=(const T& x, const U& y)
+    { return (x < y) || (x == y); }
+  friend bool operator>=(const T& x, const U& y)
+    { return (x > y) || (x == y); }
+  friend bool operator>(const U& x, const T& y)
+    { return y < x; }
+  friend bool operator<(const U& x, const T& y)
+    { return y > x; }
+  friend bool operator<=(const U& x, const T& y)
+    { return (y > x) || (y == x); }
+  friend bool operator>=(const U& x, const T& y)
+    { return (y < x) || (y == x); }
+};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct partially_ordered1 : B
+{
+  friend bool operator>(const T& x, const T& y)
+    { return y < x; }
+  friend bool operator<=(const T& x, const T& y)
+    { return (x < y) || (x == y); }
+  friend bool operator>=(const T& x, const T& y)
+    { return (y < x) || (x == y); }
+};
+
+//  Combined operator classes (contributed by Daryle Walker) ----------------//
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct totally_ordered2
+    : less_than_comparable2<T, U
+    , equality_comparable2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct totally_ordered1
+    : less_than_comparable1<T
+    , equality_comparable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct additive2
+    : addable2<T, U
+    , subtractable2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct additive1
+    : addable1<T
+    , subtractable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct multiplicative2
+    : multipliable2<T, U
+    , dividable2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct multiplicative1
+    : multipliable1<T
+    , dividable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct integer_multiplicative2
+    : multiplicative2<T, U
+    , modable2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct integer_multiplicative1
+    : multiplicative1<T
+    , modable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct arithmetic2
+    : additive2<T, U
+    , multiplicative2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct arithmetic1
+    : additive1<T
+    , multiplicative1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct integer_arithmetic2
+    : additive2<T, U
+    , integer_multiplicative2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct integer_arithmetic1
+    : additive1<T
+    , integer_multiplicative1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct bitwise2
+    : xorable2<T, U
+    , andable2<T, U
+    , orable2<T, U, B
+      > > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct bitwise1
+    : xorable1<T
+    , andable1<T
+    , orable1<T, B
+      > > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct unit_steppable
+    : incrementable<T
+    , decrementable<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct shiftable2
+    : left_shiftable2<T, U
+    , right_shiftable2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct shiftable1
+    : left_shiftable1<T
+    , right_shiftable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct ring_operators2
+    : additive2<T, U
+    , subtractable2_left<T, U
+    , multipliable2<T, U, B
+      > > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct ring_operators1
+    : additive1<T
+    , multipliable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct ordered_ring_operators2
+    : ring_operators2<T, U
+    , totally_ordered2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct ordered_ring_operators1
+    : ring_operators1<T
+    , totally_ordered1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct field_operators2
+    : ring_operators2<T, U
+    , dividable2<T, U
+    , dividable2_left<T, U, B
+      > > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct field_operators1
+    : ring_operators1<T
+    , dividable1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct ordered_field_operators2
+    : field_operators2<T, U
+    , totally_ordered2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct ordered_field_operators1
+    : field_operators1<T
+    , totally_ordered1<T, B
+      > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct euclidian_ring_operators2
+    : ring_operators2<T, U
+    , dividable2<T, U
+    , dividable2_left<T, U
+    , modable2<T, U
+    , modable2_left<T, U, B
+      > > > > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct euclidian_ring_operators1
+    : ring_operators1<T
+    , dividable1<T
+    , modable1<T, B
+      > > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base>
+struct ordered_euclidian_ring_operators2
+    : totally_ordered2<T, U
+    , euclidian_ring_operators2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct ordered_euclidian_ring_operators1
+    : totally_ordered1<T
+    , euclidian_ring_operators1<T, B
+      > > {};
+      
+template <class T, class P, class B = ::boost::detail::empty_base>
+struct input_iteratable
+    : equality_comparable1<T
+    , incrementable<T
+    , dereferenceable<T, P, B
+      > > > {};
+
+template <class T, class B = ::boost::detail::empty_base>
+struct output_iteratable
+    : incrementable<T, B
+      > {};
+
+template <class T, class P, class B = ::boost::detail::empty_base>
+struct forward_iteratable
+    : input_iteratable<T, P, B
+      > {};
+
+template <class T, class P, class B = ::boost::detail::empty_base>
+struct bidirectional_iteratable
+    : forward_iteratable<T, P
+    , decrementable<T, B
+      > > {};
+
+//  To avoid repeated derivation from equality_comparable,
+//  which is an indirect base class of bidirectional_iterable,
+//  random_access_iteratable must not be derived from totally_ordered1
+//  but from less_than_comparable1 only. (Helmut Zeisel, 02-Dec-2001)
+template <class T, class P, class D, class R, class B = ::boost::detail::empty_base>
+struct random_access_iteratable
+    : bidirectional_iteratable<T, P
+    , less_than_comparable1<T
+    , additive2<T, D
+    , indexable<T, D, R, B
+      > > > > {};
+
+#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
+} // namespace boost
+#endif // BOOST_NO_OPERATORS_IN_NAMESPACE
+
+
+// BOOST_IMPORT_TEMPLATE1 .. BOOST_IMPORT_TEMPLATE4 -
+//
+// When BOOST_NO_OPERATORS_IN_NAMESPACE is defined we need a way to import an
+// operator template into the boost namespace. BOOST_IMPORT_TEMPLATE1 is used
+// for one-argument forms of operator templates; BOOST_IMPORT_TEMPLATE2 for
+// two-argument forms. Note that these macros expect to be invoked from within
+// boost.
+
+#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
+
+  // The template is already in boost so we have nothing to do.
+# define BOOST_IMPORT_TEMPLATE4(template_name)
+# define BOOST_IMPORT_TEMPLATE3(template_name)
+# define BOOST_IMPORT_TEMPLATE2(template_name)
+# define BOOST_IMPORT_TEMPLATE1(template_name)
+
+#else // BOOST_NO_OPERATORS_IN_NAMESPACE
+
+#  ifndef BOOST_NO_USING_TEMPLATE
+
+     // Bring the names in with a using-declaration
+     // to avoid stressing the compiler.
+#    define BOOST_IMPORT_TEMPLATE4(template_name) using ::template_name;
+#    define BOOST_IMPORT_TEMPLATE3(template_name) using ::template_name;
+#    define BOOST_IMPORT_TEMPLATE2(template_name) using ::template_name;
+#    define BOOST_IMPORT_TEMPLATE1(template_name) using ::template_name;
+
+#  else
+
+     // Otherwise, because a Borland C++ 5.5 bug prevents a using declaration
+     // from working, we are forced to use inheritance for that compiler.
+#    define BOOST_IMPORT_TEMPLATE4(template_name)                                          \
+     template <class T, class U, class V, class W, class B = ::boost::detail::empty_base>  \
+     struct template_name : ::template_name<T, U, V, W, B> {};
+
+#    define BOOST_IMPORT_TEMPLATE3(template_name)                                 \
+     template <class T, class U, class V, class B = ::boost::detail::empty_base>  \
+     struct template_name : ::template_name<T, U, V, B> {};
+
+#    define BOOST_IMPORT_TEMPLATE2(template_name)                              \
+     template <class T, class U, class B = ::boost::detail::empty_base>        \
+     struct template_name : ::template_name<T, U, B> {};
+
+#    define BOOST_IMPORT_TEMPLATE1(template_name)                              \
+     template <class T, class B = ::boost::detail::empty_base>                 \
+     struct template_name : ::template_name<T, B> {};
+
+#  endif // BOOST_NO_USING_TEMPLATE
+
+#endif // BOOST_NO_OPERATORS_IN_NAMESPACE
+
+//
+// Here's where we put it all together, defining the xxxx forms of the templates
+// in namespace boost. We also define specializations of is_chained_base<> for
+// the xxxx, xxxx1, and xxxx2 templates, importing them into boost:: as
+// neccessary.
+//
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+// is_chained_base<> - a traits class used to distinguish whether an operator
+// template argument is being used for base class chaining, or is specifying a
+// 2nd argument type.
+
+namespace boost {
+// A type parameter is used instead of a plain bool because Borland's compiler
+// didn't cope well with the more obvious non-type template parameter.
+namespace detail {
+  struct true_t {};
+  struct false_t {};
+} // namespace detail
+
+// Unspecialized version assumes that most types are not being used for base
+// class chaining. We specialize for the operator templates defined in this
+// library.
+template<class T> struct is_chained_base {
+  typedef ::boost::detail::false_t value;
+};
+
+} // namespace boost
+
+// Import a 4-type-argument operator template into boost (if neccessary) and
+// provide a specialization of 'is_chained_base<>' for it.
+# define BOOST_OPERATOR_TEMPLATE4(template_name4)                     \
+  BOOST_IMPORT_TEMPLATE4(template_name4)                              \
+  template<class T, class U, class V, class W, class B>               \
+  struct is_chained_base< ::boost::template_name4<T, U, V, W, B> > {  \
+    typedef ::boost::detail::true_t value;                            \
+  };
+
+// Import a 3-type-argument operator template into boost (if neccessary) and
+// provide a specialization of 'is_chained_base<>' for it.
+# define BOOST_OPERATOR_TEMPLATE3(template_name3)                     \
+  BOOST_IMPORT_TEMPLATE3(template_name3)                              \
+  template<class T, class U, class V, class B>                        \
+  struct is_chained_base< ::boost::template_name3<T, U, V, B> > {     \
+    typedef ::boost::detail::true_t value;                            \
+  };
+
+// Import a 2-type-argument operator template into boost (if neccessary) and
+// provide a specialization of 'is_chained_base<>' for it.
+# define BOOST_OPERATOR_TEMPLATE2(template_name2)                  \
+  BOOST_IMPORT_TEMPLATE2(template_name2)                           \
+  template<class T, class U, class B>                              \
+  struct is_chained_base< ::boost::template_name2<T, U, B> > {     \
+    typedef ::boost::detail::true_t value;                         \
+  };
+
+// Import a 1-type-argument operator template into boost (if neccessary) and
+// provide a specialization of 'is_chained_base<>' for it.
+# define BOOST_OPERATOR_TEMPLATE1(template_name1)                  \
+  BOOST_IMPORT_TEMPLATE1(template_name1)                           \
+  template<class T, class B>                                       \
+  struct is_chained_base< ::boost::template_name1<T, B> > {        \
+    typedef ::boost::detail::true_t value;                         \
+  };
+
+// BOOST_OPERATOR_TEMPLATE(template_name) defines template_name<> such that it
+// can be used for specifying both 1-argument and 2-argument forms. Requires the
+// existence of two previously defined class templates named '<template_name>1'
+// and '<template_name>2' which must implement the corresponding 1- and 2-
+// argument forms.
+//
+// The template type parameter O == is_chained_base<U>::value is used to
+// distinguish whether the 2nd argument to <template_name> is being used for
+// base class chaining from another boost operator template or is describing a
+// 2nd operand type. O == true_t only when U is actually an another operator
+// template from the library. Partial specialization is used to select an
+// implementation in terms of either '<template_name>1' or '<template_name>2'.
+//
+
+# define BOOST_OPERATOR_TEMPLATE(template_name)                    \
+template <class T                                                  \
+         ,class U = T                                              \
+         ,class B = ::boost::detail::empty_base                    \
+         ,class O = typename is_chained_base<U>::value             \
+         >                                                         \
+struct template_name : template_name##2<T, U, B> {};               \
+                                                                   \
+template<class T, class U, class B>                                \
+struct template_name<T, U, B, ::boost::detail::true_t>             \
+  : template_name##1<T, U> {};                                     \
+                                                                   \
+template <class T, class B>                                        \
+struct template_name<T, T, B, ::boost::detail::false_t>            \
+  : template_name##1<T, B> {};                                     \
+                                                                   \
+template<class T, class U, class B, class O>                       \
+struct is_chained_base< ::boost::template_name<T, U, B, O> > {     \
+  typedef ::boost::detail::true_t value;                           \
+};                                                                 \
+                                                                   \
+BOOST_OPERATOR_TEMPLATE2(template_name##2)                         \
+BOOST_OPERATOR_TEMPLATE1(template_name##1)
+
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#  define BOOST_OPERATOR_TEMPLATE4(template_name4) \
+        BOOST_IMPORT_TEMPLATE4(template_name4)
+#  define BOOST_OPERATOR_TEMPLATE3(template_name3) \
+        BOOST_IMPORT_TEMPLATE3(template_name3)
+#  define BOOST_OPERATOR_TEMPLATE2(template_name2) \
+        BOOST_IMPORT_TEMPLATE2(template_name2)
+#  define BOOST_OPERATOR_TEMPLATE1(template_name1) \
+        BOOST_IMPORT_TEMPLATE1(template_name1)
+
+   // In this case we can only assume that template_name<> is equivalent to the
+   // more commonly needed template_name1<> form.
+#  define BOOST_OPERATOR_TEMPLATE(template_name)                   \
+   template <class T, class B = ::boost::detail::empty_base>       \
+   struct template_name : template_name##1<T, B> {};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace boost {
+    
+BOOST_OPERATOR_TEMPLATE(less_than_comparable)
+BOOST_OPERATOR_TEMPLATE(equality_comparable)
+BOOST_OPERATOR_TEMPLATE(multipliable)
+BOOST_OPERATOR_TEMPLATE(addable)
+BOOST_OPERATOR_TEMPLATE(subtractable)
+BOOST_OPERATOR_TEMPLATE2(subtractable2_left)
+BOOST_OPERATOR_TEMPLATE(dividable)
+BOOST_OPERATOR_TEMPLATE2(dividable2_left)
+BOOST_OPERATOR_TEMPLATE(modable)
+BOOST_OPERATOR_TEMPLATE2(modable2_left)
+BOOST_OPERATOR_TEMPLATE(xorable)
+BOOST_OPERATOR_TEMPLATE(andable)
+BOOST_OPERATOR_TEMPLATE(orable)
+
+BOOST_OPERATOR_TEMPLATE1(incrementable)
+BOOST_OPERATOR_TEMPLATE1(decrementable)
+
+BOOST_OPERATOR_TEMPLATE2(dereferenceable)
+BOOST_OPERATOR_TEMPLATE3(indexable)
+
+BOOST_OPERATOR_TEMPLATE(left_shiftable)
+BOOST_OPERATOR_TEMPLATE(right_shiftable)
+BOOST_OPERATOR_TEMPLATE(equivalent)
+BOOST_OPERATOR_TEMPLATE(partially_ordered)
+
+BOOST_OPERATOR_TEMPLATE(totally_ordered)
+BOOST_OPERATOR_TEMPLATE(additive)
+BOOST_OPERATOR_TEMPLATE(multiplicative)
+BOOST_OPERATOR_TEMPLATE(integer_multiplicative)
+BOOST_OPERATOR_TEMPLATE(arithmetic)
+BOOST_OPERATOR_TEMPLATE(integer_arithmetic)
+BOOST_OPERATOR_TEMPLATE(bitwise)
+BOOST_OPERATOR_TEMPLATE1(unit_steppable)
+BOOST_OPERATOR_TEMPLATE(shiftable)
+BOOST_OPERATOR_TEMPLATE(ring_operators)
+BOOST_OPERATOR_TEMPLATE(ordered_ring_operators)
+BOOST_OPERATOR_TEMPLATE(field_operators)
+BOOST_OPERATOR_TEMPLATE(ordered_field_operators)
+BOOST_OPERATOR_TEMPLATE(euclidian_ring_operators)
+BOOST_OPERATOR_TEMPLATE(ordered_euclidian_ring_operators)
+BOOST_OPERATOR_TEMPLATE2(input_iteratable)
+BOOST_OPERATOR_TEMPLATE1(output_iteratable)
+BOOST_OPERATOR_TEMPLATE2(forward_iteratable)
+BOOST_OPERATOR_TEMPLATE2(bidirectional_iteratable)
+BOOST_OPERATOR_TEMPLATE4(random_access_iteratable)
+
+#undef BOOST_OPERATOR_TEMPLATE
+#undef BOOST_OPERATOR_TEMPLATE4
+#undef BOOST_OPERATOR_TEMPLATE3
+#undef BOOST_OPERATOR_TEMPLATE2
+#undef BOOST_OPERATOR_TEMPLATE1
+#undef BOOST_IMPORT_TEMPLATE1
+#undef BOOST_IMPORT_TEMPLATE2
+#undef BOOST_IMPORT_TEMPLATE3
+#undef BOOST_IMPORT_TEMPLATE4
+
+// The following 'operators' classes can only be used portably if the derived class
+// declares ALL of the required member operators.
+template <class T, class U>
+struct operators2
+    : totally_ordered2<T,U
+    , integer_arithmetic2<T,U
+    , bitwise2<T,U
+      > > > {};
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <class T, class U = T>
+struct operators : operators2<T, U> {};
+
+template <class T> struct operators<T, T>
+#else
+template <class T> struct operators
+#endif
+    : totally_ordered<T
+    , integer_arithmetic<T
+    , bitwise<T
+    , unit_steppable<T
+      > > > > {};
+
+//  Iterator helper classes (contributed by Jeremy Siek) -------------------//
+//  (Input and output iterator helpers contributed by Daryle Walker) -------//
+//  (Changed to use combined operator classes by Daryle Walker) ------------//
+template <class T,
+          class V,
+          class D = std::ptrdiff_t,
+          class P = V const *,
+          class R = V const &>
+struct input_iterator_helper
+  : input_iteratable<T, P
+  , boost::iterator<std::input_iterator_tag, V, D, P, R
+    > > {};
+
+template<class T>
+struct output_iterator_helper
+  : output_iteratable<T
+  , boost::iterator<std::output_iterator_tag, void, void, void, void
+  > >
+{
+  T& operator*()  { return static_cast<T&>(*this); }
+  T& operator++() { return static_cast<T&>(*this); }
+};
+
+template <class T,
+          class V,
+          class D = std::ptrdiff_t,
+          class P = V*,
+          class R = V&>
+struct forward_iterator_helper
+  : forward_iteratable<T, P
+  , boost::iterator<std::forward_iterator_tag, V, D, P, R
+    > > {};
+
+template <class T,
+          class V,
+          class D = std::ptrdiff_t,
+          class P = V*,
+          class R = V&>
+struct bidirectional_iterator_helper
+  : bidirectional_iteratable<T, P
+  , boost::iterator<std::bidirectional_iterator_tag, V, D, P, R
+    > > {};
+
+template <class T,
+          class V, 
+          class D = std::ptrdiff_t,
+          class P = V*,
+          class R = V&>
+struct random_access_iterator_helper
+  : random_access_iteratable<T, P, D, R
+  , boost::iterator<std::random_access_iterator_tag, V, D, P, R
+    > >
+{
+  friend D requires_difference_operator(const T& x, const T& y) {
+    return x - y;
+  }
+}; // random_access_iterator_helper
+
+} // namespace boost
+
+#if defined(__sgi) && !defined(__GNUC__)
+#pragma reset woff 1234
+#endif
+
+#endif // BOOST_OPERATORS_HPP
diff --git a/boost/boost/permutation_iterator.hpp b/boost/boost/permutation_iterator.hpp
new file mode 100644 (file)
index 0000000..28ecfbb
--- /dev/null
@@ -0,0 +1,72 @@
+// (C) Copyright Toon Knapen 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.
+//
+
+#ifndef boost_permutation_iterator_hpp
+#define boost_permutation_iterator_hpp
+
+#include <boost/iterator_adaptors.hpp>
+
+namespace boost {
+
+  template < typename IndexIterator >
+  struct permutation_iterator_policies : public default_iterator_policies
+  {
+    permutation_iterator_policies() {}
+
+    permutation_iterator_policies(IndexIterator order_it) 
+      : order_it_( order_it ) 
+    {}
+
+    template <class IteratorAdaptor>
+    typename IteratorAdaptor::reference dereference(const IteratorAdaptor& x) const
+    { return *(x.base() + *order_it_); }
+
+    template <class IteratorAdaptor>
+    void increment(IteratorAdaptor&)
+    { ++order_it_; }
+
+    template <class IteratorAdaptor>
+    void decrement(IteratorAdaptor&)
+    { --order_it_; }
+
+    template <class IteratorAdaptor, class DifferenceType>
+    void advance(IteratorAdaptor& x, DifferenceType n)
+    { std::advance( order_it_, n ); }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    typename IteratorAdaptor1::difference_type
+    distance(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+    { return std::distance( x.policies().order_it_, y.policies().order_it_ ); }
+
+    template <class IteratorAdaptor1, class IteratorAdaptor2>
+    bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+    { return x.policies().order_it_ == y.policies().order_it_; }
+  
+    IndexIterator order_it_;
+  };
+
+  template < typename ElementIterator, typename IndexIterator >
+  struct permutation_iterator_generator
+  {
+    typedef boost::iterator_adaptor
+    < ElementIterator,
+      permutation_iterator_policies< IndexIterator > 
+    > type;
+  };
+
+  template < class IndexIterator, class ElementIterator >
+  inline typename permutation_iterator_generator< ElementIterator, IndexIterator >::type
+  make_permutation_iterator(ElementIterator base, IndexIterator order)
+  {
+    typedef typename permutation_iterator_generator< ElementIterator, IndexIterator >::type result_t;
+    return result_t( base, order );
+  }
+
+} // namespace boost
+
+#endif // boost_permutation_iterator_hpp
+
diff --git a/boost/boost/preprocessor.hpp b/boost/boost/preprocessor.hpp
new file mode 100644 (file)
index 0000000..cc09742
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef BOOST_PREPROCESSOR_HPP
+#define BOOST_PREPROCESSOR_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Includes all Preprocessor library headers.</p> */
+
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/assert_msg.hpp>
+#include <boost/preprocessor/comparison.hpp>
+#include <boost/preprocessor/enum_params.hpp>
+#include <boost/preprocessor/enum_params_with_a_default.hpp>
+#include <boost/preprocessor/enum_params_with_defaults.hpp>
+#include <boost/preprocessor/enum_shifted_params.hpp>
+#include <boost/preprocessor/expand.hpp>
+#include <boost/preprocessor/for.hpp>
+#include <boost/preprocessor/limits.hpp>
+#include <boost/preprocessor/list.hpp>
+#include <boost/preprocessor/logical.hpp>
+#include <boost/preprocessor/max.hpp>
+#include <boost/preprocessor/min.hpp>
+#include <boost/preprocessor/repeat_from_to.hpp>
+#include <boost/preprocessor/repeat_from_to_2nd.hpp>
+#include <boost/preprocessor/repeat_from_to_3rd.hpp>
+#include <boost/preprocessor/stringize.hpp>
+#endif
diff --git a/boost/boost/preprocessor/arithmetic.hpp b/boost/boost/preprocessor/arithmetic.hpp
new file mode 100644 (file)
index 0000000..89e4d76
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef BOOST_PREPROCESSOR_ARITHMETIC_HPP
+#define BOOST_PREPROCESSOR_ARITHMETIC_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Includes all arithmetic headers.</p> */
+
+#include <boost/preprocessor/arithmetic/div.hpp>
+#include <boost/preprocessor/arithmetic/mod.hpp>
+#include <boost/preprocessor/arithmetic/mul.hpp>
+#endif
diff --git a/boost/boost/preprocessor/arithmetic/add.hpp b/boost/boost/preprocessor/arithmetic/add.hpp
new file mode 100644 (file)
index 0000000..fe8b536
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP
+#define BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/inc.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/while.hpp>
+
+/** <p>Expands to the sum of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_ADD(4,3)</code> expands to <code>7</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_ADD(X,Y) BOOST_PP_ADD_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_ADD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_ADD_C,BOOST_PP_ADD_F,(X,Y)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P)
+#  define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,P)))
+#else
+#  define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE2_ELEM1 P
+#  define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P))
+#endif
+
+/* <p>Obsolete. Use BOOST_PP_ADD().</p> */
+#define BOOST_PREPROCESSOR_ADD(X,Y) BOOST_PP_ADD(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/arithmetic/div.hpp b/boost/boost/preprocessor/arithmetic/div.hpp
new file mode 100644 (file)
index 0000000..8f41662
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef BOOST_PREPROCESSOR_ARITHMETIC_DIV_HPP
+#define BOOST_PREPROCESSOR_ARITHMETIC_DIV_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/inc.hpp>
+
+/** <p>Expands to the quotient of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_DIV(4,3)</code> expands to <code>1</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_DIV(X,Y) BOOST_PP_DIV_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_DIV_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_DIV_C,BOOST_PP_DIV_F,(0,X,Y)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,P),BOOST_PP_TUPLE_ELEM(3,1,P))
+#  define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,P)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_TUPLE_ELEM(3,2,P)),BOOST_PP_TUPLE_ELEM(3,2,P))
+#else
+#  define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE3_ELEM2 P,BOOST_PP_TUPLE3_ELEM1 P)
+#  define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE3_ELEM0 P),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_TUPLE3_ELEM2 P),BOOST_PP_TUPLE3_ELEM2 P)
+#endif
+
+/* <p>Obsolete. Use BOOST_PP_DIV().</p> */
+#define BOOST_PREPROCESSOR_DIV(X,Y) BOOST_PP_DIV(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/arithmetic/mod.hpp b/boost/boost/preprocessor/arithmetic/mod.hpp
new file mode 100644 (file)
index 0000000..0cc043d
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BOOST_PREPROCESSOR_ARITHMETIC_MOD_HPP
+#define BOOST_PREPROCESSOR_ARITHMETIC_MOD_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+
+/** <p>Expands to the remainder of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_MOD(4,3)</code> expands to <code>1</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_MOD(X,Y) BOOST_PP_MOD_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_MOD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_MOD_C,BOOST_PP_MOD_F,(X,Y)))
+#define BOOST_PP_MOD_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE2_ELEM1 P,BOOST_PP_TUPLE2_ELEM0 P)
+#define BOOST_PP_MOD_F(D,P) (BOOST_PP_SUB_D(D,BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM1 P),BOOST_PP_TUPLE2_ELEM1 P)
+
+/* <p>Obsolete. Use BOOST_PP_MOD().</p> */
+#define BOOST_PREPROCESSOR_MOD(X,Y) BOOST_PP_MOD(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/arithmetic/mul.hpp b/boost/boost/preprocessor/arithmetic/mul.hpp
new file mode 100644 (file)
index 0000000..2ab66fd
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
+#define BOOST_PREPROCESSOR_ARITHMETIC_MUL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/arithmetic/add.hpp>
+
+/** <p>Expands to the product of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_MUL(4,3)</code> expands to <code>12</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_MUL(X,Y) BOOST_PP_MUL_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_MUL_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_MUL_C,BOOST_PP_MUL_F,(0,X,Y)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE_ELEM(3,2,P)
+#  define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P)),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,P)))
+#else
+#  define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE3_ELEM2 P
+#  define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 P))
+#endif
+
+/* <p>Obsolete. Use BOOST_PP_MUL().</p> */
+#define BOOST_PREPROCESSOR_MUL(X,Y) BOOST_PP_MUL(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/arithmetic/sub.hpp b/boost/boost/preprocessor/arithmetic/sub.hpp
new file mode 100644 (file)
index 0000000..9fece28
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef BOOST_PREPROCESSOR_ARITHMETIC_SUB_HPP
+#define BOOST_PREPROCESSOR_ARITHMETIC_SUB_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/while.hpp>
+
+/** <p>Expands to the difference of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_SUB(4,3)</code> expands to <code>1</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_SUB(X,Y) BOOST_PP_SUB_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_SUB_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_SUB_C,BOOST_PP_SUB_F,(X,Y)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P)
+#  define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,P)))
+#else
+#  define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE2_ELEM1 P
+#  define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P))
+#endif
+
+/* <p>Obsolete. Use BOOST_PP_SUB(X,Y).</p> */
+#define BOOST_PREPROCESSOR_SUB(X,Y) BOOST_PP_SUB(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/assert_msg.hpp b/boost/boost/preprocessor/assert_msg.hpp
new file mode 100644 (file)
index 0000000..ff36db3
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef BOOST_PREPROCESSOR_ASSERT_MSG_HPP
+#define BOOST_PREPROCESSOR_ASSERT_MSG_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/expr_if.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+
+/** <p>Expands to nothing if <code>COND != 0</code> and to <code>MSG</code> if
+<code>COND == 0</code>.</p>
+
+<p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_ASSERT_MSG(1,A BUG!)</code> expands to <code>A BUG!</code>.</p>
+*/
+#define BOOST_PP_ASSERT_MSG(COND,MSG) BOOST_PP_EXPR_IF(BOOST_PP_NOT(COND),MSG)
+
+/* <p>Obsolete. Use BOOST_PP_ASSERT_MSG().</p> */
+#define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG)
+#endif
diff --git a/boost/boost/preprocessor/cat.hpp b/boost/boost/preprocessor/cat.hpp
new file mode 100644 (file)
index 0000000..e5bc9d9
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef BOOST_PREPROCESSOR_CAT_HPP
+#define BOOST_PREPROCESSOR_CAT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Concatenates <code>X</code> and <code>Y</code> after they are macro
+expanded.</p>
+
+<p>For example, <code>BOOST_PP_CAT(A,BOOST_PP_CAT(_,B))</code> expands to <code>A_B</code>.</p>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/static_assert.c">static_assert.c</a></li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_CAT(X,Y) BOOST_PP_CAT_DELAY(X,Y)
+
+#define BOOST_PP_CAT_DELAY(X,Y) BOOST_PP_DO_CAT(X,Y)
+#define BOOST_PP_DO_CAT(X,Y) X##Y
+
+/* <p>Obsolete. Use BOOST_PP_CAT().</p> */
+#define BOOST_PREPROCESSOR_CAT(X,Y) BOOST_PP_CAT(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/comma.hpp b/boost/boost/preprocessor/comma.hpp
new file mode 100644 (file)
index 0000000..a17a210
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef BOOST_PREPROCESSOR_COMMA_HPP
+#define BOOST_PREPROCESSOR_COMMA_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Expands to a comma.</p>
+
+<p>Commas need special handling in preprocessor code, because commas are used
+for separating macro parameters.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_IF(1,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
+</pre>
+
+<p>expands to a comma.</p>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_COMMA_IF()</li>
+</ul>
+*/
+#define BOOST_PP_COMMA() ,
+
+/* <p>Obsolete. Use BOOST_PP_COMMA().</p> */
+#define BOOST_PREPROCESSOR_COMMA() ,
+#endif
diff --git a/boost/boost/preprocessor/comma_if.hpp b/boost/boost/preprocessor/comma_if.hpp
new file mode 100644 (file)
index 0000000..a3b49d3
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef BOOST_PREPROCESSOR_COMMA_IF_HPP
+#define BOOST_PREPROCESSOR_COMMA_IF_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comma.hpp>
+#include <boost/preprocessor/empty.hpp>
+#include <boost/preprocessor/if.hpp>
+
+/** <p>Expands to a comma if <code>COND != 0</code> and nothing if
+<code>COND == 0</code>.</p>
+
+<p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_COMMA_IF(0)</code> expands to nothing.</p>
+*/
+#define BOOST_PP_COMMA_IF(COND) BOOST_PP_IF(COND,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
+
+/* <p>Obsolete. Use BOOST_PP_COMMA_IF().</p> */
+#define BOOST_PREPROCESSOR_COMMA_IF(C) BOOST_PP_COMMA_IF(C)
+#endif
diff --git a/boost/boost/preprocessor/comparison.hpp b/boost/boost/preprocessor/comparison.hpp
new file mode 100644 (file)
index 0000000..b9bb152
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Includes all comparison headers.</p> */
+
+#include <boost/preprocessor/comparison/equal.hpp>
+#include <boost/preprocessor/comparison/greater.hpp>
+#include <boost/preprocessor/comparison/greater_equal.hpp>
+#endif
diff --git a/boost/boost/preprocessor/comparison/equal.hpp b/boost/boost/preprocessor/comparison/equal.hpp
new file mode 100644 (file)
index 0000000..3802876
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_EQUAL_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_EQUAL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/not_equal.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+
+/** <p>Expands to <code>1</code> if <code>X == Y</code> and <code>0</code>
+otherwise.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_EQUAL(4,4)</code> expands to <code>1</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_EQUAL(X,Y) BOOST_PP_EQUAL_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_NOT_EQUAL_D(D,X,Y))
+
+/* <p>Obsolete. Use BOOST_PP_EQUAL().</p> */
+#define BOOST_PREPROCESSOR_EQUAL(X,Y) BOOST_PP_EQUAL(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/comparison/greater.hpp b/boost/boost/preprocessor/comparison/greater.hpp
new file mode 100644 (file)
index 0000000..09c137b
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_GREATER_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_GREATER_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less.hpp>
+
+/** <p>Expands to <code>1</code> if <code>X &gt; Y</code> and <code>0</code>
+otherwise.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_GREATER(4,3)</code> expands to <code>1</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_GREATER(X,Y) BOOST_PP_GREATER_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_GREATER_D(D,X,Y) BOOST_PP_LESS_D(D,Y,X)
+
+/* <p>Obsolete. Use BOOST_PP_GREATER().</p> */
+#define BOOST_PREPROCESSOR_GREATER(X,Y) BOOST_PP_GREATER(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/comparison/greater_equal.hpp b/boost/boost/preprocessor/comparison/greater_equal.hpp
new file mode 100644 (file)
index 0000000..c327543
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_GREATER_EQUAL_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_GREATER_EQUAL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+
+/** <p>Expands to <code>1</code> if <code>X &gt;= Y</code> and <code>0</code>
+otherwise.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_GREATER_EQUAL(1,3)</code> expands to <code>0</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_GREATER_EQUAL_D(D,X,Y) BOOST_PP_LESS_EQUAL_D(D,Y,X)
+
+/* <p>Obsolete. Use BOOST_PP_GREATER_EQUAL().</p> */
+#define BOOST_PREPROCESSOR_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/comparison/less.hpp b/boost/boost/preprocessor/comparison/less.hpp
new file mode 100644 (file)
index 0000000..9d0a197
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_LESS_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_LESS_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/comparison/not_equal.hpp>
+#include <boost/preprocessor/logical/and.hpp>
+
+/** <p>Expands to <code>1</code> if <code>X &lt; Y</code> and <code>0</code>
+otherwise.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_LESS(2,6)</code> expands to <code>1</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LESS(X,Y) BOOST_PP_LESS_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LESS_D(D,X,Y) BOOST_PP_AND(BOOST_PP_NOT_EQUAL_D(D,X,Y),BOOST_PP_LESS_EQUAL_D(D,X,Y))
+
+/* <p>Obsolete. Use BOOST_PP_LESS().</p> */
+#define BOOST_PREPROCESSOR_LESS(X,Y) BOOST_PP_LESS(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/comparison/less_equal.hpp b/boost/boost/preprocessor/comparison/less_equal.hpp
new file mode 100644 (file)
index 0000000..fa8e69f
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_LESS_EQUAL_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_LESS_EQUAL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+
+/** <p>Expands to <code>1</code> if <code>X &lt;= Y</code> and <code>0</code>
+otherwise.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_LESS_EQUAL(7,5)</code> expands to <code>0</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LESS_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_SUB_D(D,X,Y))
+
+/* <p>Obsolete. Use BOOST_PP_LESS_EQUAL().</p> */
+#define BOOST_PREPROCESSOR_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/comparison/not_equal.hpp b/boost/boost/preprocessor/comparison/not_equal.hpp
new file mode 100644 (file)
index 0000000..82ae0b6
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef BOOST_PREPROCESSOR_COMPARISON_NOT_EQUAL_HPP
+#define BOOST_PREPROCESSOR_COMPARISON_NOT_EQUAL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/logical/bool.hpp>
+
+/** <p>Expands to <code>1</code> if <code>X != Y</code> and <code>0</code>
+otherwise.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_NOT_EQUAL(4,4)</code> expands to <code>0</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_NOT_EQUAL_D(D,X,Y) BOOST_PP_BOOL(BOOST_PP_ADD_D(D,BOOST_PP_SUB_D(D,X,Y),BOOST_PP_SUB_D(D,Y,X)))
+
+/* <p>Obsolete. Use BOOST_PP_NOT_EQUAL().</p> */
+#define BOOST_PREPROCESSOR_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/dec.hpp b/boost/boost/preprocessor/dec.hpp
new file mode 100644 (file)
index 0000000..35718ef
--- /dev/null
@@ -0,0 +1,161 @@
+#ifndef BOOST_PREPROCESSOR_DEC_HPP
+#define BOOST_PREPROCESSOR_DEC_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Decrements <code>X</code> expanding to a single token.</p>
+
+<p>For example, <code>BOOST_PP_DEC(3)</code> expands to <code>2</code> (a
+single token).</p>
+
+<p>BOOST_PP_DEC() uses saturation arithmetic. Decrementing 0 yeilds a 0.</p>
+
+<p>Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are
+supported.</p>
+*/
+#define BOOST_PP_DEC(X) BOOST_PP_DEC_DELAY(X)
+
+#define BOOST_PP_DEC_DELAY(X) BOOST_PP_DEC##X
+#define BOOST_PP_DEC0 0
+#define BOOST_PP_DEC1 0
+#define BOOST_PP_DEC2 1
+#define BOOST_PP_DEC3 2
+#define BOOST_PP_DEC4 3
+#define BOOST_PP_DEC5 4
+#define BOOST_PP_DEC6 5
+#define BOOST_PP_DEC7 6
+#define BOOST_PP_DEC8 7
+#define BOOST_PP_DEC9 8
+#define BOOST_PP_DEC10 9
+#define BOOST_PP_DEC11 10
+#define BOOST_PP_DEC12 11
+#define BOOST_PP_DEC13 12
+#define BOOST_PP_DEC14 13
+#define BOOST_PP_DEC15 14
+#define BOOST_PP_DEC16 15
+#define BOOST_PP_DEC17 16
+#define BOOST_PP_DEC18 17
+#define BOOST_PP_DEC19 18
+#define BOOST_PP_DEC20 19
+#define BOOST_PP_DEC21 20
+#define BOOST_PP_DEC22 21
+#define BOOST_PP_DEC23 22
+#define BOOST_PP_DEC24 23
+#define BOOST_PP_DEC25 24
+#define BOOST_PP_DEC26 25
+#define BOOST_PP_DEC27 26
+#define BOOST_PP_DEC28 27
+#define BOOST_PP_DEC29 28
+#define BOOST_PP_DEC30 29
+#define BOOST_PP_DEC31 30
+#define BOOST_PP_DEC32 31
+#define BOOST_PP_DEC33 32
+#define BOOST_PP_DEC34 33
+#define BOOST_PP_DEC35 34
+#define BOOST_PP_DEC36 35
+#define BOOST_PP_DEC37 36
+#define BOOST_PP_DEC38 37
+#define BOOST_PP_DEC39 38
+#define BOOST_PP_DEC40 39
+#define BOOST_PP_DEC41 40
+#define BOOST_PP_DEC42 41
+#define BOOST_PP_DEC43 42
+#define BOOST_PP_DEC44 43
+#define BOOST_PP_DEC45 44
+#define BOOST_PP_DEC46 45
+#define BOOST_PP_DEC47 46
+#define BOOST_PP_DEC48 47
+#define BOOST_PP_DEC49 48
+#define BOOST_PP_DEC50 49
+#define BOOST_PP_DEC51 50
+#define BOOST_PP_DEC52 51
+#define BOOST_PP_DEC53 52
+#define BOOST_PP_DEC54 53
+#define BOOST_PP_DEC55 54
+#define BOOST_PP_DEC56 55
+#define BOOST_PP_DEC57 56
+#define BOOST_PP_DEC58 57
+#define BOOST_PP_DEC59 58
+#define BOOST_PP_DEC60 59
+#define BOOST_PP_DEC61 60
+#define BOOST_PP_DEC62 61
+#define BOOST_PP_DEC63 62
+#define BOOST_PP_DEC64 63
+#define BOOST_PP_DEC65 64
+#define BOOST_PP_DEC66 65
+#define BOOST_PP_DEC67 66
+#define BOOST_PP_DEC68 67
+#define BOOST_PP_DEC69 68
+#define BOOST_PP_DEC70 69
+#define BOOST_PP_DEC71 70
+#define BOOST_PP_DEC72 71
+#define BOOST_PP_DEC73 72
+#define BOOST_PP_DEC74 73
+#define BOOST_PP_DEC75 74
+#define BOOST_PP_DEC76 75
+#define BOOST_PP_DEC77 76
+#define BOOST_PP_DEC78 77
+#define BOOST_PP_DEC79 78
+#define BOOST_PP_DEC80 79
+#define BOOST_PP_DEC81 80
+#define BOOST_PP_DEC82 81
+#define BOOST_PP_DEC83 82
+#define BOOST_PP_DEC84 83
+#define BOOST_PP_DEC85 84
+#define BOOST_PP_DEC86 85
+#define BOOST_PP_DEC87 86
+#define BOOST_PP_DEC88 87
+#define BOOST_PP_DEC89 88
+#define BOOST_PP_DEC90 89
+#define BOOST_PP_DEC91 90
+#define BOOST_PP_DEC92 91
+#define BOOST_PP_DEC93 92
+#define BOOST_PP_DEC94 93
+#define BOOST_PP_DEC95 94
+#define BOOST_PP_DEC96 95
+#define BOOST_PP_DEC97 96
+#define BOOST_PP_DEC98 97
+#define BOOST_PP_DEC99 98
+#define BOOST_PP_DEC100 99
+#define BOOST_PP_DEC101 100
+#define BOOST_PP_DEC102 101
+#define BOOST_PP_DEC103 102
+#define BOOST_PP_DEC104 103
+#define BOOST_PP_DEC105 104
+#define BOOST_PP_DEC106 105
+#define BOOST_PP_DEC107 106
+#define BOOST_PP_DEC108 107
+#define BOOST_PP_DEC109 108
+#define BOOST_PP_DEC110 109
+#define BOOST_PP_DEC111 110
+#define BOOST_PP_DEC112 111
+#define BOOST_PP_DEC113 112
+#define BOOST_PP_DEC114 113
+#define BOOST_PP_DEC115 114
+#define BOOST_PP_DEC116 115
+#define BOOST_PP_DEC117 116
+#define BOOST_PP_DEC118 117
+#define BOOST_PP_DEC119 118
+#define BOOST_PP_DEC120 119
+#define BOOST_PP_DEC121 120
+#define BOOST_PP_DEC122 121
+#define BOOST_PP_DEC123 122
+#define BOOST_PP_DEC124 123
+#define BOOST_PP_DEC125 124
+#define BOOST_PP_DEC126 125
+#define BOOST_PP_DEC127 126
+#define BOOST_PP_DEC128 127
+
+/* <p>Obsolete. Use BOOST_PP_DEC().</p> */
+#define BOOST_PREPROCESSOR_DEC(X) BOOST_PP_DEC(X)
+#endif
diff --git a/boost/boost/preprocessor/empty.hpp b/boost/boost/preprocessor/empty.hpp
new file mode 100644 (file)
index 0000000..250450c
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef BOOST_PREPROCESSOR_EMPTY_HPP
+#define BOOST_PREPROCESSOR_EMPTY_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Expands to nothing.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_IF(0,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
+</pre>
+
+<p>expands to nothing.</p>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/subscript_layer.cpp">subscript_layer.cpp</a></li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_EMPTY()
+
+/* <p>Obsolete. Use BOOST_PP_EMPTY().</p> */
+#define BOOST_PREPROCESSOR_EMPTY()
+#endif
diff --git a/boost/boost/preprocessor/enum.hpp b/boost/boost/preprocessor/enum.hpp
new file mode 100644 (file)
index 0000000..c11222c
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef BOOST_PREPROCESSOR_ENUM_HPP
+#define BOOST_PREPROCESSOR_ENUM_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comma_if.hpp>
+#include <boost/preprocessor/repeat.hpp>
+#include <boost/preprocessor/tuple.hpp>
+
+/** <p>Generates a comma separated list.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TYPED_PARAM(INDEX,DATA)\
+  BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
+BOOST_PP_ENUM(3,TYPED_PARAM,(X,x))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+X0 x0, X1 x1, X2 x2
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_ENUM(COUNT,MACRO,DATA) BOOST_PP_REPEAT(COUNT,BOOST_PP_ENUM_F,(MACRO,DATA))
+
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,FP)(I,BOOST_PP_TUPLE_ELEM(2,1,FP))
+#else
+#  define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 FP(I,BOOST_PP_TUPLE2_ELEM1 FP)
+#endif
+#endif
diff --git a/boost/boost/preprocessor/enum_params.hpp b/boost/boost/preprocessor/enum_params.hpp
new file mode 100644 (file)
index 0000000..8754ee1
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_HPP
+#define BOOST_PREPROCESSOR_ENUM_PARAMS_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/enum.hpp>
+
+/** <p>Generates a comma separated list of parameters.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
+</pre>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_ENUM_PARAMS(3,x)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+x0, x1, x2
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_ENUM_PARAMS(COUNT,PARAM) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_F,PARAM)
+
+#define BOOST_PP_ENUM_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
+
+/* <p>Obsolete. Use BOOST_PP_ENUM_PARAMS().</p> */
+#define BOOST_PREPROCESSOR_ENUM_PARAMS(N,P) BOOST_PP_ENUM_PARAMS(N,P)
+#endif
diff --git a/boost/boost/preprocessor/enum_params_with_a_default.hpp b/boost/boost/preprocessor/enum_params_with_a_default.hpp
new file mode 100644 (file)
index 0000000..1b31a63
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT_HPP
+#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/enum.hpp>
+
+/** <p>Generates a comma separated list of parameters with a default.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+BOOST_PP_CAT(PARAM,0) = DEFAULT,
+BOOST_PP_CAT(PARAM,1) = DEFAULT,
+...,
+BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
+</pre>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3,x,y)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+x0 = y, x1 = y, x2 = y
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(PARAM,DEFAULT))
+
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_TUPLE_ELEM(2,1,PD)
+#else
+#  define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_TUPLE2_ELEM1 PD
+#endif
+
+/* <p>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT().</p> */
+#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D)
+#endif
diff --git a/boost/boost/preprocessor/enum_params_with_defaults.hpp b/boost/boost/preprocessor/enum_params_with_defaults.hpp
new file mode 100644 (file)
index 0000000..5281f02
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS_HPP
+#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/enum.hpp>
+
+/** <p>Generates a comma separated list of parameters with defaults.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0),
+BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1),
+...,
+BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT))
+</pre>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3,x,y)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+x0 = y0, x1 = y1, x2 = y2
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(PARAM,DEFAULT))
+
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,PD),I)
+#else
+#  define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM1 PD,I)
+#endif
+
+/* <p>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS().</p> */
+#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D)
+#endif
diff --git a/boost/boost/preprocessor/enum_shifted.hpp b/boost/boost/preprocessor/enum_shifted.hpp
new file mode 100644 (file)
index 0000000..9204614
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef BOOST_PREPROCESSOR_ENUM_SHIFTED_HPP
+#define BOOST_PREPROCESSOR_ENUM_SHIFTED_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/enum.hpp>
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/inc.hpp>
+
+/** <p>Generates a comma separated shifted list.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TYPED_PARAM(INDEX,DATA)\
+  BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
+BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+X1 x1, X2 x2
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+*/
+#define BOOST_PP_ENUM_SHIFTED(COUNT,MACRO,DATA) BOOST_PP_ENUM(BOOST_PP_DEC(COUNT),BOOST_PP_ENUM_SHIFTED_F,(MACRO,DATA))
+
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE_ELEM(2,0,FP)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,FP))
+#else
+#  define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE2_ELEM0 FP(BOOST_PP_INC(I),BOOST_PP_TUPLE2_ELEM1 FP)
+#endif
+#endif
diff --git a/boost/boost/preprocessor/enum_shifted_params.hpp b/boost/boost/preprocessor/enum_shifted_params.hpp
new file mode 100644 (file)
index 0000000..58bce38
--- /dev/null
@@ -0,0 +1,60 @@
+#ifndef BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS_HPP
+#define BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/enum_shifted.hpp>
+
+/** <p>Generates a comma separated list of shifted actual parameters.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
+</pre>
+<p>For example,</p>
+
+<pre>
+BOOST_PP_ENUM_SHIFTED_PARAMS(3,x)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+x1, x2
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+
+<h3>Rationale</h3>
+<ul>
+  <li>This macro facilitates a typical usage of the library. Shifted parameter
+      lists are common in template metaprograms.</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_2nd_test.cpp">repeat_2nd_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_ENUM_SHIFTED_PARAMS(COUNT,PARAM) BOOST_PP_ENUM_SHIFTED(COUNT,BOOST_PP_ENUM_SHIFTED_PARAMS_F,PARAM)
+
+#define BOOST_PP_ENUM_SHIFTED_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
+
+/* <p>Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS().</p> */
+#define BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED_PARAMS(N,P)
+#endif
diff --git a/boost/boost/preprocessor/expand.hpp b/boost/boost/preprocessor/expand.hpp
new file mode 100644 (file)
index 0000000..9f81b50
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef BOOST_PREPROCESSOR_EXPAND_HPP
+#define BOOST_PREPROCESSOR_EXPAND_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/identity.hpp>
+
+/** <p>Essentially macro expands the parameter <code>X</code> twice.</p> */
+#define BOOST_PP_EXPAND(X) X
+#endif
diff --git a/boost/boost/preprocessor/expr_if.hpp b/boost/boost/preprocessor/expr_if.hpp
new file mode 100644 (file)
index 0000000..7122c3f
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef BOOST_PREPROCESSOR_EXPR_IF_HPP
+#define BOOST_PREPROCESSOR_EXPR_IF_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/bool.hpp>
+
+/** <p>Expands to <code>EXPR</code> if <code>COND != 0</code> and to nothing if <code>COND == 0</code>.</p>
+
+<p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_EXPR_IF(1,^)</code> expands to <code>^</code>.</p>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_IF()</li>
+</ul>
+*/
+#define BOOST_PP_EXPR_IF(COND,EXPR) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(COND))(EXPR)
+
+#define BOOST_PP_EXPR_IF_BOOL(C) BOOST_PP_EXPR_IF_BOOL_DELAY(C)
+#define BOOST_PP_EXPR_IF_BOOL_DELAY(C) BOOST_PP_EXPR_IF_BOOL##C
+#define BOOST_PP_EXPR_IF_BOOL0(E)
+#define BOOST_PP_EXPR_IF_BOOL1(E) E
+#endif
diff --git a/boost/boost/preprocessor/for.hpp b/boost/boost/preprocessor/for.hpp
new file mode 100644 (file)
index 0000000..d6dab32
--- /dev/null
@@ -0,0 +1,217 @@
+#ifndef BOOST_PREPROCESSOR_FOR_HPP
+#define BOOST_PREPROCESSOR_FOR_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/if.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+/** <p>Repeats <code>MACRO(R,STATE)</code> and iterates <code>OP(R,STATE)</code> while
+<code>PRED(R,STATE)</code> is true.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(R,STATE)
+MACRO(R,OP(R,STATE))
+MACRO(R,OP(R,OP(R,STATE)))
+...
+MACRO(R,OP(R,OP(...OP(R,STATE)...)))
+</pre>
+
+<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
+
+<p>For example,</p>
+
+<pre>
+#define PRED(R,STATE) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+#define OP(R,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+#define MACRO(R,STATE) BOOST_PP_TUPLE_ELEM(2,0,STATE)
+BOOST_PP_FOR((0,3),PRED,OP,MACRO)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+0 1 2
+</pre>
+
+<h3>Legend</h3>
+<ul>
+  <li><b>STATE</b> is the current state of iteration. The state is usually a tuple.</li>
+  <li><b>PRED</b> is the condition for iteration. It must expand to a decimal
+      integer literal.</li>
+  <li><b>OP</b> is the iterated macro. Note that if the state is a tuple, then
+      OP(R,STATE) usually expands to a tuple of the same number of elements.</li>
+  <li><b>MACRO</b> is the state instantiation macro.</li>
+  <li><b>R</b> is the recursion depth and should only be used as a parameter to
+      other macros using BOOST_PP_FOR() or for invoking BOOST_PP_FOR##R()
+      directly. For each macro using BOOST_PP_FOR(), e.g. BOOST_PP_LIST_FOR_EACH(),
+      there is a version of the macro, e.g. BOOST_PP_LIST_FOR_EACH_R(), distinguished
+      by the R suffix, that accepts an additional recursion depth as the first
+      parameter. This technique is necessary to avoid recursively expanding the same
+      macro again, which is not permitted by the C++ preprocessor.</li>
+</ul>
+
+<h3>BOOST_PP_REPEAT() vs BOOST_PP_FOR()</h3>
+
+<p>BOOST_PP_FOR() is a generalization of BOOST_PP_REPEAT(). This means that
+BOOST_PP_REPEAT() can be implemented using BOOST_PP_FOR(). However,
+BOOST_PP_REPEAT() was introduced earlier, is generally easier to use, and is
+still quite useful on its own.</p>
+
+<h3>2D and 3D repetition</h3>
+
+<p>BOOST_PP_FOR() can be used for multidimensional repetition simply by
+invoking BOOST_PP_FOR##R() directly.</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/for_test.cpp">for_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_FOR(STATE,PRED,OP,MACRO) BOOST_PP_FOR0(STATE,PRED,OP,MACRO)
+
+#define BOOST_PP_FOR_C0(P,R,S,M) BOOST_PP_IF(P(R,S),M,BOOST_PP_TUPLE2_EAT)
+#define BOOST_PP_FOR_C1(P,R,S) BOOST_PP_IF(P(R,S),BOOST_PP_FOR##R,BOOST_PP_TUPLE4_EAT)
+#define BOOST_PP_FOR0(S,P,O,M) BOOST_PP_FOR_C0(P,1,S,M)(1,S) BOOST_PP_FOR_C1(P,1,S)(O(1,S),P,O,M)
+#define BOOST_PP_FOR1(S,P,O,M) BOOST_PP_FOR_C0(P,2,S,M)(2,S) BOOST_PP_FOR_C1(P,2,S)(O(2,S),P,O,M)
+#define BOOST_PP_FOR2(S,P,O,M) BOOST_PP_FOR_C0(P,3,S,M)(3,S) BOOST_PP_FOR_C1(P,3,S)(O(3,S),P,O,M)
+#define BOOST_PP_FOR3(S,P,O,M) BOOST_PP_FOR_C0(P,4,S,M)(4,S) BOOST_PP_FOR_C1(P,4,S)(O(4,S),P,O,M)
+#define BOOST_PP_FOR4(S,P,O,M) BOOST_PP_FOR_C0(P,5,S,M)(5,S) BOOST_PP_FOR_C1(P,5,S)(O(5,S),P,O,M)
+#define BOOST_PP_FOR5(S,P,O,M) BOOST_PP_FOR_C0(P,6,S,M)(6,S) BOOST_PP_FOR_C1(P,6,S)(O(6,S),P,O,M)
+#define BOOST_PP_FOR6(S,P,O,M) BOOST_PP_FOR_C0(P,7,S,M)(7,S) BOOST_PP_FOR_C1(P,7,S)(O(7,S),P,O,M)
+#define BOOST_PP_FOR7(S,P,O,M) BOOST_PP_FOR_C0(P,8,S,M)(8,S) BOOST_PP_FOR_C1(P,8,S)(O(8,S),P,O,M)
+#define BOOST_PP_FOR8(S,P,O,M) BOOST_PP_FOR_C0(P,9,S,M)(9,S) BOOST_PP_FOR_C1(P,9,S)(O(9,S),P,O,M)
+#define BOOST_PP_FOR9(S,P,O,M) BOOST_PP_FOR_C0(P,10,S,M)(10,S) BOOST_PP_FOR_C1(P,10,S)(O(10,S),P,O,M)
+#define BOOST_PP_FOR10(S,P,O,M) BOOST_PP_FOR_C0(P,11,S,M)(11,S) BOOST_PP_FOR_C1(P,11,S)(O(11,S),P,O,M)
+#define BOOST_PP_FOR11(S,P,O,M) BOOST_PP_FOR_C0(P,12,S,M)(12,S) BOOST_PP_FOR_C1(P,12,S)(O(12,S),P,O,M)
+#define BOOST_PP_FOR12(S,P,O,M) BOOST_PP_FOR_C0(P,13,S,M)(13,S) BOOST_PP_FOR_C1(P,13,S)(O(13,S),P,O,M)
+#define BOOST_PP_FOR13(S,P,O,M) BOOST_PP_FOR_C0(P,14,S,M)(14,S) BOOST_PP_FOR_C1(P,14,S)(O(14,S),P,O,M)
+#define BOOST_PP_FOR14(S,P,O,M) BOOST_PP_FOR_C0(P,15,S,M)(15,S) BOOST_PP_FOR_C1(P,15,S)(O(15,S),P,O,M)
+#define BOOST_PP_FOR15(S,P,O,M) BOOST_PP_FOR_C0(P,16,S,M)(16,S) BOOST_PP_FOR_C1(P,16,S)(O(16,S),P,O,M)
+#define BOOST_PP_FOR16(S,P,O,M) BOOST_PP_FOR_C0(P,17,S,M)(17,S) BOOST_PP_FOR_C1(P,17,S)(O(17,S),P,O,M)
+#define BOOST_PP_FOR17(S,P,O,M) BOOST_PP_FOR_C0(P,18,S,M)(18,S) BOOST_PP_FOR_C1(P,18,S)(O(18,S),P,O,M)
+#define BOOST_PP_FOR18(S,P,O,M) BOOST_PP_FOR_C0(P,19,S,M)(19,S) BOOST_PP_FOR_C1(P,19,S)(O(19,S),P,O,M)
+#define BOOST_PP_FOR19(S,P,O,M) BOOST_PP_FOR_C0(P,20,S,M)(20,S) BOOST_PP_FOR_C1(P,20,S)(O(20,S),P,O,M)
+#define BOOST_PP_FOR20(S,P,O,M) BOOST_PP_FOR_C0(P,21,S,M)(21,S) BOOST_PP_FOR_C1(P,21,S)(O(21,S),P,O,M)
+#define BOOST_PP_FOR21(S,P,O,M) BOOST_PP_FOR_C0(P,22,S,M)(22,S) BOOST_PP_FOR_C1(P,22,S)(O(22,S),P,O,M)
+#define BOOST_PP_FOR22(S,P,O,M) BOOST_PP_FOR_C0(P,23,S,M)(23,S) BOOST_PP_FOR_C1(P,23,S)(O(23,S),P,O,M)
+#define BOOST_PP_FOR23(S,P,O,M) BOOST_PP_FOR_C0(P,24,S,M)(24,S) BOOST_PP_FOR_C1(P,24,S)(O(24,S),P,O,M)
+#define BOOST_PP_FOR24(S,P,O,M) BOOST_PP_FOR_C0(P,25,S,M)(25,S) BOOST_PP_FOR_C1(P,25,S)(O(25,S),P,O,M)
+#define BOOST_PP_FOR25(S,P,O,M) BOOST_PP_FOR_C0(P,26,S,M)(26,S) BOOST_PP_FOR_C1(P,26,S)(O(26,S),P,O,M)
+#define BOOST_PP_FOR26(S,P,O,M) BOOST_PP_FOR_C0(P,27,S,M)(27,S) BOOST_PP_FOR_C1(P,27,S)(O(27,S),P,O,M)
+#define BOOST_PP_FOR27(S,P,O,M) BOOST_PP_FOR_C0(P,28,S,M)(28,S) BOOST_PP_FOR_C1(P,28,S)(O(28,S),P,O,M)
+#define BOOST_PP_FOR28(S,P,O,M) BOOST_PP_FOR_C0(P,29,S,M)(29,S) BOOST_PP_FOR_C1(P,29,S)(O(29,S),P,O,M)
+#define BOOST_PP_FOR29(S,P,O,M) BOOST_PP_FOR_C0(P,30,S,M)(30,S) BOOST_PP_FOR_C1(P,30,S)(O(30,S),P,O,M)
+#define BOOST_PP_FOR30(S,P,O,M) BOOST_PP_FOR_C0(P,31,S,M)(31,S) BOOST_PP_FOR_C1(P,31,S)(O(31,S),P,O,M)
+#define BOOST_PP_FOR31(S,P,O,M) BOOST_PP_FOR_C0(P,32,S,M)(32,S) BOOST_PP_FOR_C1(P,32,S)(O(32,S),P,O,M)
+#define BOOST_PP_FOR32(S,P,O,M) BOOST_PP_FOR_C0(P,33,S,M)(33,S) BOOST_PP_FOR_C1(P,33,S)(O(33,S),P,O,M)
+#define BOOST_PP_FOR33(S,P,O,M) BOOST_PP_FOR_C0(P,34,S,M)(34,S) BOOST_PP_FOR_C1(P,34,S)(O(34,S),P,O,M)
+#define BOOST_PP_FOR34(S,P,O,M) BOOST_PP_FOR_C0(P,35,S,M)(35,S) BOOST_PP_FOR_C1(P,35,S)(O(35,S),P,O,M)
+#define BOOST_PP_FOR35(S,P,O,M) BOOST_PP_FOR_C0(P,36,S,M)(36,S) BOOST_PP_FOR_C1(P,36,S)(O(36,S),P,O,M)
+#define BOOST_PP_FOR36(S,P,O,M) BOOST_PP_FOR_C0(P,37,S,M)(37,S) BOOST_PP_FOR_C1(P,37,S)(O(37,S),P,O,M)
+#define BOOST_PP_FOR37(S,P,O,M) BOOST_PP_FOR_C0(P,38,S,M)(38,S) BOOST_PP_FOR_C1(P,38,S)(O(38,S),P,O,M)
+#define BOOST_PP_FOR38(S,P,O,M) BOOST_PP_FOR_C0(P,39,S,M)(39,S) BOOST_PP_FOR_C1(P,39,S)(O(39,S),P,O,M)
+#define BOOST_PP_FOR39(S,P,O,M) BOOST_PP_FOR_C0(P,40,S,M)(40,S) BOOST_PP_FOR_C1(P,40,S)(O(40,S),P,O,M)
+#define BOOST_PP_FOR40(S,P,O,M) BOOST_PP_FOR_C0(P,41,S,M)(41,S) BOOST_PP_FOR_C1(P,41,S)(O(41,S),P,O,M)
+#define BOOST_PP_FOR41(S,P,O,M) BOOST_PP_FOR_C0(P,42,S,M)(42,S) BOOST_PP_FOR_C1(P,42,S)(O(42,S),P,O,M)
+#define BOOST_PP_FOR42(S,P,O,M) BOOST_PP_FOR_C0(P,43,S,M)(43,S) BOOST_PP_FOR_C1(P,43,S)(O(43,S),P,O,M)
+#define BOOST_PP_FOR43(S,P,O,M) BOOST_PP_FOR_C0(P,44,S,M)(44,S) BOOST_PP_FOR_C1(P,44,S)(O(44,S),P,O,M)
+#define BOOST_PP_FOR44(S,P,O,M) BOOST_PP_FOR_C0(P,45,S,M)(45,S) BOOST_PP_FOR_C1(P,45,S)(O(45,S),P,O,M)
+#define BOOST_PP_FOR45(S,P,O,M) BOOST_PP_FOR_C0(P,46,S,M)(46,S) BOOST_PP_FOR_C1(P,46,S)(O(46,S),P,O,M)
+#define BOOST_PP_FOR46(S,P,O,M) BOOST_PP_FOR_C0(P,47,S,M)(47,S) BOOST_PP_FOR_C1(P,47,S)(O(47,S),P,O,M)
+#define BOOST_PP_FOR47(S,P,O,M) BOOST_PP_FOR_C0(P,48,S,M)(48,S) BOOST_PP_FOR_C1(P,48,S)(O(48,S),P,O,M)
+#define BOOST_PP_FOR48(S,P,O,M) BOOST_PP_FOR_C0(P,49,S,M)(49,S) BOOST_PP_FOR_C1(P,49,S)(O(49,S),P,O,M)
+#define BOOST_PP_FOR49(S,P,O,M) BOOST_PP_FOR_C0(P,50,S,M)(50,S) BOOST_PP_FOR_C1(P,50,S)(O(50,S),P,O,M)
+#define BOOST_PP_FOR50(S,P,O,M) BOOST_PP_FOR_C0(P,51,S,M)(51,S) BOOST_PP_FOR_C1(P,51,S)(O(51,S),P,O,M)
+#define BOOST_PP_FOR51(S,P,O,M) BOOST_PP_FOR_C0(P,52,S,M)(52,S) BOOST_PP_FOR_C1(P,52,S)(O(52,S),P,O,M)
+#define BOOST_PP_FOR52(S,P,O,M) BOOST_PP_FOR_C0(P,53,S,M)(53,S) BOOST_PP_FOR_C1(P,53,S)(O(53,S),P,O,M)
+#define BOOST_PP_FOR53(S,P,O,M) BOOST_PP_FOR_C0(P,54,S,M)(54,S) BOOST_PP_FOR_C1(P,54,S)(O(54,S),P,O,M)
+#define BOOST_PP_FOR54(S,P,O,M) BOOST_PP_FOR_C0(P,55,S,M)(55,S) BOOST_PP_FOR_C1(P,55,S)(O(55,S),P,O,M)
+#define BOOST_PP_FOR55(S,P,O,M) BOOST_PP_FOR_C0(P,56,S,M)(56,S) BOOST_PP_FOR_C1(P,56,S)(O(56,S),P,O,M)
+#define BOOST_PP_FOR56(S,P,O,M) BOOST_PP_FOR_C0(P,57,S,M)(57,S) BOOST_PP_FOR_C1(P,57,S)(O(57,S),P,O,M)
+#define BOOST_PP_FOR57(S,P,O,M) BOOST_PP_FOR_C0(P,58,S,M)(58,S) BOOST_PP_FOR_C1(P,58,S)(O(58,S),P,O,M)
+#define BOOST_PP_FOR58(S,P,O,M) BOOST_PP_FOR_C0(P,59,S,M)(59,S) BOOST_PP_FOR_C1(P,59,S)(O(59,S),P,O,M)
+#define BOOST_PP_FOR59(S,P,O,M) BOOST_PP_FOR_C0(P,60,S,M)(60,S) BOOST_PP_FOR_C1(P,60,S)(O(60,S),P,O,M)
+#define BOOST_PP_FOR60(S,P,O,M) BOOST_PP_FOR_C0(P,61,S,M)(61,S) BOOST_PP_FOR_C1(P,61,S)(O(61,S),P,O,M)
+#define BOOST_PP_FOR61(S,P,O,M) BOOST_PP_FOR_C0(P,62,S,M)(62,S) BOOST_PP_FOR_C1(P,62,S)(O(62,S),P,O,M)
+#define BOOST_PP_FOR62(S,P,O,M) BOOST_PP_FOR_C0(P,63,S,M)(63,S) BOOST_PP_FOR_C1(P,63,S)(O(63,S),P,O,M)
+#define BOOST_PP_FOR63(S,P,O,M) BOOST_PP_FOR_C0(P,64,S,M)(64,S) BOOST_PP_FOR_C1(P,64,S)(O(64,S),P,O,M)
+#define BOOST_PP_FOR64(S,P,O,M) BOOST_PP_FOR_C0(P,65,S,M)(65,S) BOOST_PP_FOR_C1(P,65,S)(O(65,S),P,O,M)
+#define BOOST_PP_FOR65(S,P,O,M) BOOST_PP_FOR_C0(P,66,S,M)(66,S) BOOST_PP_FOR_C1(P,66,S)(O(66,S),P,O,M)
+#define BOOST_PP_FOR66(S,P,O,M) BOOST_PP_FOR_C0(P,67,S,M)(67,S) BOOST_PP_FOR_C1(P,67,S)(O(67,S),P,O,M)
+#define BOOST_PP_FOR67(S,P,O,M) BOOST_PP_FOR_C0(P,68,S,M)(68,S) BOOST_PP_FOR_C1(P,68,S)(O(68,S),P,O,M)
+#define BOOST_PP_FOR68(S,P,O,M) BOOST_PP_FOR_C0(P,69,S,M)(69,S) BOOST_PP_FOR_C1(P,69,S)(O(69,S),P,O,M)
+#define BOOST_PP_FOR69(S,P,O,M) BOOST_PP_FOR_C0(P,70,S,M)(70,S) BOOST_PP_FOR_C1(P,70,S)(O(70,S),P,O,M)
+#define BOOST_PP_FOR70(S,P,O,M) BOOST_PP_FOR_C0(P,71,S,M)(71,S) BOOST_PP_FOR_C1(P,71,S)(O(71,S),P,O,M)
+#define BOOST_PP_FOR71(S,P,O,M) BOOST_PP_FOR_C0(P,72,S,M)(72,S) BOOST_PP_FOR_C1(P,72,S)(O(72,S),P,O,M)
+#define BOOST_PP_FOR72(S,P,O,M) BOOST_PP_FOR_C0(P,73,S,M)(73,S) BOOST_PP_FOR_C1(P,73,S)(O(73,S),P,O,M)
+#define BOOST_PP_FOR73(S,P,O,M) BOOST_PP_FOR_C0(P,74,S,M)(74,S) BOOST_PP_FOR_C1(P,74,S)(O(74,S),P,O,M)
+#define BOOST_PP_FOR74(S,P,O,M) BOOST_PP_FOR_C0(P,75,S,M)(75,S) BOOST_PP_FOR_C1(P,75,S)(O(75,S),P,O,M)
+#define BOOST_PP_FOR75(S,P,O,M) BOOST_PP_FOR_C0(P,76,S,M)(76,S) BOOST_PP_FOR_C1(P,76,S)(O(76,S),P,O,M)
+#define BOOST_PP_FOR76(S,P,O,M) BOOST_PP_FOR_C0(P,77,S,M)(77,S) BOOST_PP_FOR_C1(P,77,S)(O(77,S),P,O,M)
+#define BOOST_PP_FOR77(S,P,O,M) BOOST_PP_FOR_C0(P,78,S,M)(78,S) BOOST_PP_FOR_C1(P,78,S)(O(78,S),P,O,M)
+#define BOOST_PP_FOR78(S,P,O,M) BOOST_PP_FOR_C0(P,79,S,M)(79,S) BOOST_PP_FOR_C1(P,79,S)(O(79,S),P,O,M)
+#define BOOST_PP_FOR79(S,P,O,M) BOOST_PP_FOR_C0(P,80,S,M)(80,S) BOOST_PP_FOR_C1(P,80,S)(O(80,S),P,O,M)
+#define BOOST_PP_FOR80(S,P,O,M) BOOST_PP_FOR_C0(P,81,S,M)(81,S) BOOST_PP_FOR_C1(P,81,S)(O(81,S),P,O,M)
+#define BOOST_PP_FOR81(S,P,O,M) BOOST_PP_FOR_C0(P,82,S,M)(82,S) BOOST_PP_FOR_C1(P,82,S)(O(82,S),P,O,M)
+#define BOOST_PP_FOR82(S,P,O,M) BOOST_PP_FOR_C0(P,83,S,M)(83,S) BOOST_PP_FOR_C1(P,83,S)(O(83,S),P,O,M)
+#define BOOST_PP_FOR83(S,P,O,M) BOOST_PP_FOR_C0(P,84,S,M)(84,S) BOOST_PP_FOR_C1(P,84,S)(O(84,S),P,O,M)
+#define BOOST_PP_FOR84(S,P,O,M) BOOST_PP_FOR_C0(P,85,S,M)(85,S) BOOST_PP_FOR_C1(P,85,S)(O(85,S),P,O,M)
+#define BOOST_PP_FOR85(S,P,O,M) BOOST_PP_FOR_C0(P,86,S,M)(86,S) BOOST_PP_FOR_C1(P,86,S)(O(86,S),P,O,M)
+#define BOOST_PP_FOR86(S,P,O,M) BOOST_PP_FOR_C0(P,87,S,M)(87,S) BOOST_PP_FOR_C1(P,87,S)(O(87,S),P,O,M)
+#define BOOST_PP_FOR87(S,P,O,M) BOOST_PP_FOR_C0(P,88,S,M)(88,S) BOOST_PP_FOR_C1(P,88,S)(O(88,S),P,O,M)
+#define BOOST_PP_FOR88(S,P,O,M) BOOST_PP_FOR_C0(P,89,S,M)(89,S) BOOST_PP_FOR_C1(P,89,S)(O(89,S),P,O,M)
+#define BOOST_PP_FOR89(S,P,O,M) BOOST_PP_FOR_C0(P,90,S,M)(90,S) BOOST_PP_FOR_C1(P,90,S)(O(90,S),P,O,M)
+#define BOOST_PP_FOR90(S,P,O,M) BOOST_PP_FOR_C0(P,91,S,M)(91,S) BOOST_PP_FOR_C1(P,91,S)(O(91,S),P,O,M)
+#define BOOST_PP_FOR91(S,P,O,M) BOOST_PP_FOR_C0(P,92,S,M)(92,S) BOOST_PP_FOR_C1(P,92,S)(O(92,S),P,O,M)
+#define BOOST_PP_FOR92(S,P,O,M) BOOST_PP_FOR_C0(P,93,S,M)(93,S) BOOST_PP_FOR_C1(P,93,S)(O(93,S),P,O,M)
+#define BOOST_PP_FOR93(S,P,O,M) BOOST_PP_FOR_C0(P,94,S,M)(94,S) BOOST_PP_FOR_C1(P,94,S)(O(94,S),P,O,M)
+#define BOOST_PP_FOR94(S,P,O,M) BOOST_PP_FOR_C0(P,95,S,M)(95,S) BOOST_PP_FOR_C1(P,95,S)(O(95,S),P,O,M)
+#define BOOST_PP_FOR95(S,P,O,M) BOOST_PP_FOR_C0(P,96,S,M)(96,S) BOOST_PP_FOR_C1(P,96,S)(O(96,S),P,O,M)
+#define BOOST_PP_FOR96(S,P,O,M) BOOST_PP_FOR_C0(P,97,S,M)(97,S) BOOST_PP_FOR_C1(P,97,S)(O(97,S),P,O,M)
+#define BOOST_PP_FOR97(S,P,O,M) BOOST_PP_FOR_C0(P,98,S,M)(98,S) BOOST_PP_FOR_C1(P,98,S)(O(98,S),P,O,M)
+#define BOOST_PP_FOR98(S,P,O,M) BOOST_PP_FOR_C0(P,99,S,M)(99,S) BOOST_PP_FOR_C1(P,99,S)(O(99,S),P,O,M)
+#define BOOST_PP_FOR99(S,P,O,M) BOOST_PP_FOR_C0(P,100,S,M)(100,S) BOOST_PP_FOR_C1(P,100,S)(O(100,S),P,O,M)
+#define BOOST_PP_FOR100(S,P,O,M) BOOST_PP_FOR_C0(P,101,S,M)(101,S) BOOST_PP_FOR_C1(P,101,S)(O(101,S),P,O,M)
+#define BOOST_PP_FOR101(S,P,O,M) BOOST_PP_FOR_C0(P,102,S,M)(102,S) BOOST_PP_FOR_C1(P,102,S)(O(102,S),P,O,M)
+#define BOOST_PP_FOR102(S,P,O,M) BOOST_PP_FOR_C0(P,103,S,M)(103,S) BOOST_PP_FOR_C1(P,103,S)(O(103,S),P,O,M)
+#define BOOST_PP_FOR103(S,P,O,M) BOOST_PP_FOR_C0(P,104,S,M)(104,S) BOOST_PP_FOR_C1(P,104,S)(O(104,S),P,O,M)
+#define BOOST_PP_FOR104(S,P,O,M) BOOST_PP_FOR_C0(P,105,S,M)(105,S) BOOST_PP_FOR_C1(P,105,S)(O(105,S),P,O,M)
+#define BOOST_PP_FOR105(S,P,O,M) BOOST_PP_FOR_C0(P,106,S,M)(106,S) BOOST_PP_FOR_C1(P,106,S)(O(106,S),P,O,M)
+#define BOOST_PP_FOR106(S,P,O,M) BOOST_PP_FOR_C0(P,107,S,M)(107,S) BOOST_PP_FOR_C1(P,107,S)(O(107,S),P,O,M)
+#define BOOST_PP_FOR107(S,P,O,M) BOOST_PP_FOR_C0(P,108,S,M)(108,S) BOOST_PP_FOR_C1(P,108,S)(O(108,S),P,O,M)
+#define BOOST_PP_FOR108(S,P,O,M) BOOST_PP_FOR_C0(P,109,S,M)(109,S) BOOST_PP_FOR_C1(P,109,S)(O(109,S),P,O,M)
+#define BOOST_PP_FOR109(S,P,O,M) BOOST_PP_FOR_C0(P,110,S,M)(110,S) BOOST_PP_FOR_C1(P,110,S)(O(110,S),P,O,M)
+#define BOOST_PP_FOR110(S,P,O,M) BOOST_PP_FOR_C0(P,111,S,M)(111,S) BOOST_PP_FOR_C1(P,111,S)(O(111,S),P,O,M)
+#define BOOST_PP_FOR111(S,P,O,M) BOOST_PP_FOR_C0(P,112,S,M)(112,S) BOOST_PP_FOR_C1(P,112,S)(O(112,S),P,O,M)
+#define BOOST_PP_FOR112(S,P,O,M) BOOST_PP_FOR_C0(P,113,S,M)(113,S) BOOST_PP_FOR_C1(P,113,S)(O(113,S),P,O,M)
+#define BOOST_PP_FOR113(S,P,O,M) BOOST_PP_FOR_C0(P,114,S,M)(114,S) BOOST_PP_FOR_C1(P,114,S)(O(114,S),P,O,M)
+#define BOOST_PP_FOR114(S,P,O,M) BOOST_PP_FOR_C0(P,115,S,M)(115,S) BOOST_PP_FOR_C1(P,115,S)(O(115,S),P,O,M)
+#define BOOST_PP_FOR115(S,P,O,M) BOOST_PP_FOR_C0(P,116,S,M)(116,S) BOOST_PP_FOR_C1(P,116,S)(O(116,S),P,O,M)
+#define BOOST_PP_FOR116(S,P,O,M) BOOST_PP_FOR_C0(P,117,S,M)(117,S) BOOST_PP_FOR_C1(P,117,S)(O(117,S),P,O,M)
+#define BOOST_PP_FOR117(S,P,O,M) BOOST_PP_FOR_C0(P,118,S,M)(118,S) BOOST_PP_FOR_C1(P,118,S)(O(118,S),P,O,M)
+#define BOOST_PP_FOR118(S,P,O,M) BOOST_PP_FOR_C0(P,119,S,M)(119,S) BOOST_PP_FOR_C1(P,119,S)(O(119,S),P,O,M)
+#define BOOST_PP_FOR119(S,P,O,M) BOOST_PP_FOR_C0(P,120,S,M)(120,S) BOOST_PP_FOR_C1(P,120,S)(O(120,S),P,O,M)
+#define BOOST_PP_FOR120(S,P,O,M) BOOST_PP_FOR_C0(P,121,S,M)(121,S) BOOST_PP_FOR_C1(P,121,S)(O(121,S),P,O,M)
+#define BOOST_PP_FOR121(S,P,O,M) BOOST_PP_FOR_C0(P,122,S,M)(122,S) BOOST_PP_FOR_C1(P,122,S)(O(122,S),P,O,M)
+#define BOOST_PP_FOR122(S,P,O,M) BOOST_PP_FOR_C0(P,123,S,M)(123,S) BOOST_PP_FOR_C1(P,123,S)(O(123,S),P,O,M)
+#define BOOST_PP_FOR123(S,P,O,M) BOOST_PP_FOR_C0(P,124,S,M)(124,S) BOOST_PP_FOR_C1(P,124,S)(O(124,S),P,O,M)
+#define BOOST_PP_FOR124(S,P,O,M) BOOST_PP_FOR_C0(P,125,S,M)(125,S) BOOST_PP_FOR_C1(P,125,S)(O(125,S),P,O,M)
+#define BOOST_PP_FOR125(S,P,O,M) BOOST_PP_FOR_C0(P,126,S,M)(126,S) BOOST_PP_FOR_C1(P,126,S)(O(126,S),P,O,M)
+#define BOOST_PP_FOR126(S,P,O,M) BOOST_PP_FOR_C0(P,127,S,M)(127,S) BOOST_PP_FOR_C1(P,127,S)(O(127,S),P,O,M)
+#define BOOST_PP_FOR127(S,P,O,M) BOOST_PP_FOR_C0(P,128,S,M)(128,S) BOOST_PP_FOR_C1(P,128,S)(O(128,S),P,O,M)
+#define BOOST_PP_FOR128(S,P,O,M) BOOST_PP_FOR_C0(P,129,S,M)(129,S) BOOST_PP_FOR_C1(P,129,S)(O(129,S),P,O,M)
+#define BOOST_PP_FOR129(S,P,O,M) RECURSION DEPTH EXCEEDED!
+#endif
diff --git a/boost/boost/preprocessor/identity.hpp b/boost/boost/preprocessor/identity.hpp
new file mode 100644 (file)
index 0000000..a39e9b6
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BOOST_PREPROCESSOR_IDENTITY_HPP
+#define BOOST_PREPROCESSOR_IDENTITY_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/empty.hpp>
+
+/** <p>Expands to <code>X</code> once invoked.</p>
+
+<p>Designed to be used with BOOST_PP_IF(), when one of the clauses need to be
+invoked.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_IF(1,BOOST_PP_IDENTITY(X),BOOST_PP_EMPTY)<b>()</b>
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+X
+</pre>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_IDENTITY(X) X BOOST_PP_EMPTY
+
+/* <p>Obsolete. Use BOOST_PP_IDENTITY().</p> */
+#define BOOST_PREPROCESSOR_IDENTITY(X) BOOST_PP_IDENTITY(X)
+#endif
diff --git a/boost/boost/preprocessor/if.hpp b/boost/boost/preprocessor/if.hpp
new file mode 100644 (file)
index 0000000..e61a4e6
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef BOOST_PREPROCESSOR_IF_HPP
+#define BOOST_PREPROCESSOR_IF_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/bool.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+/** <p>Expands to <code>THEN</code> if <code>COND != 0</code> and <code>ELSE</code> if
+<code>COND == 0</code>.</p>
+
+<p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_IF(0,1,2)</code> expands to <code>2</code>.</p>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_EXPR_IF()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_IF(COND,THEN,ELSE) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(COND))(ELSE,THEN)
+
+#define BOOST_PP_IF_BOOL(C) BOOST_PP_IF_BOOL_DELAY(C)
+#define BOOST_PP_IF_BOOL_DELAY(C) BOOST_PP_TUPLE2_ELEM##C
+
+/* <p>Obsolete. Use BOOST_PP_IF().</p> */
+#define BOOST_PREPROCESSOR_IF(C,T,E) BOOST_PP_IF(C,T,E)
+#endif
diff --git a/boost/boost/preprocessor/inc.hpp b/boost/boost/preprocessor/inc.hpp
new file mode 100644 (file)
index 0000000..c253376
--- /dev/null
@@ -0,0 +1,162 @@
+#ifndef BOOST_PREPROCESSOR_INC_HPP
+#define BOOST_PREPROCESSOR_INC_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Increments <code>X</code> expanding to a single token.</p>
+
+<p>For example, <code>BOOST_PP_INC(3)</code> expands to <code>4</code> (a
+single token).</p>
+
+<p>BOOST_PP_INC() uses saturation arithmetic. Incrementing a
+BOOST_PP_LIMIT_MAG yields a BOOST_PP_LIMIT_MAG.</p>
+
+<p>Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are
+supported.</p>
+*/
+#define BOOST_PP_INC(X) BOOST_PP_INC_DELAY(X)
+
+#define BOOST_PP_INC_DELAY(X) BOOST_PP_INC##X
+#define BOOST_PP_INC0 1
+#define BOOST_PP_INC1 2
+#define BOOST_PP_INC2 3
+#define BOOST_PP_INC3 4
+#define BOOST_PP_INC4 5
+#define BOOST_PP_INC5 6
+#define BOOST_PP_INC6 7
+#define BOOST_PP_INC7 8
+#define BOOST_PP_INC8 9
+#define BOOST_PP_INC9 10
+#define BOOST_PP_INC10 11
+#define BOOST_PP_INC11 12
+#define BOOST_PP_INC12 13
+#define BOOST_PP_INC13 14
+#define BOOST_PP_INC14 15
+#define BOOST_PP_INC15 16
+#define BOOST_PP_INC16 17
+#define BOOST_PP_INC17 18
+#define BOOST_PP_INC18 19
+#define BOOST_PP_INC19 20
+#define BOOST_PP_INC20 21
+#define BOOST_PP_INC21 22
+#define BOOST_PP_INC22 23
+#define BOOST_PP_INC23 24
+#define BOOST_PP_INC24 25
+#define BOOST_PP_INC25 26
+#define BOOST_PP_INC26 27
+#define BOOST_PP_INC27 28
+#define BOOST_PP_INC28 29
+#define BOOST_PP_INC29 30
+#define BOOST_PP_INC30 31
+#define BOOST_PP_INC31 32
+#define BOOST_PP_INC32 33
+#define BOOST_PP_INC33 34
+#define BOOST_PP_INC34 35
+#define BOOST_PP_INC35 36
+#define BOOST_PP_INC36 37
+#define BOOST_PP_INC37 38
+#define BOOST_PP_INC38 39
+#define BOOST_PP_INC39 40
+#define BOOST_PP_INC40 41
+#define BOOST_PP_INC41 42
+#define BOOST_PP_INC42 43
+#define BOOST_PP_INC43 44
+#define BOOST_PP_INC44 45
+#define BOOST_PP_INC45 46
+#define BOOST_PP_INC46 47
+#define BOOST_PP_INC47 48
+#define BOOST_PP_INC48 49
+#define BOOST_PP_INC49 50
+#define BOOST_PP_INC50 51
+#define BOOST_PP_INC51 52
+#define BOOST_PP_INC52 53
+#define BOOST_PP_INC53 54
+#define BOOST_PP_INC54 55
+#define BOOST_PP_INC55 56
+#define BOOST_PP_INC56 57
+#define BOOST_PP_INC57 58
+#define BOOST_PP_INC58 59
+#define BOOST_PP_INC59 60
+#define BOOST_PP_INC60 61
+#define BOOST_PP_INC61 62
+#define BOOST_PP_INC62 63
+#define BOOST_PP_INC63 64
+#define BOOST_PP_INC64 65
+#define BOOST_PP_INC65 66
+#define BOOST_PP_INC66 67
+#define BOOST_PP_INC67 68
+#define BOOST_PP_INC68 69
+#define BOOST_PP_INC69 70
+#define BOOST_PP_INC70 71
+#define BOOST_PP_INC71 72
+#define BOOST_PP_INC72 73
+#define BOOST_PP_INC73 74
+#define BOOST_PP_INC74 75
+#define BOOST_PP_INC75 76
+#define BOOST_PP_INC76 77
+#define BOOST_PP_INC77 78
+#define BOOST_PP_INC78 79
+#define BOOST_PP_INC79 80
+#define BOOST_PP_INC80 81
+#define BOOST_PP_INC81 82
+#define BOOST_PP_INC82 83
+#define BOOST_PP_INC83 84
+#define BOOST_PP_INC84 85
+#define BOOST_PP_INC85 86
+#define BOOST_PP_INC86 87
+#define BOOST_PP_INC87 88
+#define BOOST_PP_INC88 89
+#define BOOST_PP_INC89 90
+#define BOOST_PP_INC90 91
+#define BOOST_PP_INC91 92
+#define BOOST_PP_INC92 93
+#define BOOST_PP_INC93 94
+#define BOOST_PP_INC94 95
+#define BOOST_PP_INC95 96
+#define BOOST_PP_INC96 97
+#define BOOST_PP_INC97 98
+#define BOOST_PP_INC98 99
+#define BOOST_PP_INC99 100
+#define BOOST_PP_INC100 101
+#define BOOST_PP_INC101 102
+#define BOOST_PP_INC102 103
+#define BOOST_PP_INC103 104
+#define BOOST_PP_INC104 105
+#define BOOST_PP_INC105 106
+#define BOOST_PP_INC106 107
+#define BOOST_PP_INC107 108
+#define BOOST_PP_INC108 109
+#define BOOST_PP_INC109 110
+#define BOOST_PP_INC110 111
+#define BOOST_PP_INC111 112
+#define BOOST_PP_INC112 113
+#define BOOST_PP_INC113 114
+#define BOOST_PP_INC114 115
+#define BOOST_PP_INC115 116
+#define BOOST_PP_INC116 117
+#define BOOST_PP_INC117 118
+#define BOOST_PP_INC118 119
+#define BOOST_PP_INC119 120
+#define BOOST_PP_INC120 121
+#define BOOST_PP_INC121 122
+#define BOOST_PP_INC122 123
+#define BOOST_PP_INC123 124
+#define BOOST_PP_INC124 125
+#define BOOST_PP_INC125 126
+#define BOOST_PP_INC126 127
+#define BOOST_PP_INC127 128
+#define BOOST_PP_INC128 128
+
+/* <p>Obsolete. Use BOOST_PP_INC().</p> */
+#define BOOST_PREPROCESSOR_INC(X) BOOST_PP_INC(X)
+#endif
diff --git a/boost/boost/preprocessor/limits.hpp b/boost/boost/preprocessor/limits.hpp
new file mode 100644 (file)
index 0000000..4361926
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BOOST_PREPROCESSOR_LIMITS_HPP
+#define BOOST_PREPROCESSOR_LIMITS_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Expands to the number of dimensions of repeat supported by the
+library.</p>
+
+<p>The repeat macros are named BOOST_PP_REPEAT(), BOOST_PP_REPEAT_2ND(),
+BOOST_PP_REPEAT_3RD(), ...</p>
+*/
+#define BOOST_PP_LIMIT_DIM 3
+
+/** <p>Expands to the maximum straight numeric literal supported by the
+library.</p>
+
+<p>This is also the limit of the repetition primitives (BOOST_PP_ENUM family
+and BOOST_PP_REPEAT family).</p>
+
+<h3>Note</h3>
+<ul>
+  <li>Only decimal integer literals in the range [0, BOOST_PP_LIMIT_MAG]
+      are supported.</li>
+  <li>All arithmetic operations (BOOST_PP_ADD(), BOOST_PP_SUB(),
+      BOOST_PP_MUL(), BOOST_PP_DIV()) use saturation arithmetic.</li>
+  <li>The maximum repetition count supported by the library may not be reached
+      due to compiler limitations.</li>
+</ul>
+*/
+#define BOOST_PP_LIMIT_MAG 128
+
+/** <p>Expands to the maximum tuple size supported by the library.</p> */
+#define BOOST_PP_LIMIT_TUPLE 16
+
+/* <p>Obsolete. Use BOOST_PP_LIMIT_DIM.</p> */
+#define BOOST_PREPROCESSOR_LIMIT_DIM BOOST_PP_LIMIT_DIM
+
+/* <p>Obsolete. Use BOOST_PP_LIMIT_MAG.</p> */
+#define BOOST_PREPROCESSOR_LIMIT_MAG BOOST_PP_LIMIT_MAG
+
+/* <p>Obsolete. Use BOOST_PP_LIMIT_TUPLE.</p> */
+#define BOOST_PREPROCESSOR_LIMIT_TUPLE BOOST_PP_LIMIT_TUPLE
+#endif
diff --git a/boost/boost/preprocessor/list.hpp b/boost/boost/preprocessor/list.hpp
new file mode 100644 (file)
index 0000000..77dc79a
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef BOOST_PREPROCESSOR_LIST_HPP
+#define BOOST_PREPROCESSOR_LIST_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Includes all list headers.</p> */
+
+#include <boost/preprocessor/list/append.hpp>
+#include <boost/preprocessor/list/at.hpp>
+#include <boost/preprocessor/list/cat.hpp>
+#include <boost/preprocessor/list/filter.hpp>
+#include <boost/preprocessor/list/first_n.hpp>
+#include <boost/preprocessor/list/fold_right_2nd.hpp>
+#include <boost/preprocessor/list/for_each.hpp>
+#include <boost/preprocessor/list/for_each_product.hpp>
+#include <boost/preprocessor/list/size.hpp>
+#include <boost/preprocessor/list/to_tuple.hpp>
+#include <boost/preprocessor/list/transform.hpp>
+#endif
diff --git a/boost/boost/preprocessor/list/adt.hpp b/boost/boost/preprocessor/list/adt.hpp
new file mode 100644 (file)
index 0000000..f599a90
--- /dev/null
@@ -0,0 +1,123 @@
+#ifndef BOOST_PREPROCESSOR_LIST_ADT_HPP
+#define BOOST_PREPROCESSOR_LIST_ADT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>This header defines the fundamental list operations.</p>
+
+<h3>Note</h3>
+<ul>
+  <li>The internal representation of lists is hidden. Although there aren't
+      compelling reasons to change the representation, you should avoid
+      writing code that depends on the internal representation details.</li>
+</ul>
+*/
+
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/logical/not.hpp>
+
+/** <p>List constructor.</p>
+
+<p>Lists are build using list constructors BOOST_PP_LIST_NIL and
+BOOST_PP_LIST_CONS(). For example,</p>
+
+<pre>
+BOOST_PP_LIST_CONS(1,
+BOOST_PP_LIST_CONS(2,
+BOOST_PP_LIST_CONS(3,
+BOOST_PP_LIST_CONS(4,
+BOOST_PP_LIST_CONS(5,
+BOOST_PP_LIST_NIL)))))
+</pre>
+
+<p>Short lists can also be build from tuples:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
+</pre>
+
+<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
+
+<p>Longer lists can be built from short lists with BOOST_PP_LIST_APPEND_D()
+and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
+
+<pre>
+BOOST_PP_LIST_FOLD_RIGHT_2ND
+( BOOST_PP_LIST_APPEND_D
+, BOOST_PP_TUPLE_TO_LIST
+  ( N
+  , BOOST_PP_TUPLE_TO_LIST(M, (E11, E12, ..., E1M) )
+  , BOOST_PP_TUPLE_TO_LIST(M, (E21, E22, ..., E2M) )
+  , ...
+  , BOOST_PP_TUPLE_TO_LIST(M, (EN1, EN2, ..., ENM) )
+  )
+)
+</pre>
+*/
+#define BOOST_PP_LIST_CONS(FIRST,REST) (FIRST,REST,1)
+
+/** <p>List nil constructor.</p> */
+#define BOOST_PP_LIST_NIL (_,_,0)
+
+/** <p>Expands to 1 if the list is not nil and 0 otherwise.</p> */
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE_ELEM(3,2,LIST)
+#else
+#  define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE3_ELEM2 LIST
+#endif
+
+/** <p>Expands to 1 if the list is nil and 0 otherwise.</p> */
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,LIST))
+#else
+#  define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 LIST)
+#endif
+
+/** <p>Expands to the first element of the list. The list must not be nil.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
+</pre>
+
+<p>expands to 1.</p>
+*/
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE_ELEM(3,0,LIST)
+#else
+#  define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE3_ELEM0 LIST
+#endif
+
+/** <p>Expands to a list of all but the first element of the list.</p>
+
+<p>The list must not be nil.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
+</pre>
+*/
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE_ELEM(3,1,LIST)
+#else
+#  define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE3_ELEM1 LIST
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/append.hpp b/boost/boost/preprocessor/list/append.hpp
new file mode 100644 (file)
index 0000000..8a7e14a
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef BOOST_PREPROCESSOR_LIST_APPEND_HPP
+#define BOOST_PREPROCESSOR_LIST_APPEND_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/fold_right.hpp>
+
+/** <p>Catenates two lists together.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_APPEND
+( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
+, BOOST_PP_TUPLE_TO_LIST(2,(3,4))
+)
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4))
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOLD_RIGHT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_APPEND(LIST_1ST,LIST_2ND) BOOST_PP_LIST_APPEND_D(0,LIST_1ST,LIST_2ND)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_APPEND_D(D,LIST_1ST,LIST_2ND) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,LIST_1ST,LIST_2ND)
+#define BOOST_PP_LIST_APPEND_F(D,H,P) (H,P,1)
+#endif
diff --git a/boost/boost/preprocessor/list/at.hpp b/boost/boost/preprocessor/list/at.hpp
new file mode 100644 (file)
index 0000000..afac0b0
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef BOOST_PFIRST_NPROCESSOR_LIST_AT_HPP
+#define BOOST_PFIRST_NPROCESSOR_LIST_AT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this softwaFIRST_N is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/rest_n.hpp>
+
+/** <p>Expands to the <code>INDEX</code>:th element of the list <code>LIST</code>. The
+first element is at index <code>0</code>.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
+</pre>
+
+<p>expands to <code>B</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_AT(LIST,INDEX) BOOST_PP_LIST_AT_D(0,LIST,INDEX)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_AT_D(D,LIST,INDEX) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,INDEX,LIST))
+#endif
diff --git a/boost/boost/preprocessor/list/cat.hpp b/boost/boost/preprocessor/list/cat.hpp
new file mode 100644 (file)
index 0000000..7a88f99
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef BOOST_PREPROCESSOR_LIST_CAT_HPP
+#define BOOST_PREPROCESSOR_LIST_CAT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/list/fold_left.hpp>
+
+/** <p>Catenates all elements of the list.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+123
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOLD_LEFT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_CAT(LIST) BOOST_PP_LIST_CAT_D(0,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_CAT_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE3_ELEM0 LIST,BOOST_PP_TUPLE3_ELEM1 LIST)
+#define BOOST_PP_LIST_CAT_F(D,P,H) BOOST_PP_CAT(P,H)
+#endif
diff --git a/boost/boost/preprocessor/list/enum.hpp b/boost/boost/preprocessor/list/enum.hpp
new file mode 100644 (file)
index 0000000..2727d79
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef BOOST_PREPROCESSOR_LIST_ENUM_HPP
+#define BOOST_PREPROCESSOR_LIST_ENUM_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comma_if.hpp>
+#include <boost/preprocessor/list/for_each_i.hpp>
+
+/** <p>Converts the list to a comma separated list.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+A,B,C
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOR_EACH_I()</li>
+</ul>
+*/
+#define BOOST_PP_LIST_ENUM(LIST) BOOST_PP_LIST_ENUM_R(0,LIST)
+
+/** <p>Can be used inside BOOST_PP_FOR().</p> */
+#define BOOST_PP_LIST_ENUM_R(R,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_ENUM_F,_,LIST)
+#define BOOST_PP_LIST_ENUM_F(R,_,I,X) BOOST_PP_COMMA_IF(I) X
+#endif
diff --git a/boost/boost/preprocessor/list/filter.hpp b/boost/boost/preprocessor/list/filter.hpp
new file mode 100644 (file)
index 0000000..838d546
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FILTER_HPP
+#define BOOST_PREPROCESSOR_LIST_FILTER_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/fold_right.hpp>
+
+/** <p>Expands to a list containing all the elements <code>X</code> of the list
+for which <code>PRED(D,DATA,X)</code> is true.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(2,(1,3))
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE() (see for explanation of the D parameter)</li>
+  <li>BOOST_PP_LIST_FOLD_RIGHT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_FILTER(PRED,DATA,LIST) BOOST_PP_LIST_FILTER_D(0,PRED,DATA,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_FILTER_D(D,PRED,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,LIST,(PRED,DATA,(_,_,0))))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE_ELEM(3,2,P)))
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE3_ELEM2 P))
+#else
+#  define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE3_ELEM2 P))
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/first_n.hpp b/boost/boost/preprocessor/list/first_n.hpp
new file mode 100644 (file)
index 0000000..f7d8da9
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FIRST_N_HPP
+#define BOOST_PREPROCESSOR_LIST_FIRST_N_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/while.hpp>
+
+/** <p>Expands to a list of the first <code>COUNT</code> elements of the list
+<code>LIST</code>.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(2,(+,-))
+</pre>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_LIST_REST_N()</li>
+</ul>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOLD_LEFT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_FIRST_N(COUNT,LIST) BOOST_PP_LIST_FIRST_N_D(0,COUNT,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_FIRST_N_D(D,COUNT,LIST) BOOST_PP_LIST_REVERSE_D(D,BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_FIRST_N_C,BOOST_PP_LIST_FIRST_N_F,((_,_,0),LIST,COUNT))))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,X)
+#  define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_TUPLE_ELEM(3,0,X),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,X)))
+#else
+#  define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE3_ELEM2 X
+#  define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 X,1),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 X))
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/fold_left.hpp b/boost/boost/preprocessor/list/fold_left.hpp
new file mode 100644 (file)
index 0000000..9ade0dd
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOLD_LEFT_HPP
+#define BOOST_PREPROCESSOR_LIST_FOLD_LEFT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/while.hpp>
+
+/** <p>Iterates <code>OP(D,STATE,X)</code> for each element <code>X</code> of the
+list <code>LIST</code> (from the left or the start of the list).</p>
+
+<p>In other words, expands to:</p>
+
+<pre>
+OP
+( D
+, ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ...
+, BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))
+)
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(D,STATE,X) BOOST_PP_CAT(STATE,X)
+BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+_ABC
+</pre>
+
+<h3>Note</h3>
+<ul>
+  <li>Folding, or accumulation, is a very general pattern of computation.
+      Most list operations can be implemented in terms of folding.</li>
+</ul>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOLD_RIGHT()</li>
+</ul>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE() (see for explanation of the D parameter)</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_FOLD_LEFT(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_D(0,OP,STATE,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_FOLD_LEFT_D(D,OP,STATE,LIST) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_C,BOOST_PP_LIST_FOLD_LEFT_F,(OP,STATE,LIST)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))
+#  define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X)))
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X
+#  define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE3_ELEM0 X(D,BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM2 X),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM2 X)
+#else
+#  define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X
+#  define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE3_ELEM0 X,BOOST_PP_TUPLE3_ELEM0 X(D,BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM2 X),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM2 X)
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/fold_left_2nd.hpp b/boost/boost/preprocessor/list/fold_left_2nd.hpp
new file mode 100644 (file)
index 0000000..df12662
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOLD_LEFT_2ND_HPP
+#define BOOST_PREPROCESSOR_LIST_FOLD_LEFT_2ND_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/while.hpp>
+
+/** <p>Same as BOOST_PP_LIST_FOLD_LEFT(), but implemented independently.</p> */
+#define BOOST_PP_LIST_FOLD_LEFT_2ND(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_2ND_D(0,OP,STATE,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,OP,STATE,LIST) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_2ND_C,BOOST_PP_LIST_FOLD_LEFT_2ND_F,(OP,STATE,LIST)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FOLD_LEFT_2ND_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))
+#  define BOOST_PP_LIST_FOLD_LEFT_2ND_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X)))
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_FOLD_LEFT_2ND_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X
+#  define BOOST_PP_LIST_FOLD_LEFT_2ND_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE3_ELEM0 X(D,BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM2 X),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM2 X)
+#else
+#  define BOOST_PP_LIST_FOLD_LEFT_2ND_C(D,X) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE3_ELEM2 X
+#  define BOOST_PP_LIST_FOLD_LEFT_2ND_F(D,X) (BOOST_PP_TUPLE3_ELEM0 X,BOOST_PP_TUPLE3_ELEM0 X(D,BOOST_PP_TUPLE3_ELEM1 X,BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM2 X),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM2 X)
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/fold_right.hpp b/boost/boost/preprocessor/list/fold_right.hpp
new file mode 100644 (file)
index 0000000..c6c0b40
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_HPP
+#define BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/reverse.hpp>
+
+/** <p>Iterates <code>OP(D,X,STATE)</code> for each element <code>X</code> of the
+list <code>LIST</code> (from the right or the end of the list).</p>
+
+<p>In other words, expands to:</p>
+
+<pre>
+OP
+( D
+, BOOST_PP_LIST_AT(LIST,0)
+, ... OP
+      ( D
+      , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
+      , OP
+        ( D
+        , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
+        , STATE
+        )
+      ) ...
+)
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(D,X,STATE) BOOST_PP_CAT(STATE,X)
+BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+_CBA
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE() (see for explanation of the D parameter)</li>
+  <li>BOOST_PP_LIST_FOLD_LEFT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_FOLD_RIGHT(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_D(0,OP,LIST,STATE)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_FOLD_RIGHT_D(D,OP,LIST,STATE) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_F,(OP,STATE),BOOST_PP_LIST_REVERSE_D(D,LIST)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P)))
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE2_ELEM1 P))
+#else
+#  define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM0 P(D,H,BOOST_PP_TUPLE2_ELEM1 P))
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/fold_right_2nd.hpp b/boost/boost/preprocessor/list/fold_right_2nd.hpp
new file mode 100644 (file)
index 0000000..5dada16
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_2ND_HPP
+#define BOOST_PREPROCESSOR_LIST_FOLD_RIGHT_2ND_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/fold_left_2nd.hpp>
+#include <boost/preprocessor/list/reverse.hpp>
+
+/** <p>Same as BOOST_PP_LIST_FOLD_RIGHT(), but implemented independently.</p> */
+#define BOOST_PP_LIST_FOLD_RIGHT_2ND(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_2ND_D(0,OP,LIST,STATE)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,OP,LIST,STATE) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_FOLD_RIGHT_2ND_F,(OP,STATE),BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_FOLD_RIGHT_2ND_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P)))
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_FOLD_RIGHT_2ND_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE2_ELEM1 P))
+#else
+#  define BOOST_PP_LIST_FOLD_RIGHT_2ND_F(D,P,H) (BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM0 P(D,H,BOOST_PP_TUPLE2_ELEM1 P))
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/for_each.hpp b/boost/boost/preprocessor/list/for_each.hpp
new file mode 100644 (file)
index 0000000..fe826e8
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOR_EACH_HPP
+#define BOOST_PREPROCESSOR_LIST_FOR_EACH_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/for_each_i.hpp>
+
+/** <p>Repeats <code>MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,INDEX))</code> for each INDEX = [0,
+BOOST_PP_LIST_SIZE(LIST)).</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
+MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
+...
+MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(R,DATA,X) BOOST_PP_CAT(DATA,X)();
+BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+prefix_A(); prefix_B(); prefix_C();
+</pre>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/catch_builtin.cpp">catch_builtin.cpp</a></li>
+</ul>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_FOR() (see for explanation of the R parameter)</li>
+  <li>BOOST_PP_LIST_FOR_EACH_I() </li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_FOR_EACH(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_R(0,MACRO,DATA,LIST)
+
+/** <p>Can be used inside BOOST_PP_FOR().</p> */
+#define BOOST_PP_LIST_FOR_EACH_R(R,MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_FOR_EACH_F,(MACRO,DATA),LIST)
+#define BOOST_PP_LIST_FOR_EACH_F(R,FP,I,X) BOOST_PP_TUPLE_ELEM(2,0,FP)(R,BOOST_PP_TUPLE_ELEM(2,1,FP),X)
+#endif
diff --git a/boost/boost/preprocessor/list/for_each_i.hpp b/boost/boost/preprocessor/list/for_each_i.hpp
new file mode 100644 (file)
index 0000000..409673f
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOR_EACH_I_HPP
+#define BOOST_PREPROCESSOR_LIST_FOR_EACH_I_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/inc.hpp>
+#include <boost/preprocessor/for.hpp>
+
+/** <p>Repeats <code>MACRO(R,DATA,INDEX,BOOST_PP_LIST_AT(LIST,INDEX))</code> for each INDEX = [0,
+BOOST_PP_LIST_SIZE(LIST)).</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
+MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
+...
+MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX);
+BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+prefix_A(0); prefix_B(1); prefix_C(2);
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_FOR() (see for explanation of the R parameter)</li>
+</ul>
+*/
+#define BOOST_PP_LIST_FOR_EACH_I(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(0,MACRO,DATA,LIST)
+
+/** <p>Can be used inside BOOST_PP_FOR().</p> */
+#define BOOST_PP_LIST_FOR_EACH_I_R(R,MACRO,DATA,LIST) BOOST_PP_FOR##R((MACRO,DATA,LIST,0),BOOST_PP_LIST_FOR_EACH_I_C,BOOST_PP_LIST_FOR_EACH_I_F,BOOST_PP_LIST_FOR_EACH_I_I)
+#define BOOST_PP_LIST_FOR_EACH_I_C(R,FPLI) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,2,FPLI))
+#define BOOST_PP_LIST_FOR_EACH_I_F(R,FPLI) (BOOST_PP_TUPLE_ELEM(4,0,FPLI),BOOST_PP_TUPLE_ELEM(4,1,FPLI),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,2,FPLI)),BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4,3,FPLI)))
+#define BOOST_PP_LIST_FOR_EACH_I_I(R,FPLI) BOOST_PP_TUPLE_ELEM(4,0,FPLI)(R,BOOST_PP_TUPLE_ELEM(4,1,FPLI),BOOST_PP_TUPLE_ELEM(4,3,FPLI),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,2,FPLI)))
+#endif
diff --git a/boost/boost/preprocessor/list/for_each_product.hpp b/boost/boost/preprocessor/list/for_each_product.hpp
new file mode 100644 (file)
index 0000000..214cd55
--- /dev/null
@@ -0,0 +1,117 @@
+#ifndef BOOST_PREPROCESSOR_LIST_FOR_EACH_PRODUCT_HPP
+#define BOOST_PREPROCESSOR_LIST_FOR_EACH_PRODUCT_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/list/to_tuple.hpp>
+#include <boost/preprocessor/tuple/to_list.hpp>
+#include <boost/preprocessor/tuple/reverse.hpp>
+#include <boost/preprocessor/for.hpp>
+
+/** <p>Repeats <code>MACRO(R,X)</code> for each element <code>X</code> of the
+cartesian product of the lists of the <code>SIZE_OF_TUPLE</code>-tuple <code>TUPLE_OF_LISTS</code>.</p>
+
+<p>This macro is useful for generating code to avoid combinatorial
+explosion.</p>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(R,X) X
+BOOST_PP_LIST_FOR_EACH_PRODUCT
+( TEST
+, 2
+, ( BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
+  , BOOST_PP_TUPLE_TO_LIST(2,(1,2))
+  )
+)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+(A,1) (A,2) (B,1) (B,2) (C,1) (C,2) 
+</pre>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/is_integral.cpp">is_integral.cpp</a></li>
+  <li><a href="../../example/array_arithmetic.c">array_arithmetic.c</a></li>
+</ul>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_FOR() (see for explanation of the R parameter)</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)
+
+/** <p>Can be used inside BOOST_PP_FOR().</p> */
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(0,MACRO,BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE_OF_LISTS)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) ||\
+  !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(R,F,LL) BOOST_PP_FOR##R((BOOST_PP_TUPLE_ELEM(3,0,LL),BOOST_PP_TUPLE_ELEM(3,1,LL),(_,_,0),F),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I0)
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_C(R,P) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,0,P))
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_F(R,P) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,1,P),BOOST_PP_TUPLE_ELEM(4,2,P),BOOST_PP_TUPLE_ELEM(4,3,P))
+
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_I(R,P) BOOST_PP_TUPLE_ELEM(4,3,P)(R,BOOST_PP_LIST_TO_TUPLE_R(R,(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1)))
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,I) BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_LIST_FOR_EACH_PRODUCT_I##I##_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_I)
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P) (BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,1,P)),(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1),BOOST_PP_TUPLE_ELEM(4,3,P))
+#else
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(R,F,LL) BOOST_PP_FOR##R((BOOST_PP_TUPLE3_ELEM0 LL,BOOST_PP_TUPLE3_ELEM1 LL,(_,_,0),F),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I0)
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_C(R,P) BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE4_ELEM0 P
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_F(R,P) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE4_ELEM0 P),BOOST_PP_TUPLE4_ELEM1 P,BOOST_PP_TUPLE4_ELEM2 P,BOOST_PP_TUPLE4_ELEM3 P)
+
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_I(R,P) BOOST_PP_TUPLE4_ELEM3 P(R,BOOST_PP_LIST_TO_TUPLE_R(R,(BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM0 P,BOOST_PP_TUPLE4_ELEM2 P,1)))
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,I) BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE4_ELEM1 P,BOOST_PP_LIST_FOR_EACH_PRODUCT_I##I##_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_I)
+#  define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P) (BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM1 P,BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE4_ELEM1 P,(BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM0 P,BOOST_PP_TUPLE4_ELEM2 P,1),BOOST_PP_TUPLE4_ELEM3 P)
+#endif
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I0_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I1)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I0(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,0)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I1_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I2)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I1(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,1)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I2_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I3)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I2(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,2)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I3_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I4)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I3(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,3)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I4_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I5)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I4(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,4)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I5_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I6)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I5(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,5)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I6_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I7)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I6(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,6)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I7_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I8)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I7(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,7)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I8_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I9)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I8(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,8)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I9_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I10)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I9(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,9)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I10_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I11)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I10(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,10)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I11_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I12)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I11(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,11)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I12_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I13)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I12(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,12)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I13_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I14)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I13(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,13)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I14_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I15)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I14(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,14)(R,P)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I15_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I16)
+#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I15(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,15)(R,P)
+#endif
diff --git a/boost/boost/preprocessor/list/rest_n.hpp b/boost/boost/preprocessor/list/rest_n.hpp
new file mode 100644 (file)
index 0000000..45ec37d
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef BOOST_PREPROCESSOR_LIST_REST_N_HPP
+#define BOOST_PREPROCESSOR_LIST_REST_N_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/list/adt.hpp>
+#include <boost/preprocessor/while.hpp>
+
+/** <p>Expands to a list of all but the first <code>COUNT</code> elements of the
+list <code>LIST</code>.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(2,(*,/))
+</pre>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_LIST_FIRST_N()</li>
+</ul>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_REST_N(COUNT,LIST) BOOST_PP_LIST_REST_N_D(0,COUNT,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_REST_N_D(D,COUNT,LIST) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(LIST,COUNT)))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE_ELEM(2,1,X)
+#  define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,X)))
+#else
+#  define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE2_ELEM1 X
+#  define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE2_ELEM0 X,BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 X))
+#endif
+#endif
diff --git a/boost/boost/preprocessor/list/reverse.hpp b/boost/boost/preprocessor/list/reverse.hpp
new file mode 100644 (file)
index 0000000..0834dce
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef BOOST_PREPROCESSOR_LIST_REVERSE_HPP
+#define BOOST_PREPROCESSOR_LIST_REVERSE_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/fold_left.hpp>
+
+/** <p>List reversal.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(3,(C,B,A))
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOLD_LEFT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_REVERSE(LIST) BOOST_PP_LIST_REVERSE_D(0,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_REVERSE_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST)
+#define BOOST_PP_LIST_REVERSE_F(D,P,H) (H,P,1)
+#endif
diff --git a/boost/boost/preprocessor/list/size.hpp b/boost/boost/preprocessor/list/size.hpp
new file mode 100644 (file)
index 0000000..a0ce8a7
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BOOST_PREPROCESSOR_LIST_SIZE_HPP
+#define BOOST_PREPROCESSOR_LIST_SIZE_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/fold_left.hpp>
+#include <boost/preprocessor/inc.hpp>
+
+/** <p>Expands to the number of elements in the list.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to <code>3</code>.</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_LIST_FOLD_LEFT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_SIZE(LIST) BOOST_PP_LIST_SIZE_D(0,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_SIZE_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_SIZE_F,0,LIST)
+#define BOOST_PP_LIST_SIZE_F(D,P,H) BOOST_PP_INC(P)
+#endif
diff --git a/boost/boost/preprocessor/list/to_tuple.hpp b/boost/boost/preprocessor/list/to_tuple.hpp
new file mode 100644 (file)
index 0000000..b24c957
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef BOOST_PREPROCESSOR_LIST_TO_TUPLE_HPP
+#define BOOST_PREPROCESSOR_LIST_TO_TUPLE_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/enum.hpp>
+
+/** <p>Converts the list to a tuple.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+</pre>
+
+<p>expands to <code>(A,B,C)</code>.</p>
+
+<h3>Note</h3>
+<ul>
+  <li>The supported size of the list being converted to a tuple is limited by
+      BOOST_PP_LIMIT_MAG rather than BOOST_PP_LIMIT_TUPLE.</li>
+</ul>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_FOR()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_TO_TUPLE(LIST) BOOST_PP_LIST_TO_TUPLE_R(0,LIST)
+
+/** <p>Can be used inside BOOST_PP_FOR().</p> */
+#define BOOST_PP_LIST_TO_TUPLE_R(R,LIST) (BOOST_PP_LIST_ENUM_R(R,LIST))
+#endif
diff --git a/boost/boost/preprocessor/list/transform.hpp b/boost/boost/preprocessor/list/transform.hpp
new file mode 100644 (file)
index 0000000..5ab33b6
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
+#define BOOST_PREPROCESSOR_LIST_TRANSFORM_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/fold_right.hpp>
+
+/** <p>Applies the macro <code>OP(D,DATA,X)</code> to each element <code>X</code>
+of the list producing a new list.</p>
+
+<p>In other words, expands to:</p>
+
+<pre>
+BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,0)),
+BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
+...
+BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
+BOOST_PP_LIST_NIL) ... ))
+</pre>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
+</pre>
+
+<p>expands to the same as:</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(2,(3,4))
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE() (see for explanation of the D parameter)</li>
+  <li>BOOST_PP_LIST_FOLD_RIGHT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_LIST_TRANSFORM(OP,DATA,LIST) BOOST_PP_LIST_TRANSFORM_D(0,OP,DATA,LIST)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_LIST_TRANSFORM_D(D,OP,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,LIST,(OP,DATA,(_,_,0))))
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE_ELEM(3,1,P),H),BOOST_PP_TUPLE_ELEM(3,2,P),1))
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE3_ELEM1 P,(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_TUPLE3_ELEM2 P,1))
+#else
+#  define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P,(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_TUPLE3_ELEM2 P,1))
+#endif
+#endif
diff --git a/boost/boost/preprocessor/logical.hpp b/boost/boost/preprocessor/logical.hpp
new file mode 100644 (file)
index 0000000..e6b08a7
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Includes all logical headers.</p> */
+
+#include <boost/preprocessor/logical/or.hpp>
+#include <boost/preprocessor/logical/xor.hpp>
+#endif
diff --git a/boost/boost/preprocessor/logical/and.hpp b/boost/boost/preprocessor/logical/and.hpp
new file mode 100644 (file)
index 0000000..94598c2
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_AND_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_AND_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/not.hpp>
+
+/** <p>Expands to the logical AND of the operands.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_AND(0,5)</code> expands to <code>0</code> (a single token).</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/logical_test.cpp">logical_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_AND(X,Y) BOOST_PP_NOR(BOOST_PP_NOT(X),BOOST_PP_NOT(Y))
+
+/* <p>Obsolete. Use BOOST_PP_AND().</p> */
+#define BOOST_PREPROCESSOR_AND(X,Y) BOOST_PP_AND(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/logical/bool.hpp b/boost/boost/preprocessor/logical/bool.hpp
new file mode 100644 (file)
index 0000000..35559a1
--- /dev/null
@@ -0,0 +1,160 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_BOOL_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_BOOL_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Expands to <code>0</code> if <code>X == 0</code> and <code>1</code> if <code>X != 0</code>.</p>
+
+<p><code>X</code> must be an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_BOOL(3)</code> expands to <code>1</code>.</p>
+*/
+#define BOOST_PP_BOOL(X) BOOST_PP_BOOL_DELAY(X)
+
+/* BOOL can be implemented in O(1) tokens using saturated ADD & SUB.
+ * Unfortunately, it would result in significantly slower preprocessing.
+ */
+#define BOOST_PP_BOOL_DELAY(X) BOOST_PP_BOOL##X
+#define BOOST_PP_BOOL0 0
+#define BOOST_PP_BOOL1 1
+#define BOOST_PP_BOOL2 1
+#define BOOST_PP_BOOL3 1
+#define BOOST_PP_BOOL4 1
+#define BOOST_PP_BOOL5 1
+#define BOOST_PP_BOOL6 1
+#define BOOST_PP_BOOL7 1
+#define BOOST_PP_BOOL8 1
+#define BOOST_PP_BOOL9 1
+#define BOOST_PP_BOOL10 1
+#define BOOST_PP_BOOL11 1
+#define BOOST_PP_BOOL12 1
+#define BOOST_PP_BOOL13 1
+#define BOOST_PP_BOOL14 1
+#define BOOST_PP_BOOL15 1
+#define BOOST_PP_BOOL16 1
+#define BOOST_PP_BOOL17 1
+#define BOOST_PP_BOOL18 1
+#define BOOST_PP_BOOL19 1
+#define BOOST_PP_BOOL20 1
+#define BOOST_PP_BOOL21 1
+#define BOOST_PP_BOOL22 1
+#define BOOST_PP_BOOL23 1
+#define BOOST_PP_BOOL24 1
+#define BOOST_PP_BOOL25 1
+#define BOOST_PP_BOOL26 1
+#define BOOST_PP_BOOL27 1
+#define BOOST_PP_BOOL28 1
+#define BOOST_PP_BOOL29 1
+#define BOOST_PP_BOOL30 1
+#define BOOST_PP_BOOL31 1
+#define BOOST_PP_BOOL32 1
+#define BOOST_PP_BOOL33 1
+#define BOOST_PP_BOOL34 1
+#define BOOST_PP_BOOL35 1
+#define BOOST_PP_BOOL36 1
+#define BOOST_PP_BOOL37 1
+#define BOOST_PP_BOOL38 1
+#define BOOST_PP_BOOL39 1
+#define BOOST_PP_BOOL40 1
+#define BOOST_PP_BOOL41 1
+#define BOOST_PP_BOOL42 1
+#define BOOST_PP_BOOL43 1
+#define BOOST_PP_BOOL44 1
+#define BOOST_PP_BOOL45 1
+#define BOOST_PP_BOOL46 1
+#define BOOST_PP_BOOL47 1
+#define BOOST_PP_BOOL48 1
+#define BOOST_PP_BOOL49 1
+#define BOOST_PP_BOOL50 1
+#define BOOST_PP_BOOL51 1
+#define BOOST_PP_BOOL52 1
+#define BOOST_PP_BOOL53 1
+#define BOOST_PP_BOOL54 1
+#define BOOST_PP_BOOL55 1
+#define BOOST_PP_BOOL56 1
+#define BOOST_PP_BOOL57 1
+#define BOOST_PP_BOOL58 1
+#define BOOST_PP_BOOL59 1
+#define BOOST_PP_BOOL60 1
+#define BOOST_PP_BOOL61 1
+#define BOOST_PP_BOOL62 1
+#define BOOST_PP_BOOL63 1
+#define BOOST_PP_BOOL64 1
+#define BOOST_PP_BOOL65 1
+#define BOOST_PP_BOOL66 1
+#define BOOST_PP_BOOL67 1
+#define BOOST_PP_BOOL68 1
+#define BOOST_PP_BOOL69 1
+#define BOOST_PP_BOOL70 1
+#define BOOST_PP_BOOL71 1
+#define BOOST_PP_BOOL72 1
+#define BOOST_PP_BOOL73 1
+#define BOOST_PP_BOOL74 1
+#define BOOST_PP_BOOL75 1
+#define BOOST_PP_BOOL76 1
+#define BOOST_PP_BOOL77 1
+#define BOOST_PP_BOOL78 1
+#define BOOST_PP_BOOL79 1
+#define BOOST_PP_BOOL80 1
+#define BOOST_PP_BOOL81 1
+#define BOOST_PP_BOOL82 1
+#define BOOST_PP_BOOL83 1
+#define BOOST_PP_BOOL84 1
+#define BOOST_PP_BOOL85 1
+#define BOOST_PP_BOOL86 1
+#define BOOST_PP_BOOL87 1
+#define BOOST_PP_BOOL88 1
+#define BOOST_PP_BOOL89 1
+#define BOOST_PP_BOOL90 1
+#define BOOST_PP_BOOL91 1
+#define BOOST_PP_BOOL92 1
+#define BOOST_PP_BOOL93 1
+#define BOOST_PP_BOOL94 1
+#define BOOST_PP_BOOL95 1
+#define BOOST_PP_BOOL96 1
+#define BOOST_PP_BOOL97 1
+#define BOOST_PP_BOOL98 1
+#define BOOST_PP_BOOL99 1
+#define BOOST_PP_BOOL100 1
+#define BOOST_PP_BOOL101 1
+#define BOOST_PP_BOOL102 1
+#define BOOST_PP_BOOL103 1
+#define BOOST_PP_BOOL104 1
+#define BOOST_PP_BOOL105 1
+#define BOOST_PP_BOOL106 1
+#define BOOST_PP_BOOL107 1
+#define BOOST_PP_BOOL108 1
+#define BOOST_PP_BOOL109 1
+#define BOOST_PP_BOOL110 1
+#define BOOST_PP_BOOL111 1
+#define BOOST_PP_BOOL112 1
+#define BOOST_PP_BOOL113 1
+#define BOOST_PP_BOOL114 1
+#define BOOST_PP_BOOL115 1
+#define BOOST_PP_BOOL116 1
+#define BOOST_PP_BOOL117 1
+#define BOOST_PP_BOOL118 1
+#define BOOST_PP_BOOL119 1
+#define BOOST_PP_BOOL120 1
+#define BOOST_PP_BOOL121 1
+#define BOOST_PP_BOOL122 1
+#define BOOST_PP_BOOL123 1
+#define BOOST_PP_BOOL124 1
+#define BOOST_PP_BOOL125 1
+#define BOOST_PP_BOOL126 1
+#define BOOST_PP_BOOL127 1
+#define BOOST_PP_BOOL128 1
+
+/* <p>Obsolete. Use BOOST_PP_BOOL().</p> */
+#define BOOST_PREPROCESSOR_BOOL(X) BOOST_PP_BOOL(X)
+#endif
diff --git a/boost/boost/preprocessor/logical/nor.hpp b/boost/boost/preprocessor/logical/nor.hpp
new file mode 100644 (file)
index 0000000..00d787a
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_NOR_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_NOR_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/bool.hpp>
+
+/** <p>Expands to the logical NEITHER OR of the operands.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_NOR(0,5)</code> expands to <code>0</code> (a single token).</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/logical_test.cpp">logical_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_NOR(X,Y) BOOST_PP_NOR_BOOL(BOOST_PP_BOOL(X),BOOST_PP_BOOL(Y))
+
+#define BOOST_PP_NOR_BOOL(X,Y) BOOST_PP_NOR_BOOL_DELAY(X,Y)
+#define BOOST_PP_NOR_BOOL_DELAY(X,Y) BOOST_PP_NOR_BOOL##X##Y
+#define BOOST_PP_NOR_BOOL00 1
+#define BOOST_PP_NOR_BOOL01 0
+#define BOOST_PP_NOR_BOOL10 0
+#define BOOST_PP_NOR_BOOL11 0
+
+/* <p>Obsolete. Use BOOST_PP_NOR().</p> */
+#define BOOST_PREPROCESSOR_NOR(X,Y) BOOST_PP_NOR(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/logical/not.hpp b/boost/boost/preprocessor/logical/not.hpp
new file mode 100644 (file)
index 0000000..6f5e00d
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_NOT_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_NOT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/nor.hpp>
+
+/** <p>Expands to the logical NOT of the operand.</p>
+
+<p><code>X</code> must be an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_NOT(0)</code> expands to <code>1</code> (a single token).</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/logical_test.cpp">logical_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_NOT(X) BOOST_PP_NOR(X,X)
+
+/* <p>Obsolete. Use BOOST_PP_NOT().</p> */
+#define BOOST_PREPROCESSOR_NOT(X) BOOST_PP_NOT(X)
+#endif
diff --git a/boost/boost/preprocessor/logical/or.hpp b/boost/boost/preprocessor/logical/or.hpp
new file mode 100644 (file)
index 0000000..7fc863a
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_OR_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_OR_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/not.hpp>
+
+/** <p>Expands to the logical OR of the operands.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_OR(0,2)</code> expands to <code>1</code> (a single token).</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/logical_test.cpp">logical_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_OR(X,Y) BOOST_PP_NOT(BOOST_PP_NOR(X,Y))
+
+/* <p>Obsolete. Use BOOST_PP_OR().</p> */
+#define BOOST_PREPROCESSOR_OR(X,Y) BOOST_PP_OR(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/logical/xor.hpp b/boost/boost/preprocessor/logical/xor.hpp
new file mode 100644 (file)
index 0000000..e95f748
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef BOOST_PREPROCESSOR_LOGICAL_XOR_HPP
+#define BOOST_PREPROCESSOR_LOGICAL_XOR_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/logical/and.hpp>
+
+/** <p>Expands to the logical EXCLUSIVE OR of the operands.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_XOR(1,2)</code> expands to <code>0</code> (a single token).</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/logical_test.cpp">logical_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_XOR(X,Y) BOOST_PP_NOR(BOOST_PP_NOR(X,Y),BOOST_PP_AND(X,Y))
+
+/* <p>Obsolete. Use BOOST_PP_XOR().</p> */
+#define BOOST_PREPROCESSOR_XOR(X,Y) BOOST_PP_XOR(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/max.hpp b/boost/boost/preprocessor/max.hpp
new file mode 100644 (file)
index 0000000..b8a343e
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BOOST_PREPROCESSOR_MAX_HPP
+#define BOOST_PREPROCESSOR_MAX_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/if.hpp>
+
+/** <p>Expands to the maximum of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_MAX(5,7)</code> expands to <code>7</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_MAX(X,Y) BOOST_PP_MAX_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_MAX_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,X,Y),Y,X)
+
+/* <p>Obsolete. Use BOOST_PP_MAX().</p> */
+#define BOOST_PREPROCESSOR_MAX(X,Y) BOOST_PP_MAX(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/min.hpp b/boost/boost/preprocessor/min.hpp
new file mode 100644 (file)
index 0000000..e345ad0
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef BOOST_PREPROCESSOR_MIN_HPP
+#define BOOST_PREPROCESSOR_MIN_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/comparison/less_equal.hpp>
+#include <boost/preprocessor/if.hpp>
+
+/** <p>Expands to the minimum of <code>X</code> and <code>Y</code>.</p>
+
+<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
+in the range [0, BOOST_PP_LIMIT_MAG].</p>
+
+<p>For example, <code>BOOST_PP_MIN(5,7)</code> expands to <code>5</code> (a
+single token).</p>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_WHILE()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/arithmetic_test.cpp">arithmetic_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_MIN(X,Y) BOOST_PP_MIN_D(0,X,Y)
+
+/** <p>Can be used inside BOOST_PP_WHILE().</p> */
+#define BOOST_PP_MIN_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,Y,X),Y,X)
+
+/* <p>Obsolete. Use BOOST_PP_MIN().</p> */
+#define BOOST_PREPROCESSOR_MIN(X,Y) BOOST_PP_MIN(X,Y)
+#endif
diff --git a/boost/boost/preprocessor/repeat.hpp b/boost/boost/preprocessor/repeat.hpp
new file mode 100644 (file)
index 0000000..43ddfd0
--- /dev/null
@@ -0,0 +1,189 @@
+#ifndef BOOST_PREPROCESSOR_REPEAT_HPP
+#define BOOST_PREPROCESSOR_REPEAT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [0,COUNT)</code>.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(INDEX,DATA) DATA(INDEX);
+BOOST_PP_REPEAT(3,TEST,X)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+X(0); X(1); X(2);
+</pre>
+
+<h3>2D and 3D repetition</h3>
+
+<p>2D and 3D repetition are supported with the BOOST_PP_REPEAT_2ND() and
+BOOST_PP_REPEAT_3RD() macros.</p>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/duffs_device.c">duffs_device.c</a></li>
+  <li><a href="../../example/repeat_2d.c">repeat_2d.c</a></li>
+</ul>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_FOR()</li>
+  <li>BOOST_PP_LIMIT_MAG</li>
+</ul>
+*/
+#define BOOST_PP_REPEAT(COUNT,MACRO,DATA) BOOST_PP_REPEAT_DELAY(COUNT)(MACRO,DATA)
+
+#define BOOST_PP_REPEAT_DELAY(N) BOOST_PP_REPEAT##N
+#define BOOST_PP_REPEAT0(M,D)
+#define BOOST_PP_REPEAT1(M,D) M(0,D)
+#define BOOST_PP_REPEAT2(M,D) M(0,D) M(1,D)
+#define BOOST_PP_REPEAT3(M,D) M(0,D) M(1,D) M(2,D)
+#define BOOST_PP_REPEAT4(M,D) M(0,D) M(1,D) M(2,D) M(3,D)
+#define BOOST_PP_REPEAT5(M,D) BOOST_PP_REPEAT4(M,D) M(4,D)
+#define BOOST_PP_REPEAT6(M,D) BOOST_PP_REPEAT5(M,D) M(5,D)
+#define BOOST_PP_REPEAT7(M,D) BOOST_PP_REPEAT6(M,D) M(6,D)
+#define BOOST_PP_REPEAT8(M,D) BOOST_PP_REPEAT7(M,D) M(7,D)
+#define BOOST_PP_REPEAT9(M,D) BOOST_PP_REPEAT8(M,D) M(8,D)
+#define BOOST_PP_REPEAT10(M,D) BOOST_PP_REPEAT9(M,D) M(9,D)
+#define BOOST_PP_REPEAT11(M,D) BOOST_PP_REPEAT10(M,D) M(10,D)
+#define BOOST_PP_REPEAT12(M,D) BOOST_PP_REPEAT11(M,D) M(11,D)
+#define BOOST_PP_REPEAT13(M,D) BOOST_PP_REPEAT12(M,D) M(12,D)
+#define BOOST_PP_REPEAT14(M,D) BOOST_PP_REPEAT13(M,D) M(13,D)
+#define BOOST_PP_REPEAT15(M,D) BOOST_PP_REPEAT14(M,D) M(14,D)
+#define BOOST_PP_REPEAT16(M,D) BOOST_PP_REPEAT15(M,D) M(15,D)
+#define BOOST_PP_REPEAT17(M,D) BOOST_PP_REPEAT16(M,D) M(16,D)
+#define BOOST_PP_REPEAT18(M,D) BOOST_PP_REPEAT17(M,D) M(17,D)
+#define BOOST_PP_REPEAT19(M,D) BOOST_PP_REPEAT18(M,D) M(18,D)
+#define BOOST_PP_REPEAT20(M,D) BOOST_PP_REPEAT19(M,D) M(19,D)
+#define BOOST_PP_REPEAT21(M,D) BOOST_PP_REPEAT20(M,D) M(20,D)
+#define BOOST_PP_REPEAT22(M,D) BOOST_PP_REPEAT21(M,D) M(21,D)
+#define BOOST_PP_REPEAT23(M,D) BOOST_PP_REPEAT22(M,D) M(22,D)
+#define BOOST_PP_REPEAT24(M,D) BOOST_PP_REPEAT23(M,D) M(23,D)
+#define BOOST_PP_REPEAT25(M,D) BOOST_PP_REPEAT24(M,D) M(24,D)
+#define BOOST_PP_REPEAT26(M,D) BOOST_PP_REPEAT25(M,D) M(25,D)
+#define BOOST_PP_REPEAT27(M,D) BOOST_PP_REPEAT26(M,D) M(26,D)
+#define BOOST_PP_REPEAT28(M,D) BOOST_PP_REPEAT27(M,D) M(27,D)
+#define BOOST_PP_REPEAT29(M,D) BOOST_PP_REPEAT28(M,D) M(28,D)
+#define BOOST_PP_REPEAT30(M,D) BOOST_PP_REPEAT29(M,D) M(29,D)
+#define BOOST_PP_REPEAT31(M,D) BOOST_PP_REPEAT30(M,D) M(30,D)
+#define BOOST_PP_REPEAT32(M,D) BOOST_PP_REPEAT31(M,D) M(31,D)
+#define BOOST_PP_REPEAT33(M,D) BOOST_PP_REPEAT32(M,D) M(32,D)
+#define BOOST_PP_REPEAT34(M,D) BOOST_PP_REPEAT33(M,D) M(33,D)
+#define BOOST_PP_REPEAT35(M,D) BOOST_PP_REPEAT34(M,D) M(34,D)
+#define BOOST_PP_REPEAT36(M,D) BOOST_PP_REPEAT35(M,D) M(35,D)
+#define BOOST_PP_REPEAT37(M,D) BOOST_PP_REPEAT36(M,D) M(36,D)
+#define BOOST_PP_REPEAT38(M,D) BOOST_PP_REPEAT37(M,D) M(37,D)
+#define BOOST_PP_REPEAT39(M,D) BOOST_PP_REPEAT38(M,D) M(38,D)
+#define BOOST_PP_REPEAT40(M,D) BOOST_PP_REPEAT39(M,D) M(39,D)
+#define BOOST_PP_REPEAT41(M,D) BOOST_PP_REPEAT40(M,D) M(40,D)
+#define BOOST_PP_REPEAT42(M,D) BOOST_PP_REPEAT41(M,D) M(41,D)
+#define BOOST_PP_REPEAT43(M,D) BOOST_PP_REPEAT42(M,D) M(42,D)
+#define BOOST_PP_REPEAT44(M,D) BOOST_PP_REPEAT43(M,D) M(43,D)
+#define BOOST_PP_REPEAT45(M,D) BOOST_PP_REPEAT44(M,D) M(44,D)
+#define BOOST_PP_REPEAT46(M,D) BOOST_PP_REPEAT45(M,D) M(45,D)
+#define BOOST_PP_REPEAT47(M,D) BOOST_PP_REPEAT46(M,D) M(46,D)
+#define BOOST_PP_REPEAT48(M,D) BOOST_PP_REPEAT47(M,D) M(47,D)
+#define BOOST_PP_REPEAT49(M,D) BOOST_PP_REPEAT48(M,D) M(48,D)
+#define BOOST_PP_REPEAT50(M,D) BOOST_PP_REPEAT49(M,D) M(49,D)
+#define BOOST_PP_REPEAT51(M,D) BOOST_PP_REPEAT50(M,D) M(50,D)
+#define BOOST_PP_REPEAT52(M,D) BOOST_PP_REPEAT51(M,D) M(51,D)
+#define BOOST_PP_REPEAT53(M,D) BOOST_PP_REPEAT52(M,D) M(52,D)
+#define BOOST_PP_REPEAT54(M,D) BOOST_PP_REPEAT53(M,D) M(53,D)
+#define BOOST_PP_REPEAT55(M,D) BOOST_PP_REPEAT54(M,D) M(54,D)
+#define BOOST_PP_REPEAT56(M,D) BOOST_PP_REPEAT55(M,D) M(55,D)
+#define BOOST_PP_REPEAT57(M,D) BOOST_PP_REPEAT56(M,D) M(56,D)
+#define BOOST_PP_REPEAT58(M,D) BOOST_PP_REPEAT57(M,D) M(57,D)
+#define BOOST_PP_REPEAT59(M,D) BOOST_PP_REPEAT58(M,D) M(58,D)
+#define BOOST_PP_REPEAT60(M,D) BOOST_PP_REPEAT59(M,D) M(59,D)
+#define BOOST_PP_REPEAT61(M,D) BOOST_PP_REPEAT60(M,D) M(60,D)
+#define BOOST_PP_REPEAT62(M,D) BOOST_PP_REPEAT61(M,D) M(61,D)
+#define BOOST_PP_REPEAT63(M,D) BOOST_PP_REPEAT62(M,D) M(62,D)
+#define BOOST_PP_REPEAT64(M,D) BOOST_PP_REPEAT63(M,D) M(63,D)
+#define BOOST_PP_REPEAT65(M,D) BOOST_PP_REPEAT64(M,D) M(64,D)
+#define BOOST_PP_REPEAT66(M,D) BOOST_PP_REPEAT65(M,D) M(65,D)
+#define BOOST_PP_REPEAT67(M,D) BOOST_PP_REPEAT66(M,D) M(66,D)
+#define BOOST_PP_REPEAT68(M,D) BOOST_PP_REPEAT67(M,D) M(67,D)
+#define BOOST_PP_REPEAT69(M,D) BOOST_PP_REPEAT68(M,D) M(68,D)
+#define BOOST_PP_REPEAT70(M,D) BOOST_PP_REPEAT69(M,D) M(69,D)
+#define BOOST_PP_REPEAT71(M,D) BOOST_PP_REPEAT70(M,D) M(70,D)
+#define BOOST_PP_REPEAT72(M,D) BOOST_PP_REPEAT71(M,D) M(71,D)
+#define BOOST_PP_REPEAT73(M,D) BOOST_PP_REPEAT72(M,D) M(72,D)
+#define BOOST_PP_REPEAT74(M,D) BOOST_PP_REPEAT73(M,D) M(73,D)
+#define BOOST_PP_REPEAT75(M,D) BOOST_PP_REPEAT74(M,D) M(74,D)
+#define BOOST_PP_REPEAT76(M,D) BOOST_PP_REPEAT75(M,D) M(75,D)
+#define BOOST_PP_REPEAT77(M,D) BOOST_PP_REPEAT76(M,D) M(76,D)
+#define BOOST_PP_REPEAT78(M,D) BOOST_PP_REPEAT77(M,D) M(77,D)
+#define BOOST_PP_REPEAT79(M,D) BOOST_PP_REPEAT78(M,D) M(78,D)
+#define BOOST_PP_REPEAT80(M,D) BOOST_PP_REPEAT79(M,D) M(79,D)
+#define BOOST_PP_REPEAT81(M,D) BOOST_PP_REPEAT80(M,D) M(80,D)
+#define BOOST_PP_REPEAT82(M,D) BOOST_PP_REPEAT81(M,D) M(81,D)
+#define BOOST_PP_REPEAT83(M,D) BOOST_PP_REPEAT82(M,D) M(82,D)
+#define BOOST_PP_REPEAT84(M,D) BOOST_PP_REPEAT83(M,D) M(83,D)
+#define BOOST_PP_REPEAT85(M,D) BOOST_PP_REPEAT84(M,D) M(84,D)
+#define BOOST_PP_REPEAT86(M,D) BOOST_PP_REPEAT85(M,D) M(85,D)
+#define BOOST_PP_REPEAT87(M,D) BOOST_PP_REPEAT86(M,D) M(86,D)
+#define BOOST_PP_REPEAT88(M,D) BOOST_PP_REPEAT87(M,D) M(87,D)
+#define BOOST_PP_REPEAT89(M,D) BOOST_PP_REPEAT88(M,D) M(88,D)
+#define BOOST_PP_REPEAT90(M,D) BOOST_PP_REPEAT89(M,D) M(89,D)
+#define BOOST_PP_REPEAT91(M,D) BOOST_PP_REPEAT90(M,D) M(90,D)
+#define BOOST_PP_REPEAT92(M,D) BOOST_PP_REPEAT91(M,D) M(91,D)
+#define BOOST_PP_REPEAT93(M,D) BOOST_PP_REPEAT92(M,D) M(92,D)
+#define BOOST_PP_REPEAT94(M,D) BOOST_PP_REPEAT93(M,D) M(93,D)
+#define BOOST_PP_REPEAT95(M,D) BOOST_PP_REPEAT94(M,D) M(94,D)
+#define BOOST_PP_REPEAT96(M,D) BOOST_PP_REPEAT95(M,D) M(95,D)
+#define BOOST_PP_REPEAT97(M,D) BOOST_PP_REPEAT96(M,D) M(96,D)
+#define BOOST_PP_REPEAT98(M,D) BOOST_PP_REPEAT97(M,D) M(97,D)
+#define BOOST_PP_REPEAT99(M,D) BOOST_PP_REPEAT98(M,D) M(98,D)
+#define BOOST_PP_REPEAT100(M,D) BOOST_PP_REPEAT99(M,D) M(99,D)
+#define BOOST_PP_REPEAT101(M,D) BOOST_PP_REPEAT100(M,D) M(100,D)
+#define BOOST_PP_REPEAT102(M,D) BOOST_PP_REPEAT101(M,D) M(101,D)
+#define BOOST_PP_REPEAT103(M,D) BOOST_PP_REPEAT102(M,D) M(102,D)
+#define BOOST_PP_REPEAT104(M,D) BOOST_PP_REPEAT103(M,D) M(103,D)
+#define BOOST_PP_REPEAT105(M,D) BOOST_PP_REPEAT104(M,D) M(104,D)
+#define BOOST_PP_REPEAT106(M,D) BOOST_PP_REPEAT105(M,D) M(105,D)
+#define BOOST_PP_REPEAT107(M,D) BOOST_PP_REPEAT106(M,D) M(106,D)
+#define BOOST_PP_REPEAT108(M,D) BOOST_PP_REPEAT107(M,D) M(107,D)
+#define BOOST_PP_REPEAT109(M,D) BOOST_PP_REPEAT108(M,D) M(108,D)
+#define BOOST_PP_REPEAT110(M,D) BOOST_PP_REPEAT109(M,D) M(109,D)
+#define BOOST_PP_REPEAT111(M,D) BOOST_PP_REPEAT110(M,D) M(110,D)
+#define BOOST_PP_REPEAT112(M,D) BOOST_PP_REPEAT111(M,D) M(111,D)
+#define BOOST_PP_REPEAT113(M,D) BOOST_PP_REPEAT112(M,D) M(112,D)
+#define BOOST_PP_REPEAT114(M,D) BOOST_PP_REPEAT113(M,D) M(113,D)
+#define BOOST_PP_REPEAT115(M,D) BOOST_PP_REPEAT114(M,D) M(114,D)
+#define BOOST_PP_REPEAT116(M,D) BOOST_PP_REPEAT115(M,D) M(115,D)
+#define BOOST_PP_REPEAT117(M,D) BOOST_PP_REPEAT116(M,D) M(116,D)
+#define BOOST_PP_REPEAT118(M,D) BOOST_PP_REPEAT117(M,D) M(117,D)
+#define BOOST_PP_REPEAT119(M,D) BOOST_PP_REPEAT118(M,D) M(118,D)
+#define BOOST_PP_REPEAT120(M,D) BOOST_PP_REPEAT119(M,D) M(119,D)
+#define BOOST_PP_REPEAT121(M,D) BOOST_PP_REPEAT120(M,D) M(120,D)
+#define BOOST_PP_REPEAT122(M,D) BOOST_PP_REPEAT121(M,D) M(121,D)
+#define BOOST_PP_REPEAT123(M,D) BOOST_PP_REPEAT122(M,D) M(122,D)
+#define BOOST_PP_REPEAT124(M,D) BOOST_PP_REPEAT123(M,D) M(123,D)
+#define BOOST_PP_REPEAT125(M,D) BOOST_PP_REPEAT124(M,D) M(124,D)
+#define BOOST_PP_REPEAT126(M,D) BOOST_PP_REPEAT125(M,D) M(125,D)
+#define BOOST_PP_REPEAT127(M,D) BOOST_PP_REPEAT126(M,D) M(126,D)
+#define BOOST_PP_REPEAT128(M,D) BOOST_PP_REPEAT127(M,D) M(127,D)
+
+/* <p>Obsolete. Use BOOST_PP_REPEAT().</p> */
+#define BOOST_PREPROCESSOR_REPEAT(C,M,D) BOOST_PP_REPEAT(C,M,D)
+#endif
diff --git a/boost/boost/preprocessor/repeat_2nd.hpp b/boost/boost/preprocessor/repeat_2nd.hpp
new file mode 100644 (file)
index 0000000..6489cef
--- /dev/null
@@ -0,0 +1,158 @@
+#ifndef BOOST_PREPROCESSOR_REPEAT_2ND_HPP
+#define BOOST_PREPROCESSOR_REPEAT_2ND_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Same as BOOST_PP_REPEAT(), but implemented independently.</p>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_2nd_test.cpp">repeat_2nd_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_REPEAT_2ND(COUNT,MACRO,DATA) BOOST_PP_REPEAT_2ND_DELAY(COUNT)(MACRO,DATA)
+
+#define BOOST_PP_REPEAT_2ND_DELAY(C) BOOST_PP_REPEAT_2ND##C
+#define BOOST_PP_REPEAT_2ND0(M,D)
+#define BOOST_PP_REPEAT_2ND1(M,D) M(0,D)
+#define BOOST_PP_REPEAT_2ND2(M,D) M(0,D) M(1,D)
+#define BOOST_PP_REPEAT_2ND3(M,D) M(0,D) M(1,D) M(2,D)
+#define BOOST_PP_REPEAT_2ND4(M,D) M(0,D) M(1,D) M(2,D) M(3,D)
+#define BOOST_PP_REPEAT_2ND5(M,D) BOOST_PP_REPEAT_2ND4(M,D) M(4,D)
+#define BOOST_PP_REPEAT_2ND6(M,D) BOOST_PP_REPEAT_2ND5(M,D) M(5,D)
+#define BOOST_PP_REPEAT_2ND7(M,D) BOOST_PP_REPEAT_2ND6(M,D) M(6,D)
+#define BOOST_PP_REPEAT_2ND8(M,D) BOOST_PP_REPEAT_2ND7(M,D) M(7,D)
+#define BOOST_PP_REPEAT_2ND9(M,D) BOOST_PP_REPEAT_2ND8(M,D) M(8,D)
+#define BOOST_PP_REPEAT_2ND10(M,D) BOOST_PP_REPEAT_2ND9(M,D) M(9,D)
+#define BOOST_PP_REPEAT_2ND11(M,D) BOOST_PP_REPEAT_2ND10(M,D) M(10,D)
+#define BOOST_PP_REPEAT_2ND12(M,D) BOOST_PP_REPEAT_2ND11(M,D) M(11,D)
+#define BOOST_PP_REPEAT_2ND13(M,D) BOOST_PP_REPEAT_2ND12(M,D) M(12,D)
+#define BOOST_PP_REPEAT_2ND14(M,D) BOOST_PP_REPEAT_2ND13(M,D) M(13,D)
+#define BOOST_PP_REPEAT_2ND15(M,D) BOOST_PP_REPEAT_2ND14(M,D) M(14,D)
+#define BOOST_PP_REPEAT_2ND16(M,D) BOOST_PP_REPEAT_2ND15(M,D) M(15,D)
+#define BOOST_PP_REPEAT_2ND17(M,D) BOOST_PP_REPEAT_2ND16(M,D) M(16,D)
+#define BOOST_PP_REPEAT_2ND18(M,D) BOOST_PP_REPEAT_2ND17(M,D) M(17,D)
+#define BOOST_PP_REPEAT_2ND19(M,D) BOOST_PP_REPEAT_2ND18(M,D) M(18,D)
+#define BOOST_PP_REPEAT_2ND20(M,D) BOOST_PP_REPEAT_2ND19(M,D) M(19,D)
+#define BOOST_PP_REPEAT_2ND21(M,D) BOOST_PP_REPEAT_2ND20(M,D) M(20,D)
+#define BOOST_PP_REPEAT_2ND22(M,D) BOOST_PP_REPEAT_2ND21(M,D) M(21,D)
+#define BOOST_PP_REPEAT_2ND23(M,D) BOOST_PP_REPEAT_2ND22(M,D) M(22,D)
+#define BOOST_PP_REPEAT_2ND24(M,D) BOOST_PP_REPEAT_2ND23(M,D) M(23,D)
+#define BOOST_PP_REPEAT_2ND25(M,D) BOOST_PP_REPEAT_2ND24(M,D) M(24,D)
+#define BOOST_PP_REPEAT_2ND26(M,D) BOOST_PP_REPEAT_2ND25(M,D) M(25,D)
+#define BOOST_PP_REPEAT_2ND27(M,D) BOOST_PP_REPEAT_2ND26(M,D) M(26,D)
+#define BOOST_PP_REPEAT_2ND28(M,D) BOOST_PP_REPEAT_2ND27(M,D) M(27,D)
+#define BOOST_PP_REPEAT_2ND29(M,D) BOOST_PP_REPEAT_2ND28(M,D) M(28,D)
+#define BOOST_PP_REPEAT_2ND30(M,D) BOOST_PP_REPEAT_2ND29(M,D) M(29,D)
+#define BOOST_PP_REPEAT_2ND31(M,D) BOOST_PP_REPEAT_2ND30(M,D) M(30,D)
+#define BOOST_PP_REPEAT_2ND32(M,D) BOOST_PP_REPEAT_2ND31(M,D) M(31,D)
+#define BOOST_PP_REPEAT_2ND33(M,D) BOOST_PP_REPEAT_2ND32(M,D) M(32,D)
+#define BOOST_PP_REPEAT_2ND34(M,D) BOOST_PP_REPEAT_2ND33(M,D) M(33,D)
+#define BOOST_PP_REPEAT_2ND35(M,D) BOOST_PP_REPEAT_2ND34(M,D) M(34,D)
+#define BOOST_PP_REPEAT_2ND36(M,D) BOOST_PP_REPEAT_2ND35(M,D) M(35,D)
+#define BOOST_PP_REPEAT_2ND37(M,D) BOOST_PP_REPEAT_2ND36(M,D) M(36,D)
+#define BOOST_PP_REPEAT_2ND38(M,D) BOOST_PP_REPEAT_2ND37(M,D) M(37,D)
+#define BOOST_PP_REPEAT_2ND39(M,D) BOOST_PP_REPEAT_2ND38(M,D) M(38,D)
+#define BOOST_PP_REPEAT_2ND40(M,D) BOOST_PP_REPEAT_2ND39(M,D) M(39,D)
+#define BOOST_PP_REPEAT_2ND41(M,D) BOOST_PP_REPEAT_2ND40(M,D) M(40,D)
+#define BOOST_PP_REPEAT_2ND42(M,D) BOOST_PP_REPEAT_2ND41(M,D) M(41,D)
+#define BOOST_PP_REPEAT_2ND43(M,D) BOOST_PP_REPEAT_2ND42(M,D) M(42,D)
+#define BOOST_PP_REPEAT_2ND44(M,D) BOOST_PP_REPEAT_2ND43(M,D) M(43,D)
+#define BOOST_PP_REPEAT_2ND45(M,D) BOOST_PP_REPEAT_2ND44(M,D) M(44,D)
+#define BOOST_PP_REPEAT_2ND46(M,D) BOOST_PP_REPEAT_2ND45(M,D) M(45,D)
+#define BOOST_PP_REPEAT_2ND47(M,D) BOOST_PP_REPEAT_2ND46(M,D) M(46,D)
+#define BOOST_PP_REPEAT_2ND48(M,D) BOOST_PP_REPEAT_2ND47(M,D) M(47,D)
+#define BOOST_PP_REPEAT_2ND49(M,D) BOOST_PP_REPEAT_2ND48(M,D) M(48,D)
+#define BOOST_PP_REPEAT_2ND50(M,D) BOOST_PP_REPEAT_2ND49(M,D) M(49,D)
+#define BOOST_PP_REPEAT_2ND51(M,D) BOOST_PP_REPEAT_2ND50(M,D) M(50,D)
+#define BOOST_PP_REPEAT_2ND52(M,D) BOOST_PP_REPEAT_2ND51(M,D) M(51,D)
+#define BOOST_PP_REPEAT_2ND53(M,D) BOOST_PP_REPEAT_2ND52(M,D) M(52,D)
+#define BOOST_PP_REPEAT_2ND54(M,D) BOOST_PP_REPEAT_2ND53(M,D) M(53,D)
+#define BOOST_PP_REPEAT_2ND55(M,D) BOOST_PP_REPEAT_2ND54(M,D) M(54,D)
+#define BOOST_PP_REPEAT_2ND56(M,D) BOOST_PP_REPEAT_2ND55(M,D) M(55,D)
+#define BOOST_PP_REPEAT_2ND57(M,D) BOOST_PP_REPEAT_2ND56(M,D) M(56,D)
+#define BOOST_PP_REPEAT_2ND58(M,D) BOOST_PP_REPEAT_2ND57(M,D) M(57,D)
+#define BOOST_PP_REPEAT_2ND59(M,D) BOOST_PP_REPEAT_2ND58(M,D) M(58,D)
+#define BOOST_PP_REPEAT_2ND60(M,D) BOOST_PP_REPEAT_2ND59(M,D) M(59,D)
+#define BOOST_PP_REPEAT_2ND61(M,D) BOOST_PP_REPEAT_2ND60(M,D) M(60,D)
+#define BOOST_PP_REPEAT_2ND62(M,D) BOOST_PP_REPEAT_2ND61(M,D) M(61,D)
+#define BOOST_PP_REPEAT_2ND63(M,D) BOOST_PP_REPEAT_2ND62(M,D) M(62,D)
+#define BOOST_PP_REPEAT_2ND64(M,D) BOOST_PP_REPEAT_2ND63(M,D) M(63,D)
+#define BOOST_PP_REPEAT_2ND65(M,D) BOOST_PP_REPEAT_2ND64(M,D) M(64,D)
+#define BOOST_PP_REPEAT_2ND66(M,D) BOOST_PP_REPEAT_2ND65(M,D) M(65,D)
+#define BOOST_PP_REPEAT_2ND67(M,D) BOOST_PP_REPEAT_2ND66(M,D) M(66,D)
+#define BOOST_PP_REPEAT_2ND68(M,D) BOOST_PP_REPEAT_2ND67(M,D) M(67,D)
+#define BOOST_PP_REPEAT_2ND69(M,D) BOOST_PP_REPEAT_2ND68(M,D) M(68,D)
+#define BOOST_PP_REPEAT_2ND70(M,D) BOOST_PP_REPEAT_2ND69(M,D) M(69,D)
+#define BOOST_PP_REPEAT_2ND71(M,D) BOOST_PP_REPEAT_2ND70(M,D) M(70,D)
+#define BOOST_PP_REPEAT_2ND72(M,D) BOOST_PP_REPEAT_2ND71(M,D) M(71,D)
+#define BOOST_PP_REPEAT_2ND73(M,D) BOOST_PP_REPEAT_2ND72(M,D) M(72,D)
+#define BOOST_PP_REPEAT_2ND74(M,D) BOOST_PP_REPEAT_2ND73(M,D) M(73,D)
+#define BOOST_PP_REPEAT_2ND75(M,D) BOOST_PP_REPEAT_2ND74(M,D) M(74,D)
+#define BOOST_PP_REPEAT_2ND76(M,D) BOOST_PP_REPEAT_2ND75(M,D) M(75,D)
+#define BOOST_PP_REPEAT_2ND77(M,D) BOOST_PP_REPEAT_2ND76(M,D) M(76,D)
+#define BOOST_PP_REPEAT_2ND78(M,D) BOOST_PP_REPEAT_2ND77(M,D) M(77,D)
+#define BOOST_PP_REPEAT_2ND79(M,D) BOOST_PP_REPEAT_2ND78(M,D) M(78,D)
+#define BOOST_PP_REPEAT_2ND80(M,D) BOOST_PP_REPEAT_2ND79(M,D) M(79,D)
+#define BOOST_PP_REPEAT_2ND81(M,D) BOOST_PP_REPEAT_2ND80(M,D) M(80,D)
+#define BOOST_PP_REPEAT_2ND82(M,D) BOOST_PP_REPEAT_2ND81(M,D) M(81,D)
+#define BOOST_PP_REPEAT_2ND83(M,D) BOOST_PP_REPEAT_2ND82(M,D) M(82,D)
+#define BOOST_PP_REPEAT_2ND84(M,D) BOOST_PP_REPEAT_2ND83(M,D) M(83,D)
+#define BOOST_PP_REPEAT_2ND85(M,D) BOOST_PP_REPEAT_2ND84(M,D) M(84,D)
+#define BOOST_PP_REPEAT_2ND86(M,D) BOOST_PP_REPEAT_2ND85(M,D) M(85,D)
+#define BOOST_PP_REPEAT_2ND87(M,D) BOOST_PP_REPEAT_2ND86(M,D) M(86,D)
+#define BOOST_PP_REPEAT_2ND88(M,D) BOOST_PP_REPEAT_2ND87(M,D) M(87,D)
+#define BOOST_PP_REPEAT_2ND89(M,D) BOOST_PP_REPEAT_2ND88(M,D) M(88,D)
+#define BOOST_PP_REPEAT_2ND90(M,D) BOOST_PP_REPEAT_2ND89(M,D) M(89,D)
+#define BOOST_PP_REPEAT_2ND91(M,D) BOOST_PP_REPEAT_2ND90(M,D) M(90,D)
+#define BOOST_PP_REPEAT_2ND92(M,D) BOOST_PP_REPEAT_2ND91(M,D) M(91,D)
+#define BOOST_PP_REPEAT_2ND93(M,D) BOOST_PP_REPEAT_2ND92(M,D) M(92,D)
+#define BOOST_PP_REPEAT_2ND94(M,D) BOOST_PP_REPEAT_2ND93(M,D) M(93,D)
+#define BOOST_PP_REPEAT_2ND95(M,D) BOOST_PP_REPEAT_2ND94(M,D) M(94,D)
+#define BOOST_PP_REPEAT_2ND96(M,D) BOOST_PP_REPEAT_2ND95(M,D) M(95,D)
+#define BOOST_PP_REPEAT_2ND97(M,D) BOOST_PP_REPEAT_2ND96(M,D) M(96,D)
+#define BOOST_PP_REPEAT_2ND98(M,D) BOOST_PP_REPEAT_2ND97(M,D) M(97,D)
+#define BOOST_PP_REPEAT_2ND99(M,D) BOOST_PP_REPEAT_2ND98(M,D) M(98,D)
+#define BOOST_PP_REPEAT_2ND100(M,D) BOOST_PP_REPEAT_2ND99(M,D) M(99,D)
+#define BOOST_PP_REPEAT_2ND101(M,D) BOOST_PP_REPEAT_2ND100(M,D) M(100,D)
+#define BOOST_PP_REPEAT_2ND102(M,D) BOOST_PP_REPEAT_2ND101(M,D) M(101,D)
+#define BOOST_PP_REPEAT_2ND103(M,D) BOOST_PP_REPEAT_2ND102(M,D) M(102,D)
+#define BOOST_PP_REPEAT_2ND104(M,D) BOOST_PP_REPEAT_2ND103(M,D) M(103,D)
+#define BOOST_PP_REPEAT_2ND105(M,D) BOOST_PP_REPEAT_2ND104(M,D) M(104,D)
+#define BOOST_PP_REPEAT_2ND106(M,D) BOOST_PP_REPEAT_2ND105(M,D) M(105,D)
+#define BOOST_PP_REPEAT_2ND107(M,D) BOOST_PP_REPEAT_2ND106(M,D) M(106,D)
+#define BOOST_PP_REPEAT_2ND108(M,D) BOOST_PP_REPEAT_2ND107(M,D) M(107,D)
+#define BOOST_PP_REPEAT_2ND109(M,D) BOOST_PP_REPEAT_2ND108(M,D) M(108,D)
+#define BOOST_PP_REPEAT_2ND110(M,D) BOOST_PP_REPEAT_2ND109(M,D) M(109,D)
+#define BOOST_PP_REPEAT_2ND111(M,D) BOOST_PP_REPEAT_2ND110(M,D) M(110,D)
+#define BOOST_PP_REPEAT_2ND112(M,D) BOOST_PP_REPEAT_2ND111(M,D) M(111,D)
+#define BOOST_PP_REPEAT_2ND113(M,D) BOOST_PP_REPEAT_2ND112(M,D) M(112,D)
+#define BOOST_PP_REPEAT_2ND114(M,D) BOOST_PP_REPEAT_2ND113(M,D) M(113,D)
+#define BOOST_PP_REPEAT_2ND115(M,D) BOOST_PP_REPEAT_2ND114(M,D) M(114,D)
+#define BOOST_PP_REPEAT_2ND116(M,D) BOOST_PP_REPEAT_2ND115(M,D) M(115,D)
+#define BOOST_PP_REPEAT_2ND117(M,D) BOOST_PP_REPEAT_2ND116(M,D) M(116,D)
+#define BOOST_PP_REPEAT_2ND118(M,D) BOOST_PP_REPEAT_2ND117(M,D) M(117,D)
+#define BOOST_PP_REPEAT_2ND119(M,D) BOOST_PP_REPEAT_2ND118(M,D) M(118,D)
+#define BOOST_PP_REPEAT_2ND120(M,D) BOOST_PP_REPEAT_2ND119(M,D) M(119,D)
+#define BOOST_PP_REPEAT_2ND121(M,D) BOOST_PP_REPEAT_2ND120(M,D) M(120,D)
+#define BOOST_PP_REPEAT_2ND122(M,D) BOOST_PP_REPEAT_2ND121(M,D) M(121,D)
+#define BOOST_PP_REPEAT_2ND123(M,D) BOOST_PP_REPEAT_2ND122(M,D) M(122,D)
+#define BOOST_PP_REPEAT_2ND124(M,D) BOOST_PP_REPEAT_2ND123(M,D) M(123,D)
+#define BOOST_PP_REPEAT_2ND125(M,D) BOOST_PP_REPEAT_2ND124(M,D) M(124,D)
+#define BOOST_PP_REPEAT_2ND126(M,D) BOOST_PP_REPEAT_2ND125(M,D) M(125,D)
+#define BOOST_PP_REPEAT_2ND127(M,D) BOOST_PP_REPEAT_2ND126(M,D) M(126,D)
+#define BOOST_PP_REPEAT_2ND128(M,D) BOOST_PP_REPEAT_2ND127(M,D) M(127,D)
+
+/* <p>Obsolete. Use BOOST_PP_REPEAT_2ND().</p> */
+#define BOOST_PREPROCESSOR_REPEAT_2ND(C,M,D) BOOST_PP_REPEAT_2ND(C,M,D)
+#endif
diff --git a/boost/boost/preprocessor/repeat_3rd.hpp b/boost/boost/preprocessor/repeat_3rd.hpp
new file mode 100644 (file)
index 0000000..cba3f8e
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef BOOST_PREPROCESSOR_REPEAT_3RD_HPP
+#define BOOST_PREPROCESSOR_REPEAT_3RD_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Same as BOOST_PP_REPEAT(), but implemented independently.</p> */
+#define BOOST_PP_REPEAT_3RD(COUNT,MACRO,DATA) BOOST_PP_REPEAT_3RD_DELAY(COUNT)(MACRO,DATA)
+
+#define BOOST_PP_REPEAT_3RD_DELAY(C) BOOST_PP_REPEAT_3RD##C
+#define BOOST_PP_REPEAT_3RD0(M,D)
+#define BOOST_PP_REPEAT_3RD1(M,D) M(0,D)
+#define BOOST_PP_REPEAT_3RD2(M,D) M(0,D) M(1,D)
+#define BOOST_PP_REPEAT_3RD3(M,D) M(0,D) M(1,D) M(2,D)
+#define BOOST_PP_REPEAT_3RD4(M,D) M(0,D) M(1,D) M(2,D) M(3,D)
+#define BOOST_PP_REPEAT_3RD5(M,D) BOOST_PP_REPEAT_3RD4(M,D) M(4,D)
+#define BOOST_PP_REPEAT_3RD6(M,D) BOOST_PP_REPEAT_3RD5(M,D) M(5,D)
+#define BOOST_PP_REPEAT_3RD7(M,D) BOOST_PP_REPEAT_3RD6(M,D) M(6,D)
+#define BOOST_PP_REPEAT_3RD8(M,D) BOOST_PP_REPEAT_3RD7(M,D) M(7,D)
+#define BOOST_PP_REPEAT_3RD9(M,D) BOOST_PP_REPEAT_3RD8(M,D) M(8,D)
+#define BOOST_PP_REPEAT_3RD10(M,D) BOOST_PP_REPEAT_3RD9(M,D) M(9,D)
+#define BOOST_PP_REPEAT_3RD11(M,D) BOOST_PP_REPEAT_3RD10(M,D) M(10,D)
+#define BOOST_PP_REPEAT_3RD12(M,D) BOOST_PP_REPEAT_3RD11(M,D) M(11,D)
+#define BOOST_PP_REPEAT_3RD13(M,D) BOOST_PP_REPEAT_3RD12(M,D) M(12,D)
+#define BOOST_PP_REPEAT_3RD14(M,D) BOOST_PP_REPEAT_3RD13(M,D) M(13,D)
+#define BOOST_PP_REPEAT_3RD15(M,D) BOOST_PP_REPEAT_3RD14(M,D) M(14,D)
+#define BOOST_PP_REPEAT_3RD16(M,D) BOOST_PP_REPEAT_3RD15(M,D) M(15,D)
+#define BOOST_PP_REPEAT_3RD17(M,D) BOOST_PP_REPEAT_3RD16(M,D) M(16,D)
+#define BOOST_PP_REPEAT_3RD18(M,D) BOOST_PP_REPEAT_3RD17(M,D) M(17,D)
+#define BOOST_PP_REPEAT_3RD19(M,D) BOOST_PP_REPEAT_3RD18(M,D) M(18,D)
+#define BOOST_PP_REPEAT_3RD20(M,D) BOOST_PP_REPEAT_3RD19(M,D) M(19,D)
+#define BOOST_PP_REPEAT_3RD21(M,D) BOOST_PP_REPEAT_3RD20(M,D) M(20,D)
+#define BOOST_PP_REPEAT_3RD22(M,D) BOOST_PP_REPEAT_3RD21(M,D) M(21,D)
+#define BOOST_PP_REPEAT_3RD23(M,D) BOOST_PP_REPEAT_3RD22(M,D) M(22,D)
+#define BOOST_PP_REPEAT_3RD24(M,D) BOOST_PP_REPEAT_3RD23(M,D) M(23,D)
+#define BOOST_PP_REPEAT_3RD25(M,D) BOOST_PP_REPEAT_3RD24(M,D) M(24,D)
+#define BOOST_PP_REPEAT_3RD26(M,D) BOOST_PP_REPEAT_3RD25(M,D) M(25,D)
+#define BOOST_PP_REPEAT_3RD27(M,D) BOOST_PP_REPEAT_3RD26(M,D) M(26,D)
+#define BOOST_PP_REPEAT_3RD28(M,D) BOOST_PP_REPEAT_3RD27(M,D) M(27,D)
+#define BOOST_PP_REPEAT_3RD29(M,D) BOOST_PP_REPEAT_3RD28(M,D) M(28,D)
+#define BOOST_PP_REPEAT_3RD30(M,D) BOOST_PP_REPEAT_3RD29(M,D) M(29,D)
+#define BOOST_PP_REPEAT_3RD31(M,D) BOOST_PP_REPEAT_3RD30(M,D) M(30,D)
+#define BOOST_PP_REPEAT_3RD32(M,D) BOOST_PP_REPEAT_3RD31(M,D) M(31,D)
+#define BOOST_PP_REPEAT_3RD33(M,D) BOOST_PP_REPEAT_3RD32(M,D) M(32,D)
+#define BOOST_PP_REPEAT_3RD34(M,D) BOOST_PP_REPEAT_3RD33(M,D) M(33,D)
+#define BOOST_PP_REPEAT_3RD35(M,D) BOOST_PP_REPEAT_3RD34(M,D) M(34,D)
+#define BOOST_PP_REPEAT_3RD36(M,D) BOOST_PP_REPEAT_3RD35(M,D) M(35,D)
+#define BOOST_PP_REPEAT_3RD37(M,D) BOOST_PP_REPEAT_3RD36(M,D) M(36,D)
+#define BOOST_PP_REPEAT_3RD38(M,D) BOOST_PP_REPEAT_3RD37(M,D) M(37,D)
+#define BOOST_PP_REPEAT_3RD39(M,D) BOOST_PP_REPEAT_3RD38(M,D) M(38,D)
+#define BOOST_PP_REPEAT_3RD40(M,D) BOOST_PP_REPEAT_3RD39(M,D) M(39,D)
+#define BOOST_PP_REPEAT_3RD41(M,D) BOOST_PP_REPEAT_3RD40(M,D) M(40,D)
+#define BOOST_PP_REPEAT_3RD42(M,D) BOOST_PP_REPEAT_3RD41(M,D) M(41,D)
+#define BOOST_PP_REPEAT_3RD43(M,D) BOOST_PP_REPEAT_3RD42(M,D) M(42,D)
+#define BOOST_PP_REPEAT_3RD44(M,D) BOOST_PP_REPEAT_3RD43(M,D) M(43,D)
+#define BOOST_PP_REPEAT_3RD45(M,D) BOOST_PP_REPEAT_3RD44(M,D) M(44,D)
+#define BOOST_PP_REPEAT_3RD46(M,D) BOOST_PP_REPEAT_3RD45(M,D) M(45,D)
+#define BOOST_PP_REPEAT_3RD47(M,D) BOOST_PP_REPEAT_3RD46(M,D) M(46,D)
+#define BOOST_PP_REPEAT_3RD48(M,D) BOOST_PP_REPEAT_3RD47(M,D) M(47,D)
+#define BOOST_PP_REPEAT_3RD49(M,D) BOOST_PP_REPEAT_3RD48(M,D) M(48,D)
+#define BOOST_PP_REPEAT_3RD50(M,D) BOOST_PP_REPEAT_3RD49(M,D) M(49,D)
+#define BOOST_PP_REPEAT_3RD51(M,D) BOOST_PP_REPEAT_3RD50(M,D) M(50,D)
+#define BOOST_PP_REPEAT_3RD52(M,D) BOOST_PP_REPEAT_3RD51(M,D) M(51,D)
+#define BOOST_PP_REPEAT_3RD53(M,D) BOOST_PP_REPEAT_3RD52(M,D) M(52,D)
+#define BOOST_PP_REPEAT_3RD54(M,D) BOOST_PP_REPEAT_3RD53(M,D) M(53,D)
+#define BOOST_PP_REPEAT_3RD55(M,D) BOOST_PP_REPEAT_3RD54(M,D) M(54,D)
+#define BOOST_PP_REPEAT_3RD56(M,D) BOOST_PP_REPEAT_3RD55(M,D) M(55,D)
+#define BOOST_PP_REPEAT_3RD57(M,D) BOOST_PP_REPEAT_3RD56(M,D) M(56,D)
+#define BOOST_PP_REPEAT_3RD58(M,D) BOOST_PP_REPEAT_3RD57(M,D) M(57,D)
+#define BOOST_PP_REPEAT_3RD59(M,D) BOOST_PP_REPEAT_3RD58(M,D) M(58,D)
+#define BOOST_PP_REPEAT_3RD60(M,D) BOOST_PP_REPEAT_3RD59(M,D) M(59,D)
+#define BOOST_PP_REPEAT_3RD61(M,D) BOOST_PP_REPEAT_3RD60(M,D) M(60,D)
+#define BOOST_PP_REPEAT_3RD62(M,D) BOOST_PP_REPEAT_3RD61(M,D) M(61,D)
+#define BOOST_PP_REPEAT_3RD63(M,D) BOOST_PP_REPEAT_3RD62(M,D) M(62,D)
+#define BOOST_PP_REPEAT_3RD64(M,D) BOOST_PP_REPEAT_3RD63(M,D) M(63,D)
+#define BOOST_PP_REPEAT_3RD65(M,D) BOOST_PP_REPEAT_3RD64(M,D) M(64,D)
+#define BOOST_PP_REPEAT_3RD66(M,D) BOOST_PP_REPEAT_3RD65(M,D) M(65,D)
+#define BOOST_PP_REPEAT_3RD67(M,D) BOOST_PP_REPEAT_3RD66(M,D) M(66,D)
+#define BOOST_PP_REPEAT_3RD68(M,D) BOOST_PP_REPEAT_3RD67(M,D) M(67,D)
+#define BOOST_PP_REPEAT_3RD69(M,D) BOOST_PP_REPEAT_3RD68(M,D) M(68,D)
+#define BOOST_PP_REPEAT_3RD70(M,D) BOOST_PP_REPEAT_3RD69(M,D) M(69,D)
+#define BOOST_PP_REPEAT_3RD71(M,D) BOOST_PP_REPEAT_3RD70(M,D) M(70,D)
+#define BOOST_PP_REPEAT_3RD72(M,D) BOOST_PP_REPEAT_3RD71(M,D) M(71,D)
+#define BOOST_PP_REPEAT_3RD73(M,D) BOOST_PP_REPEAT_3RD72(M,D) M(72,D)
+#define BOOST_PP_REPEAT_3RD74(M,D) BOOST_PP_REPEAT_3RD73(M,D) M(73,D)
+#define BOOST_PP_REPEAT_3RD75(M,D) BOOST_PP_REPEAT_3RD74(M,D) M(74,D)
+#define BOOST_PP_REPEAT_3RD76(M,D) BOOST_PP_REPEAT_3RD75(M,D) M(75,D)
+#define BOOST_PP_REPEAT_3RD77(M,D) BOOST_PP_REPEAT_3RD76(M,D) M(76,D)
+#define BOOST_PP_REPEAT_3RD78(M,D) BOOST_PP_REPEAT_3RD77(M,D) M(77,D)
+#define BOOST_PP_REPEAT_3RD79(M,D) BOOST_PP_REPEAT_3RD78(M,D) M(78,D)
+#define BOOST_PP_REPEAT_3RD80(M,D) BOOST_PP_REPEAT_3RD79(M,D) M(79,D)
+#define BOOST_PP_REPEAT_3RD81(M,D) BOOST_PP_REPEAT_3RD80(M,D) M(80,D)
+#define BOOST_PP_REPEAT_3RD82(M,D) BOOST_PP_REPEAT_3RD81(M,D) M(81,D)
+#define BOOST_PP_REPEAT_3RD83(M,D) BOOST_PP_REPEAT_3RD82(M,D) M(82,D)
+#define BOOST_PP_REPEAT_3RD84(M,D) BOOST_PP_REPEAT_3RD83(M,D) M(83,D)
+#define BOOST_PP_REPEAT_3RD85(M,D) BOOST_PP_REPEAT_3RD84(M,D) M(84,D)
+#define BOOST_PP_REPEAT_3RD86(M,D) BOOST_PP_REPEAT_3RD85(M,D) M(85,D)
+#define BOOST_PP_REPEAT_3RD87(M,D) BOOST_PP_REPEAT_3RD86(M,D) M(86,D)
+#define BOOST_PP_REPEAT_3RD88(M,D) BOOST_PP_REPEAT_3RD87(M,D) M(87,D)
+#define BOOST_PP_REPEAT_3RD89(M,D) BOOST_PP_REPEAT_3RD88(M,D) M(88,D)
+#define BOOST_PP_REPEAT_3RD90(M,D) BOOST_PP_REPEAT_3RD89(M,D) M(89,D)
+#define BOOST_PP_REPEAT_3RD91(M,D) BOOST_PP_REPEAT_3RD90(M,D) M(90,D)
+#define BOOST_PP_REPEAT_3RD92(M,D) BOOST_PP_REPEAT_3RD91(M,D) M(91,D)
+#define BOOST_PP_REPEAT_3RD93(M,D) BOOST_PP_REPEAT_3RD92(M,D) M(92,D)
+#define BOOST_PP_REPEAT_3RD94(M,D) BOOST_PP_REPEAT_3RD93(M,D) M(93,D)
+#define BOOST_PP_REPEAT_3RD95(M,D) BOOST_PP_REPEAT_3RD94(M,D) M(94,D)
+#define BOOST_PP_REPEAT_3RD96(M,D) BOOST_PP_REPEAT_3RD95(M,D) M(95,D)
+#define BOOST_PP_REPEAT_3RD97(M,D) BOOST_PP_REPEAT_3RD96(M,D) M(96,D)
+#define BOOST_PP_REPEAT_3RD98(M,D) BOOST_PP_REPEAT_3RD97(M,D) M(97,D)
+#define BOOST_PP_REPEAT_3RD99(M,D) BOOST_PP_REPEAT_3RD98(M,D) M(98,D)
+#define BOOST_PP_REPEAT_3RD100(M,D) BOOST_PP_REPEAT_3RD99(M,D) M(99,D)
+#define BOOST_PP_REPEAT_3RD101(M,D) BOOST_PP_REPEAT_3RD100(M,D) M(100,D)
+#define BOOST_PP_REPEAT_3RD102(M,D) BOOST_PP_REPEAT_3RD101(M,D) M(101,D)
+#define BOOST_PP_REPEAT_3RD103(M,D) BOOST_PP_REPEAT_3RD102(M,D) M(102,D)
+#define BOOST_PP_REPEAT_3RD104(M,D) BOOST_PP_REPEAT_3RD103(M,D) M(103,D)
+#define BOOST_PP_REPEAT_3RD105(M,D) BOOST_PP_REPEAT_3RD104(M,D) M(104,D)
+#define BOOST_PP_REPEAT_3RD106(M,D) BOOST_PP_REPEAT_3RD105(M,D) M(105,D)
+#define BOOST_PP_REPEAT_3RD107(M,D) BOOST_PP_REPEAT_3RD106(M,D) M(106,D)
+#define BOOST_PP_REPEAT_3RD108(M,D) BOOST_PP_REPEAT_3RD107(M,D) M(107,D)
+#define BOOST_PP_REPEAT_3RD109(M,D) BOOST_PP_REPEAT_3RD108(M,D) M(108,D)
+#define BOOST_PP_REPEAT_3RD110(M,D) BOOST_PP_REPEAT_3RD109(M,D) M(109,D)
+#define BOOST_PP_REPEAT_3RD111(M,D) BOOST_PP_REPEAT_3RD110(M,D) M(110,D)
+#define BOOST_PP_REPEAT_3RD112(M,D) BOOST_PP_REPEAT_3RD111(M,D) M(111,D)
+#define BOOST_PP_REPEAT_3RD113(M,D) BOOST_PP_REPEAT_3RD112(M,D) M(112,D)
+#define BOOST_PP_REPEAT_3RD114(M,D) BOOST_PP_REPEAT_3RD113(M,D) M(113,D)
+#define BOOST_PP_REPEAT_3RD115(M,D) BOOST_PP_REPEAT_3RD114(M,D) M(114,D)
+#define BOOST_PP_REPEAT_3RD116(M,D) BOOST_PP_REPEAT_3RD115(M,D) M(115,D)
+#define BOOST_PP_REPEAT_3RD117(M,D) BOOST_PP_REPEAT_3RD116(M,D) M(116,D)
+#define BOOST_PP_REPEAT_3RD118(M,D) BOOST_PP_REPEAT_3RD117(M,D) M(117,D)
+#define BOOST_PP_REPEAT_3RD119(M,D) BOOST_PP_REPEAT_3RD118(M,D) M(118,D)
+#define BOOST_PP_REPEAT_3RD120(M,D) BOOST_PP_REPEAT_3RD119(M,D) M(119,D)
+#define BOOST_PP_REPEAT_3RD121(M,D) BOOST_PP_REPEAT_3RD120(M,D) M(120,D)
+#define BOOST_PP_REPEAT_3RD122(M,D) BOOST_PP_REPEAT_3RD121(M,D) M(121,D)
+#define BOOST_PP_REPEAT_3RD123(M,D) BOOST_PP_REPEAT_3RD122(M,D) M(122,D)
+#define BOOST_PP_REPEAT_3RD124(M,D) BOOST_PP_REPEAT_3RD123(M,D) M(123,D)
+#define BOOST_PP_REPEAT_3RD125(M,D) BOOST_PP_REPEAT_3RD124(M,D) M(124,D)
+#define BOOST_PP_REPEAT_3RD126(M,D) BOOST_PP_REPEAT_3RD125(M,D) M(125,D)
+#define BOOST_PP_REPEAT_3RD127(M,D) BOOST_PP_REPEAT_3RD126(M,D) M(126,D)
+#define BOOST_PP_REPEAT_3RD128(M,D) BOOST_PP_REPEAT_3RD127(M,D) M(127,D)
+
+/* <p>Obsolete. Use BOOST_PP_REPEAT_3RD().</p> */
+#define BOOST_PREPROCESSOR_REPEAT_3RD(C,M,D) BOOST_PP_REPEAT_3RD(C,M,D)
+#endif
diff --git a/boost/boost/preprocessor/repeat_from_to.hpp b/boost/boost/preprocessor/repeat_from_to.hpp
new file mode 100644 (file)
index 0000000..ee2abe7
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BOOST_PREPROCESSOR_REPEAT_FROM_TO_HPP
+#define BOOST_PREPROCESSOR_REPEAT_FROM_TO_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/repeat.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+
+/** <p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [FIRST,LAST)</code>.</p>
+
+<p>In other words, expands to the sequence:</p>
+
+<pre>
+MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA)
+</pre>
+
+<p>For example,</p>
+
+<pre>
+#define TEST(INDEX,DATA) DATA(INDEX);
+BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X)
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+X(4); X(5); X(6);
+</pre>
+
+<h3>Uses</h3>
+<ul>
+  <li>BOOST_PP_REPEAT()</li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_REPEAT_FROM_TO(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_F,(FIRST,MACRO,DATA))
+#define BOOST_PP_REPEAT_FROM_TO_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP))
+#endif
diff --git a/boost/boost/preprocessor/repeat_from_to_2nd.hpp b/boost/boost/preprocessor/repeat_from_to_2nd.hpp
new file mode 100644 (file)
index 0000000..6d1876a
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef BOOST_PREPROCESSOR_REPEAT_FROM_TO_2ND_HPP
+#define BOOST_PREPROCESSOR_REPEAT_FROM_TO_2ND_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/repeat_2nd.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+
+/** <p>Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.</p> */
+#define BOOST_PP_REPEAT_FROM_TO_2ND(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT_2ND(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_2ND_F,(FIRST,MACRO,DATA))
+#define BOOST_PP_REPEAT_FROM_TO_2ND_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP))
+#endif
diff --git a/boost/boost/preprocessor/repeat_from_to_3rd.hpp b/boost/boost/preprocessor/repeat_from_to_3rd.hpp
new file mode 100644 (file)
index 0000000..cea72ee
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef BOOST_PREPROCESSOR_REPEAT_FROM_TO_3RD_HPP
+#define BOOST_PREPROCESSOR_REPEAT_FROM_TO_3RD_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/repeat_3rd.hpp>
+#include <boost/preprocessor/arithmetic/sub.hpp>
+#include <boost/preprocessor/arithmetic/add.hpp>
+
+/** <p>Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.</p> */
+#define BOOST_PP_REPEAT_FROM_TO_3RD(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT_3RD(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_3RD_F,(FIRST,MACRO,DATA))
+#define BOOST_PP_REPEAT_FROM_TO_3RD_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP))
+#endif
diff --git a/boost/boost/preprocessor/stringize.hpp b/boost/boost/preprocessor/stringize.hpp
new file mode 100644 (file)
index 0000000..edd606a
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef BOOST_PREPROCESSOR_STRINGIZE_HPP
+#define BOOST_PREPROCESSOR_STRINGIZE_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Stringizes <code>X</code> after it is macro expanded.</p>
+
+<p>For example, <code>BOOST_PP_STRINGIZE(BOOST_PP_CAT(a,b))</code> expands to <code>"ab"</code>.</p>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/note.c">note.c</a></li>
+</ul>
+
+<h3>Test</h3>
+<ul>
+  <li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
+</ul>
+*/
+#define BOOST_PP_STRINGIZE(X) BOOST_PP_STRINGIZE_DELAY(X)
+
+#define BOOST_PP_STRINGIZE_DELAY(X) BOOST_PP_DO_STRINGIZE(X)
+#define BOOST_PP_DO_STRINGIZE(X) #X
+
+/* <p>Obsolete. Use BOOST_PP_STRINGIZE().</p> */
+#define BOOST_PREPROCESSOR_STRINGIZE(E) BOOST_PP_STRINGIZE(E)
+#endif
diff --git a/boost/boost/preprocessor/tuple.hpp b/boost/boost/preprocessor/tuple.hpp
new file mode 100644 (file)
index 0000000..0866bb4
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef BOOST_PREPROCESSOR_TUPLE_HPP
+#define BOOST_PREPROCESSOR_TUPLE_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Includes all tuple headers.</p>
+
+<p>A tuple is a fixed size collection of elements.</p>
+
+<p>In the preprocessor library, tuples are represented like macro parameter
+lists. Thus an element of a tuple can be any sequence of tokens that
+constitutes a single macro parameter.</p>
+
+<p>Examples of tuples:</p>
+
+<pre>
+(const, volatile)    // 2-tuple
+(*, /, %)            // 3-tuple
+(1, "2", '3', (4,5)) // 4-tuple
+</pre>
+
+<p>Tuples can be used for representing structured data.</p>
+*/
+
+#include <boost/preprocessor/tuple/eat.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/preprocessor/tuple/reverse.hpp>
+#include <boost/preprocessor/tuple/to_list.hpp>
+#endif
diff --git a/boost/boost/preprocessor/tuple/eat.hpp b/boost/boost/preprocessor/tuple/eat.hpp
new file mode 100644 (file)
index 0000000..d79bfe4
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef BOOST_PREPROCESSOR_TUPLE_EAT_HPP
+#define BOOST_PREPROCESSOR_TUPLE_EAT_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Expands to a macro that eats a tuple of the specified size.</p>
+
+<p>BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like
+BOOST_PP_EMPTY().</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P)
+</pre>
+
+<p>expands to nothing.</p>
+*/
+#define BOOST_PP_TUPLE_EAT(SIZE_OF_TUPLE) BOOST_PP_TUPLE_EAT_DELAY(SIZE_OF_TUPLE)
+
+#define BOOST_PP_TUPLE_EAT_DELAY(N) BOOST_PP_TUPLE##N##_EAT
+#define BOOST_PP_TUPLE0_EAT()
+#define BOOST_PP_TUPLE1_EAT(A)
+#define BOOST_PP_TUPLE2_EAT(A,B)
+#define BOOST_PP_TUPLE3_EAT(A,B,C)
+#define BOOST_PP_TUPLE4_EAT(A,B,C,D)
+#define BOOST_PP_TUPLE5_EAT(A,B,C,D,E)
+#define BOOST_PP_TUPLE6_EAT(A,B,C,D,E,F)
+#define BOOST_PP_TUPLE7_EAT(A,B,C,D,E,F,G)
+#define BOOST_PP_TUPLE8_EAT(A,B,C,D,E,F,G,H)
+#define BOOST_PP_TUPLE9_EAT(A,B,C,D,E,F,G,H,I)
+#define BOOST_PP_TUPLE10_EAT(A,B,C,D,E,F,G,H,I,J)
+#define BOOST_PP_TUPLE11_EAT(A,B,C,D,E,F,G,H,I,J,K)
+#define BOOST_PP_TUPLE12_EAT(A,B,C,D,E,F,G,H,I,J,K,L)
+#define BOOST_PP_TUPLE13_EAT(A,B,C,D,E,F,G,H,I,J,K,L,M)
+#define BOOST_PP_TUPLE14_EAT(A,B,C,D,E,F,G,H,I,J,K,L,M,N)
+#define BOOST_PP_TUPLE15_EAT(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O)
+#define BOOST_PP_TUPLE16_EAT(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P)
+#endif
diff --git a/boost/boost/preprocessor/tuple/elem.hpp b/boost/boost/preprocessor/tuple/elem.hpp
new file mode 100644 (file)
index 0000000..f2daac1
--- /dev/null
@@ -0,0 +1,206 @@
+#ifndef BOOST_PREPROCESSOR_TUPLE_ELEM_HPP
+#define BOOST_PREPROCESSOR_TUPLE_ELEM_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Expands to the <code>INDEX</code>:th element of an <code>SIZE_OF_TUPLE</code>-tuple.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_TUPLE_ELEM(2,1,(A,B))
+</pre>
+
+<p>expands to <code>B</code>.</p>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_LIMIT_TUPLE</li>
+</ul>
+*/
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+#  define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX,TUPLE)
+/* This is a workaround for a CodeWarrior PP bug. Strictly speaking
+ * this workaround invokes undefined behavior, but it works as desired.
+ */
+#  define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_TUPLE##N##_ELEM##I##T
+#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
+#  include <boost/preprocessor/expand.hpp>
+/* This is a workaround for a MSVC++ PP bug. It should not be necessary
+ * to use BOOST_PP_EXPAND(). Works on standard conforming compilers, too.
+ */
+#  define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX)TUPLE)
+#  define BOOST_PP_TUPLE_ELEM_DELAY(N,I) BOOST_PP_TUPLE##N##_ELEM##I
+#else
+#  define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX)TUPLE
+#  define BOOST_PP_TUPLE_ELEM_DELAY(N,I) BOOST_PP_TUPLE##N##_ELEM##I
+#endif
+
+/* TUPLE_ELEM can be implemented in O(N*N) space and O(N) time instead
+ * of O(N*N*N) space and O(1) time. The current trade-off seems better.
+ */
+#define BOOST_PP_TUPLE1_ELEM0(A) A
+
+#define BOOST_PP_TUPLE2_ELEM0(A,B) A
+#define BOOST_PP_TUPLE2_ELEM1(A,B) B
+
+#define BOOST_PP_TUPLE3_ELEM0(A,B,C) A
+#define BOOST_PP_TUPLE3_ELEM1(A,B,C) B
+#define BOOST_PP_TUPLE3_ELEM2(A,B,C) C
+
+#define BOOST_PP_TUPLE4_ELEM0(A,B,C,D) A
+#define BOOST_PP_TUPLE4_ELEM1(A,B,C,D) B
+#define BOOST_PP_TUPLE4_ELEM2(A,B,C,D) C
+#define BOOST_PP_TUPLE4_ELEM3(A,B,C,D) D
+
+#define BOOST_PP_TUPLE5_ELEM0(A,B,C,D,E) A
+#define BOOST_PP_TUPLE5_ELEM1(A,B,C,D,E) B
+#define BOOST_PP_TUPLE5_ELEM2(A,B,C,D,E) C
+#define BOOST_PP_TUPLE5_ELEM3(A,B,C,D,E) D
+#define BOOST_PP_TUPLE5_ELEM4(A,B,C,D,E) E
+
+#define BOOST_PP_TUPLE6_ELEM0(A,B,C,D,E,F) A
+#define BOOST_PP_TUPLE6_ELEM1(A,B,C,D,E,F) B
+#define BOOST_PP_TUPLE6_ELEM2(A,B,C,D,E,F) C
+#define BOOST_PP_TUPLE6_ELEM3(A,B,C,D,E,F) D
+#define BOOST_PP_TUPLE6_ELEM4(A,B,C,D,E,F) E
+#define BOOST_PP_TUPLE6_ELEM5(A,B,C,D,E,F) F
+
+#define BOOST_PP_TUPLE7_ELEM0(A,B,C,D,E,F,G) A
+#define BOOST_PP_TUPLE7_ELEM1(A,B,C,D,E,F,G) B
+#define BOOST_PP_TUPLE7_ELEM2(A,B,C,D,E,F,G) C
+#define BOOST_PP_TUPLE7_ELEM3(A,B,C,D,E,F,G) D
+#define BOOST_PP_TUPLE7_ELEM4(A,B,C,D,E,F,G) E
+#define BOOST_PP_TUPLE7_ELEM5(A,B,C,D,E,F,G) F
+#define BOOST_PP_TUPLE7_ELEM6(A,B,C,D,E,F,G) G
+
+#define BOOST_PP_TUPLE8_ELEM0(A,B,C,D,E,F,G,H) A
+#define BOOST_PP_TUPLE8_ELEM1(A,B,C,D,E,F,G,H) B
+#define BOOST_PP_TUPLE8_ELEM2(A,B,C,D,E,F,G,H) C
+#define BOOST_PP_TUPLE8_ELEM3(A,B,C,D,E,F,G,H) D
+#define BOOST_PP_TUPLE8_ELEM4(A,B,C,D,E,F,G,H) E
+#define BOOST_PP_TUPLE8_ELEM5(A,B,C,D,E,F,G,H) F
+#define BOOST_PP_TUPLE8_ELEM6(A,B,C,D,E,F,G,H) G
+#define BOOST_PP_TUPLE8_ELEM7(A,B,C,D,E,F,G,H) H
+
+#define BOOST_PP_TUPLE9_ELEM0(A,B,C,D,E,F,G,H,I) A
+#define BOOST_PP_TUPLE9_ELEM1(A,B,C,D,E,F,G,H,I) B
+#define BOOST_PP_TUPLE9_ELEM2(A,B,C,D,E,F,G,H,I) C
+#define BOOST_PP_TUPLE9_ELEM3(A,B,C,D,E,F,G,H,I) D
+#define BOOST_PP_TUPLE9_ELEM4(A,B,C,D,E,F,G,H,I) E
+#define BOOST_PP_TUPLE9_ELEM5(A,B,C,D,E,F,G,H,I) F
+#define BOOST_PP_TUPLE9_ELEM6(A,B,C,D,E,F,G,H,I) G
+#define BOOST_PP_TUPLE9_ELEM7(A,B,C,D,E,F,G,H,I) H
+#define BOOST_PP_TUPLE9_ELEM8(A,B,C,D,E,F,G,H,I) I
+
+#define BOOST_PP_TUPLE10_ELEM0(A,B,C,D,E,F,G,H,I,J) A
+#define BOOST_PP_TUPLE10_ELEM1(A,B,C,D,E,F,G,H,I,J) B
+#define BOOST_PP_TUPLE10_ELEM2(A,B,C,D,E,F,G,H,I,J) C
+#define BOOST_PP_TUPLE10_ELEM3(A,B,C,D,E,F,G,H,I,J) D
+#define BOOST_PP_TUPLE10_ELEM4(A,B,C,D,E,F,G,H,I,J) E
+#define BOOST_PP_TUPLE10_ELEM5(A,B,C,D,E,F,G,H,I,J) F
+#define BOOST_PP_TUPLE10_ELEM6(A,B,C,D,E,F,G,H,I,J) G
+#define BOOST_PP_TUPLE10_ELEM7(A,B,C,D,E,F,G,H,I,J) H
+#define BOOST_PP_TUPLE10_ELEM8(A,B,C,D,E,F,G,H,I,J) I
+#define BOOST_PP_TUPLE10_ELEM9(A,B,C,D,E,F,G,H,I,J) J
+
+#define BOOST_PP_TUPLE11_ELEM0(A,B,C,D,E,F,G,H,I,J,K) A
+#define BOOST_PP_TUPLE11_ELEM1(A,B,C,D,E,F,G,H,I,J,K) B
+#define BOOST_PP_TUPLE11_ELEM2(A,B,C,D,E,F,G,H,I,J,K) C
+#define BOOST_PP_TUPLE11_ELEM3(A,B,C,D,E,F,G,H,I,J,K) D
+#define BOOST_PP_TUPLE11_ELEM4(A,B,C,D,E,F,G,H,I,J,K) E
+#define BOOST_PP_TUPLE11_ELEM5(A,B,C,D,E,F,G,H,I,J,K) F
+#define BOOST_PP_TUPLE11_ELEM6(A,B,C,D,E,F,G,H,I,J,K) G
+#define BOOST_PP_TUPLE11_ELEM7(A,B,C,D,E,F,G,H,I,J,K) H
+#define BOOST_PP_TUPLE11_ELEM8(A,B,C,D,E,F,G,H,I,J,K) I
+#define BOOST_PP_TUPLE11_ELEM9(A,B,C,D,E,F,G,H,I,J,K) J
+#define BOOST_PP_TUPLE11_ELEM10(A,B,C,D,E,F,G,H,I,J,K) K
+
+#define BOOST_PP_TUPLE12_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L) A
+#define BOOST_PP_TUPLE12_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L) B
+#define BOOST_PP_TUPLE12_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L) C
+#define BOOST_PP_TUPLE12_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L) D
+#define BOOST_PP_TUPLE12_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L) E
+#define BOOST_PP_TUPLE12_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L) F
+#define BOOST_PP_TUPLE12_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L) G
+#define BOOST_PP_TUPLE12_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L) H
+#define BOOST_PP_TUPLE12_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L) I
+#define BOOST_PP_TUPLE12_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L) J
+#define BOOST_PP_TUPLE12_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L) K
+#define BOOST_PP_TUPLE12_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L) L
+
+#define BOOST_PP_TUPLE13_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M) A
+#define BOOST_PP_TUPLE13_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M) B
+#define BOOST_PP_TUPLE13_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M) C
+#define BOOST_PP_TUPLE13_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M) D
+#define BOOST_PP_TUPLE13_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M) E
+#define BOOST_PP_TUPLE13_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M) F
+#define BOOST_PP_TUPLE13_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M) G
+#define BOOST_PP_TUPLE13_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M) H
+#define BOOST_PP_TUPLE13_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M) I
+#define BOOST_PP_TUPLE13_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M) J
+#define BOOST_PP_TUPLE13_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M) K
+#define BOOST_PP_TUPLE13_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M) L
+#define BOOST_PP_TUPLE13_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M) M
+
+#define BOOST_PP_TUPLE14_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M,N) A
+#define BOOST_PP_TUPLE14_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M,N) B
+#define BOOST_PP_TUPLE14_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M,N) C
+#define BOOST_PP_TUPLE14_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M,N) D
+#define BOOST_PP_TUPLE14_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M,N) E
+#define BOOST_PP_TUPLE14_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M,N) F
+#define BOOST_PP_TUPLE14_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M,N) G
+#define BOOST_PP_TUPLE14_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M,N) H
+#define BOOST_PP_TUPLE14_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M,N) I
+#define BOOST_PP_TUPLE14_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M,N) J
+#define BOOST_PP_TUPLE14_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M,N) K
+#define BOOST_PP_TUPLE14_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M,N) L
+#define BOOST_PP_TUPLE14_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M,N) M
+#define BOOST_PP_TUPLE14_ELEM13(A,B,C,D,E,F,G,H,I,J,K,L,M,N) N
+
+#define BOOST_PP_TUPLE15_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) A
+#define BOOST_PP_TUPLE15_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) B
+#define BOOST_PP_TUPLE15_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) C
+#define BOOST_PP_TUPLE15_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) D
+#define BOOST_PP_TUPLE15_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) E
+#define BOOST_PP_TUPLE15_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) F
+#define BOOST_PP_TUPLE15_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) G
+#define BOOST_PP_TUPLE15_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) H
+#define BOOST_PP_TUPLE15_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) I
+#define BOOST_PP_TUPLE15_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) J
+#define BOOST_PP_TUPLE15_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) K
+#define BOOST_PP_TUPLE15_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) L
+#define BOOST_PP_TUPLE15_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) M
+#define BOOST_PP_TUPLE15_ELEM13(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) N
+#define BOOST_PP_TUPLE15_ELEM14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) O
+
+#define BOOST_PP_TUPLE16_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) A
+#define BOOST_PP_TUPLE16_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) B
+#define BOOST_PP_TUPLE16_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) C
+#define BOOST_PP_TUPLE16_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) D
+#define BOOST_PP_TUPLE16_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) E
+#define BOOST_PP_TUPLE16_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) F
+#define BOOST_PP_TUPLE16_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) G
+#define BOOST_PP_TUPLE16_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) H
+#define BOOST_PP_TUPLE16_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) I
+#define BOOST_PP_TUPLE16_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) J
+#define BOOST_PP_TUPLE16_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) K
+#define BOOST_PP_TUPLE16_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) L
+#define BOOST_PP_TUPLE16_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) M
+#define BOOST_PP_TUPLE16_ELEM13(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) N
+#define BOOST_PP_TUPLE16_ELEM14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) O
+#define BOOST_PP_TUPLE16_ELEM15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) P
+
+/* <p>Obsolete. Use BOOST_PP_TUPLE_ELEM().</p> */
+#define BOOST_PREPROCESSOR_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM(N,I,T)
+#endif
diff --git a/boost/boost/preprocessor/tuple/reverse.hpp b/boost/boost/preprocessor/tuple/reverse.hpp
new file mode 100644 (file)
index 0000000..5a90c8d
--- /dev/null
@@ -0,0 +1,53 @@
+#ifndef BOOST_PREPROCESSOR_TUPLE_REVERSE_HPP
+#define BOOST_PREPROCESSOR_TUPLE_REVERSE_HPP
+
+/* Copyright (C) 2002
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+/** <p>Tuple reversal.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_TUPLE_REVERSE(3,(A,B,C))
+</pre>
+
+<p>expands to <code>(C,B,A)</code>.</p>
+*/
+#define BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE) BOOST_PP_TUPLE_REVERSE_DELAY(SIZE_OF_TUPLE,TUPLE)
+
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+/* This is a workaround for a CodeWarrior PP bug. Strictly speaking
+ * this workaround invokes undefined behavior, but it works as desired.
+ */
+#  define BOOST_PP_TUPLE_REVERSE_DELAY(N,T) BOOST_PP_TUPLE##N##_REVERSE##T
+#else
+#  define BOOST_PP_TUPLE_REVERSE_DELAY(N,T) BOOST_PP_TUPLE##N##_REVERSE T
+#endif
+#define BOOST_PP_TUPLE0_REVERSE() ()
+#define BOOST_PP_TUPLE1_REVERSE(A) (A)
+#define BOOST_PP_TUPLE2_REVERSE(A,B) (B,A)
+#define BOOST_PP_TUPLE3_REVERSE(A,B,C) (C,B,A)
+#define BOOST_PP_TUPLE4_REVERSE(A,B,C,D) (D,C,B,A)
+#define BOOST_PP_TUPLE5_REVERSE(A,B,C,D,E) (E,D,C,B,A)
+#define BOOST_PP_TUPLE6_REVERSE(A,B,C,D,E,F) (F,E,D,C,B,A)
+#define BOOST_PP_TUPLE7_REVERSE(A,B,C,D,E,F,G) (G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE8_REVERSE(A,B,C,D,E,F,G,H) (H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE9_REVERSE(A,B,C,D,E,F,G,H,I) (I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE10_REVERSE(A,B,C,D,E,F,G,H,I,J) (J,I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE11_REVERSE(A,B,C,D,E,F,G,H,I,J,K) (K,J,I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE12_REVERSE(A,B,C,D,E,F,G,H,I,J,K,L) (L,K,J,I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE13_REVERSE(A,B,C,D,E,F,G,H,I,J,K,L,M) (M,L,K,J,I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE14_REVERSE(A,B,C,D,E,F,G,H,I,J,K,L,M,N) (N,M,L,K,J,I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE15_REVERSE(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) (O,N,M,L,K,J,I,H,G,F,E,D,C,B,A)
+#define BOOST_PP_TUPLE16_REVERSE(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) (P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A)
+#endif
diff --git a/boost/boost/preprocessor/tuple/to_list.hpp b/boost/boost/preprocessor/tuple/to_list.hpp
new file mode 100644 (file)
index 0000000..27664f1
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef BOOST_PREPROCESSOR_TUPLE_TO_LIST_HPP
+#define BOOST_PREPROCESSOR_TUPLE_TO_LIST_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/list/adt.hpp>
+
+/** <p>Converts a tuple to a list.</p>
+
+<p>For example,</p>
+
+<pre>
+BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
+</pre>
+
+<p>expands to the same as</p>
+
+<pre>
+BOOST_PP_LIST_CONS(A,
+BOOST_PP_LIST_CONS(B,
+BOOST_PP_LIST_CONS(C,
+BOOST_PP_LIST_NIL)))
+</pre>
+
+<h3>See</h3>
+<ul>
+  <li>BOOST_PP_LIMIT_TUPLE</li>
+</ul>
+*/
+#define BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,TUPLE) BOOST_PP_TUPLE_TO_LIST_DELAY(SIZE_OF_TUPLE,TUPLE)
+
+#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
+/* This is a workaround for a CodeWarrior PP bug. Strictly speaking
+ * this workaround invokes undefined behavior, but it works as desired.
+ */
+#  define BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) BOOST_PP_TUPLE##N##_TO_LIST##T
+#else
+#  define BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) BOOST_PP_TUPLE##N##_TO_LIST T
+#endif
+#define BOOST_PP_TUPLE0_TO_LIST() (_,_,0)
+#define BOOST_PP_TUPLE1_TO_LIST(A) (A,(_,_,0),1)
+#define BOOST_PP_TUPLE2_TO_LIST(A,B) (A,(B,(_,_,0),1),1)
+#define BOOST_PP_TUPLE3_TO_LIST(A,B,C) (A,(B,(C,(_,_,0),1),1),1)
+#define BOOST_PP_TUPLE4_TO_LIST(A,B,C,D) (A,(B,(C,(D,(_,_,0),1),1),1),1)
+#define BOOST_PP_TUPLE5_TO_LIST(A,B,C,D,E) (A,(B,(C,(D,(E,(_,_,0),1),1),1),1),1)
+#define BOOST_PP_TUPLE6_TO_LIST(A,B,C,D,E,F) (A,(B,(C,(D,(E,(F,(_,_,0),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE7_TO_LIST(A,B,C,D,E,F,G) (A,(B,(C,(D,(E,(F,(G,(_,_,0),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE8_TO_LIST(A,B,C,D,E,F,G,H) (A,(B,(C,(D,(E,(F,(G,(H,(_,_,0),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE9_TO_LIST(A,B,C,D,E,F,G,H,I) (A,(B,(C,(D,(E,(F,(G,(H,(I,(_,_,0),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE10_TO_LIST(A,B,C,D,E,F,G,H,I,J) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(_,_,0),1),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE11_TO_LIST(A,B,C,D,E,F,G,H,I,J,K) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(K,(_,_,0),1),1),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE12_TO_LIST(A,B,C,D,E,F,G,H,I,J,K,L) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(K,(L,(_,_,0),1),1),1),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE13_TO_LIST(A,B,C,D,E,F,G,H,I,J,K,L,M) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(K,(L,(M,(_,_,0),1),1),1),1),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE14_TO_LIST(A,B,C,D,E,F,G,H,I,J,K,L,M,N) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(K,(L,(M,(N,(_,_,0),1),1),1),1),1),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE15_TO_LIST(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(K,(L,(M,(N,(O,(_,_,0),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1)
+#define BOOST_PP_TUPLE16_TO_LIST(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) (A,(B,(C,(D,(E,(F,(G,(H,(I,(J,(K,(L,(M,(N,(O,(P,(_,_,0),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1),1)
+#endif
diff --git a/boost/boost/preprocessor/while.hpp b/boost/boost/preprocessor/while.hpp
new file mode 100644 (file)
index 0000000..357c20e
--- /dev/null
@@ -0,0 +1,339 @@
+#ifndef BOOST_PREPROCESSOR_WHILE_HPP
+#define BOOST_PREPROCESSOR_WHILE_HPP
+
+/* Copyright (C) 2001
+ * Housemarque Oy
+ * http://www.housemarque.com
+ *
+ * Permission to copy, use, modify, sell and distribute this software is
+ * granted provided this copyright notice appears in all copies. This
+ * software is provided "as is" without express or implied warranty, and
+ * with no claim as to its suitability for any purpose.
+ *
+ * See http://www.boost.org for most recent version.
+ */
+
+#include <boost/preprocessor/if.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
+
+/** <p>Iterates <code>OP(D,STATE)</code> while <code>PRED(D,STATE)</code> is true.</p>
+
+<p>In other words, expands to:</p>
+
+<pre>
+OP(D, ... OP(D, OP(D,STATE) ) ... )
+</pre>
+
+<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
+
+<p>For example,</p>
+
+<pre>
+#define PRED(D,STATE) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+#define OP(D,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+BOOST_PP_WHILE(PRED,OP,(0,3))
+</pre>
+
+<p>expands to:</p>
+
+<pre>
+(3,3)
+</pre>
+
+<h3>Legend</h3>
+<ul>
+  <li><b>STATE</b> is the current state of iteration. The state is usually a tuple.</li>
+  <li><b>PRED</b> is the condition for iteration. It must expand to a decimal
+      integer literal.</li>
+  <li><b>OP</b> is the iterated macro. Note that if the state is a tuple, then
+      OP(D,STATE) usually expands to a tuple of the same number of elements.</li>
+  <li><b>D</b> is the recursion depth and should only be used as a parameter
+      to other macros using BOOST_PP_WHILE(). Such macros include
+      BOOST_PP_ADD() and other arithmetic operations. For each macro using
+      BOOST_PP_WHILE(), there is a version of the macro, distinguished by the
+      D suffix (e.g. BOOST_PP_ADD_D()), that accepts an additional recursion
+      depth as the first parameter. This technique is necessary to avoid
+      recursively expanding the same macro again, which is not permitted by the
+      C++ preprocessor.</li>
+</ul>
+
+<h3>Note</h3>
+<ul>
+  <li>The value of the D parameter may exceed BOOST_PP_LIMIT_MAG.</li>
+  <li>Using BOOST_PP_WHILE() is a bit tricky. This is due to the C++
+      preprocessor limitations. It is recommended to take a look at the
+      implementations of the various PREPROCESSOR library primitives such as
+      BOOST_PP_ADD() for additional examples.</li>
+</ul>
+
+<h3>Example</h3>
+<ul>
+  <li><a href="../../example/count_down.c">count_down.c</a></li>
+  <li><a href="../../example/linear_fib.c">linear_fib.c</a></li>
+  <li><a href="../../example/delay.c">delay.c</a></li>
+</ul>
+*/
+#define BOOST_PP_WHILE(PRED,OP,STATE) BOOST_PP_WHILE_C(PRED(1,STATE),0,STATE)(PRED,OP,OP(1,STATE))
+
+#define BOOST_PP_WHILE_C(C,D,S) BOOST_PP_IF(C,BOOST_PP_WHILE##D,S BOOST_PP_TUPLE3_EAT)
+#define BOOST_PP_WHILE0(P,O,S) BOOST_PP_WHILE_C(P(2,S),1,S)(P,O,O(2,S))
+#define BOOST_PP_WHILE1(P,O,S) BOOST_PP_WHILE_C(P(3,S),2,S)(P,O,O(3,S))
+#define BOOST_PP_WHILE2(P,O,S) BOOST_PP_WHILE_C(P(4,S),3,S)(P,O,O(4,S))
+#define BOOST_PP_WHILE3(P,O,S) BOOST_PP_WHILE_C(P(5,S),4,S)(P,O,O(5,S))
+#define BOOST_PP_WHILE4(P,O,S) BOOST_PP_WHILE_C(P(6,S),5,S)(P,O,O(6,S))
+#define BOOST_PP_WHILE5(P,O,S) BOOST_PP_WHILE_C(P(7,S),6,S)(P,O,O(7,S))
+#define BOOST_PP_WHILE6(P,O,S) BOOST_PP_WHILE_C(P(8,S),7,S)(P,O,O(8,S))
+#define BOOST_PP_WHILE7(P,O,S) BOOST_PP_WHILE_C(P(9,S),8,S)(P,O,O(9,S))
+#define BOOST_PP_WHILE8(P,O,S) BOOST_PP_WHILE_C(P(10,S),9,S)(P,O,O(10,S))
+#define BOOST_PP_WHILE9(P,O,S) BOOST_PP_WHILE_C(P(11,S),10,S)(P,O,O(11,S))
+#define BOOST_PP_WHILE10(P,O,S) BOOST_PP_WHILE_C(P(12,S),11,S)(P,O,O(12,S))
+#define BOOST_PP_WHILE11(P,O,S) BOOST_PP_WHILE_C(P(13,S),12,S)(P,O,O(13,S))
+#define BOOST_PP_WHILE12(P,O,S) BOOST_PP_WHILE_C(P(14,S),13,S)(P,O,O(14,S))
+#define BOOST_PP_WHILE13(P,O,S) BOOST_PP_WHILE_C(P(15,S),14,S)(P,O,O(15,S))
+#define BOOST_PP_WHILE14(P,O,S) BOOST_PP_WHILE_C(P(16,S),15,S)(P,O,O(16,S))
+#define BOOST_PP_WHILE15(P,O,S) BOOST_PP_WHILE_C(P(17,S),16,S)(P,O,O(17,S))
+#define BOOST_PP_WHILE16(P,O,S) BOOST_PP_WHILE_C(P(18,S),17,S)(P,O,O(18,S))
+#define BOOST_PP_WHILE17(P,O,S) BOOST_PP_WHILE_C(P(19,S),18,S)(P,O,O(19,S))
+#define BOOST_PP_WHILE18(P,O,S) BOOST_PP_WHILE_C(P(20,S),19,S)(P,O,O(20,S))
+#define BOOST_PP_WHILE19(P,O,S) BOOST_PP_WHILE_C(P(21,S),20,S)(P,O,O(21,S))
+#define BOOST_PP_WHILE20(P,O,S) BOOST_PP_WHILE_C(P(22,S),21,S)(P,O,O(22,S))
+#define BOOST_PP_WHILE21(P,O,S) BOOST_PP_WHILE_C(P(23,S),22,S)(P,O,O(23,S))
+#define BOOST_PP_WHILE22(P,O,S) BOOST_PP_WHILE_C(P(24,S),23,S)(P,O,O(24,S))
+#define BOOST_PP_WHILE23(P,O,S) BOOST_PP_WHILE_C(P(25,S),24,S)(P,O,O(25,S))
+#define BOOST_PP_WHILE24(P,O,S) BOOST_PP_WHILE_C(P(26,S),25,S)(P,O,O(26,S))
+#define BOOST_PP_WHILE25(P,O,S) BOOST_PP_WHILE_C(P(27,S),26,S)(P,O,O(27,S))
+#define BOOST_PP_WHILE26(P,O,S) BOOST_PP_WHILE_C(P(28,S),27,S)(P,O,O(28,S))
+#define BOOST_PP_WHILE27(P,O,S) BOOST_PP_WHILE_C(P(29,S),28,S)(P,O,O(29,S))
+#define BOOST_PP_WHILE28(P,O,S) BOOST_PP_WHILE_C(P(30,S),29,S)(P,O,O(30,S))
+#define BOOST_PP_WHILE29(P,O,S) BOOST_PP_WHILE_C(P(31,S),30,S)(P,O,O(31,S))
+#define BOOST_PP_WHILE30(P,O,S) BOOST_PP_WHILE_C(P(32,S),31,S)(P,O,O(32,S))
+#define BOOST_PP_WHILE31(P,O,S) BOOST_PP_WHILE_C(P(33,S),32,S)(P,O,O(33,S))
+#define BOOST_PP_WHILE32(P,O,S) BOOST_PP_WHILE_C(P(34,S),33,S)(P,O,O(34,S))
+#define BOOST_PP_WHILE33(P,O,S) BOOST_PP_WHILE_C(P(35,S),34,S)(P,O,O(35,S))
+#define BOOST_PP_WHILE34(P,O,S) BOOST_PP_WHILE_C(P(36,S),35,S)(P,O,O(36,S))
+#define BOOST_PP_WHILE35(P,O,S) BOOST_PP_WHILE_C(P(37,S),36,S)(P,O,O(37,S))
+#define BOOST_PP_WHILE36(P,O,S) BOOST_PP_WHILE_C(P(38,S),37,S)(P,O,O(38,S))
+#define BOOST_PP_WHILE37(P,O,S) BOOST_PP_WHILE_C(P(39,S),38,S)(P,O,O(39,S))
+#define BOOST_PP_WHILE38(P,O,S) BOOST_PP_WHILE_C(P(40,S),39,S)(P,O,O(40,S))
+#define BOOST_PP_WHILE39(P,O,S) BOOST_PP_WHILE_C(P(41,S),40,S)(P,O,O(41,S))
+#define BOOST_PP_WHILE40(P,O,S) BOOST_PP_WHILE_C(P(42,S),41,S)(P,O,O(42,S))
+#define BOOST_PP_WHILE41(P,O,S) BOOST_PP_WHILE_C(P(43,S),42,S)(P,O,O(43,S))
+#define BOOST_PP_WHILE42(P,O,S) BOOST_PP_WHILE_C(P(44,S),43,S)(P,O,O(44,S))
+#define BOOST_PP_WHILE43(P,O,S) BOOST_PP_WHILE_C(P(45,S),44,S)(P,O,O(45,S))
+#define BOOST_PP_WHILE44(P,O,S) BOOST_PP_WHILE_C(P(46,S),45,S)(P,O,O(46,S))
+#define BOOST_PP_WHILE45(P,O,S) BOOST_PP_WHILE_C(P(47,S),46,S)(P,O,O(47,S))
+#define BOOST_PP_WHILE46(P,O,S) BOOST_PP_WHILE_C(P(48,S),47,S)(P,O,O(48,S))
+#define BOOST_PP_WHILE47(P,O,S) BOOST_PP_WHILE_C(P(49,S),48,S)(P,O,O(49,S))
+#define BOOST_PP_WHILE48(P,O,S) BOOST_PP_WHILE_C(P(50,S),49,S)(P,O,O(50,S))
+#define BOOST_PP_WHILE49(P,O,S) BOOST_PP_WHILE_C(P(51,S),50,S)(P,O,O(51,S))
+#define BOOST_PP_WHILE50(P,O,S) BOOST_PP_WHILE_C(P(52,S),51,S)(P,O,O(52,S))
+#define BOOST_PP_WHILE51(P,O,S) BOOST_PP_WHILE_C(P(53,S),52,S)(P,O,O(53,S))
+#define BOOST_PP_WHILE52(P,O,S) BOOST_PP_WHILE_C(P(54,S),53,S)(P,O,O(54,S))
+#define BOOST_PP_WHILE53(P,O,S) BOOST_PP_WHILE_C(P(55,S),54,S)(P,O,O(55,S))
+#define BOOST_PP_WHILE54(P,O,S) BOOST_PP_WHILE_C(P(56,S),55,S)(P,O,O(56,S))
+#define BOOST_PP_WHILE55(P,O,S) BOOST_PP_WHILE_C(P(57,S),56,S)(P,O,O(57,S))
+#define BOOST_PP_WHILE56(P,O,S) BOOST_PP_WHILE_C(P(58,S),57,S)(P,O,O(58,S))
+#define BOOST_PP_WHILE57(P,O,S) BOOST_PP_WHILE_C(P(59,S),58,S)(P,O,O(59,S))
+#define BOOST_PP_WHILE58(P,O,S) BOOST_PP_WHILE_C(P(60,S),59,S)(P,O,O(60,S))
+#define BOOST_PP_WHILE59(P,O,S) BOOST_PP_WHILE_C(P(61,S),60,S)(P,O,O(61,S))
+#define BOOST_PP_WHILE60(P,O,S) BOOST_PP_WHILE_C(P(62,S),61,S)(P,O,O(62,S))
+#define BOOST_PP_WHILE61(P,O,S) BOOST_PP_WHILE_C(P(63,S),62,S)(P,O,O(63,S))
+#define BOOST_PP_WHILE62(P,O,S) BOOST_PP_WHILE_C(P(64,S),63,S)(P,O,O(64,S))
+#define BOOST_PP_WHILE63(P,O,S) BOOST_PP_WHILE_C(P(65,S),64,S)(P,O,O(65,S))
+#define BOOST_PP_WHILE64(P,O,S) BOOST_PP_WHILE_C(P(66,S),65,S)(P,O,O(66,S))
+#define BOOST_PP_WHILE65(P,O,S) BOOST_PP_WHILE_C(P(67,S),66,S)(P,O,O(67,S))
+#define BOOST_PP_WHILE66(P,O,S) BOOST_PP_WHILE_C(P(68,S),67,S)(P,O,O(68,S))
+#define BOOST_PP_WHILE67(P,O,S) BOOST_PP_WHILE_C(P(69,S),68,S)(P,O,O(69,S))
+#define BOOST_PP_WHILE68(P,O,S) BOOST_PP_WHILE_C(P(70,S),69,S)(P,O,O(70,S))
+#define BOOST_PP_WHILE69(P,O,S) BOOST_PP_WHILE_C(P(71,S),70,S)(P,O,O(71,S))
+#define BOOST_PP_WHILE70(P,O,S) BOOST_PP_WHILE_C(P(72,S),71,S)(P,O,O(72,S))
+#define BOOST_PP_WHILE71(P,O,S) BOOST_PP_WHILE_C(P(73,S),72,S)(P,O,O(73,S))
+#define BOOST_PP_WHILE72(P,O,S) BOOST_PP_WHILE_C(P(74,S),73,S)(P,O,O(74,S))
+#define BOOST_PP_WHILE73(P,O,S) BOOST_PP_WHILE_C(P(75,S),74,S)(P,O,O(75,S))
+#define BOOST_PP_WHILE74(P,O,S) BOOST_PP_WHILE_C(P(76,S),75,S)(P,O,O(76,S))
+#define BOOST_PP_WHILE75(P,O,S) BOOST_PP_WHILE_C(P(77,S),76,S)(P,O,O(77,S))
+#define BOOST_PP_WHILE76(P,O,S) BOOST_PP_WHILE_C(P(78,S),77,S)(P,O,O(78,S))
+#define BOOST_PP_WHILE77(P,O,S) BOOST_PP_WHILE_C(P(79,S),78,S)(P,O,O(79,S))
+#define BOOST_PP_WHILE78(P,O,S) BOOST_PP_WHILE_C(P(80,S),79,S)(P,O,O(80,S))
+#define BOOST_PP_WHILE79(P,O,S) BOOST_PP_WHILE_C(P(81,S),80,S)(P,O,O(81,S))
+#define BOOST_PP_WHILE80(P,O,S) BOOST_PP_WHILE_C(P(82,S),81,S)(P,O,O(82,S))
+#define BOOST_PP_WHILE81(P,O,S) BOOST_PP_WHILE_C(P(83,S),82,S)(P,O,O(83,S))
+#define BOOST_PP_WHILE82(P,O,S) BOOST_PP_WHILE_C(P(84,S),83,S)(P,O,O(84,S))
+#define BOOST_PP_WHILE83(P,O,S) BOOST_PP_WHILE_C(P(85,S),84,S)(P,O,O(85,S))
+#define BOOST_PP_WHILE84(P,O,S) BOOST_PP_WHILE_C(P(86,S),85,S)(P,O,O(86,S))
+#define BOOST_PP_WHILE85(P,O,S) BOOST_PP_WHILE_C(P(87,S),86,S)(P,O,O(87,S))
+#define BOOST_PP_WHILE86(P,O,S) BOOST_PP_WHILE_C(P(88,S),87,S)(P,O,O(88,S))
+#define BOOST_PP_WHILE87(P,O,S) BOOST_PP_WHILE_C(P(89,S),88,S)(P,O,O(89,S))
+#define BOOST_PP_WHILE88(P,O,S) BOOST_PP_WHILE_C(P(90,S),89,S)(P,O,O(90,S))
+#define BOOST_PP_WHILE89(P,O,S) BOOST_PP_WHILE_C(P(91,S),90,S)(P,O,O(91,S))
+#define BOOST_PP_WHILE90(P,O,S) BOOST_PP_WHILE_C(P(92,S),91,S)(P,O,O(92,S))
+#define BOOST_PP_WHILE91(P,O,S) BOOST_PP_WHILE_C(P(93,S),92,S)(P,O,O(93,S))
+#define BOOST_PP_WHILE92(P,O,S) BOOST_PP_WHILE_C(P(94,S),93,S)(P,O,O(94,S))
+#define BOOST_PP_WHILE93(P,O,S) BOOST_PP_WHILE_C(P(95,S),94,S)(P,O,O(95,S))
+#define BOOST_PP_WHILE94(P,O,S) BOOST_PP_WHILE_C(P(96,S),95,S)(P,O,O(96,S))
+#define BOOST_PP_WHILE95(P,O,S) BOOST_PP_WHILE_C(P(97,S),96,S)(P,O,O(97,S))
+#define BOOST_PP_WHILE96(P,O,S) BOOST_PP_WHILE_C(P(98,S),97,S)(P,O,O(98,S))
+#define BOOST_PP_WHILE97(P,O,S) BOOST_PP_WHILE_C(P(99,S),98,S)(P,O,O(99,S))
+#define BOOST_PP_WHILE98(P,O,S) BOOST_PP_WHILE_C(P(100,S),99,S)(P,O,O(100,S))
+#define BOOST_PP_WHILE99(P,O,S) BOOST_PP_WHILE_C(P(101,S),100,S)(P,O,O(101,S))
+#define BOOST_PP_WHILE100(P,O,S) BOOST_PP_WHILE_C(P(102,S),101,S)(P,O,O(102,S))
+#define BOOST_PP_WHILE101(P,O,S) BOOST_PP_WHILE_C(P(103,S),102,S)(P,O,O(103,S))
+#define BOOST_PP_WHILE102(P,O,S) BOOST_PP_WHILE_C(P(104,S),103,S)(P,O,O(104,S))
+#define BOOST_PP_WHILE103(P,O,S) BOOST_PP_WHILE_C(P(105,S),104,S)(P,O,O(105,S))
+#define BOOST_PP_WHILE104(P,O,S) BOOST_PP_WHILE_C(P(106,S),105,S)(P,O,O(106,S))
+#define BOOST_PP_WHILE105(P,O,S) BOOST_PP_WHILE_C(P(107,S),106,S)(P,O,O(107,S))
+#define BOOST_PP_WHILE106(P,O,S) BOOST_PP_WHILE_C(P(108,S),107,S)(P,O,O(108,S))
+#define BOOST_PP_WHILE107(P,O,S) BOOST_PP_WHILE_C(P(109,S),108,S)(P,O,O(109,S))
+#define BOOST_PP_WHILE108(P,O,S) BOOST_PP_WHILE_C(P(110,S),109,S)(P,O,O(110,S))
+#define BOOST_PP_WHILE109(P,O,S) BOOST_PP_WHILE_C(P(111,S),110,S)(P,O,O(111,S))
+#define BOOST_PP_WHILE110(P,O,S) BOOST_PP_WHILE_C(P(112,S),111,S)(P,O,O(112,S))
+#define BOOST_PP_WHILE111(P,O,S) BOOST_PP_WHILE_C(P(113,S),112,S)(P,O,O(113,S))
+#define BOOST_PP_WHILE112(P,O,S) BOOST_PP_WHILE_C(P(114,S),113,S)(P,O,O(114,S))
+#define BOOST_PP_WHILE113(P,O,S) BOOST_PP_WHILE_C(P(115,S),114,S)(P,O,O(115,S))
+#define BOOST_PP_WHILE114(P,O,S) BOOST_PP_WHILE_C(P(116,S),115,S)(P,O,O(116,S))
+#define BOOST_PP_WHILE115(P,O,S) BOOST_PP_WHILE_C(P(117,S),116,S)(P,O,O(117,S))
+#define BOOST_PP_WHILE116(P,O,S) BOOST_PP_WHILE_C(P(118,S),117,S)(P,O,O(118,S))
+#define BOOST_PP_WHILE117(P,O,S) BOOST_PP_WHILE_C(P(119,S),118,S)(P,O,O(119,S))
+#define BOOST_PP_WHILE118(P,O,S) BOOST_PP_WHILE_C(P(120,S),119,S)(P,O,O(120,S))
+#define BOOST_PP_WHILE119(P,O,S) BOOST_PP_WHILE_C(P(121,S),120,S)(P,O,O(121,S))
+#define BOOST_PP_WHILE120(P,O,S) BOOST_PP_WHILE_C(P(122,S),121,S)(P,O,O(122,S))
+#define BOOST_PP_WHILE121(P,O,S) BOOST_PP_WHILE_C(P(123,S),122,S)(P,O,O(123,S))
+#define BOOST_PP_WHILE122(P,O,S) BOOST_PP_WHILE_C(P(124,S),123,S)(P,O,O(124,S))
+#define BOOST_PP_WHILE123(P,O,S) BOOST_PP_WHILE_C(P(125,S),124,S)(P,O,O(125,S))
+#define BOOST_PP_WHILE124(P,O,S) BOOST_PP_WHILE_C(P(126,S),125,S)(P,O,O(126,S))
+#define BOOST_PP_WHILE125(P,O,S) BOOST_PP_WHILE_C(P(127,S),126,S)(P,O,O(127,S))
+#define BOOST_PP_WHILE126(P,O,S) BOOST_PP_WHILE_C(P(128,S),127,S)(P,O,O(128,S))
+#define BOOST_PP_WHILE127(P,O,S) BOOST_PP_WHILE_C(P(129,S),128,S)(P,O,O(129,S))
+#define BOOST_PP_WHILE128(P,O,S) BOOST_PP_WHILE_C(P(130,S),129,S)(P,O,O(130,S))
+#define BOOST_PP_WHILE129(P,O,S) BOOST_PP_WHILE_C(P(131,S),130,S)(P,O,O(131,S))
+#define BOOST_PP_WHILE130(P,O,S) BOOST_PP_WHILE_C(P(132,S),131,S)(P,O,O(132,S))
+#define BOOST_PP_WHILE131(P,O,S) BOOST_PP_WHILE_C(P(133,S),132,S)(P,O,O(133,S))
+#define BOOST_PP_WHILE132(P,O,S) BOOST_PP_WHILE_C(P(134,S),133,S)(P,O,O(134,S))
+#define BOOST_PP_WHILE133(P,O,S) BOOST_PP_WHILE_C(P(135,S),134,S)(P,O,O(135,S))
+#define BOOST_PP_WHILE134(P,O,S) BOOST_PP_WHILE_C(P(136,S),135,S)(P,O,O(136,S))
+#define BOOST_PP_WHILE135(P,O,S) BOOST_PP_WHILE_C(P(137,S),136,S)(P,O,O(137,S))
+#define BOOST_PP_WHILE136(P,O,S) BOOST_PP_WHILE_C(P(138,S),137,S)(P,O,O(138,S))
+#define BOOST_PP_WHILE137(P,O,S) BOOST_PP_WHILE_C(P(139,S),138,S)(P,O,O(139,S))
+#define BOOST_PP_WHILE138(P,O,S) BOOST_PP_WHILE_C(P(140,S),139,S)(P,O,O(140,S))
+#define BOOST_PP_WHILE139(P,O,S) BOOST_PP_WHILE_C(P(141,S),140,S)(P,O,O(141,S))
+#define BOOST_PP_WHILE140(P,O,S) BOOST_PP_WHILE_C(P(142,S),141,S)(P,O,O(142,S))
+#define BOOST_PP_WHILE141(P,O,S) BOOST_PP_WHILE_C(P(143,S),142,S)(P,O,O(143,S))
+#define BOOST_PP_WHILE142(P,O,S) BOOST_PP_WHILE_C(P(144,S),143,S)(P,O,O(144,S))
+#define BOOST_PP_WHILE143(P,O,S) BOOST_PP_WHILE_C(P(145,S),144,S)(P,O,O(145,S))
+#define BOOST_PP_WHILE144(P,O,S) BOOST_PP_WHILE_C(P(146,S),145,S)(P,O,O(146,S))
+#define BOOST_PP_WHILE145(P,O,S) BOOST_PP_WHILE_C(P(147,S),146,S)(P,O,O(147,S))
+#define BOOST_PP_WHILE146(P,O,S) BOOST_PP_WHILE_C(P(148,S),147,S)(P,O,O(148,S))
+#define BOOST_PP_WHILE147(P,O,S) BOOST_PP_WHILE_C(P(149,S),148,S)(P,O,O(149,S))
+#define BOOST_PP_WHILE148(P,O,S) BOOST_PP_WHILE_C(P(150,S),149,S)(P,O,O(150,S))
+#define BOOST_PP_WHILE149(P,O,S) BOOST_PP_WHILE_C(P(151,S),150,S)(P,O,O(151,S))
+#define BOOST_PP_WHILE150(P,O,S) BOOST_PP_WHILE_C(P(152,S),151,S)(P,O,O(152,S))
+#define BOOST_PP_WHILE151(P,O,S) BOOST_PP_WHILE_C(P(153,S),152,S)(P,O,O(153,S))
+#define BOOST_PP_WHILE152(P,O,S) BOOST_PP_WHILE_C(P(154,S),153,S)(P,O,O(154,S))
+#define BOOST_PP_WHILE153(P,O,S) BOOST_PP_WHILE_C(P(155,S),154,S)(P,O,O(155,S))
+#define BOOST_PP_WHILE154(P,O,S) BOOST_PP_WHILE_C(P(156,S),155,S)(P,O,O(156,S))
+#define BOOST_PP_WHILE155(P,O,S) BOOST_PP_WHILE_C(P(157,S),156,S)(P,O,O(157,S))
+#define BOOST_PP_WHILE156(P,O,S) BOOST_PP_WHILE_C(P(158,S),157,S)(P,O,O(158,S))
+#define BOOST_PP_WHILE157(P,O,S) BOOST_PP_WHILE_C(P(159,S),158,S)(P,O,O(159,S))
+#define BOOST_PP_WHILE158(P,O,S) BOOST_PP_WHILE_C(P(160,S),159,S)(P,O,O(160,S))
+#define BOOST_PP_WHILE159(P,O,S) BOOST_PP_WHILE_C(P(161,S),160,S)(P,O,O(161,S))
+#define BOOST_PP_WHILE160(P,O,S) BOOST_PP_WHILE_C(P(162,S),161,S)(P,O,O(162,S))
+#define BOOST_PP_WHILE161(P,O,S) BOOST_PP_WHILE_C(P(163,S),162,S)(P,O,O(163,S))
+#define BOOST_PP_WHILE162(P,O,S) BOOST_PP_WHILE_C(P(164,S),163,S)(P,O,O(164,S))
+#define BOOST_PP_WHILE163(P,O,S) BOOST_PP_WHILE_C(P(165,S),164,S)(P,O,O(165,S))
+#define BOOST_PP_WHILE164(P,O,S) BOOST_PP_WHILE_C(P(166,S),165,S)(P,O,O(166,S))
+#define BOOST_PP_WHILE165(P,O,S) BOOST_PP_WHILE_C(P(167,S),166,S)(P,O,O(167,S))
+#define BOOST_PP_WHILE166(P,O,S) BOOST_PP_WHILE_C(P(168,S),167,S)(P,O,O(168,S))
+#define BOOST_PP_WHILE167(P,O,S) BOOST_PP_WHILE_C(P(169,S),168,S)(P,O,O(169,S))
+#define BOOST_PP_WHILE168(P,O,S) BOOST_PP_WHILE_C(P(170,S),169,S)(P,O,O(170,S))
+#define BOOST_PP_WHILE169(P,O,S) BOOST_PP_WHILE_C(P(171,S),170,S)(P,O,O(171,S))
+#define BOOST_PP_WHILE170(P,O,S) BOOST_PP_WHILE_C(P(172,S),171,S)(P,O,O(172,S))
+#define BOOST_PP_WHILE171(P,O,S) BOOST_PP_WHILE_C(P(173,S),172,S)(P,O,O(173,S))
+#define BOOST_PP_WHILE172(P,O,S) BOOST_PP_WHILE_C(P(174,S),173,S)(P,O,O(174,S))
+#define BOOST_PP_WHILE173(P,O,S) BOOST_PP_WHILE_C(P(175,S),174,S)(P,O,O(175,S))
+#define BOOST_PP_WHILE174(P,O,S) BOOST_PP_WHILE_C(P(176,S),175,S)(P,O,O(176,S))
+#define BOOST_PP_WHILE175(P,O,S) BOOST_PP_WHILE_C(P(177,S),176,S)(P,O,O(177,S))
+#define BOOST_PP_WHILE176(P,O,S) BOOST_PP_WHILE_C(P(178,S),177,S)(P,O,O(178,S))
+#define BOOST_PP_WHILE177(P,O,S) BOOST_PP_WHILE_C(P(179,S),178,S)(P,O,O(179,S))
+#define BOOST_PP_WHILE178(P,O,S) BOOST_PP_WHILE_C(P(180,S),179,S)(P,O,O(180,S))
+#define BOOST_PP_WHILE179(P,O,S) BOOST_PP_WHILE_C(P(181,S),180,S)(P,O,O(181,S))
+#define BOOST_PP_WHILE180(P,O,S) BOOST_PP_WHILE_C(P(182,S),181,S)(P,O,O(182,S))
+#define BOOST_PP_WHILE181(P,O,S) BOOST_PP_WHILE_C(P(183,S),182,S)(P,O,O(183,S))
+#define BOOST_PP_WHILE182(P,O,S) BOOST_PP_WHILE_C(P(184,S),183,S)(P,O,O(184,S))
+#define BOOST_PP_WHILE183(P,O,S) BOOST_PP_WHILE_C(P(185,S),184,S)(P,O,O(185,S))
+#define BOOST_PP_WHILE184(P,O,S) BOOST_PP_WHILE_C(P(186,S),185,S)(P,O,O(186,S))
+#define BOOST_PP_WHILE185(P,O,S) BOOST_PP_WHILE_C(P(187,S),186,S)(P,O,O(187,S))
+#define BOOST_PP_WHILE186(P,O,S) BOOST_PP_WHILE_C(P(188,S),187,S)(P,O,O(188,S))
+#define BOOST_PP_WHILE187(P,O,S) BOOST_PP_WHILE_C(P(189,S),188,S)(P,O,O(189,S))
+#define BOOST_PP_WHILE188(P,O,S) BOOST_PP_WHILE_C(P(190,S),189,S)(P,O,O(190,S))
+#define BOOST_PP_WHILE189(P,O,S) BOOST_PP_WHILE_C(P(191,S),190,S)(P,O,O(191,S))
+#define BOOST_PP_WHILE190(P,O,S) BOOST_PP_WHILE_C(P(192,S),191,S)(P,O,O(192,S))
+#define BOOST_PP_WHILE191(P,O,S) BOOST_PP_WHILE_C(P(193,S),192,S)(P,O,O(193,S))
+#define BOOST_PP_WHILE192(P,O,S) BOOST_PP_WHILE_C(P(194,S),193,S)(P,O,O(194,S))
+#define BOOST_PP_WHILE193(P,O,S) BOOST_PP_WHILE_C(P(195,S),194,S)(P,O,O(195,S))
+#define BOOST_PP_WHILE194(P,O,S) BOOST_PP_WHILE_C(P(196,S),195,S)(P,O,O(196,S))
+#define BOOST_PP_WHILE195(P,O,S) BOOST_PP_WHILE_C(P(197,S),196,S)(P,O,O(197,S))
+#define BOOST_PP_WHILE196(P,O,S) BOOST_PP_WHILE_C(P(198,S),197,S)(P,O,O(198,S))
+#define BOOST_PP_WHILE197(P,O,S) BOOST_PP_WHILE_C(P(199,S),198,S)(P,O,O(199,S))
+#define BOOST_PP_WHILE198(P,O,S) BOOST_PP_WHILE_C(P(200,S),199,S)(P,O,O(200,S))
+#define BOOST_PP_WHILE199(P,O,S) BOOST_PP_WHILE_C(P(201,S),200,S)(P,O,O(201,S))
+#define BOOST_PP_WHILE200(P,O,S) BOOST_PP_WHILE_C(P(202,S),201,S)(P,O,O(202,S))
+#define BOOST_PP_WHILE201(P,O,S) BOOST_PP_WHILE_C(P(203,S),202,S)(P,O,O(203,S))
+#define BOOST_PP_WHILE202(P,O,S) BOOST_PP_WHILE_C(P(204,S),203,S)(P,O,O(204,S))
+#define BOOST_PP_WHILE203(P,O,S) BOOST_PP_WHILE_C(P(205,S),204,S)(P,O,O(205,S))
+#define BOOST_PP_WHILE204(P,O,S) BOOST_PP_WHILE_C(P(206,S),205,S)(P,O,O(206,S))
+#define BOOST_PP_WHILE205(P,O,S) BOOST_PP_WHILE_C(P(207,S),206,S)(P,O,O(207,S))
+#define BOOST_PP_WHILE206(P,O,S) BOOST_PP_WHILE_C(P(208,S),207,S)(P,O,O(208,S))
+#define BOOST_PP_WHILE207(P,O,S) BOOST_PP_WHILE_C(P(209,S),208,S)(P,O,O(209,S))
+#define BOOST_PP_WHILE208(P,O,S) BOOST_PP_WHILE_C(P(210,S),209,S)(P,O,O(210,S))
+#define BOOST_PP_WHILE209(P,O,S) BOOST_PP_WHILE_C(P(211,S),210,S)(P,O,O(211,S))
+#define BOOST_PP_WHILE210(P,O,S) BOOST_PP_WHILE_C(P(212,S),211,S)(P,O,O(212,S))
+#define BOOST_PP_WHILE211(P,O,S) BOOST_PP_WHILE_C(P(213,S),212,S)(P,O,O(213,S))
+#define BOOST_PP_WHILE212(P,O,S) BOOST_PP_WHILE_C(P(214,S),213,S)(P,O,O(214,S))
+#define BOOST_PP_WHILE213(P,O,S) BOOST_PP_WHILE_C(P(215,S),214,S)(P,O,O(215,S))
+#define BOOST_PP_WHILE214(P,O,S) BOOST_PP_WHILE_C(P(216,S),215,S)(P,O,O(216,S))
+#define BOOST_PP_WHILE215(P,O,S) BOOST_PP_WHILE_C(P(217,S),216,S)(P,O,O(217,S))
+#define BOOST_PP_WHILE216(P,O,S) BOOST_PP_WHILE_C(P(218,S),217,S)(P,O,O(218,S))
+#define BOOST_PP_WHILE217(P,O,S) BOOST_PP_WHILE_C(P(219,S),218,S)(P,O,O(219,S))
+#define BOOST_PP_WHILE218(P,O,S) BOOST_PP_WHILE_C(P(220,S),219,S)(P,O,O(220,S))
+#define BOOST_PP_WHILE219(P,O,S) BOOST_PP_WHILE_C(P(221,S),220,S)(P,O,O(221,S))
+#define BOOST_PP_WHILE220(P,O,S) BOOST_PP_WHILE_C(P(222,S),221,S)(P,O,O(222,S))
+#define BOOST_PP_WHILE221(P,O,S) BOOST_PP_WHILE_C(P(223,S),222,S)(P,O,O(223,S))
+#define BOOST_PP_WHILE222(P,O,S) BOOST_PP_WHILE_C(P(224,S),223,S)(P,O,O(224,S))
+#define BOOST_PP_WHILE223(P,O,S) BOOST_PP_WHILE_C(P(225,S),224,S)(P,O,O(225,S))
+#define BOOST_PP_WHILE224(P,O,S) BOOST_PP_WHILE_C(P(226,S),225,S)(P,O,O(226,S))
+#define BOOST_PP_WHILE225(P,O,S) BOOST_PP_WHILE_C(P(227,S),226,S)(P,O,O(227,S))
+#define BOOST_PP_WHILE226(P,O,S) BOOST_PP_WHILE_C(P(228,S),227,S)(P,O,O(228,S))
+#define BOOST_PP_WHILE227(P,O,S) BOOST_PP_WHILE_C(P(229,S),228,S)(P,O,O(229,S))
+#define BOOST_PP_WHILE228(P,O,S) BOOST_PP_WHILE_C(P(230,S),229,S)(P,O,O(230,S))
+#define BOOST_PP_WHILE229(P,O,S) BOOST_PP_WHILE_C(P(231,S),230,S)(P,O,O(231,S))
+#define BOOST_PP_WHILE230(P,O,S) BOOST_PP_WHILE_C(P(232,S),231,S)(P,O,O(232,S))
+#define BOOST_PP_WHILE231(P,O,S) BOOST_PP_WHILE_C(P(233,S),232,S)(P,O,O(233,S))
+#define BOOST_PP_WHILE232(P,O,S) BOOST_PP_WHILE_C(P(234,S),233,S)(P,O,O(234,S))
+#define BOOST_PP_WHILE233(P,O,S) BOOST_PP_WHILE_C(P(235,S),234,S)(P,O,O(235,S))
+#define BOOST_PP_WHILE234(P,O,S) BOOST_PP_WHILE_C(P(236,S),235,S)(P,O,O(236,S))
+#define BOOST_PP_WHILE235(P,O,S) BOOST_PP_WHILE_C(P(237,S),236,S)(P,O,O(237,S))
+#define BOOST_PP_WHILE236(P,O,S) BOOST_PP_WHILE_C(P(238,S),237,S)(P,O,O(238,S))
+#define BOOST_PP_WHILE237(P,O,S) BOOST_PP_WHILE_C(P(239,S),238,S)(P,O,O(239,S))
+#define BOOST_PP_WHILE238(P,O,S) BOOST_PP_WHILE_C(P(240,S),239,S)(P,O,O(240,S))
+#define BOOST_PP_WHILE239(P,O,S) BOOST_PP_WHILE_C(P(241,S),240,S)(P,O,O(241,S))
+#define BOOST_PP_WHILE240(P,O,S) BOOST_PP_WHILE_C(P(242,S),241,S)(P,O,O(242,S))
+#define BOOST_PP_WHILE241(P,O,S) BOOST_PP_WHILE_C(P(243,S),242,S)(P,O,O(243,S))
+#define BOOST_PP_WHILE242(P,O,S) BOOST_PP_WHILE_C(P(244,S),243,S)(P,O,O(244,S))
+#define BOOST_PP_WHILE243(P,O,S) BOOST_PP_WHILE_C(P(245,S),244,S)(P,O,O(245,S))
+#define BOOST_PP_WHILE244(P,O,S) BOOST_PP_WHILE_C(P(246,S),245,S)(P,O,O(246,S))
+#define BOOST_PP_WHILE245(P,O,S) BOOST_PP_WHILE_C(P(247,S),246,S)(P,O,O(247,S))
+#define BOOST_PP_WHILE246(P,O,S) BOOST_PP_WHILE_C(P(248,S),247,S)(P,O,O(248,S))
+#define BOOST_PP_WHILE247(P,O,S) BOOST_PP_WHILE_C(P(249,S),248,S)(P,O,O(249,S))
+#define BOOST_PP_WHILE248(P,O,S) BOOST_PP_WHILE_C(P(250,S),249,S)(P,O,O(250,S))
+#define BOOST_PP_WHILE249(P,O,S) BOOST_PP_WHILE_C(P(251,S),250,S)(P,O,O(251,S))
+#define BOOST_PP_WHILE250(P,O,S) BOOST_PP_WHILE_C(P(252,S),251,S)(P,O,O(252,S))
+#define BOOST_PP_WHILE251(P,O,S) BOOST_PP_WHILE_C(P(253,S),252,S)(P,O,O(253,S))
+#define BOOST_PP_WHILE252(P,O,S) BOOST_PP_WHILE_C(P(254,S),253,S)(P,O,O(254,S))
+#define BOOST_PP_WHILE253(P,O,S) BOOST_PP_WHILE_C(P(255,S),254,S)(P,O,O(255,S))
+#define BOOST_PP_WHILE254(P,O,S) BOOST_PP_WHILE_C(P(256,S),255,S)(P,O,O(256,S))
+#define BOOST_PP_WHILE255(P,O,S) BOOST_PP_WHILE_C(P(257,S),256,S)(P,O,O(257,S))
+#define BOOST_PP_WHILE256(P,O,S) BOOST_PP_WHILE_C(P(258,S),257,S)(P,O,O(258,S))
+#define BOOST_PP_WHILE257(P,O,S) BOOST_PP_WHILE_C(P(259,S),258,S)(P,O,O(259,S))
+#define BOOST_PP_WHILE258(P,O,S) RECURSION DEPTH EXCEEDED!
+#define BOOST_PP_WHILE259(P,O,S) RECURSION DEPTH EXCEEDED!
+#endif
diff --git a/boost/boost/progress.hpp b/boost/boost/progress.hpp
new file mode 100644 (file)
index 0000000..94aad0d
--- /dev/null
@@ -0,0 +1,144 @@
+//  boost progress.hpp header file  ------------------------------------------//
+
+//  (C) Copyright Beman Dawes 1994-99. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Revision History
+//   1 Dec 01  Add leading progress display strings (suggested by Toon Knapen)
+//  20 May 01  Introduce several static_casts<> to eliminate warning messages
+//             (Fixed by Beman, reported by Herve Bronnimann)
+//  12 Jan 01  Change to inline implementation to allow use without library
+//             builds. See docs for more rationale. (Beman Dawes) 
+//  22 Jul 99  Name changed to .hpp
+//  16 Jul 99  Second beta
+//   6 Jul 99  Initial boost version
+
+#ifndef BOOST_PROGRESS_HPP
+#define BOOST_PROGRESS_HPP
+
+#include <boost/timer.hpp>
+#include <boost/utility.hpp>  // for noncopyable
+#include <boost/cstdint.hpp>  // for uintmax_t
+#include <iostream>           // for ostream, cout, etc
+#include <string>             // for string
+
+namespace boost {
+
+//  progress_timer  ----------------------------------------------------------//
+
+//  A progress_timer behaves like a timer except that the destructor displays
+//  an elapsed time message at an appropriate place in an appropriate form.
+
+class progress_timer : public timer, private noncopyable
+{
+  
+ public:
+  explicit progress_timer( std::ostream & os = std::cout )
+     // os is hint; implementation may ignore, particularly in embedded systems
+     : m_os(os) {}
+  ~progress_timer()
+  {
+  //  A) Throwing an exception from a destructor is a Bad Thing.
+  //  B) The progress_timer destructor does output which may throw.
+  //  C) A progress_timer is usually not critical to the application.
+  //  Therefore, wrap the I/O in a try block, catch and ignore all exceptions.
+    try
+    {
+      // use istream instead of ios_base to workaround GNU problem (Greg Chicares)
+      std::istream::fmtflags old_flags = m_os.setf( std::istream::fixed,
+                                                   std::istream::floatfield );
+      std::streamsize old_prec = m_os.precision( 2 );
+      m_os << elapsed() << " s\n" // "s" is System International d'Unités std
+                        << std::endl;
+      m_os.flags( old_flags );
+      m_os.precision( old_prec );
+    }
+
+    catch (...) {} // eat any exceptions
+  } // ~progress_timer
+
+ private:
+  std::ostream & m_os;
+};
+
+
+//  progress_display  --------------------------------------------------------//
+
+//  progress_display displays an appropriate indication of 
+//  progress at an appropriate place in an appropriate form.
+
+// NOTE: (Jan 12, 2001) Tried to change unsigned long to boost::uintmax_t, but
+// found some compilers couldn't handle the required conversion to double.
+// Reverted to unsigned long until the compilers catch up. 
+
+class progress_display : private noncopyable
+{
+ public:
+  explicit progress_display( unsigned long expected_count,
+                             std::ostream & os = std::cout,
+                             const std::string & s1 = "\n", //leading strings
+                             const std::string & s2 = "",
+                             const std::string & s3 = "" )
+   // os is hint; implementation may ignore, particularly in embedded systems
+   : m_os(os), m_s1(s1), m_s2(s2), m_s3(s3) { restart(expected_count); }
+
+  void           restart( unsigned long expected_count )
+  //  Effects: display appropriate scale
+  //  Postconditions: count()==0, expected_count()==expected_count
+  {
+    _count = _next_tic_count = _tic = 0;
+    _expected_count = expected_count;
+
+    m_os << m_s1 << "0%   10   20   30   40   50   60   70   80   90   100%\n"
+         << m_s2 << "|----|----|----|----|----|----|----|----|----|----|"
+         << std::endl  // endl implies flush, which ensures display
+         << m_s3;
+    if ( !_expected_count ) _expected_count = 1;  // prevent divide by zero
+  } // restart
+
+  unsigned long  operator+=( unsigned long increment )
+  //  Effects: Display appropriate progress tic if needed.
+  //  Postconditions: count()== original count() + increment
+  //  Returns: count().
+  {
+    if ( (_count += increment) >= _next_tic_count ) { display_tic(); }
+    return _count;
+  }
+
+  unsigned long  operator++()           { return operator+=( 1 ); }
+  unsigned long  count() const          { return _count; }
+  unsigned long  expected_count() const { return _expected_count; }
+
+  private:
+  std::ostream &     m_os;  // may not be present in all imps
+  const std::string  m_s1;  // string is more general, safer than 
+  const std::string  m_s2;  //  const char *, and efficiency or size are
+  const std::string  m_s3;  //  not issues
+
+  unsigned long _count, _expected_count, _next_tic_count;
+  unsigned int  _tic;
+  void display_tic()
+  {
+    // use of floating point ensures that both large and small counts
+    // work correctly.  static_cast<>() is also used several places
+    // to suppress spurious compiler warnings. 
+    unsigned int tics_needed =
+      static_cast<unsigned int>(
+        (static_cast<double>(_count)/_expected_count)*50.0 );
+    do { m_os << '*' << std::flush; } while ( ++_tic < tics_needed );
+    _next_tic_count = 
+      static_cast<unsigned long>((_tic/50.0)*_expected_count);
+    if ( _count == _expected_count ) {
+      if ( _tic < 51 ) m_os << '*';
+      m_os << std::endl;
+      }
+  } // display_tic
+};
+
+} // namespace boost
+
+#endif  // BOOST_PROGRESS_HPP
diff --git a/boost/boost/property_map.hpp b/boost/boost/property_map.hpp
new file mode 100644 (file)
index 0000000..b392884
--- /dev/null
@@ -0,0 +1,538 @@
+//  (C) Copyright Jeremy Siek 1999-2001. Permission to copy, use, modify,
+//  sell and distribute this software is granted provided this
+//  copyright notice appears in all copies. This software is provided
+//  "as is" without express or implied warranty, and with no claim as
+//  to its suitability for any purpose.
+
+#ifndef BOOST_PROPERTY_MAP_HPP
+#define BOOST_PROPERTY_MAP_HPP
+
+#include <cassert>
+#include <iterator>
+#include <boost/config.hpp>
+#include <boost/pending/cstddef.hpp>
+#include <boost/concept_check.hpp>
+#include <boost/concept_archetype.hpp>
+
+namespace boost {
+
+  //=========================================================================
+  // property_traits class
+
+  template <typename PA>
+  struct property_traits {
+    typedef typename PA::key_type key_type;
+    typedef typename PA::value_type value_type; 
+    typedef typename PA::reference reference;
+    typedef typename PA::category   category;
+  };
+
+  //=========================================================================
+  // property_traits category tags
+
+  namespace detail {
+    enum ePropertyMapID { READABLE_PA, WRITABLE_PA, 
+                          READ_WRITE_PA, LVALUE_PA, OP_BRACKET_PA, 
+                          RAND_ACCESS_ITER_PA, LAST_PA };
+  }
+  struct readable_property_map_tag { enum { id = detail::READABLE_PA }; };
+  struct writable_property_map_tag { enum { id = detail::WRITABLE_PA }; };
+  struct read_write_property_map_tag :
+    public readable_property_map_tag,
+    public writable_property_map_tag
+  { enum { id = detail::READ_WRITE_PA }; };
+
+  struct lvalue_property_map_tag : public read_write_property_map_tag
+  { enum { id = detail::LVALUE_PA }; };
+
+  //=========================================================================
+  // property_traits specialization for pointers
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  // The user will just have to create their own specializations for
+  // other pointers types if the compiler does not have partial
+  // specializations. Sorry!
+#define BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(TYPE) \
+  template <> \
+  struct property_traits<TYPE*> { \
+    typedef TYPE value_type; \
+    typedef value_type& reference; \
+    typedef std::ptrdiff_t key_type; \
+    typedef lvalue_property_map_tag   category; \
+  }; \
+  template <> \
+  struct property_traits<const TYPE*> { \
+    typedef TYPE value_type; \
+    typedef const value_type& reference; \
+    typedef std::ptrdiff_t key_type; \
+    typedef lvalue_property_map_tag   category; \
+  }
+
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(long);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(unsigned long);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(int);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(unsigned int);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(short);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(unsigned short);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(char);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(unsigned char);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(signed char);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(bool);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(float);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(double);
+  BOOST_SPECIALIZE_PROPERTY_TRAITS_PTR(long double);
+
+  // This may need to be turned off for some older compilers that don't have
+  // wchar_t intrinsically.
+# ifndef BOOST_NO_INTRINSIC_WCHAR_T
+  template <>
+  struct property_traits<wchar_t*> {
+    typedef wchar_t value_type;
+    typedef value_type& reference;
+    typedef std::ptrdiff_t key_type;
+    typedef lvalue_property_map_tag   category;
+  };
+  template <>
+  struct property_traits<const wchar_t*> {
+    typedef wchar_t value_type;
+    typedef const value_type& reference;
+    typedef std::ptrdiff_t key_type;
+    typedef lvalue_property_map_tag   category;
+  };
+# endif
+
+#else
+  template <class T>
+  struct property_traits<T*> {
+    typedef T value_type;
+    typedef value_type& reference;
+    typedef std::ptrdiff_t key_type;
+    typedef lvalue_property_map_tag category;
+  };
+  template <class T>
+  struct property_traits<const T*> {
+    typedef T value_type;
+    typedef const value_type& reference;
+    typedef std::ptrdiff_t key_type;
+    typedef lvalue_property_map_tag category;
+  };
+#endif
+
+#ifndef BOOST_MSVC
+  // MSVC doesn't have Koenig lookup, so the user has to
+  // do boost::get() anyways, and the using clause
+  // doesn't really work for MSVC.
+} // namespace boost
+#endif
+
+  // These need to go in global namespace because Koenig
+  // lookup does not apply to T*.
+
+  // V must be convertible to T
+  template <class T, class V>
+  inline void put(T* pa, std::ptrdiff_t k, const V& val) { pa[k] = val;  }
+
+  template <class T>
+  inline const T& get(const T* pa, std::ptrdiff_t k) { return pa[k]; }
+
+#ifndef BOOST_MSVC
+namespace boost {
+  using ::put;
+  using ::get;
+#endif
+
+  //=========================================================================
+  // concept checks for property maps
+
+  template <class PMap, class Key>
+  struct ReadablePropertyMapConcept
+  {
+    typedef typename property_traits<PMap>::key_type key_type;
+    typedef typename property_traits<PMap>::reference reference;
+    typedef typename property_traits<PMap>::category Category;
+    typedef boost::readable_property_map_tag ReadableTag;
+    void constraints() {
+      function_requires< ConvertibleConcept<Category, ReadableTag> >();
+
+      val = get(pmap, k);
+    }
+    PMap pmap;
+    Key k;
+    typename property_traits<PMap>::value_type val;
+  };
+  template <typename KeyArchetype, typename ValueArchetype>
+  struct readable_property_map_archetype {
+    typedef KeyArchetype key_type;
+    typedef ValueArchetype value_type;
+    typedef convertible_to_archetype<ValueArchetype> reference;
+    typedef readable_property_map_tag category;
+  };
+  template <typename K, typename V>
+  const typename readable_property_map_archetype<K,V>::reference&
+  get(const readable_property_map_archetype<K,V>&, const K&) {
+    typedef typename readable_property_map_archetype<K,V>::reference R;
+    return static_object<R>::get();
+  }
+
+
+  template <class PMap, class Key>
+  struct WritablePropertyMapConcept
+  {
+    typedef typename property_traits<PMap>::key_type key_type;
+    typedef typename property_traits<PMap>::category Category;
+    typedef boost::writable_property_map_tag WritableTag;
+    void constraints() {
+      function_requires< ConvertibleConcept<Category, WritableTag> >();
+      put(pmap, k, val);
+    }
+    PMap pmap;
+    Key k;
+    typename property_traits<PMap>::value_type val;
+  };
+  template <typename KeyArchetype, typename ValueArchetype>
+  struct writable_property_map_archetype {
+    typedef KeyArchetype key_type;
+    typedef ValueArchetype value_type;
+    typedef void reference;
+    typedef writable_property_map_tag category;
+  };
+  template <typename K, typename V>
+  void put(const writable_property_map_archetype<K,V>&, const K&, const V&) { }
+
+
+  template <class PMap, class Key>
+  struct ReadWritePropertyMapConcept
+  {
+    typedef typename property_traits<PMap>::category Category;
+    typedef boost::read_write_property_map_tag ReadWriteTag;
+    void constraints() {
+      function_requires< ReadablePropertyMapConcept<PMap, Key> >();
+      function_requires< WritablePropertyMapConcept<PMap, Key> >();
+      function_requires< ConvertibleConcept<Category, ReadWriteTag> >();
+    }
+  };
+  template <typename KeyArchetype, typename ValueArchetype>
+  struct read_write_property_map_archetype
+    : public readable_property_map_archetype<KeyArchetype, ValueArchetype>,
+      public writable_property_map_archetype<KeyArchetype, ValueArchetype>
+  {
+    typedef KeyArchetype key_type;
+    typedef ValueArchetype value_type;
+    typedef convertible_to_archetype<ValueArchetype> reference;
+    typedef read_write_property_map_tag category;
+  };
+
+
+  template <class PMap, class Key>
+  struct LvaluePropertyMapConcept
+  {
+    typedef typename property_traits<PMap>::category Category;
+    typedef boost::lvalue_property_map_tag LvalueTag;
+    typedef typename property_traits<PMap>::reference reference;
+
+    void constraints() {
+      function_requires< ReadablePropertyMapConcept<PMap, Key> >();
+      function_requires< ConvertibleConcept<Category, LvalueTag> >();
+      
+      typedef typename require_same<
+        const typename property_traits<PMap>::value_type&,
+        reference>::type req;
+
+      reference ref = pmap[k];
+      ignore_unused_variable_warning(ref);
+    }
+    PMap pmap;
+    Key k;
+  };
+  template <typename KeyArchetype, typename ValueArchetype>
+  struct lvalue_property_map_archetype
+    : public readable_property_map_archetype<KeyArchetype, ValueArchetype>
+  {
+    typedef KeyArchetype key_type;
+    typedef ValueArchetype value_type;
+    typedef const ValueArchetype& reference;
+    typedef lvalue_property_map_tag category;
+    const value_type& operator[](const key_type&) const {
+      return static_object<value_type>::get();
+    }
+  };
+
+  template <class PMap, class Key>
+  struct Mutable_LvaluePropertyMapConcept
+  {
+    typedef typename property_traits<PMap>::category Category;
+    typedef boost::lvalue_property_map_tag LvalueTag;
+    typedef typename property_traits<PMap>::reference reference;
+    void constraints() { 
+      boost::function_requires< ReadWritePropertyMapConcept<PMap, Key> >();
+      boost::function_requires<ConvertibleConcept<Category, LvalueTag> >();
+      typedef typename require_same<
+        typename property_traits<PMap>::value_type&,
+        reference>::type req;
+
+      reference ref = pmap[k];
+      ignore_unused_variable_warning(ref);
+    }
+    PMap pmap;
+    Key k;
+  };
+  template <typename KeyArchetype, typename ValueArchetype>
+  struct mutable_lvalue_property_map_archetype
+    : public readable_property_map_archetype<KeyArchetype, ValueArchetype>,
+      public writable_property_map_archetype<KeyArchetype, ValueArchetype>
+  {
+    typedef KeyArchetype key_type;
+    typedef ValueArchetype value_type;
+    typedef ValueArchetype& reference;
+    typedef lvalue_property_map_tag category;
+    value_type& operator[](const key_type&) const { 
+      return static_object<value_type>::get();
+    }
+  };
+
+  struct identity_property_map;
+
+  // A helper class for constructing a property map
+  // from a class that implements operator[]
+
+  template <class Reference, class LvaluePropertyMap>
+  struct put_get_helper { };
+
+  template <class PropertyMap, class Reference, class K>
+  inline Reference
+  get(const put_get_helper<Reference, PropertyMap>& pa, const K& k)
+  {
+    Reference v = static_cast<const PropertyMap&>(pa)[k];
+    return v;
+  }
+  template <class PropertyMap, class Reference, class K, class V>
+  inline void
+  put(const put_get_helper<Reference, PropertyMap>& pa, K k, const V& v)
+  {
+    static_cast<const PropertyMap&>(pa)[k] = v;
+  }
+
+  //=========================================================================
+  // Adapter to turn a RandomAccessIterator into a property map
+
+  template <class RandomAccessIterator, 
+    class IndexMap
+#ifdef BOOST_NO_STD_ITERATOR_TRAITS
+    , class T, class R
+#else
+    , class T = typename std::iterator_traits<RandomAccessIterator>::value_type
+    , class R = typename std::iterator_traits<RandomAccessIterator>::reference
+#endif
+     >
+  class iterator_property_map
+    : public boost::put_get_helper< R, 
+        iterator_property_map<RandomAccessIterator, IndexMap,
+        T, R> >
+  {
+  public:
+    typedef typename property_traits<IndexMap>::key_type key_type;
+    typedef T value_type;
+    typedef R reference;
+    typedef boost::lvalue_property_map_tag category;
+
+    inline iterator_property_map(
+      RandomAccessIterator cc = RandomAccessIterator(), 
+      const IndexMap& _id = IndexMap() ) 
+      : iter(cc), index(_id) { }
+    inline R operator[](key_type v) const { return *(iter + get(index, v)) ; }
+  protected:
+    RandomAccessIterator iter;
+    IndexMap index;
+  };
+
+#if !defined BOOST_NO_STD_ITERATOR_TRAITS
+  template <class RAIter, class ID>
+  inline iterator_property_map<
+    RAIter, ID,
+    typename std::iterator_traits<RAIter>::value_type,
+    typename std::iterator_traits<RAIter>::reference>
+  make_iterator_property_map(RAIter iter, ID id) {
+    function_requires< RandomAccessIteratorConcept<RAIter> >();
+    typedef iterator_property_map<
+      RAIter, ID,
+      typename std::iterator_traits<RAIter>::value_type,
+      typename std::iterator_traits<RAIter>::reference> PA;
+    return PA(iter, id);
+  }
+#endif
+  template <class RAIter, class Value, class ID>
+  inline iterator_property_map<RAIter, ID, Value, Value&>
+  make_iterator_property_map(RAIter iter, ID id, Value) {
+    function_requires< RandomAccessIteratorConcept<RAIter> >();
+    typedef iterator_property_map<RAIter, ID, Value, Value&> PMap;
+    return PMap(iter, id);
+  }
+
+  template <class RandomAccessIterator, 
+    class IndexMap
+#ifdef BOOST_NO_STD_ITERATOR_TRAITS
+    , class T, class R
+#else
+    , class T = typename std::iterator_traits<RandomAccessIterator>::value_type
+    , class R = typename std::iterator_traits<RandomAccessIterator>::reference
+#endif
+     >
+  class safe_iterator_property_map
+    : public boost::put_get_helper< R, 
+        safe_iterator_property_map<RandomAccessIterator, IndexMap,
+        T, R> >
+  {
+  public:
+    typedef typename property_traits<IndexMap>::key_type key_type; 
+    typedef T value_type;
+    typedef R reference;
+    typedef boost::lvalue_property_map_tag category;
+
+    inline safe_iterator_property_map(
+      RandomAccessIterator first = RandomAccessIterator(), 
+      std::size_t n = 0, 
+      const IndexMap& _id = IndexMap() ) 
+      : iter(first), n(n), index(_id) { }
+    inline R operator[](key_type v) const {
+      assert(get(index, v) < n);
+      return *(iter + get(index, v)) ;
+    }
+    typename property_traits<IndexMap>::value_type size() const { return n; }
+  protected:
+    RandomAccessIterator iter;
+    typename property_traits<IndexMap>::value_type n;
+    IndexMap index;
+  };
+
+#if !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+  template <class RAIter, class ID>
+  inline safe_iterator_property_map<
+    RAIter, ID,
+    typename std::iterator_traits<RAIter>::value_type,
+    typename std::iterator_traits<RAIter>::reference>
+  make_safe_iterator_property_map(RAIter iter, std::size_t n, ID id) {
+    function_requires< RandomAccessIteratorConcept<RAIter> >();
+    typedef safe_iterator_property_map<
+      RAIter, ID,
+      typename std::iterator_traits<RAIter>::value_type,
+      typename std::iterator_traits<RAIter>::reference> PA;
+    return PA(iter, n, id);
+  }
+#endif
+  template <class RAIter, class Value, class ID>
+  inline safe_iterator_property_map<RAIter, ID, Value, Value&>
+  make_safe_iterator_property_map(RAIter iter, std::size_t n, ID id, Value) {
+    function_requires< RandomAccessIteratorConcept<RAIter> >();
+    typedef safe_iterator_property_map<RAIter, ID, Value, Value&> PMap;
+    return PMap(iter, n, id);
+  }
+
+  //=========================================================================
+  // An adaptor to turn a Unique Pair Associative Container like std::map or
+  // std::hash_map into an Lvalue Property Map.
+
+  template <typename UniquePairAssociativeContainer>
+  class associative_property_map
+    : public boost::put_get_helper<
+       typename UniquePairAssociativeContainer::value_type::second_type&,
+       associative_property_map<UniquePairAssociativeContainer> >
+  {
+    typedef UniquePairAssociativeContainer C;
+  public:
+    typedef typename C::key_type key_type;
+    typedef typename C::value_type::second_type value_type;
+    typedef value_type& reference;
+    typedef lvalue_property_map_tag category;
+    associative_property_map() : m_c(0) { }
+    associative_property_map(C& c) : m_c(&c) { }
+    reference operator[](const key_type& k) const {
+      return (*m_c)[k];
+    }
+  private:
+    C* m_c;
+  };
+
+  template <class UniquePairAssociativeContainer>
+  associative_property_map<UniquePairAssociativeContainer>
+  make_assoc_property_map(UniquePairAssociativeContainer& c)
+  {
+    return associative_property_map<UniquePairAssociativeContainer>(c);
+  }
+
+  template <typename UniquePairAssociativeContainer>
+  class const_associative_property_map
+    : public boost::put_get_helper<
+       const typename UniquePairAssociativeContainer::value_type::second_type&,
+       const_associative_property_map<UniquePairAssociativeContainer> >
+  {
+    typedef UniquePairAssociativeContainer C;
+  public:
+    typedef typename C::key_type key_type;
+    typedef typename C::value_type::second_type value_type;
+    typedef const value_type& reference;
+    typedef lvalue_property_map_tag category;
+    const_associative_property_map() : m_c(0) { }
+    const_associative_property_map(const C& c) : m_c(&c) { }
+    reference operator[](const key_type& k) const {
+      return (*m_c)[k];
+    }
+  private:
+    C* m_c;
+  };
+  
+  template <class UniquePairAssociativeContainer>
+  const_associative_property_map<UniquePairAssociativeContainer>
+  make_assoc_property_map(const UniquePairAssociativeContainer& c)
+  {
+    return const_associative_property_map<UniquePairAssociativeContainer>(c);
+  }
+
+  //=========================================================================
+  // A property map that applies the identity function to integers
+  struct identity_property_map
+    : public boost::put_get_helper<std::size_t, 
+        identity_property_map>
+  {
+    typedef std::size_t key_type;
+    typedef std::size_t value_type;
+    typedef std::size_t reference;
+    typedef boost::readable_property_map_tag category;
+
+    inline value_type operator[](const key_type& v) const { return v; }
+  };
+
+  //=========================================================================
+  // A property map that does not do anything, for
+  // when you have to supply a property map, but don't need it.
+  namespace detail {
+    struct dummy_pmap_reference {
+      template <class T>
+      dummy_pmap_reference& operator=(const T&) { return *this; }
+      operator int() { return 0; }
+    };
+  }
+  class dummy_property_map 
+    : public boost::put_get_helper<detail::dummy_pmap_reference,
+        dummy_property_map  > 
+  {
+  public:
+    typedef void key_type; 
+    typedef int value_type;
+    typedef detail::dummy_pmap_reference reference;
+    typedef boost::read_write_property_map_tag category;
+    inline dummy_property_map() : c(0) { }
+    inline dummy_property_map(value_type cc) : c(cc) { }
+    inline dummy_property_map(const dummy_property_map& x)
+      : c(x.c) { }
+    template <class Vertex>
+    inline reference operator[](Vertex) const { return reference(); }
+   protected:
+    value_type c;
+  };
+
+
+} // namespace boost
+
+
+#endif /* BOOST_PROPERTY_MAP_HPP */
+
diff --git a/boost/boost/property_map_iterator.hpp b/boost/boost/property_map_iterator.hpp
new file mode 100644 (file)
index 0000000..b1eb408
--- /dev/null
@@ -0,0 +1,97 @@
+// (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.
+
+#ifndef BOOST_PROPERTY_MAP_ITERATOR_HPP
+#define BOOST_PROPERTY_MAP_ITERATOR_HPP
+
+#include <boost/property_map.hpp>
+#include <boost/iterator_adaptors.hpp>
+
+namespace boost {
+
+  //======================================================================
+  // property iterator, generalized from ideas by François Faure
+
+  namespace detail {
+
+    template <class LvaluePropertyMap>
+    struct lvalue_pmap_iter_policies : public default_iterator_policies
+    {
+      lvalue_pmap_iter_policies() { }
+      lvalue_pmap_iter_policies(LvaluePropertyMap m) : m_map(m) {}
+
+      template <class Iter>
+      typename Iter::reference
+      dereference(const Iter& i) const 
+      {
+        return m_map[*i.base()];
+      }
+    private:
+      LvaluePropertyMap m_map;
+    };
+
+    template <class ReadablePropertyMap>
+    struct readable_pmap_iter_policies : public default_iterator_policies
+    {
+      readable_pmap_iter_policies() { }
+      readable_pmap_iter_policies(ReadablePropertyMap m) : m_map(m) {}
+
+      template <class Iter>
+      typename Iter::reference
+      dereference(const Iter& i) const 
+      {
+        return get(m_map, *i.base());
+      }
+    private:
+      ReadablePropertyMap m_map;
+    };
+
+    template <class PMapCategory>
+    struct choose_pmap_iter {
+      template <class PMap, class Iter>
+      struct bind_ {     
+        typedef typename property_traits<PMap>::value_type value;
+        typedef iterator_adaptor<Iter,
+          readable_pmap_iter_policies<PMap>, value, value,
+          value*, std::input_iterator_tag> type;
+      };
+    };
+
+    template <>
+    struct choose_pmap_iter<lvalue_property_map_tag> {
+      template <class PMap, class Iter>
+      struct bind_ {
+        typedef typename property_traits<PMap>::value_type value;
+        typedef typename property_traits<PMap>::reference ref;
+        typedef iterator_adaptor<Iter,
+          lvalue_pmap_iter_policies<PMap>,
+          value, ref> type;
+      };
+    };
+    
+  } // namespace detail
+
+  template <class PropertyMap, class Iterator>
+  class property_map_iterator_generator {
+  public:
+    typedef typename property_traits<PropertyMap>::category Cat; 
+    typedef typename detail::choose_pmap_iter<Cat>::
+      template bind_<PropertyMap, Iterator>::type type;
+  };
+
+  template <class PropertyMap, class Iterator>
+  typename property_map_iterator_generator<PropertyMap, Iterator>::type
+  make_property_map_iterator(PropertyMap pmap, Iterator iter)
+  {
+    typedef typename property_map_iterator_generator<PropertyMap, 
+      Iterator>::type Iter;
+    return Iter(iter, pmap);
+  }
+
+} // namespace boost
+
+#endif // BOOST_PROPERTY_MAP_ITERATOR_HPP
+
diff --git a/boost/boost/rational.hpp b/boost/boost/rational.hpp
new file mode 100644 (file)
index 0000000..6bf41a8
--- /dev/null
@@ -0,0 +1,541 @@
+//  Boost rational.hpp header file  ------------------------------------------//
+
+//  (C) Copyright Paul Moore 1999. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or
+//  implied warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Credits:
+//  Thanks to the boost mailing list in general for useful comments.
+//  Particular contributions included:
+//    Andrew D Jewell, for reminding me to take care to avoid overflow
+//    Ed Brey, for many comments, including picking up on some dreadful typos
+//    Stephen Silver contributed the test suite and comments on user-defined
+//    IntType
+//    Nickolay Mladenov, for the implementation of operator+=
+
+//  Revision History
+//  05 Jul 01  Recode gcd(), avoiding std::swap (Helmut Zeisel)
+//  03 Mar 01  Workarounds for Intel C++ 5.0 (David Abrahams)
+//  05 Feb 01  Update operator>> to tighten up input syntax
+//  05 Feb 01  Final tidy up of gcd code prior to the new release
+//  27 Jan 01  Recode abs() without relying on abs(IntType)
+//  21 Jan 01  Include Nickolay Mladenov's operator+= algorithm,
+//             tidy up a number of areas, use newer features of operators.hpp
+//             (reduces space overhead to zero), add operator!,
+//             introduce explicit mixed-mode arithmetic operations
+//  12 Jan 01  Include fixes to handle a user-defined IntType better
+//  19 Nov 00  Throw on divide by zero in operator /= (John (EBo) David)
+//  23 Jun 00  Incorporate changes from Mark Rodgers for Borland C++
+//  22 Jun 00  Change _MSC_VER to BOOST_MSVC so other compilers are not
+//             affected (Beman Dawes)
+//   6 Mar 00  Fix operator-= normalization, #include <string> (Jens Maurer)
+//  14 Dec 99  Modifications based on comments from the boost list
+//  09 Dec 99  Initial Version (Paul Moore)
+
+#ifndef BOOST_RATIONAL_HPP
+#define BOOST_RATIONAL_HPP
+
+#include <iostream>              // for std::istream and std::ostream
+#include <iomanip>               // for std::noskipws
+#include <stdexcept>             // for std::domain_error
+#include <string>                // for std::string implicit constructor
+#include <boost/operators.hpp>   // for boost::addable etc
+#include <cstdlib>               // for std::abs
+#include <boost/call_traits.hpp> // for boost::call_traits
+#include <boost/config.hpp>      // for BOOST_NO_STDC_NAMESPACE, BOOST_MSVC
+
+namespace boost {
+
+// Note: We use n and m as temporaries in this function, so there is no value
+// in using const IntType& as we would only need to make a copy anyway...
+template <typename IntType>
+IntType gcd(IntType n, IntType m)
+{
+    // Avoid repeated construction
+    IntType zero(0);
+
+    // This is abs() - given the existence of broken compilers with Koenig
+    // lookup issues and other problems, I code this explicitly. (Remember,
+    // IntType may be a user-defined type).
+    if (n < zero)
+        n = -n;
+    if (m < zero)
+        m = -m;
+
+    // As n and m are now positive, we can be sure that %= returns a
+    // positive value (the standard guarantees this for built-in types,
+    // and we require it of user-defined types).
+    for(;;) {
+      if(m == zero)
+        return n;
+      n %= m;
+      if(n == zero)
+        return m;
+      m %= n;
+    }
+}
+
+template <typename IntType>
+IntType lcm(IntType n, IntType m)
+{
+    // Avoid repeated construction
+    IntType zero(0);
+
+    if (n == zero || m == zero)
+        return zero;
+
+    n /= gcd(n, m);
+    n *= m;
+
+    if (n < zero)
+        n = -n;
+    return n;
+}
+
+class bad_rational : public std::domain_error
+{
+public:
+    explicit bad_rational() : std::domain_error("bad rational: zero denominator") {}
+};
+
+template <typename IntType>
+class rational;
+
+template <typename IntType>
+rational<IntType> abs(const rational<IntType>& r);
+
+template <typename IntType>
+class rational :
+    less_than_comparable < rational<IntType>,
+    equality_comparable < rational<IntType>,
+    less_than_comparable2 < rational<IntType>, IntType,
+    equality_comparable2 < rational<IntType>, IntType,
+    addable < rational<IntType>,
+    subtractable < rational<IntType>,
+    multipliable < rational<IntType>,
+    dividable < rational<IntType>,
+    addable2 < rational<IntType>, IntType,
+    subtractable2 < rational<IntType>, IntType,
+    multipliable2 < rational<IntType>, IntType,
+    dividable2 < rational<IntType>, IntType,
+    incrementable < rational<IntType>,
+    decrementable < rational<IntType>
+    > > > > > > > > > > > > > >
+{
+    typedef IntType int_type;
+    typedef typename boost::call_traits<IntType>::param_type param_type;
+
+public:
+    rational() : num(0), den(1) {}
+    rational(param_type n) : num(n), den(1) {}
+    rational(param_type n, param_type d) : num(n), den(d) { normalize(); }
+
+    // Default copy constructor and assignment are fine
+
+    // Add assignment from IntType
+    rational& operator=(param_type n) { return assign(n, 1); }
+
+    // Assign in place
+    rational& assign(param_type n, param_type d);
+
+    // Access to representation
+    IntType numerator() const { return num; }
+    IntType denominator() const { return den; }
+
+    // Arithmetic assignment operators
+    rational& operator+= (const rational& r);
+    rational& operator-= (const rational& r);
+    rational& operator*= (const rational& r);
+    rational& operator/= (const rational& r);
+
+    rational& operator+= (param_type i);
+    rational& operator-= (param_type i);
+    rational& operator*= (param_type i);
+    rational& operator/= (param_type i);
+
+    // Increment and decrement
+    const rational& operator++();
+    const rational& operator--();
+
+    // Operator not
+    bool operator!() const { return !num; }
+
+    // Comparison operators
+    bool operator< (const rational& r) const;
+    bool operator== (const rational& r) const;
+
+    bool operator< (param_type i) const;
+    bool operator> (param_type i) const;
+    bool operator== (param_type i) const;
+
+private:
+    // Implementation - numerator and denominator (normalized).
+    // Other possibilities - separate whole-part, or sign, fields?
+    IntType num;
+    IntType den;
+
+    // Representation note: Fractions are kept in normalized form at all
+    // times. normalized form is defined as gcd(num,den) == 1 and den > 0.
+    // In particular, note that the implementation of abs() below relies
+    // on den always being positive.
+    void normalize();
+};
+
+// Assign in place
+template <typename IntType>
+inline rational<IntType>& rational<IntType>::assign(param_type n, param_type d)
+{
+    num = n;
+    den = d;
+    normalize();
+    return *this;
+}
+
+// Unary plus and minus
+template <typename IntType>
+inline rational<IntType> operator+ (const rational<IntType>& r)
+{
+    return r;
+}
+
+template <typename IntType>
+inline rational<IntType> operator- (const rational<IntType>& r)
+{
+    return rational<IntType>(-r.numerator(), r.denominator());
+}
+
+// Arithmetic assignment operators
+template <typename IntType>
+rational<IntType>& rational<IntType>::operator+= (const rational<IntType>& r)
+{
+    // This calculation avoids overflow, and minimises the number of expensive
+    // calculations. Thanks to Nickolay Mladenov for this algorithm.
+    //
+    // Proof:
+    // We have to compute a/b + c/d, where gcd(a,b)=1 and gcd(b,c)=1.
+    // Let g = gcd(b,d), and b = b1*g, d=d1*g. Then gcd(b1,d1)=1
+    //
+    // The result is (a*d1 + c*b1) / (b1*d1*g).
+    // Now we have to normalize this ratio.
+    // Let's assume h | gcd((a*d1 + c*b1), (b1*d1*g)), and h > 1
+    // If h | b1 then gcd(h,d1)=1 and hence h|(a*d1+c*b1) => h|a.
+    // But since gcd(a,b1)=1 we have h=1.
+    // Similarly h|d1 leads to h=1.
+    // So we have that h | gcd((a*d1 + c*b1) , (b1*d1*g)) => h|g
+    // Finally we have gcd((a*d1 + c*b1), (b1*d1*g)) = gcd((a*d1 + c*b1), g)
+    // Which proves that instead of normalizing the result, it is better to
+    // divide num and den by gcd((a*d1 + c*b1), g)
+
+    // Protect against self-modification
+    IntType r_num = r.num;
+    IntType r_den = r.den;
+
+    IntType g = gcd(den, r_den);
+    den /= g;  // = b1 from the calculations above
+    num = num * (r_den / g) + r_num * den;
+    g = gcd(num, g);
+    num /= g;
+    den *= r_den/g;
+
+    return *this;
+}
+
+template <typename IntType>
+rational<IntType>& rational<IntType>::operator-= (const rational<IntType>& r)
+{
+    // Protect against self-modification
+    IntType r_num = r.num;
+    IntType r_den = r.den;
+
+    // This calculation avoids overflow, and minimises the number of expensive
+    // calculations. It corresponds exactly to the += case above
+    IntType g = gcd(den, r_den);
+    den /= g;
+    num = num * (r_den / g) - r_num * den;
+    g = gcd(num, g);
+    num /= g;
+    den *= r_den/g;
+
+    return *this;
+}
+
+template <typename IntType>
+rational<IntType>& rational<IntType>::operator*= (const rational<IntType>& r)
+{
+    // Protect against self-modification
+    IntType r_num = r.num;
+    IntType r_den = r.den;
+
+    // Avoid overflow and preserve normalization
+    IntType gcd1 = gcd<IntType>(num, r_den);
+    IntType gcd2 = gcd<IntType>(r_num, den);
+    num = (num/gcd1) * (r_num/gcd2);
+    den = (den/gcd2) * (r_den/gcd1);
+    return *this;
+}
+
+template <typename IntType>
+rational<IntType>& rational<IntType>::operator/= (const rational<IntType>& r)
+{
+    // Protect against self-modification
+    IntType r_num = r.num;
+    IntType r_den = r.den;
+
+    // Avoid repeated construction
+    IntType zero(0);
+
+    // Trap division by zero
+    if (r_num == zero)
+        throw bad_rational();
+    if (num == zero)
+        return *this;
+
+    // Avoid overflow and preserve normalization
+    IntType gcd1 = gcd<IntType>(num, r_num);
+    IntType gcd2 = gcd<IntType>(r_den, den);
+    num = (num/gcd1) * (r_den/gcd2);
+    den = (den/gcd2) * (r_num/gcd1);
+
+    if (den < zero) {
+        num = -num;
+        den = -den;
+    }
+    return *this;
+}
+
+// Mixed-mode operators
+template <typename IntType>
+inline rational<IntType>&
+rational<IntType>::operator+= (param_type i)
+{
+    return operator+= (rational<IntType>(i));
+}
+
+template <typename IntType>
+inline rational<IntType>&
+rational<IntType>::operator-= (param_type i)
+{
+    return operator-= (rational<IntType>(i));
+}
+
+template <typename IntType>
+inline rational<IntType>&
+rational<IntType>::operator*= (param_type i)
+{
+    return operator*= (rational<IntType>(i));
+}
+
+template <typename IntType>
+inline rational<IntType>&
+rational<IntType>::operator/= (param_type i)
+{
+    return operator/= (rational<IntType>(i));
+}
+
+// Intel C++ seems to choke on this unless i is a reference parameter, matching
+// the reference parameter in the operator-() generated by subtractable
+template <typename IntType, typename T>
+inline rational<IntType>
+operator- (const T& i, const rational<IntType>& r)
+{
+    IntType ii = i; // Must be able to implicitly convert T -> IntType
+    return rational<IntType>(ii) -= r;
+}
+
+// Intel C++ seems to choke on this unless i is a reference parameter, matching
+// the reference parameter in the operator-() generated by subtractable
+template <typename IntType, typename T>
+inline rational<IntType>
+operator/ (const T& i, const rational<IntType>& r)
+{
+    IntType ii = i; // Must be able to implicitly convert T -> IntType
+    return rational<IntType>(ii) /= r;
+}
+
+// Increment and decrement
+template <typename IntType>
+inline const rational<IntType>& rational<IntType>::operator++()
+{
+    // This can never denormalise the fraction
+    num += den;
+    return *this;
+}
+
+template <typename IntType>
+inline const rational<IntType>& rational<IntType>::operator--()
+{
+    // This can never denormalise the fraction
+    num -= den;
+    return *this;
+}
+
+// Comparison operators
+template <typename IntType>
+bool rational<IntType>::operator< (const rational<IntType>& r) const
+{
+    // Avoid repeated construction
+    IntType zero(0);
+
+    // If the two values have different signs, we don't need to do the
+    // expensive calculations below. We take advantage here of the fact
+    // that the denominator is always positive.
+    if (num < zero && r.num >= zero) // -ve < +ve
+        return true;
+    if (num >= zero && r.num <= zero) // +ve or zero is not < -ve or zero
+        return false;
+
+    // Avoid overflow
+    IntType gcd1 = gcd<IntType>(num, r.num);
+    IntType gcd2 = gcd<IntType>(r.den, den);
+    return (num/gcd1) * (r.den/gcd2) < (den/gcd2) * (r.num/gcd1);
+}
+
+template <typename IntType>
+bool rational<IntType>::operator< (param_type i) const
+{
+    // Avoid repeated construction
+    IntType zero(0);
+
+    // If the two values have different signs, we don't need to do the
+    // expensive calculations below. We take advantage here of the fact
+    // that the denominator is always positive.
+    if (num < zero && i >= zero) // -ve < +ve
+        return true;
+    if (num >= zero && i <= zero) // +ve or zero is not < -ve or zero
+        return false;
+
+    // Now, use the fact that n/d truncates towards zero as long as n and d
+    // are both positive.
+    // Divide instead of multiplying to avoid overflow issues. Of course,
+    // division may be slower, but accuracy is more important than speed...
+    if (num > zero)
+        return (num/den) < i;
+    else
+        return -i < (-num/den);
+}
+
+template <typename IntType>
+bool rational<IntType>::operator> (param_type i) const
+{
+    // Trap equality first
+    if (num == i && den == IntType(1))
+        return false;
+
+    // Otherwise, we can use operator<
+    return !operator<(i);
+}
+
+template <typename IntType>
+inline bool rational<IntType>::operator== (const rational<IntType>& r) const
+{
+    return ((num == r.num) && (den == r.den));
+}
+
+template <typename IntType>
+inline bool rational<IntType>::operator== (param_type i) const
+{
+    return ((den == IntType(1)) && (num == i));
+}
+
+// Normalisation
+template <typename IntType>
+void rational<IntType>::normalize()
+{
+    // Avoid repeated construction
+    IntType zero(0);
+
+    if (den == zero)
+        throw bad_rational();
+
+    // Handle the case of zero separately, to avoid division by zero
+    if (num == zero) {
+        den = IntType(1);
+        return;
+    }
+
+    IntType g = gcd<IntType>(num, den);
+
+    num /= g;
+    den /= g;
+
+    // Ensure that the denominator is positive
+    if (den < zero) {
+        num = -num;
+        den = -den;
+    }
+}
+
+namespace detail {
+
+    // A utility class to reset the format flags for an istream at end
+    // of scope, even in case of exceptions
+    struct resetter {
+        resetter(std::istream& is) : is_(is), f_(is.flags()) {}
+        ~resetter() { is_.flags(f_); }
+        std::istream& is_;
+        std::istream::fmtflags f_;      // old GNU c++ lib has no ios_base
+    };
+
+}
+
+// Input and output
+template <typename IntType>
+std::istream& operator>> (std::istream& is, rational<IntType>& r)
+{
+    IntType n = IntType(0), d = IntType(1);
+    char c = 0;
+    detail::resetter sentry(is);
+
+    is >> n;
+    c = is.get();
+
+    if (c != '/')
+        is.clear(std::istream::badbit);  // old GNU c++ lib has no ios_base
+
+#if !defined(__GNUC__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined __SGI_STL_PORT
+    is >> std::noskipws;
+#else
+    is.unsetf(ios::skipws); // compiles, but seems to have no effect.
+#endif
+    is >> d;
+
+    if (is)
+        r.assign(n, d);
+
+    return is;
+}
+
+// Add manipulators for output format?
+template <typename IntType>
+std::ostream& operator<< (std::ostream& os, const rational<IntType>& r)
+{
+    os << r.numerator() << '/' << r.denominator();
+    return os;
+}
+
+// Type conversion
+template <typename T, typename IntType>
+inline T rational_cast(const rational<IntType>& src)
+{
+    return static_cast<T>(src.numerator())/src.denominator();
+}
+
+// Do not use any abs() defined on IntType - it isn't worth it, given the
+// difficulties involved (Koenig lookup required, there may not *be* an abs()
+// defined, etc etc).
+template <typename IntType>
+inline rational<IntType> abs(const rational<IntType>& r)
+{
+    if (r.numerator() >= IntType(0))
+        return r;
+
+    return rational<IntType>(-r.numerator(), r.denominator());
+}
+
+} // namespace boost
+
+#endif  // BOOST_RATIONAL_HPP
+
diff --git a/boost/boost/ref.hpp b/boost/boost/ref.hpp
new file mode 100644 (file)
index 0000000..60a834b
--- /dev/null
@@ -0,0 +1,162 @@
+#ifndef BOOST_REF_HPP_INCLUDED
+# define BOOST_REF_HPP_INCLUDED
+
+# if _MSC_VER+0 >= 1020
+#  pragma once
+# endif
+
+# include <boost/config.hpp>
+# include <boost/utility/addressof.hpp>
+
+//
+//  ref.hpp - ref/cref, useful helper functions
+//
+//  Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
+//  Copyright (C) 2001, 2002 Peter Dimov
+//  Copyright (C) 2002 David Abrahams
+//
+//  Permission to copy, use, modify, sell and distribute this software
+//  is granted provided this copyright notice appears in all copies.
+//  This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+//
+//  See http://www.boost.org/libs/bind/ref.html for documentation.
+//
+
+namespace boost
+{
+
+template<class T> class reference_wrapper
+{ 
+public:
+    typedef T type;
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
+
+    explicit reference_wrapper(T& t): t_(&t) {}
+
+#else
+
+    explicit reference_wrapper(T& t): t_(addressof(t)) {}
+
+#endif
+
+    operator T& () const { return *t_; }
+
+    T& get() const { return *t_; }
+
+    T* get_pointer() const { return t_; }
+
+private:
+
+    T* t_;
+};
+
+# if defined(__BORLANDC__) && (__BORLANDC__ <= 0x560)
+#  define BOOST_REF_CONST
+# else
+#  define BOOST_REF_CONST const
+# endif
+
+template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
+{ 
+    return reference_wrapper<T>(t);
+}
+
+template<class T> inline reference_wrapper<T const> BOOST_REF_CONST cref(T const & t)
+{
+    return reference_wrapper<T const>(t);
+}
+
+# undef BOOST_REF_CONST
+
+# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template<typename T>
+class is_reference_wrapper
+{
+ public:
+    BOOST_STATIC_CONSTANT(bool, value = false); 
+};
+
+template<typename T>
+class is_reference_wrapper<reference_wrapper<T> >
+{
+ public:
+    BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+template<typename T>
+class unwrap_reference
+{
+ public:
+    typedef T type;
+};
+
+template<typename T>
+class unwrap_reference<reference_wrapper<T> >
+{
+ public:
+    typedef T type;
+};
+# else // no partial specialization
+
+} // namespace boost
+
+#include <boost/type.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+  typedef char (&yes_reference_wrapper_t)[1];
+  typedef char (&no_reference_wrapper_t)[2];
+      
+  no_reference_wrapper_t is_reference_wrapper_test(...);
+
+  template<typename T>
+  yes_reference_wrapper_t is_reference_wrapper_test(type< reference_wrapper<T> >);
+
+  template<bool wrapped>
+  struct reference_unwrapper
+  {
+      template <class T>
+      struct apply
+      {
+          typedef T type;
+      };
+  };
+
+  template<>
+  struct reference_unwrapper<true>
+  {
+      template <class T>
+      struct apply
+      {
+          typedef typename T::type type;
+      };
+  };
+}
+
+template<typename T>
+class is_reference_wrapper
+{
+ public:
+    BOOST_STATIC_CONSTANT(
+        bool, value = (
+            sizeof(detail::is_reference_wrapper_test(type<T>()))
+            == sizeof(detail::yes_reference_wrapper_t)));
+};
+
+template <typename T>
+class unwrap_reference
+    : public detail::reference_unwrapper<
+        is_reference_wrapper<T>::value
+      >::template apply<T>
+{};
+
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace boost
+
+#endif // #ifndef BOOST_REF_HPP_INCLUDED
diff --git a/boost/boost/regex.h b/boost/boost/regex.h
new file mode 100644 (file)
index 0000000..6337aab
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ *
+ * Copyright (c) 1998-2000
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex.h
+  *   VERSION      3.12
+  *   DESCRIPTION: Declares POSIX API functions
+  */
+
+#ifndef BOOST_RE_REGEX_H
+#define BOOST_RE_REGEX_H
+
+#include <boost/cregex.hpp>
+
+//
+// add using declarations to bring POSIX API functions into
+// global scope, only if this is C++ (and not C).
+//
+#ifdef __cplusplus
+
+using boost::regoff_t;
+using boost::regex_tA;
+using boost::regmatch_t;
+using boost::REG_BASIC;
+using boost::REG_EXTENDED;
+using boost::REG_ICASE;
+using boost::REG_NOSUB;
+using boost::REG_NEWLINE;
+using boost::REG_NOSPEC;
+using boost::REG_PEND;
+using boost::REG_DUMP;
+using boost::REG_NOCOLLATE;
+using boost::REG_ESCAPE_IN_LISTS;
+using boost::REG_NEWLINE_ALT;
+using boost::REG_PERL;
+using boost::REG_AWK;
+using boost::REG_GREP;
+using boost::REG_EGREP;
+using boost::REG_ASSERT;
+using boost::REG_INVARG;
+using boost::REG_ATOI;
+using boost::REG_ITOA;
+
+using boost::REG_NOTBOL;
+using boost::REG_NOTEOL;
+using boost::REG_STARTEND;
+
+using boost::reg_comp_flags;
+using boost::reg_exec_flags;
+using boost::regcompA;
+using boost::regerrorA;
+using boost::regexecA;
+using boost::regfreeA;
+
+#ifndef BOOST_NO_WREGEX
+using boost::regcompW;
+using boost::regerrorW;
+using boost::regexecW;
+using boost::regfreeW;
+using boost::regex_tW;
+#endif
+
+using boost::REG_NOERROR;
+using boost::REG_NOMATCH;
+using boost::REG_BADPAT;
+using boost::REG_ECOLLATE;
+using boost::REG_ECTYPE;
+using boost::REG_EESCAPE;
+using boost::REG_ESUBREG;
+using boost::REG_EBRACK;
+using boost::REG_EPAREN;
+using boost::REG_EBRACE;
+using boost::REG_BADBR;
+using boost::REG_ERANGE;
+using boost::REG_ESPACE;
+using boost::REG_BADRPT;
+using boost::REG_EEND;
+using boost::REG_ESIZE;
+using boost::REG_ERPAREN;
+using boost::REG_EMPTY;
+using boost::REG_E_MEMORY;
+using boost::REG_E_UNKNOWN;
+using boost::reg_errcode_t;
+
+#endif // __cplusplus
+
+#endif // BOOST_RE_REGEX_H
+
+
diff --git a/boost/boost/regex.hpp b/boost/boost/regex.hpp
new file mode 100644 (file)
index 0000000..329e671
--- /dev/null
@@ -0,0 +1,1600 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex.cpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Declares boost::reg_expression<> and associated
+  *                functions and classes. This header is the main
+  *                entry point for the template regex code.
+  */
+
+
+/* start with C compatibility API */
+
+#ifndef BOOST_RE_REGEX_HPP
+#define BOOST_RE_REGEX_HPP
+
+#include <boost/cregex.hpp>
+
+#ifdef __cplusplus
+
+// what follows is all C++ don't include in C builds!!
+
+#ifdef BOOST_REGEX_DEBUG
+# include <iosfwd>
+#endif
+
+#include <new>
+#include <boost/regex/config.hpp>
+#include <cstring>
+#include <boost/regex_fwd.hpp>
+#include <boost/regex/detail/regex_stack.hpp>
+#include <boost/regex/detail/regex_raw_buffer.hpp>
+#include <boost/regex/detail/regex_kmp.hpp>
+#include <boost/regex/pattern_except.hpp>
+#include <boost/regex/regex_traits.hpp>
+#include <boost/type_traits/cv_traits.hpp>
+#include <boost/scoped_array.hpp>
+
+
+namespace boost{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+namespace re_detail{
+
+struct re_set_long;
+struct re_syntax_base;
+
+} // namespace re_detail
+
+namespace deprecated{
+//
+// class char_regex_traits_i
+// provides case insensitive traits classes (deprecated):
+template <class charT>
+class char_regex_traits_i : public regex_traits<charT> {};
+
+template<>
+class char_regex_traits_i<char> : public regex_traits<char>
+{
+public:
+   typedef char char_type;
+   typedef unsigned char uchar_type;
+   typedef unsigned int size_type;
+   typedef regex_traits<char> base_type;
+
+   char BOOST_REGEX_CALL translate(char c, bool)const
+   {
+      return static_cast<const regex_traits<char>*>(this)->translate(c, true);
+   }
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class char_regex_traits_i<wchar_t> : public regex_traits<wchar_t>
+{
+public:
+   typedef wchar_t char_type;
+   typedef unsigned short uchar_type;
+   typedef unsigned int size_type;
+   typedef regex_traits<wchar_t> base_type;
+
+   wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool)const
+   {
+      return static_cast<const regex_traits<wchar_t>*>(this)->translate(c, true);
+   }
+   boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const
+   {
+      boost::uint_fast32_t result = static_cast<const regex_traits<wchar_t>*>(this)->lookup_classname(first, last);
+      if((result & base_type::char_class_upper) == base_type::char_class_upper)
+         result |= base_type::char_class_alpha;
+      return result;
+   }
+};
+#endif
+} // namespace deprecated
+
+
+namespace re_detail{
+
+enum mask_type
+{
+   mask_take = 1,
+   mask_skip = 2,
+   mask_any = mask_skip | mask_take,
+   mask_all = mask_any
+};
+
+struct _narrow_type{};
+struct _wide_type{};
+
+template <class charT>
+class is_byte;
+
+template<>
+class is_byte<char>
+{
+public:
+   typedef _narrow_type width_type;
+};
+
+template<>
+class is_byte<unsigned char>
+{
+public:
+   typedef _narrow_type width_type;
+};
+
+template<>
+class is_byte<signed char>
+{
+public:
+   typedef _narrow_type width_type;
+};
+
+template <class charT>
+class is_byte
+{
+public:
+   typedef _wide_type width_type;
+};
+
+
+//
+// compiled structures
+//
+// the following defs describe the format of the compiled string
+//
+
+//
+// enum syntax_element_type
+// describes the type of a record
+enum syntax_element_type
+{
+   syntax_element_startmark = 0,
+   syntax_element_endmark = syntax_element_startmark + 1,
+   syntax_element_literal = syntax_element_endmark + 1,
+   syntax_element_start_line = syntax_element_literal + 1,
+   syntax_element_end_line = syntax_element_start_line + 1,
+   syntax_element_wild = syntax_element_end_line + 1,
+   syntax_element_match = syntax_element_wild + 1,
+   syntax_element_word_boundary = syntax_element_match + 1,
+   syntax_element_within_word = syntax_element_word_boundary + 1,
+   syntax_element_word_start = syntax_element_within_word + 1,
+   syntax_element_word_end = syntax_element_word_start + 1,
+   syntax_element_buffer_start = syntax_element_word_end + 1,
+   syntax_element_buffer_end = syntax_element_buffer_start + 1,
+   syntax_element_backref = syntax_element_buffer_end + 1,
+   syntax_element_long_set = syntax_element_backref + 1,
+   syntax_element_set = syntax_element_long_set + 1,
+   syntax_element_jump = syntax_element_set + 1,
+   syntax_element_alt = syntax_element_jump + 1,
+   syntax_element_rep = syntax_element_alt + 1,
+   syntax_element_combining = syntax_element_rep + 1,
+   syntax_element_soft_buffer_end = syntax_element_combining + 1,
+   syntax_element_restart_continue = syntax_element_soft_buffer_end + 1
+};
+
+#ifdef BOOST_REGEX_DEBUG
+// dwa 09/26/00 - This is needed to suppress warnings about an ambiguous conversion
+std::ostream& operator<<(std::ostream&, syntax_element_type);
+#endif
+
+union offset_type
+{
+   re_syntax_base* p;
+   std::size_t i;
+};
+
+//
+// struct re_syntax_base
+// base class for all syntax types:
+struct re_syntax_base
+{
+   syntax_element_type type;
+   offset_type next;
+   unsigned int can_be_null;
+};
+
+//
+// struct re_brace
+// marks start or end of (...)
+struct re_brace : public re_syntax_base
+{
+   int index;
+};
+
+//
+// struct re_literal
+// marks a literal string and
+// is followed by an array of charT[length]:
+struct re_literal : public re_syntax_base
+{
+   unsigned int length;
+};
+
+//
+// struct re_long_set
+// provides data for sets [...] containing
+// wide characters
+struct re_set_long : public re_syntax_base
+{
+   unsigned int csingles, cranges, cequivalents;
+   boost::uint_fast32_t cclasses;
+   bool isnot;
+};
+
+//
+// struct re_set
+// provides a map of bools for sets containing
+// narrow, single byte characters.
+struct re_set : public re_syntax_base
+{
+   unsigned char _map[256];
+};
+
+//
+// struct re_jump
+// provides alternative next destination
+struct re_jump : public re_syntax_base
+{
+   offset_type alt;
+   unsigned char _map[256];
+};
+
+//
+// struct re_repeat
+// provides repeat expressions
+struct re_repeat : public re_jump
+{
+   unsigned min, max;
+   int id;
+   bool leading;
+   bool greedy;
+};
+
+
+//
+// enum re_jump_size_type
+// provides compiled size of re_jump
+// allowing for trailing alignment
+// provide this so we know how many
+// bytes to insert
+enum re_jump_size_type
+{
+   re_jump_size = (sizeof(re_jump) + padding_mask) & ~(padding_mask),
+   re_repeater_size = (sizeof(re_repeat) + padding_mask) & ~(padding_mask)
+};
+
+} // namespace re_detail
+
+//
+// class basic_regex
+// handles error codes and flags
+
+class BOOST_REGEX_DECL regbase
+{
+public:
+   enum flag_type_
+   {
+      escape_in_lists = 1,                     // '\' special inside [...]
+      char_classes = escape_in_lists << 1,     // [[:CLASS:]] allowed
+      intervals = char_classes << 1,           // {x,y} allowed
+      limited_ops = intervals << 1,            // all of + ? and | are normal characters
+      newline_alt = limited_ops << 1,          // \n is the same as |
+      bk_plus_qm = newline_alt << 1,           // uses \+ and \?
+      bk_braces = bk_plus_qm << 1,             // uses \{ and \}
+      bk_parens = bk_braces << 1,              // uses \( and \)
+      bk_refs = bk_parens << 1,                // \d allowed
+      bk_vbar = bk_refs << 1,                  // uses \|
+
+      use_except = bk_vbar << 1,               // exception on error
+      failbit = use_except << 1,               // error flag
+      literal = failbit << 1,                  // all characters are literals
+      icase = literal << 1,                    // characters are matched regardless of case
+      nocollate = icase << 1,                  // don't use locale specific collation
+
+      basic = char_classes | intervals | limited_ops | bk_braces | bk_parens | bk_refs,
+      extended = char_classes | intervals | bk_refs,
+      normal = escape_in_lists | char_classes | intervals | bk_refs | nocollate,
+      emacs = bk_braces | bk_parens | bk_refs | bk_vbar,
+      awk = extended | escape_in_lists,
+      grep = basic | newline_alt,
+      egrep = extended | newline_alt,
+      sed = basic,
+      perl = normal
+   };
+   typedef unsigned int flag_type;
+
+   enum restart_info
+   {
+      restart_any = 0,
+      restart_word = 1,
+      restart_line = 2,
+      restart_buf = 3,
+      restart_continue = 4,
+      restart_lit = 5,
+      restart_fixed_lit = 6
+   };
+
+   flag_type BOOST_REGEX_CALL flags()const
+   {
+      return _flags;
+   }
+
+   regbase();
+   regbase(const regbase& b);
+protected:
+   flag_type _flags;
+};
+
+//
+// some forward declarations:
+namespace re_detail{
+template <class iterator, class Allocator>
+class _priv_match_data;
+
+#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <class T>
+struct regex_iterator_traits 
+{
+  typedef typename T::iterator_category iterator_category;
+  typedef typename T::value_type        value_type;
+#if !defined(BOOST_NO_STD_ITERATOR)
+  typedef typename T::difference_type   difference_type;
+  typedef typename T::pointer           pointer;
+  typedef typename T::reference         reference;
+#else
+  typedef std::ptrdiff_t                difference_type;
+  typedef value_type*                   pointer;
+  typedef value_type&                   reference;
+#endif
+};
+
+template <class T>
+struct pointer_iterator_traits
+{
+   typedef std::ptrdiff_t difference_type;
+   typedef T value_type;
+   typedef T* pointer;
+   typedef T& reference;
+   typedef std::random_access_iterator_tag iterator_category;
+};
+template <class T>
+struct const_pointer_iterator_traits
+{
+   typedef std::ptrdiff_t difference_type;
+   typedef T value_type;
+   typedef const T* pointer;
+   typedef const T& reference;
+   typedef std::random_access_iterator_tag iterator_category;
+};
+
+template<>
+struct regex_iterator_traits<char*> : pointer_iterator_traits<char>{};
+template<>
+struct regex_iterator_traits<const char*> : const_pointer_iterator_traits<char>{};
+template<>
+struct regex_iterator_traits<wchar_t*> : pointer_iterator_traits<wchar_t>{};
+template<>
+struct regex_iterator_traits<const wchar_t*> : const_pointer_iterator_traits<wchar_t>{};
+
+#if defined(__SGI_STL_PORT) && defined(__STL_DEBUG)
+template<>
+struct regex_iterator_traits<std::string::iterator> : pointer_iterator_traits<char>{};
+template<>
+struct regex_iterator_traits<std::string::const_iterator> : const_pointer_iterator_traits<char>{};
+#ifndef BOOST_NO_STD_WSTRING
+template<>
+struct regex_iterator_traits<std::wstring::iterator> : pointer_iterator_traits<wchar_t>{};
+template<>
+struct regex_iterator_traits<std::wstring::const_iterator> : const_pointer_iterator_traits<wchar_t>{};
+#endif // BOOST_NO_WSTRING
+#endif // stport
+
+#else
+
+template <class T>
+struct regex_iterator_traits : public std::iterator_traits<T> {};
+
+#endif
+
+template <class I>
+struct def_alloc_param_traits
+{
+   typedef typename regex_iterator_traits<I>::value_type const_value_type;
+   typedef typename remove_cv<const_value_type>::type type;
+};
+template <>
+struct def_alloc_param_traits<const char*>
+{
+   typedef char type;
+};
+template <>
+struct def_alloc_param_traits<const wchar_t*>
+{
+   typedef wchar_t type;
+};
+
+}
+
+template <class iterator, class Allocator =
+#ifndef BOOST_MSVC
+BOOST_DEFAULT_ALLOCATOR(typename re_detail::def_alloc_param_traits<iterator>::type) >
+#else
+BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<iterator>::type) >
+#endif
+class match_results;
+
+//
+// class reg_expression
+// represents the compiled
+// regular expression:
+//
+
+#ifdef BOOST_REGEX_NO_FWD
+template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+#else
+template <class charT, class traits, class Allocator >
+#endif
+class reg_expression : public regbase
+{
+public:
+   typedef typename traits::size_type traits_size_type;
+   typedef typename traits::uchar_type traits_uchar_type;
+   typedef typename traits::string_type traits_string_type;
+   // typedefs:
+   typedef charT char_type;
+   typedef traits traits_type;
+
+   // locale_type
+   // placeholder for actual locale type used by the
+   // traits class to localise *this.
+   typedef typename traits::locale_type locale_type;
+   // value_type
+   typedef charT value_type;
+   // reference, const_reference
+   typedef charT& reference;
+   typedef const charT& const_reference;
+   // iterator, const_iterator
+   typedef const charT* const_iterator;
+   typedef const_iterator iterator;
+   // difference_type
+   typedef typename Allocator::difference_type difference_type;
+   // size_type
+   typedef typename Allocator::size_type size_type;   
+   // allocator_type
+   typedef Allocator allocator_type;
+   typedef Allocator alloc_type;
+   // flag_type
+   typedef regbase::flag_type flag_type;
+   
+public:
+   explicit reg_expression(const Allocator& a = Allocator());
+   explicit reg_expression(const charT* p, flag_type f = regbase::normal, const Allocator& a = Allocator());
+   reg_expression(const charT* p1, const charT* p2, flag_type f = regbase::normal, const Allocator& a = Allocator());
+   reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a = Allocator());
+   reg_expression(const reg_expression&);
+   ~reg_expression();
+   reg_expression& BOOST_REGEX_CALL operator=(const reg_expression&);
+   reg_expression& BOOST_REGEX_CALL operator=(const charT* ptr)
+   {
+      set_expression(ptr, regbase::normal | regbase::use_except);
+      return *this;
+   }
+
+   //
+   // assign:
+   reg_expression& assign(const reg_expression& that)
+   { return *this = that; }
+   reg_expression& assign(const charT* ptr, flag_type f = regbase::normal)
+   {
+      set_expression(ptr, f | regbase::use_except);
+      return *this;
+   }
+
+   reg_expression& assign(const charT* first,
+                          const charT* last,
+                          flag_type f = regbase::normal)
+   {
+      set_expression(first, last, f | regbase::use_except);
+      return *this;
+   }
+#ifndef BOOST_NO_MEMBER_TEMPLATES
+
+   template <class ST, class SA>
+   unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regbase::normal)
+   { return set_expression(p.data(), p.data() + p.size(), f); }
+
+   template <class ST, class SA>
+   explicit reg_expression(const std::basic_string<charT, ST, SA>& p, flag_type f = regbase::normal, const Allocator& a = Allocator())
+    : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0) { set_expression(p, f | regbase::use_except); }
+
+   template <class I>
+   reg_expression(I first, I last, flag_type f = regbase::normal, const Allocator& al = Allocator())
+    : data(al), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+   {
+      size_type len = last-first;
+      scoped_array<charT> a(new charT[len]);
+      std::copy(first, last, a.get());
+      set_expression(a.get(), a.get() + len, f | regbase::use_except);
+   }
+
+   template <class ST, class SA>
+   reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string<charT, ST, SA>& p)
+   {
+      set_expression(p.c_str(), p.c_str() + p.size(), regbase::normal | regbase::use_except);
+      return *this;
+   }
+
+   template <class string_traits, class A>
+   reg_expression& BOOST_REGEX_CALL assign(
+       const std::basic_string<charT, string_traits, A>& s,
+       flag_type f = regbase::normal)
+   {
+      set_expression(s.c_str(), s.c_str() + s.size(), f | regbase::use_except);
+      return *this;
+   }
+
+   template <class fwd_iterator>
+   reg_expression& BOOST_REGEX_CALL assign(fwd_iterator first,
+                          fwd_iterator last,
+                          flag_type f = regbase::normal)
+   {
+      size_type len = last-first;
+      scoped_array<charT> a(new charT[len]);
+      std::copy(first, last, a.get());
+      set_expression(a.get(), a.get() + len, f | regbase::use_except);
+      return *this;
+   }
+#else
+   unsigned int BOOST_REGEX_CALL set_expression(const std::basic_string<charT>& p, flag_type f = regbase::normal)
+   { return set_expression(p.data(), p.data() + p.size(), f | regbase::use_except); }
+
+   reg_expression(const std::basic_string<charT>& p, flag_type f = regbase::normal, const Allocator& a = Allocator())
+    : data(a), pkmp(0) { set_expression(p, f | regbase::use_except); }
+
+   reg_expression& BOOST_REGEX_CALL operator=(const std::basic_string<charT>& p)
+   {
+      set_expression(p.c_str(), p.c_str() + p.size(), regbase::normal | regbase::use_except);
+      return *this;
+   }
+
+   reg_expression& BOOST_REGEX_CALL assign(
+       const std::basic_string<charT>& s,
+       flag_type f = regbase::normal)
+   {
+      set_expression(s.c_str(), s.c_str() + s.size(), f | regbase::use_except);
+      return *this;
+   }
+
+#endif
+
+
+   //
+   // allocator access:
+   Allocator BOOST_REGEX_CALL get_allocator()const;
+   //
+   // locale:
+   locale_type BOOST_REGEX_CALL imbue(locale_type l){ return traits_inst.imbue(l); }
+   locale_type BOOST_REGEX_CALL getloc()const{ return traits_inst.getloc(); }
+   //
+   // flags:
+   flag_type BOOST_REGEX_CALL getflags()const
+   { return flags(); }
+   //
+   // str:
+   std::basic_string<charT> BOOST_REGEX_CALL str()const
+   {
+      std::basic_string<charT> result;
+      if(this->error_code() == 0)
+         result = std::basic_string<charT>(_expression, _expression_len);
+      return result;
+   }
+   //
+   // begin, end:
+   const_iterator BOOST_REGEX_CALL begin()const
+   { return (this->error_code() ? 0 : _expression); }
+   const_iterator BOOST_REGEX_CALL end()const
+   { return (this->error_code() ? 0 : _expression + _expression_len); }
+   //
+   // swap:
+   void BOOST_REGEX_CALL swap(reg_expression&)throw();
+   //
+   // size:
+   size_type BOOST_REGEX_CALL size()const
+   { return (this->error_code() ? 0 : _expression_len); }
+   //
+   // max_size:
+   size_type BOOST_REGEX_CALL max_size()const
+   { return UINT_MAX; }
+   //
+   // empty:
+   bool BOOST_REGEX_CALL empty()const
+   { return 0 != this->error_code(); }
+
+   unsigned BOOST_REGEX_CALL mark_count()const { return (this->error_code() ? 0 : marks); }
+   bool BOOST_REGEX_CALL operator==(const reg_expression&)const;
+   bool BOOST_REGEX_CALL operator<(const reg_expression&)const;
+   //
+   // The following are deprecated as public interfaces
+   // but are available for compatibility with earlier versions.
+   allocator_type BOOST_REGEX_CALL allocator()const;
+   const charT* BOOST_REGEX_CALL expression()const { return (this->error_code() ? 0 : _expression); }
+   unsigned int BOOST_REGEX_CALL set_expression(const charT* p, const charT* end, flag_type f = regbase::normal);
+   unsigned int BOOST_REGEX_CALL set_expression(const charT* p, flag_type f = regbase::normal) { return set_expression(p, p + traits_type::length(p), f); }
+   //
+   // this should be private but template friends don't work:
+   const traits_type& get_traits()const { return traits_inst; }
+   unsigned int BOOST_REGEX_CALL error_code()const
+   {
+      return error_code_;
+   }
+
+private:
+   traits_type traits_inst;
+   re_detail::raw_storage<Allocator> data;
+   unsigned _restart_type;
+   unsigned marks;
+   int repeats;
+   unsigned char* startmap;
+   std::size_t _expression_len;
+   std::size_t _leading_len;
+   const charT* _leading_string;
+   std::size_t _leading_string_len;
+   re_detail::kmp_info<charT>* pkmp;
+   unsigned error_code_;
+   charT* _expression;
+
+   void BOOST_REGEX_CALL compile_maps();
+   void BOOST_REGEX_CALL compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal = 0)const;
+   bool BOOST_REGEX_CALL probe_start(re_detail::re_syntax_base* node, charT c, re_detail::re_syntax_base* terminal)const;
+   bool BOOST_REGEX_CALL probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const;
+   void BOOST_REGEX_CALL fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces);
+   void BOOST_REGEX_CALL move_offsets(re_detail::re_syntax_base* j, unsigned size);
+   re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set(const charT*& first, const charT* last);
+   re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_narrow_type&);
+   re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_wide_type&);
+   re_detail::re_syntax_base* BOOST_REGEX_CALL compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot = false);
+   unsigned int BOOST_REGEX_CALL parse_inner_set(const charT*& first, const charT* last);
+
+   re_detail::re_syntax_base* BOOST_REGEX_CALL add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size = sizeof(re_detail::re_syntax_base));
+   re_detail::re_syntax_base* BOOST_REGEX_CALL add_literal(re_detail::re_syntax_base* dat, charT c);
+   charT BOOST_REGEX_CALL parse_escape(const charT*& first, const charT* last);
+   void BOOST_REGEX_CALL parse_range(const charT*& first, const charT* last, unsigned& min, unsigned& max);
+   bool BOOST_REGEX_CALL skip_space(const charT*& first, const charT* last);
+   unsigned int BOOST_REGEX_CALL probe_restart(re_detail::re_syntax_base* dat);
+   unsigned int BOOST_REGEX_CALL fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end);
+   void BOOST_REGEX_CALL fail(unsigned int err);
+
+protected:
+   static int BOOST_REGEX_CALL repeat_count(const reg_expression& e)
+   { return e.repeats; }
+   static unsigned int BOOST_REGEX_CALL restart_type(const reg_expression& e)
+   { return e._restart_type; }
+   static const re_detail::re_syntax_base* BOOST_REGEX_CALL first(const reg_expression& e)
+   { return (const re_detail::re_syntax_base*)e.data.data(); }
+   static const unsigned char* BOOST_REGEX_CALL get_map(const reg_expression& e)
+   { return e.startmap; }
+   static std::size_t BOOST_REGEX_CALL leading_length(const reg_expression& e)
+   { return e._leading_len; }
+   static const re_detail::kmp_info<charT>* get_kmp(const reg_expression& e)
+   { return e.pkmp; }
+   static bool BOOST_REGEX_CALL can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&);
+   static bool BOOST_REGEX_CALL can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&);
+};
+
+template <class charT, class traits, class Allocator>
+inline void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::swap(reg_expression& that)throw()
+{
+   // this is not as efficient as it should be,
+   // however swapping traits classes is problematic
+   // so just use 'brute force' method for now:
+   reg_expression<charT, traits, Allocator> e(that);
+   that = *this;
+   *this = e;
+}
+
+
+//
+// class match_results and match_results_base
+// handles what matched where
+
+template <class iterator>
+struct sub_match
+{
+   typedef typename re_detail::regex_iterator_traits<iterator>::value_type       value_type;
+#if defined(BOOST_NO_STD_ITERATOR_TRAITS) || defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+   typedef std::ptrdiff_t  difference_type;
+#else
+   typedef typename re_detail::regex_iterator_traits<iterator>::difference_type       difference_type;
+#endif
+   typedef iterator                                                  iterator_type;
+   
+   iterator first;
+   iterator second;
+   bool matched;
+
+   operator std::basic_string<value_type> ()const
+   {
+      std::basic_string<value_type> result;
+      std::size_t len = boost::re_detail::distance((iterator)first, (iterator)second);
+      result.reserve(len);
+      iterator i = first;
+      while(i != second)
+      {
+         result.append(1, *i);
+         ++i;
+      }
+      return result;
+   }
+   #ifdef BOOST_OLD_REGEX_H
+   //
+   // the following are deprecated, do not use!!
+   //
+   operator int()const;
+   operator unsigned int()const;
+   operator short()const
+   {
+      return (short)(int)(*this);
+   }
+   operator unsigned short()const
+   {
+      return (unsigned short)(unsigned int)(*this);
+   }
+   #endif
+   sub_match() { matched = false; }
+   sub_match(iterator i) : first(i), second(i), matched(false) {}
+
+   bool operator==(const sub_match& that)const
+   {
+      return (first == that.first) && (second == that.second) && (matched == that.matched);
+   }
+   bool BOOST_REGEX_CALL operator !=(const sub_match& that)const
+   { return !(*this == that); }
+
+   difference_type BOOST_REGEX_CALL length()const
+   {
+      difference_type n = boost::re_detail::distance((iterator)first, (iterator)second);
+      return n;
+   }
+};
+
+#ifdef BOOST_OLD_REGEX_H
+namespace re_detail{
+template <class iterator, class charT>
+int do_toi(iterator i, iterator j, char c, int radix)
+{
+   std::string s(i, j);
+   char* p;
+   int result = std::strtol(s.c_str(), &p, radix);
+#ifndef BOOST_NO_EXCEPTIONS
+   if(*p)throw bad_pattern("Bad sub-expression");
+#endif
+   BOOST_REGEX_NOEH_ASSERT(0 == *p)
+   return result;
+}
+
+//
+// helper:
+template <class I, class charT>
+int do_toi(I& i, I j, charT c)
+{
+   int result = 0;
+   while((i != j) && (isdigit(*i)))
+   {
+      result = result*10 + (*i - '0');
+      ++i;
+   }
+   return result;
+}
+}
+
+
+template <class iterator>
+sub_match<iterator>::operator int()const
+{
+   iterator i = first;
+   iterator j = second;
+#ifndef BOOST_NO_EXCEPTIONS
+   if(i == j)throw bad_pattern("Bad sub-expression");
+#endif
+   BOOST_REGEX_NOEH_ASSERT(i != j)
+   int neg = 1;
+   if((i != j) && (*i == '-'))
+   {
+      neg = -1;
+      ++i;
+   }
+   neg *= re_detail::do_toi(i, j, *i);
+#ifndef BOOST_NO_EXCEPTIONS
+   if(i != j)throw bad_pattern("Bad sub-expression");
+#endif
+   BOOST_REGEX_NOEH_ASSERT(i == j)
+   return neg;
+}
+template <class iterator>
+sub_match<iterator>::operator unsigned int()const
+{
+   iterator i = first;
+   iterator j = second;
+#ifndef BOOST_NO_EXCEPTIONS
+   if(i == j)
+      throw bad_pattern("Bad sub-expression");
+#endif
+   BOOST_REGEX_NOEH_ASSERT(i != j)
+   return re_detail::do_toi(i, j, *first);
+}
+#endif
+
+namespace re_detail{
+
+template <class iterator, class Allocator = BOOST_DEFAULT_ALLOCATOR(typename def_alloc_param_traits<iterator>::type) >
+class match_results_base
+{
+public:
+   typedef Allocator                                                 alloc_type;
+   typedef typename boost::detail::rebind_allocator<iterator, Allocator>::type  iterator_alloc;
+   typedef typename iterator_alloc::size_type                        size_type;
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+   typedef typename std::iterator_traits<iterator>::difference_type  difference_type;
+   typedef typename std::iterator_traits<iterator>::value_type       char_type;
+#else
+   typedef std::ptrdiff_t                                            difference_type;
+   typedef typename re_detail::regex_iterator_traits<iterator>::value_type char_type;
+#endif
+   typedef sub_match<iterator>                                       value_type;
+   typedef iterator                                                  iterator_type;
+
+protected:
+   typedef typename boost::detail::rebind_allocator<char, Allocator>::type c_alloc;
+   
+   struct c_reference : public c_alloc
+   {
+      std::size_t cmatches;
+      unsigned count;
+      sub_match<iterator> head, tail, null;
+      unsigned int lines;
+      iterator line_pos, base;
+      c_reference(const Allocator& a)
+         : c_alloc(a), cmatches(0), count(0), lines(0) {  }
+
+      bool operator==(const c_reference& that)const
+      {
+         return (cmatches == that.cmatches) &&
+                  (count == that.count) &&
+                  (head == that.head) &&
+                  (tail == that.tail) &&
+                  (lines == that.lines) &&
+                  (base == that.base);
+      }
+      bool operator!=(const c_reference& that)const
+      { return !(*this == that); }
+   };
+
+   c_reference* ref;
+
+   void BOOST_REGEX_CALL cow();
+
+   // protected contructor for derived class...
+   match_results_base(bool){}
+   void BOOST_REGEX_CALL m_free();
+
+public:
+
+   match_results_base(const Allocator& a = Allocator());
+
+   match_results_base(const match_results_base& m)
+   {
+      ref = m.ref;
+      ++(ref->count);
+   }
+
+   match_results_base& BOOST_REGEX_CALL operator=(const match_results_base& m);
+
+   ~match_results_base()
+   {
+      m_free();
+   }
+
+   size_type BOOST_REGEX_CALL size()const
+   {
+      //return (*this)[0].matched ? ref->cmatches : 0;
+      return ref->cmatches;
+   }
+
+   const sub_match<iterator>& BOOST_REGEX_CALL operator[](int n) const
+   {
+      if((n >= 0) && ((unsigned int)n < ref->cmatches))
+         return *(sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>)*n);
+      return (n == -1) ? ref->head : (n == -2) ? ref->tail : ref->null;
+   }
+
+   Allocator BOOST_REGEX_CALL allocator()const;
+
+   difference_type BOOST_REGEX_CALL length(unsigned int sub = 0)const
+   {
+      jm_assert(ref->cmatches);
+      const sub_match<iterator>& m = (*this)[sub];
+      if(m.matched == false)
+         return 0;
+      difference_type n = boost::re_detail::distance((iterator)m.first, (iterator)m.second);
+      return n;
+   }
+
+   std::basic_string<char_type> str(int i)const
+   {
+      return static_cast<std::basic_string<char_type> >((*this)[i]);
+   }
+
+   unsigned int BOOST_REGEX_CALL line()const
+   {
+      return ref->lines;
+   }
+
+   difference_type BOOST_REGEX_CALL position(unsigned int sub = 0)const
+   {
+      jm_assert(ref->cmatches);
+      const sub_match<iterator>& s = (*this)[sub];
+      if(s.matched == false)
+         return -1;
+      difference_type n = boost::re_detail::distance((iterator)(ref->base), (iterator)(s.first));
+      return n;
+   }
+
+   iterator BOOST_REGEX_CALL line_start()const
+   {
+      return ref->line_pos;
+   }
+
+   void swap(match_results_base& that)
+   {
+      c_reference* t = that.ref;
+      that.ref = ref;
+      ref = t;
+   }
+
+   bool operator==(const match_results_base& that)const;
+   bool operator<(const match_results_base& that)const
+   { return position() < that.position(); }
+
+   friend class match_results<iterator, Allocator>;
+
+   void BOOST_REGEX_CALL set_size(size_type n);
+   void BOOST_REGEX_CALL set_size(size_type n, iterator i, iterator j);
+   void BOOST_REGEX_CALL maybe_assign(const match_results_base& m);
+   void BOOST_REGEX_CALL init_fail(iterator i, iterator j);
+
+   void BOOST_REGEX_CALL set_first(iterator i);
+   void BOOST_REGEX_CALL set_first(iterator i, std::size_t pos);
+
+   void BOOST_REGEX_CALL set_second(iterator i)
+   {
+      cow();
+      ((sub_match<iterator>*)(ref+1))->second = i;
+      ((sub_match<iterator>*)(ref+1))->matched = true;
+      ref->tail.first = i;
+      ref->tail.matched = (ref->tail.first == ref->tail.second) ? false : true;
+   }
+
+   void BOOST_REGEX_CALL set_second(iterator i, std::size_t pos, bool m = true)
+   {
+      cow();
+      ((sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>) * pos))->second = i;
+      ((sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>) * pos))->matched = m;
+      if(pos == 0)
+      {
+         ref->tail.first = i;
+         ref->tail.matched = (ref->tail.first == ref->tail.second) ? false : true;
+      }
+   }
+
+   void BOOST_REGEX_CALL set_line(unsigned int i, iterator pos)
+   {
+      ref->lines = i;
+      ref->line_pos = pos;
+   }
+
+   void BOOST_REGEX_CALL set_base(iterator pos)
+   {
+      ref->base = pos;
+   }
+};
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i)
+{
+   cow();
+   ref->head.second = i;
+   ref->head.matched = (ref->head.first == ref->head.second) ? false : true;
+   sub_match<iterator>* p1 = (sub_match<iterator>*)(ref+1);
+   sub_match<iterator>* p2 = p1 + ref->cmatches;
+   p1->first = i;
+   p1->matched = false;
+   ++p1;
+   while(p1 != p2)
+   {
+      p1->matched = false;
+      p1->first = ref->tail.second;
+      p1->second = ref->tail.second;
+      ++p1;
+   }
+}
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i, std::size_t pos)
+{
+   cow();
+   ((sub_match<iterator>*)((char*)ref + sizeof(c_reference) + sizeof(sub_match<iterator>) * pos))->first = i;
+   if(pos == 0)
+   {
+      ref->head.second = i;
+      ref->head.matched = (ref->head.first == ref->head.second) ? false : true;
+      sub_match<iterator>* p1 = (sub_match<iterator>*)(ref+1);
+      sub_match<iterator>* p2 = p1 + ref->cmatches;
+      p1->first = i;
+      p1->matched = false;
+      ++p1;
+      while(p1 != p2)
+      {
+         p1->matched = false;
+         p1->first = ref->tail.second;
+         p1->second = ref->tail.second;
+         ++p1;
+      }
+   }
+}
+
+
+template <class iterator, class Allocator>
+match_results_base<iterator, Allocator>::match_results_base(const Allocator& a)
+{
+   ref = (c_reference*)c_alloc(a).allocate(sizeof(sub_match<iterator>) + sizeof(c_reference));
+   BOOST_REGEX_NOEH_ASSERT(ref)
+#ifndef BOOST_NO_EXCEPTIONS
+   try
+   {
+#endif
+      new (ref) c_reference(a);
+      ref->cmatches = 1;
+      ref->count = 1;
+      // construct the sub_match<iterator>:
+#ifndef BOOST_NO_EXCEPTIONS
+      try
+      {
+#endif
+         new ((sub_match<iterator>*)(ref+1)) sub_match<iterator>();
+#ifndef BOOST_NO_EXCEPTIONS
+      }
+      catch(...)
+      {
+         ::boost::re_detail::pointer_destroy(ref);
+         throw;
+      }
+   }
+   catch(...)
+   {
+      c_alloc(a).deallocate((char*)(void*)ref, sizeof(sub_match<iterator>) + sizeof(c_reference));
+      throw;
+   }
+#endif
+}
+
+template <class iterator, class Allocator>
+Allocator BOOST_REGEX_CALL match_results_base<iterator, Allocator>::allocator()const
+{
+  return *((c_alloc*)ref);
+}
+
+template <class iterator, class Allocator>
+inline match_results_base<iterator, Allocator>& BOOST_REGEX_CALL match_results_base<iterator, Allocator>::operator=(const match_results_base<iterator, Allocator>& m)
+{
+   if(ref != m.ref)
+   {
+      m_free();
+      ref = m.ref;
+      ++(ref->count);
+   }
+   return *this;
+}
+
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::m_free()
+{
+   if(--(ref->count) == 0)
+   {
+      c_alloc a(*ref);
+      sub_match<iterator>* p1, *p2;
+      p1 = (sub_match<iterator>*)(ref+1);
+      p2 = p1 + ref->cmatches;
+      while(p1 != p2)
+      {
+         ::boost::re_detail::pointer_destroy(p1);
+         ++p1;
+      }
+      ::boost::re_detail::pointer_destroy(ref);
+      a.deallocate((char*)(void*)ref, sizeof(sub_match<iterator>) * ref->cmatches + sizeof(c_reference));
+   }
+}
+
+template <class iterator, class Allocator>
+bool match_results_base<iterator, Allocator>::operator==(const match_results_base<iterator, Allocator>& that)const
+{
+   if(*ref != *(that.ref))
+      return false;
+   const sub_match<iterator>* p1 = (sub_match<iterator>*)(ref+1);
+   const sub_match<iterator>* p2 = p1 + ref->cmatches;
+   const sub_match<iterator>* p3 = (sub_match<iterator>*)(that.ref+1);
+   while(p1 != p2)
+   {
+      if(*p1 != *p3)
+         return false;
+      ++p1;
+      ++p3;
+   }
+   return true;
+}
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n)
+{
+   if(ref->cmatches != n)
+   {
+      c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match<iterator>) * n + sizeof(c_reference));
+      BOOST_REGEX_NOEH_ASSERT(newref)
+#ifndef BOOST_NO_EXCEPTIONS
+      try
+      {
+#endif
+         new (newref) c_reference(*ref);
+         newref->count = 1;
+         newref->cmatches = n;
+         sub_match<iterator>* p1, *p2;
+         p1 = (sub_match<iterator>*)(newref+1);
+         p2 = p1 + newref->cmatches;
+#ifndef BOOST_NO_EXCEPTIONS
+         try
+         {
+#endif
+            while(p1 != p2)
+            {
+               new (p1) sub_match<iterator>();
+               ++p1;
+            }
+            m_free();
+#ifndef BOOST_NO_EXCEPTIONS
+         }
+         catch(...)
+         {
+            p2 = (sub_match<iterator>*)(newref+1);
+            while(p2 != p1)
+            {
+               ::boost::re_detail::pointer_destroy(p2);
+               ++p2;
+            }
+            ::boost::re_detail::pointer_destroy(ref);
+            throw;
+         }
+#endif
+         ref = newref;
+#ifndef BOOST_NO_EXCEPTIONS
+      }
+      catch(...)
+      {
+         ref->deallocate((char*)(void*)newref, sizeof(sub_match<iterator>) * n + sizeof(c_reference));
+         throw;
+      }
+#endif
+   }
+}
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n, iterator i, iterator j)
+{
+   if(ref->cmatches != n)
+   {
+      c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match<iterator>) * n + sizeof(c_reference));
+      BOOST_REGEX_NOEH_ASSERT(newref)
+#ifndef BOOST_NO_EXCEPTIONS
+      try{
+#endif
+         new (newref) c_reference(*ref);
+         newref->count = 1;
+         newref->cmatches = n;
+         sub_match<iterator>* p1 = (sub_match<iterator>*)(newref+1);
+         sub_match<iterator>* p2 = p1 + newref->cmatches;
+#ifndef BOOST_NO_EXCEPTIONS
+         try
+         {
+#endif
+            while(p1 != p2)
+            {
+               new (p1) sub_match<iterator>(j);
+               ++p1;
+            }
+            m_free();
+#ifndef BOOST_NO_EXCEPTIONS
+         }
+         catch(...)
+         { 
+            p2 = (sub_match<iterator>*)(newref+1);
+            while(p2 != p1)
+            {
+               ::boost::re_detail::pointer_destroy(p2);
+               ++p2;
+            }
+            ::boost::re_detail::pointer_destroy(ref);
+            throw; 
+         }
+#endif
+         ref = newref;
+#ifndef BOOST_NO_EXCEPTIONS
+      }
+      catch(...)
+      { 
+         ref->deallocate((char*)(void*)newref, sizeof(sub_match<iterator>) * n + sizeof(c_reference)); 
+         throw; 
+      }
+#endif
+   }
+   else
+   {
+      cow();
+      // set iterators to be i, matched to false:
+      sub_match<iterator>* p1, *p2;
+      p1 = (sub_match<iterator>*)(ref+1);
+      p2 = p1 + ref->cmatches;
+      while(p1 != p2)
+      {
+         p1->first = j;
+         p1->second = j;
+         p1->matched = false;
+         ++p1;
+      }                                 
+   }
+   ref->head.first = i;
+   ref->tail.second = j;
+   ref->head.matched = ref->tail.matched = true;
+   ref->null.first = ref->null.second = j;
+   ref->null.matched = false;
+}
+
+template <class iterator, class Allocator>
+inline void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::init_fail(iterator i, iterator j)
+{
+   set_size(ref->cmatches, i, j);
+}
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::maybe_assign(const match_results_base<iterator, Allocator>& m)
+{
+   sub_match<iterator>* p1, *p2;
+   p1 = (sub_match<iterator>*)(ref+1);
+   p2 = (sub_match<iterator>*)(m.ref+1);
+   iterator base = (*this)[-1].first;
+   std::size_t len1 = 0;
+   std::size_t len2 = 0;
+   std::size_t base1 = 0;
+   std::size_t base2 = 0;
+   std::size_t i;
+   for(i = 0; i < ref->cmatches; ++i)
+   {
+      //
+      // leftmost takes priority over longest:
+      base1 = boost::re_detail::distance(base, p1->first);
+      base2 = boost::re_detail::distance(base, p2->first);
+      if(base1 < base2) return;
+      if(base2 < base1) break;
+
+      len1 = boost::re_detail::distance(p1->first, p1->second);
+      len2 = boost::re_detail::distance(p2->first, p2->second);
+      if((len1 != len2) || ((p1->matched == false) && (p2->matched == true)))
+         break;
+      if((p1->matched == true) && (p2->matched == false))
+         return;
+      ++p1;
+      ++p2;
+   }
+   if(i == ref->cmatches)
+      return;
+   if(base2 < base1)
+      *this = m;
+   else if((len2 > len1) || ((p1->matched == false) && (p2->matched == true)) )
+      *this = m;
+}
+
+template <class iterator, class Allocator>
+void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::cow()
+{
+   if(ref->count > 1)
+   {
+      c_reference* newref = (c_reference*)ref->allocate(sizeof(sub_match<iterator>) * ref->cmatches + sizeof(c_reference));
+      BOOST_REGEX_NOEH_ASSERT(newref)
+#ifndef BOOST_NO_EXCEPTIONS
+      try{
+#endif
+         new (newref) c_reference(*ref);
+         newref->count = 1;
+         sub_match<iterator>* p1 = (sub_match<iterator>*)(newref+1);
+         sub_match<iterator>* p2 = p1 + newref->cmatches;
+         sub_match<iterator>* p3 = (sub_match<iterator>*)(ref+1);
+#ifndef BOOST_NO_EXCEPTIONS
+         try{
+#endif
+            while(p1 != p2)
+            {
+               new (p1) sub_match<iterator>(*p3);
+               ++p1;
+               ++p3;
+            }
+#ifndef BOOST_NO_EXCEPTIONS
+         }
+         catch(...)
+         { 
+            p2 = (sub_match<iterator>*)(newref+1);
+            while(p2 != p1)
+            {
+               ::boost::re_detail::pointer_destroy(p2);
+               ++p2;
+            }
+            ::boost::re_detail::pointer_destroy(ref);
+            throw; 
+         }
+#endif
+      --(ref->count);
+      ref = newref;
+#ifndef BOOST_NO_EXCEPTIONS
+      }
+      catch(...)
+      { 
+         ref->deallocate((char*)(void*)newref, sizeof(sub_match<iterator>) * ref->cmatches + sizeof(c_reference)); 
+         throw; 
+      }
+#endif
+   }
+}
+
+} // namespace re_detail
+
+//
+// class match_results
+// encapsulates match_results_base, does a deep copy rather than
+// reference counting to ensure thread safety when copying
+// other match_results instances
+
+template <class iterator, class Allocator>
+class match_results : public re_detail::match_results_base<iterator, Allocator>
+{
+   typedef re_detail::match_results_base<iterator, Allocator> base_type;
+public:
+
+   typedef typename base_type::alloc_type          alloc_type;
+   typedef typename base_type::size_type           size_type;
+   typedef typename base_type::char_type           char_type;
+   typedef typename base_type::value_type          value_type;
+   typedef typename base_type::difference_type     difference_type;
+   typedef typename base_type::iterator_type       iterator_type;
+
+   explicit match_results(const Allocator& a = Allocator())
+      : re_detail::match_results_base<iterator, Allocator>(a){}
+
+   match_results(const re_detail::match_results_base<iterator, Allocator>& m)
+      : re_detail::match_results_base<iterator, Allocator>(m){}
+
+   match_results& operator=(const re_detail::match_results_base<iterator, Allocator>& m)
+   {
+      // shallow copy
+      base_type::operator=(m);
+      return *this;
+   }
+
+   match_results(const match_results& m);
+   match_results& operator=(const match_results& m);
+   //
+   // the following function definitions should *not* be required, except
+   // when this class is used as a template inside another template definition,
+   // in which members of the base class are not visible to the calling code.
+   // As a workaround we define simple forwarding functions:
+   //
+   size_type size()const
+   { return static_cast<const base_type*>(this)->size(); }
+
+   const sub_match<iterator>& operator[](int n) const
+   { return (*static_cast<const base_type*>(this))[n]; }
+
+   Allocator allocator()const
+   { return static_cast<const base_type*>(this)->allocator(); }
+
+   difference_type length(int sub = 0)const
+   { return static_cast<const base_type*>(this)->length(sub); }
+
+   difference_type position(unsigned int sub = 0)const
+   { return static_cast<const base_type*>(this)->position(sub); }
+
+   unsigned int line()const
+   { return static_cast<const base_type*>(this)->line(); }
+
+   iterator line_start()const
+   { return static_cast<const base_type*>(this)->line_start(); }
+
+   std::basic_string<char_type> str(int sub = 0)const
+   { return static_cast<const base_type*>(this)->str(sub); }
+
+   void swap(match_results& that)
+   { static_cast<base_type*>(this)->swap(that); }
+
+   bool operator==(const match_results& that)const
+   { return static_cast<const base_type&>(*this) == static_cast<const base_type&>(that); }
+
+   bool operator<(const match_results& that) const
+   { return position() < that.position(); }
+};
+
+template <class iterator, class Allocator>
+match_results<iterator, Allocator>::match_results(const match_results<iterator, Allocator>& m)
+   : re_detail::match_results_base<iterator, Allocator>(false)
+{
+   this->ref =
+      reinterpret_cast<typename re_detail::match_results_base<iterator, Allocator>::c_reference *>
+         (m.ref->allocate(sizeof(sub_match<iterator>) * m.ref->cmatches +
+                          sizeof(typename re_detail::match_results_base<iterator, Allocator>::c_reference)));
+   BOOST_REGEX_NOEH_ASSERT(this->ref)                       
+#ifndef BOOST_NO_EXCEPTIONS
+   try{
+#endif
+      new (this->ref) typename re_detail::match_results_base<iterator, Allocator>::c_reference(*m.ref);
+      this->ref->count = 1;
+      sub_match<iterator>* p1 = (sub_match<iterator>*)(this->ref+1);
+      sub_match<iterator>* p2 = p1 + this->ref->cmatches;
+      sub_match<iterator>* p3 = (sub_match<iterator>*)(m.ref+1);
+#ifndef BOOST_NO_EXCEPTIONS
+      try{
+#endif
+         while(p1 != p2)
+         {
+            new (p1) sub_match<iterator>(*p3);
+            ++p1;
+            ++p3;
+         }
+#ifndef BOOST_NO_EXCEPTIONS
+      }
+      catch(...)
+      { 
+         p2 = (sub_match<iterator>*)(this->ref+1);
+         while(p2 != p1)
+         {
+            re_detail::pointer_destroy(p2);
+            ++p2;
+         }
+         re_detail::pointer_destroy(this->ref);
+         throw; 
+      }
+   }
+   catch(...)
+   { 
+      m.ref->deallocate((char*)(void*)this->ref, sizeof(sub_match<iterator>) * m.ref->cmatches + sizeof(typename re_detail::match_results_base<iterator, Allocator>::c_reference));
+      throw; 
+   }
+#endif
+}
+
+template <class iterator, class Allocator>
+match_results<iterator, Allocator>& match_results<iterator, Allocator>::operator=(const match_results<iterator, Allocator>& m)
+{
+   match_results<iterator, Allocator> t(m);
+   this->swap(t);
+   return *this;
+}
+
+namespace re_detail{
+template <class iterator, class charT, class traits_type, class Allocator>
+iterator BOOST_REGEX_CALL re_is_set_member(iterator next, 
+                          iterator last, 
+                          const re_set_long* set_, 
+                          const reg_expression<charT, traits_type, Allocator>& e);
+} // namepsace re_detail
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#include <boost/regex/detail/regex_compile.hpp>
+
+//
+// template instances:
+//
+#define BOOST_REGEX_CHAR_T char
+#ifdef BOOST_REGEX_NARROW_INSTANTIATE
+#  define BOOST_REGEX_INSTANTIATE
+#endif
+#include <boost/regex/detail/instances.hpp>
+#undef BOOST_REGEX_CHAR_T
+#ifdef BOOST_REGEX_INSTANTIATE
+#  undef BOOST_REGEX_INSTANTIATE
+#endif
+
+#ifndef BOOST_NO_WREGEX
+#define BOOST_REGEX_CHAR_T wchar_t
+#ifdef BOOST_REGEX_WIDE_INSTANTIATE
+#  define BOOST_REGEX_INSTANTIATE
+#endif
+#include <boost/regex/detail/instances.hpp>
+#undef BOOST_REGEX_CHAR_T
+#ifdef BOOST_REGEX_INSTANTIATE
+#  undef BOOST_REGEX_INSTANTIATE
+#endif
+#endif
+
+
+namespace boost{
+#ifdef BOOST_REGEX_NO_FWD
+typedef reg_expression<char, regex_traits<char>, BOOST_DEFAULT_ALLOCATOR(char)> regex;
+#ifndef BOOST_NO_WREGEX
+typedef reg_expression<wchar_t, regex_traits<wchar_t>, BOOST_DEFAULT_ALLOCATOR(wchar_t)> wregex;
+#endif
+#endif
+
+typedef match_results<const char*> cmatch;
+typedef match_results<std::string::const_iterator> smatch;
+#ifndef BOOST_NO_WREGEX
+typedef match_results<const wchar_t*> wcmatch;
+typedef match_results<std::wstring::const_iterator> wsmatch;
+#endif
+
+} // namespace boost
+#include <boost/regex/detail/regex_match.hpp>
+#include <boost/regex/detail/regex_format.hpp>
+#include <boost/regex/detail/regex_split.hpp>
+
+
+#endif  // __cplusplus
+
+#endif  // include
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boost/boost/regex/config.hpp b/boost/boost/regex/config.hpp
new file mode 100644 (file)
index 0000000..581327e
--- /dev/null
@@ -0,0 +1,630 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         config.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: regex extended config setup.
+  */
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#define BOOST_REGEX_CONFIG_HPP
+//
+// Borland C++ Fix/error check
+// this has to go *before* we include any std lib headers:
+//
+#if defined(__BORLANDC__)
+#  if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551)
+      // problems with std::basic_string and dll RTL:
+#     if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE)
+#        ifdef BOOST_REGEX_BUILD_DLL
+#           error _RWSTD_COMPILE_INSTANTIATE must not be defined when building regex++ as a DLL
+#        else
+#           pragma message("Defining _RWSTD_COMPILE_INSTANTIATE when linking to the DLL version of the RTL may produce memory corruption problems in std::basic_string, as a result of separate versions of basic_string's static data in the RTL and you're exe/dll: be warned!!")
+#        endif
+#     endif
+#     ifndef _RTLDLL
+         // this is harmless for a staic link:
+#        define _RWSTD_COMPILE_INSTANTIATE
+#     endif
+#  endif
+#  if (__BORLANDC__ <= 0x540) && !defined(BOOST_REGEX_NO_LIB) && !defined(_NO_VCL)
+      // C++ Builder 4 and earlier, we can't tell whether we should be using
+      // the VCL runtime or not, do a static link instead:
+#     define BOOST_REGEX_STATIC_LINK
+#  endif
+   //
+   // VCL support:
+   // if we're building a console app then there can't be any VCL (can there?)
+#  if !defined(__CONSOLE__) && !defined(_NO_VCL)
+#     define BOOST_REGEX_USE_VCL
+#  endif
+#endif
+
+/*****************************************************************************
+ *
+ *  Include all the headers we need here:
+ *
+ ****************************************************************************/
+
+#ifdef __cplusplus
+
+#  ifndef BOOST_REGEX_USER_CONFIG
+#     define BOOST_REGEX_USER_CONFIG <boost/regex/user.hpp>
+#  endif
+
+#  include BOOST_REGEX_USER_CONFIG
+
+#  include <cstdlib>
+#  include <cstddef>
+#  include <cstring>
+#  include <cctype>
+#  include <cstdio>
+#  include <clocale>
+#  include <cassert>
+#  include <string>
+#  include <stdexcept>
+#  include <iterator>
+#  include <boost/config.hpp>
+#  include <boost/cstdint.hpp>
+#  include <boost/detail/allocator.hpp>
+#else
+   //
+   // C build,
+   // don't include <boost/config.hpp> because that may
+   // do C++ specific things in future...
+   //
+#  include <stdlib.h>
+#  include <stddef.h>
+#  ifdef _MSC_VER
+#     define BOOST_MSVC _MSC_VER
+#  endif
+#endif
+
+/*****************************************************************************
+ *
+ *  Boilerplate regex config options:
+ *
+ ****************************************************************************/
+
+/* Obsolete macro, use BOOST_VERSION instead: */
+#define BOOST_RE_VERSION 320
+
+// fix:
+#if defined(_UNICODE) && !defined(UNICODE)
+#define UNICODE
+#endif
+
+//
+// If there isn't good enough wide character support then there will
+// be no wide character regular expressions:
+//
+#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX)
+#  define BOOST_NO_WREGEX
+#else
+#  if defined(__sgi) && defined(__SGI_STL_PORT)
+      // STLPort on IRIX is misconfigured: <cwctype> does not compile
+      // as a temporary fix include <wctype.h> instead and prevent inclusion
+      // of STLPort version of <cwctype>
+#     include <wctype.h>
+#     define __STLPORT_CWCTYPE
+#     define _STLP_CWCTYPE
+#  endif
+
+#ifdef __cplusplus
+#  include <cwchar>
+#  include <cwctype>
+#endif
+
+#endif
+
+//
+// If Win32 support has been disabled for boost in general, then
+// it is for regex in particular:
+//
+#ifdef BOOST_DISABLE_WIN32
+#  define BOOST_REGEX_NO_W32
+#endif
+
+// some versions of gcc can't merge template instances:
+#if defined(__CYGWIN__)
+#  define BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE
+#endif
+
+// fix problems with bool as a macro,
+// this probably doesn't affect any current compilers:
+#if defined(bool) || defined(true) || defined(false)
+#  define BOOST_REGEX_NO_BOOL
+#endif
+
+// We don't make our templates external if the compiler
+// can't handle it:
+#if defined(BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS) || defined(__ICL) || defined(__ICC)\
+   && !defined(BOOST_MSVC) && !defined(__BORLANDC__)
+#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+#endif
+
+// disable our own file-iterators and mapfiles if we can't
+// support them:
+#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
+#  define BOOST_REGEX_NO_FILEITER
+#endif
+
+#ifdef __cplusplus
+#ifndef MB_CUR_MAX
+// yuk!
+// better make a conservative guess!
+#define MB_CUR_MAX 10
+#endif
+
+namespace boost{ namespace re_detail{
+#ifdef BOOST_NO_STD_DISTANCE
+template <class T>
+std::ptrdiff_t distance(const T& x, const T& y)
+{ return y - x; }
+#else
+using std::distance;
+#endif
+}}
+
+
+#ifdef BOOST_REGEX_NO_BOOL
+#  define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>((x) ? true : false)
+#else
+#  ifdef BOOST_MSVC
+      // warning suppression with VC6:
+#     pragma warning(disable: 4800)
+#  endif
+#  define BOOST_REGEX_MAKE_BOOL(x) static_cast<bool>(x)
+#endif
+#endif // __cplusplus
+
+// backwards compatibitity:
+#if defined(BOOST_RE_NO_LIB)
+#  define BOOST_REGEX_NO_LIB
+#endif
+
+#if defined(__GNUC__) && (defined(_WIN32) || defined(__CYGWIN__))
+// gcc on win32 has problems merging switch statements in templates:
+#  define BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE
+// gcc on win32 has problems if you include <windows.h>
+// (sporadically generates bad code).
+#  define BOOST_REGEX_USE_C_LOCALE
+#  define BOOST_REGEX_NO_W32
+#endif
+
+
+/*****************************************************************************
+ *
+ *  Set up dll import/export options:
+ *
+ ****************************************************************************/
+
+// backwards compatibility:
+#ifdef BOOST_RE_STATIC_LIB
+#  define BOOST_REGEX_STATIC_LINK
+#endif
+
+#if defined(BOOST_MSVC) && defined(_DLL)
+#  define BOOST_REGEX_HAS_DLL_RUNTIME
+#endif
+
+#if defined(__BORLANDC__) && defined(_RTLDLL)
+#  define BOOST_REGEX_HAS_DLL_RUNTIME
+#endif
+
+#if defined(__ICL) && defined(_DLL)
+#  define BOOST_REGEX_HAS_DLL_RUNTIME
+#endif
+
+#if defined(BOOST_REGEX_HAS_DLL_RUNTIME) && !defined(BOOST_REGEX_STATIC_LINK)
+#  if defined(BOOST_REGEX_SOURCE)
+#     define BOOST_REGEX_DECL __declspec(dllexport)
+#     define BOOST_REGEX_BUILD_DLL
+#  else
+#     define BOOST_REGEX_DECL __declspec(dllimport)
+#  endif
+#endif
+
+#ifndef BOOST_REGEX_DECL
+#  define BOOST_REGEX_DECL
+#endif
+#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE)
+#  include <boost/regex/detail/regex_library_include.hpp>
+#endif
+
+/*****************************************************************************
+ *
+ *  Set up function call type:
+ *
+ ****************************************************************************/
+
+#if defined(BOOST_MSVC) || defined(__ICL)
+#  if defined(_DEBUG)
+#     define BOOST_REGEX_CALL __cdecl
+#  else
+#     define BOOST_REGEX_CALL __fastcall
+#  endif
+#  define BOOST_REGEX_CCALL __stdcall
+#endif
+
+#if defined(__BORLANDC__)
+#  define BOOST_REGEX_CALL __fastcall
+#  define BOOST_REGEX_CCALL __stdcall
+#endif
+
+#ifndef BOOST_REGEX_CALL
+#  define BOOST_REGEX_CALL
+#endif
+#ifndef BOOST_REGEX_CCALL
+#define BOOST_REGEX_CCALL
+#endif
+
+/*****************************************************************************
+ *
+ *  Set up localisation model:
+ *
+ ****************************************************************************/
+
+// backwards compatibility:
+#ifdef BOOST_RE_LOCALE_C
+#  define BOOST_REGEX_USE_C_LOCALE
+#endif
+
+#ifdef BOOST_RE_LOCALE_CPP
+#  define BOOST_REGEX_USE_CPP_LOCALE
+#endif
+
+// Win32 defaults to native Win32 locale:
+#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
+#  define BOOST_REGEX_USE_WIN32_LOCALE
+#endif
+// otherwise use C locale:
+#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
+#  define BOOST_REGEX_USE_C_LOCALE
+#endif
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+#  include <windows.h>
+#endif
+
+#ifdef MAXPATH
+#  define BOOST_REGEX_MAX_PATH MAXPATH
+#elif defined(MAX_PATH)
+#  define BOOST_REGEX_MAX_PATH MAX_PATH
+#elif defined(FILENAME_MAX)
+#  define BOOST_REGEX_MAX_PATH FILENAME_MAX
+#else
+#  define BOOST_REGEX_MAX_PATH 200
+#endif
+
+
+
+/*****************************************************************************
+ *
+ *  Error Handling for exception free compilers:
+ *
+ ****************************************************************************/
+
+#ifdef BOOST_NO_EXCEPTIONS
+//
+// If there are no exceptions then we must report critical-errors
+// the only way we know how; by terminating.
+//
+#ifdef __BORLANDC__
+// <cstdio> seems not to make stderr usable with Borland:
+#include <stdio.h>
+#endif
+#  define BOOST_REGEX_NOEH_ASSERT(x)\
+if(0 == (x))\
+{\
+   std::fprintf(stderr, "Error: critical regex++ failure in \"%s\"", #x);\
+   std::abort();\
+}
+#else
+//
+// With exceptions then error handling is taken care of and
+// there is no need for these checks:
+//
+#  define BOOST_REGEX_NOEH_ASSERT(x)
+#endif
+
+/*****************************************************************************
+ *
+ *  Debugging / tracing support:
+ *
+ ****************************************************************************/
+
+#if defined(BOOST_REGEX_DEBUG) && defined(__cplusplus)
+
+#  include <iostream>
+using std::cout;
+using std::cin;
+using std::cerr;
+using std::endl;
+using std::hex;
+using std::dec;
+
+#  ifndef jm_assert
+#     define jm_assert(x) assert(x)
+#  endif
+#  ifndef jm_trace
+#     define jm_trace(x) cerr << x << endl;
+#  endif
+#  ifndef jm_instrument
+#     define jm_instrument jm_trace(__FILE__<<"#"<<__LINE__)
+#  endif
+
+namespace boost{
+   namespace re_detail{
+class debug_guard
+{
+public:
+   char g1[32];
+   const char* pc;
+   char* pnc;
+   const char* file;
+   int line;
+   char g2[32];
+   debug_guard(const char* f, int l, const char* p1 = 0, char* p2 = 0);
+   ~debug_guard();
+};
+
+#  define BOOST_RE_GUARD_STACK boost::re_detail::debug_guard sg(__FILE__, __LINE__);
+#  define BOOST_RE_GUARD_GLOBAL(x) const char g1##x[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, }; char g2##x[32]; boost::debug_guard g3##x(__FILE__, __LINE__, g1##x, g2##x);
+
+   } // namespace re_detail
+} // namespace boost
+
+#else
+
+#  define jm_assert(x)
+#  define jm_trace(x)
+#  define BOOST_RE_GUARD_STACK
+#  define BOOST_RE_GUARD_GLOBAL(x)
+#  ifndef jm_instrument
+#     define jm_instrument
+#  endif
+#endif
+
+/*****************************************************************************
+ *
+ *  Fix broken compilers that wrongly #define some symbols:
+ *
+ ****************************************************************************/
+
+#ifdef __cplusplus
+
+#ifdef BOOST_NO_CTYPE_FUNCTIONS
+
+// Make functions out of the macros.
+// Use parentheses so the macros don't screw us up.
+inline int (isalpha)(int c) { return isalpha(c); }
+inline int (iscntrl)(int c) { return iscntrl(c); }
+inline int (isdigit)(int c) { return isdigit(c); }
+inline int (islower)(int c) { return islower(c); }
+inline int (ispunct)(int c) { return ispunct(c); }
+inline int (isspace)(int c) { return isspace(c); }
+inline int (isupper)(int c) { return isupper(c); }
+inline int (isxdigit)(int c) { return isxdigit(c); }
+
+#endif
+
+// the following may be defined as macros; this is
+// incompatable with std::something syntax, we have
+// no choice but to undef them?
+
+#ifdef memcpy
+#undef memcpy
+#endif
+#ifdef memmove
+#undef memmove
+#endif
+#ifdef memset
+#undef memset
+#endif
+#ifdef sprintf
+#undef sprintf
+#endif
+#ifdef strcat
+#undef strcat
+#endif
+#ifdef strcmp
+#undef strcmp
+#endif
+#ifdef strcpy
+#undef strcpy
+#endif
+#ifdef strlen
+#undef strlen
+#endif
+#ifdef swprintf
+#undef swprintf
+#endif
+#ifdef wcslen
+#undef wcslen
+#endif
+#ifdef wcscpy
+#undef wcscpy
+#endif
+#ifdef wcscmp
+#undef wcscmp
+#endif
+#ifdef isalpha
+#undef isalpha
+#endif
+#ifdef iscntrl
+#undef iscntrl
+#endif
+#ifdef isdigit
+#undef isdigit
+#endif
+#ifdef islower
+#undef islower
+#endif
+#ifdef isupper
+#undef isupper
+#endif
+#ifdef ispunct
+#undef ispunct
+#endif
+#ifdef isspace
+#undef isspace
+#endif
+#ifdef isxdigit
+#undef isxdigit
+#endif
+
+#ifdef tolower
+#undef tolower
+#endif
+#ifdef iswalpha
+#undef iswalpha
+#endif
+#ifdef iswcntrl
+#undef iswcntrl
+#endif
+#ifdef iswdigit
+#undef iswdigit
+#endif
+#ifdef iswlower
+#undef iswlower
+#endif
+#ifdef iswpunct
+#undef iswpunct
+#endif
+#ifdef iswspace
+#undef iswspace
+#endif
+#ifdef iswupper
+#undef iswupper
+#endif
+#ifdef iswxdigit
+#undef iswxdigit
+#endif
+#ifdef towlower
+#undef towlower
+#endif
+#ifdef wcsxfrm
+#undef wcsxfrm
+#endif
+
+#endif
+
+/*****************************************************************************
+ *
+ *  Fix broken broken namespace support:
+ *
+ ****************************************************************************/
+
+#if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
+
+namespace std{
+   using ::ptrdiff_t;
+   using ::size_t;
+   using ::memcpy;
+   using ::memmove;
+   using ::memset;
+   using ::memcmp;
+   using ::sprintf;
+   using ::strcat;
+   using ::strcmp;
+   using ::strcpy;
+   using ::strlen;
+   using ::strxfrm;
+   using ::isalpha;
+   using ::iscntrl;
+   using ::isdigit;
+   using ::islower;
+   using ::isupper;
+   using ::ispunct;
+   using ::isspace;
+   using ::isxdigit;
+   using ::tolower;
+   using ::abs;
+   using ::setlocale;
+#  ifndef BOOST_NO_WREGEX
+#     ifndef BOOST_NO_SWPRINTF
+   using ::swprintf;
+#     endif
+   using ::wcslen;
+   using ::wcscpy;
+   using ::wcscmp;
+   using ::iswalpha;
+   using ::iswcntrl;
+   using ::iswdigit;
+   using ::iswlower;
+   using ::iswpunct;
+   using ::iswspace;
+   using ::iswupper;
+   using ::iswxdigit;
+   using ::towlower;
+   using ::wcsxfrm;
+   using ::wcstombs;
+   using ::mbstowcs;
+#     if !defined(BOOST_NO_STD_LOCALE) && !defined (__STL_NO_NATIVE_MBSTATE_T) && !defined(_STLP_NO_NATIVE_MBSTATE_T)
+   using ::mbstate_t;
+#     endif
+#  endif // BOOST_NO_WREGEX
+   using ::fseek;
+   using ::fread;
+   using ::ftell;
+   using ::fopen;
+   using ::fclose;
+   using ::FILE;
+#ifdef BOOST_NO_EXCEPTIONS
+   using ::fprintf;
+   using ::abort;
+#endif
+}
+
+#endif
+
+/*****************************************************************************
+ *
+ *  helper functions pointer_construct/pointer_destroy:
+ *
+ ****************************************************************************/
+
+#ifdef __cplusplus
+namespace boost{ namespace re_detail{
+
+#ifdef BOOST_MSVC
+#pragma warning (push)
+#pragma warning (disable : 4100)
+#endif
+
+template <class T>
+inline void pointer_destroy(T* p)
+{ p->~T(); (void)p; }
+
+#ifdef BOOST_MSVC
+#pragma warning (pop)
+#endif
+
+template <class T>
+inline void pointer_construct(T* p, const T& t)
+{ new (p) T(t); }
+
+}} // namespaces
+#endif
+
+#endif
+
+
+
+
diff --git a/boost/boost/regex/detail/fileiter.hpp b/boost/boost/regex/detail/fileiter.hpp
new file mode 100644 (file)
index 0000000..90d082a
--- /dev/null
@@ -0,0 +1,453 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         fileiter.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Declares various platform independent file and
+  *                directory iterators, plus binary file input in
+  *                the form of class map_file.
+  */
+
+#ifndef BOOST_RE_FILEITER_HPP
+#define BOOST_RE_FILEITER_HPP
+
+#include <boost/regex/config.hpp>
+
+#ifndef BOOST_REGEX_NO_FILEITER
+
+#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(BOOST_REGEX_NO_W32)
+#error "Sorry, can't mix <windows.h> with STL code and gcc compiler: if you ran configure, try again with configure --disable-ms-windows"
+#define BOOST_REGEX_FI_WIN32_MAP
+#define BOOST_REGEX_FI_POSIX_DIR
+#elif (defined(__WIN32__) || defined(_WIN32) || defined(WIN32)) && !defined(BOOST_REGEX_NO_W32)
+#define BOOST_REGEX_FI_WIN32_MAP
+#define BOOST_REGEX_FI_WIN32_DIR
+#else
+#define BOOST_REGEX_FI_POSIX_MAP
+#define BOOST_REGEX_FI_POSIX_DIR
+#endif
+
+#if defined(BOOST_REGEX_FI_WIN32_MAP)||defined(BOOST_REGEX_FI_WIN32_DIR)
+#include <windows.h>
+#endif
+
+#if defined(BOOST_REGEX_FI_WIN32_DIR)
+
+namespace boost{
+   namespace re_detail{
+
+typedef WIN32_FIND_DATAA _fi_find_data;
+typedef HANDLE _fi_find_handle;
+
+   } // namespace re_detail
+
+} // namespace boost
+
+#define _fi_invalid_handle INVALID_HANDLE_VALUE
+#define _fi_dir FILE_ATTRIBUTE_DIRECTORY
+
+#elif defined(BOOST_REGEX_FI_POSIX_DIR)
+
+#include <cstdio>
+#include <cctype>
+#include <iterator>
+#include <list>
+#include <cassert>
+#include <dirent.h>
+
+#if defined(__SUNPRO_CC)
+using std::list;
+#endif
+
+#ifndef MAX_PATH
+#define MAX_PATH 256
+#endif
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+    #pragma option push -a4 -b -Ve -pc
+#endif
+
+struct _fi_find_data
+{
+   unsigned dwFileAttributes;
+   char cFileName[MAX_PATH];
+};
+
+struct _fi_priv_data;
+
+typedef _fi_priv_data* _fi_find_handle;
+#define _fi_invalid_handle 0
+#define _fi_dir 1
+
+_fi_find_handle _fi_FindFirstFile(const char* lpFileName, _fi_find_data* lpFindFileData);
+bool _fi_FindNextFile(_fi_find_handle hFindFile,   _fi_find_data* lpFindFileData);
+bool _fi_FindClose(_fi_find_handle hFindFile);
+
+#ifdef __BORLANDC__
+ #if __BORLANDC__ > 0x520
+  #pragma option pop
+ #endif
+#endif
+
+   } // namespace re_detail
+} // namespace boost
+
+#ifdef FindFirstFile
+ #undef FindFirstFile
+#endif
+#ifdef FindNextFile
+ #undef FindNextFile
+#endif
+#ifdef FindClose
+ #undef FindClose
+#endif
+
+#define FindFirstFileA _fi_FindFirstFile
+#define FindNextFileA _fi_FindNextFile
+#define FindClose _fi_FindClose
+
+#endif
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #if __BORLANDC__ == 0x530
+    #pragma option push -a4 -b
+   #elif __BORLANDC__ > 0x530
+    #pragma option push -a8 -b
+   #endif
+#endif
+
+#ifdef BOOST_REGEX_FI_WIN32_MAP // win32 mapfile
+
+class BOOST_REGEX_DECL mapfile
+{
+   HANDLE hfile;
+   HANDLE hmap;
+   const char* _first;
+   const char* _last;
+public:
+
+   typedef const char* iterator;
+
+   mapfile(){ hfile = hmap = 0; _first = _last = 0; }
+   mapfile(const char* file){ hfile = hmap = 0; _first = _last = 0; open(file); }
+   ~mapfile(){ close(); }
+   void open(const char* file);
+   void close();
+   const char* begin(){ return _first; }
+   const char* end(){ return _last; }
+   size_t size(){ return _last - _first; }
+   bool valid(){ return (hfile != 0) && (hfile != INVALID_HANDLE_VALUE); }
+};
+
+
+#else
+
+class BOOST_REGEX_DECL mapfile_iterator;
+
+class BOOST_REGEX_DECL mapfile
+{
+   typedef char* pointer;
+   std::FILE* hfile;
+   long int _size;
+   pointer* _first;
+   pointer* _last;
+   mutable std::list<pointer*> condemed;
+   enum sizes
+   {
+      buf_size = 4096
+   };
+   void lock(pointer* node)const;
+   void unlock(pointer* node)const;
+public:
+
+   typedef mapfile_iterator iterator;
+
+   mapfile(){ hfile = 0; _size = 0; _first = _last = 0; }
+   mapfile(const char* file){ hfile = 0; _size = 0; _first = _last = 0; open(file); }
+   ~mapfile(){ close(); }
+   void open(const char* file);
+   void close();
+   iterator begin()const;
+   iterator end()const;
+   unsigned long size()const{ return _size; }
+   bool valid()const{ return hfile != 0; }
+   friend class mapfile_iterator;
+};
+
+class BOOST_REGEX_DECL mapfile_iterator
+#if !defined(BOOST_NO_STD_ITERATOR) || defined(BOOST_MSVC_STD_ITERATOR)
+: public std::iterator<std::random_access_iterator_tag, char>
+#endif
+{
+   typedef mapfile::pointer internal_pointer;
+   internal_pointer* node;
+   const mapfile* file;
+   unsigned long offset;
+   long position()const
+   {
+      return file ? ((node - file->_first) * mapfile::buf_size + offset) : 0;
+   }
+   void position(long pos)
+   {
+      if(file)
+      {
+         node = file->_first + (pos / mapfile::buf_size);
+         offset = pos % mapfile::buf_size;
+      }
+   }
+public:
+   typedef std::ptrdiff_t                  difference_type;
+   typedef char                            value_type;
+   typedef const char*                     pointer;
+   typedef const char&                     reference;
+   typedef std::random_access_iterator_tag iterator_category;
+
+   mapfile_iterator() { node = 0; file = 0; offset = 0; }
+   mapfile_iterator(const mapfile* f, long position)
+   {
+      file = f;
+      node = f->_first + position / mapfile::buf_size;
+      offset = position % mapfile::buf_size;
+      if(file)
+         file->lock(node);
+   }
+   mapfile_iterator(const mapfile_iterator& i)
+   {
+      file = i.file;
+      node = i.node;
+      offset = i.offset;
+      if(file)
+         file->lock(node);
+   }
+   ~mapfile_iterator()
+   {
+      if(file && node)
+         file->unlock(node);
+   }
+   mapfile_iterator& operator = (const mapfile_iterator& i);
+   char operator* ()const
+   {
+      assert(node >= file->_first);
+      assert(node < file->_last);
+      return file ? *(*node + sizeof(int) + offset) : char(0);
+   }
+   char operator[] (long off)const
+   {
+      mapfile_iterator tmp(*this);
+      tmp += off;
+      return *tmp;
+   }
+   mapfile_iterator& operator++ ();
+   mapfile_iterator operator++ (int);
+   mapfile_iterator& operator-- ();
+   mapfile_iterator operator-- (int);
+
+   mapfile_iterator& operator += (long off)
+   {
+      position(position() + off);
+      return *this;
+   }
+   mapfile_iterator& operator -= (long off)
+   {
+      position(position() - off);
+      return *this;
+   }
+
+   friend inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset);
+   }
+
+   friend inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return !(i == j);
+   }
+
+   friend inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return i.position() < j.position();
+   }
+   friend inline bool operator>(const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return i.position() > j.position();
+   }
+   friend inline bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return i.position() <= j.position();
+   }
+   friend inline bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return i.position() >= j.position();
+   }
+
+   friend mapfile_iterator operator + (const mapfile_iterator& i, long off);
+   friend mapfile_iterator operator + (long off, const mapfile_iterator& i)
+   {
+      mapfile_iterator tmp(i);
+      return tmp += off;
+   }
+   friend mapfile_iterator operator - (const mapfile_iterator& i, long off);
+   friend inline long operator - (const mapfile_iterator& i, const mapfile_iterator& j)
+   {
+      return i.position() - j.position();
+   }
+};
+
+#endif
+
+// _fi_sep determines the directory separator, either '\\' or '/'
+BOOST_REGEX_DECL extern const char* _fi_sep;
+
+struct file_iterator_ref
+{
+   _fi_find_handle hf;
+   _fi_find_data _data;
+   long count;
+};
+
+
+class BOOST_REGEX_DECL file_iterator 
+{
+   char* _root;
+   char* _path;
+   char* ptr;
+   file_iterator_ref* ref;
+
+public:
+   typedef std::ptrdiff_t            difference_type;
+   typedef const char*               value_type;
+   typedef const char**              pointer;
+   typedef const char*&              reference;
+   typedef std::input_iterator_tag   iterator_category;
+
+   file_iterator();
+   file_iterator(const char* wild);
+   ~file_iterator();
+   file_iterator(const file_iterator&);
+   file_iterator& operator=(const file_iterator&);
+   const char* root()const { return _root; }
+   const char* path()const { return _path; }
+   const char* name()const { return ptr; }
+   _fi_find_data* data() { return &(ref->_data); }
+   void next();
+   file_iterator& operator++() { next(); return *this; }
+   file_iterator operator++(int);
+   const char* operator*() { return path(); }
+
+   friend inline bool operator == (const file_iterator& f1, const file_iterator& f2)
+   {
+      return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
+   }
+
+   friend inline bool operator != (const file_iterator& f1, const file_iterator& f2)
+   {
+      return !(f1 == f2);
+   }
+
+};
+
+// dwa 9/13/00 - suppress unused parameter warning
+inline bool operator < (const file_iterator&, const file_iterator&)
+{
+   return false;
+}
+
+
+class BOOST_REGEX_DECL directory_iterator
+{
+   char* _root;
+   char* _path;
+   char* ptr;
+   file_iterator_ref* ref;
+
+public:
+   typedef std::ptrdiff_t            difference_type;
+   typedef const char*               value_type;
+   typedef const char**              pointer;
+   typedef const char*&              reference;
+   typedef std::input_iterator_tag   iterator_category;
+
+   directory_iterator();
+   directory_iterator(const char* wild);
+   ~directory_iterator();
+   directory_iterator(const directory_iterator& other);
+   directory_iterator& operator=(const directory_iterator& other);
+
+   const char* root()const { return _root; }
+   const char* path()const { return _path; }
+   const char* name()const { return ptr; }
+   _fi_find_data* data() { return &(ref->_data); }
+   void next();
+   directory_iterator& operator++() { next(); return *this; }
+   directory_iterator operator++(int);
+   const char* operator*() { return path(); }
+
+   static const char* separator() { return _fi_sep; }
+
+   friend inline bool operator == (const directory_iterator& f1, const directory_iterator& f2)
+   {
+      return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
+   }
+
+
+   friend inline bool operator != (const directory_iterator& f1, const directory_iterator& f2)
+   {
+      return !(f1 == f2);
+   }
+
+   };
+
+inline bool operator < (const directory_iterator&, const directory_iterator&)
+{
+   return false;
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+
+} // namespace re_detail
+using boost::re_detail::directory_iterator;
+using boost::re_detail::file_iterator;
+using boost::re_detail::mapfile;
+} // namespace boost
+
+#endif     // BOOST_REGEX_NO_FILEITER
+#endif     // BOOST_RE_FILEITER_HPP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boost/boost/regex/detail/instances.hpp b/boost/boost/regex/detail/instances.hpp
new file mode 100644 (file)
index 0000000..4761844
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         instances.cpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Defines those template instances that are placed in the
+  *                library rather than in the users object files.
+  */
+
+#ifndef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+
+namespace boost{
+
+//
+// this header can be included multiple times, each time with
+// a different character type, BOOST_REGEX_CHAR_T must be defined
+// first:
+//
+#ifndef BOOST_REGEX_CHAR_T
+#  error "BOOST_REGEX_CHAR_T not defined"
+#endif
+
+//
+// what follows is compiler specific:
+//
+
+#ifdef __BORLANDC__
+
+#  ifndef BOOST_REGEX_INSTANTIATE
+#     pragma option push -Jgx
+#  endif
+
+template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
+template class BOOST_REGEX_DECL re_detail::match_results_base<BOOST_REGEX_CHAR_T const*>;
+template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>;
+template class BOOST_REGEX_DECL match_results<BOOST_REGEX_CHAR_T const*>;
+template class BOOST_REGEX_DECL match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>;
+
+
+#  ifndef BOOST_REGEX_INSTANTIATE
+#     pragma option pop
+#  endif
+
+#elif defined(BOOST_MSVC)
+
+#  ifndef BOOST_REGEX_INSTANTIATE
+#     define template extern template
+#  endif
+
+#pragma warning(push)
+#pragma warning(disable : 4251 4231 4660)
+
+//
+// these next two lines are deliberate: raw_storage is used only internally
+// by reg_expression it is not exported from the dll:
+//
+template class re_detail::raw_storage< BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >;
+template class BOOST_REGEX_DECL re_detail::raw_storage< BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) >;
+
+template class BOOST_REGEX_DECL regex_traits< BOOST_REGEX_CHAR_T >;
+template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >;
+template class BOOST_REGEX_DECL re_detail::match_results_base<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type)>;
+template class BOOST_REGEX_DECL re_detail::match_results_base<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type)>;
+template class BOOST_REGEX_DECL match_results<BOOST_REGEX_CHAR_T const*, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<BOOST_REGEX_CHAR_T const*>::type)>;
+template class BOOST_REGEX_DECL match_results<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator, BOOST_DEFAULT_ALLOCATOR(re_detail::def_alloc_param_traits<std::basic_string<BOOST_REGEX_CHAR_T>::const_iterator>::type)>;
+
+
+#pragma warning(pop)
+
+#  ifdef template
+#     undef template
+#  endif
+
+#elif !defined(BOOST_REGEX_HAS_DLL_RUNTIME)
+
+//
+// for each [member] function declare a full specialisation of that
+// [member] function, then instantiate it in one translation unit.
+// This is not guarenteed to work according to the standard, but in
+// practice it should work for all compilers (unless they use a realy
+// perverse name mangling convention).  Unfortunately this approach
+// does *not* work for Win32 style import/export, because that can
+// alter the class layout.
+//
+
+#  ifndef BOOST_REGEX_INSTANTIATE
+#     define template template<>
+#  endif
+
+template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)&);
+template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const BOOST_REGEX_CHAR_T* p, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f, const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)& a);
+template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const BOOST_REGEX_CHAR_T* p, size_type len, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f, const BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)&);
+template reg_expression<BOOST_REGEX_CHAR_T>::reg_expression(const reg_expression<BOOST_REGEX_CHAR_T>&);
+template reg_expression<BOOST_REGEX_CHAR_T>::~reg_expression();
+template reg_expression<BOOST_REGEX_CHAR_T>& BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::operator=(const reg_expression&);
+template BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::get_allocator()const;
+template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::operator==(const reg_expression<BOOST_REGEX_CHAR_T>&)const;
+template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::operator<(const reg_expression<BOOST_REGEX_CHAR_T>&)const;
+template BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T) BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::allocator()const;
+template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::set_expression(const BOOST_REGEX_CHAR_T* p, const BOOST_REGEX_CHAR_T* end, reg_expression<BOOST_REGEX_CHAR_T>::flag_type f);
+template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_maps();
+template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_map(re_detail::re_syntax_base* node, unsigned char* _map, unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const;
+template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::probe_start(re_detail::re_syntax_base* node, BOOST_REGEX_CHAR_T c, re_detail::re_syntax_base* terminal)const;
+template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const;
+template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces);
+template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::move_offsets(re_detail::re_syntax_base* j, unsigned size);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_aux(re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& singles, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack<boost::uint_fast32_t, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& classes, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& equivalents, bool isnot, const re_detail::_narrow_type&);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_aux(re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& singles, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& ranges, re_detail::jstack<boost::uint_fast32_t, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& classes, re_detail::jstack<reg_expression<BOOST_REGEX_CHAR_T>::traits_string_type, BOOST_DEFAULT_ALLOCATOR(BOOST_REGEX_CHAR_T)>& equivalents, bool isnot, const re_detail::_wide_type&);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot);
+template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::parse_inner_set(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size);
+template re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::add_literal(re_detail::re_syntax_base* dat, BOOST_REGEX_CHAR_T c);
+template BOOST_REGEX_CHAR_T BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::parse_escape(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
+template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::parse_range(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last, unsigned& min, unsigned& max);
+template bool BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::skip_space(const BOOST_REGEX_CHAR_T*& first, const BOOST_REGEX_CHAR_T* last);
+template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::probe_restart(re_detail::re_syntax_base* dat);
+template unsigned int BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end);
+template void BOOST_REGEX_CALL reg_expression<BOOST_REGEX_CHAR_T>::fail(unsigned int err);
+
+namespace re_detail{
+
+#define iterator const BOOST_REGEX_CHAR_T*
+#define Allocator match_results_base<iterator>::alloc_type
+#define size_type match_results_base<iterator>::size_type
+
+template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i);
+template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_first(iterator i, std::size_t pos);
+template match_results_base<iterator, Allocator>::match_results_base(const Allocator& a);
+template Allocator BOOST_REGEX_CALL match_results_base<iterator, Allocator>::allocator()const;
+template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::m_free();
+template bool match_results_base<iterator, Allocator>::operator==(const match_results_base<iterator, Allocator>& that)const;
+template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n);
+template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::set_size(size_type n, iterator i, iterator j);
+template void BOOST_REGEX_CALL match_results_base<iterator, Allocator>::cow();
+
+#undef iterator
+#undef Allocator
+#undef size_type
+
+} // namespace re_detail
+
+#  ifdef template
+#     undef template
+#  endif
+
+#endif
+
+} // namespace boost
+
+#endif // BOOST_REGEX_NO_EXTERNAL_TEMPLATES
diff --git a/boost/boost/regex/detail/regex_compile.hpp b/boost/boost/regex/detail/regex_compile.hpp
new file mode 100644 (file)
index 0000000..b88fbd3
--- /dev/null
@@ -0,0 +1,2081 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_compile.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Declares reg_expression<> member functions.  This is
+  *                an internal header file, do not include directly.
+  */
+
+#ifndef BOOST_REGEX_COMPILE_HPP
+#define BOOST_REGEX_COMPILE_HPP
+
+namespace boost{
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+   namespace re_detail{
+
+
+template <class traits>
+struct kmp_translator
+{
+   typedef typename traits::char_type char_type;
+   bool icase;
+   const traits* pt;
+   kmp_translator(bool c, traits* p) : icase(c), pt(p) {}
+   char_type operator()(char_type c)
+   {
+      return pt->translate(c, icase);
+   }
+};
+
+
+template <class charT, class traits_type, class Allocator>
+bool BOOST_REGEX_CALL re_maybe_set_member(charT c,
+                                 const re_set_long* set_,
+                                 const reg_expression<charT, traits_type, Allocator>& e)
+{
+   const charT* p = reinterpret_cast<const charT*>(set_+1);
+   bool icase = e.flags() & regbase::icase;
+   charT col = e.get_traits().translate(c, icase);
+   for(unsigned int i = 0; i < set_->csingles; ++i)
+   {
+      if(col == *p)
+         return set_->isnot ? false : true;
+
+      while(*p)++p;
+      ++p;     // skip null
+   }
+   return set_->isnot ? true : false;
+}
+
+} // namespace re_detail
+
+
+template <class charT, class traits, class Allocator>
+inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&)
+{
+   if((traits_size_type)(traits_uchar_type)c >= 256)
+      return true;
+   return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
+}
+
+template <class charT, class traits, class Allocator>
+inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&)
+{
+   return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const Allocator& a)
+    : regbase(), data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, flag_type f, const Allocator& a)
+    : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+   set_expression(p, f | regbase::use_except);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a)
+    : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+    set_expression(p1, p2, f | regbase::use_except);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a)
+    : data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+    set_expression(p, p + len, f | regbase::use_except);
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::reg_expression(const reg_expression<charT, traits, Allocator>& e)
+   : regbase(e), data(e.allocator()), pkmp(0), error_code_(REG_EMPTY), _expression(0)
+{
+   //
+   // we do a deep copy only if e is a valid expression, otherwise fail.
+   //
+   if(e.error_code() == 0)
+   {
+      const charT* pe = e.expression();
+      set_expression(pe, pe + e._expression_len, e.flags() | regbase::use_except);
+   }
+   else
+   {
+      _flags = e.flags() & ~(regbase::use_except);
+      fail(e.error_code());
+   }
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>::~reg_expression()
+{
+   if(pkmp)
+      re_detail::kmp_free(pkmp, data.allocator());
+}
+
+template <class charT, class traits, class Allocator>
+reg_expression<charT, traits, Allocator>& BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator=(const reg_expression<charT, traits, Allocator>& e)
+{
+   //
+   // we do a deep copy only if e is a valid expression, otherwise fail.
+   //
+   if(this == &e) return *this;
+   _flags = use_except;
+   fail(e.error_code());
+   if(error_code() == 0)
+      set_expression(e._expression, e._expression + e._expression_len, e.flags() | regbase::use_except);
+   return *this;
+}
+
+template <class charT, class traits, class Allocator>
+inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator==(const reg_expression<charT, traits, Allocator>& e)const
+{
+   return (_flags == e.flags())
+           && (_expression_len == e._expression_len)
+           && (std::memcmp(_expression, e._expression, _expression_len * sizeof(charT)) == 0);
+}
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator<(const reg_expression<charT, traits, Allocator>& e)const
+{
+   //
+   // we can't offer a diffinitive ordering, but we can be consistant:
+   if(_flags != e.flags()) return _flags < e.flags();
+   if(_expression_len != e._expression_len) return _expression_len < e._expression_len;
+   return std::memcmp(expression(), e.expression(), _expression_len);
+}
+
+template <class charT, class traits, class Allocator>
+Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::allocator()const
+{
+    return data.allocator();
+}
+
+template <class charT, class traits, class Allocator>
+Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::get_allocator()const
+{
+    return data.allocator();
+}
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_inner_set(const charT*& first, const charT* last)
+{
+   //
+   // we have an inner [...] construct
+   //
+   jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set);
+   const charT* base = first;
+   while( (first != last)
+      && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) != traits_type::syntax_close_set) )
+         ++first;
+   if(first == last)
+      return 0;
+   ++first;
+   if((first-base) < 5)
+      return 0;
+   if(*(base+1) != *(first-2))
+      return 0;
+   unsigned int result = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
+   if((result == traits_type::syntax_colon) && ((first-base) == 5))
+   {
+      return traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+2));
+   }
+   return ((result == traits_type::syntax_colon) || (result == traits_type::syntax_dot) || (result == traits_type::syntax_equal)) ? result : 0;
+}
+
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::skip_space(const charT*& first, const charT* last)
+{
+   //
+   // returns true if we get to last:
+   //
+   while((first != last) && (traits_inst.is_class(*first, traits_type::char_class_space) == true))
+   {
+      ++first;
+   }
+   return first == last;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* end, unsigned& min, unsigned& max)
+{
+   //
+   // we have {x} or {x,} or {x,y} NB no spaces inside braces
+   // anything else is illegal
+   // On input ptr points to "{"
+   //
+   ++ptr;
+   if(skip_space(ptr, end))
+   {
+      fail(REG_EBRACE);
+      return;
+   }
+   if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_digit)
+   {
+      fail(REG_BADBR);
+      return;
+   }
+   min = traits_inst.toi(ptr, end, 10);
+   if(skip_space(ptr, end))
+   {
+      fail(REG_EBRACE);
+      return;
+   }
+   if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_comma)
+   {
+      //we have a second interval:
+      ++ptr;
+      if(skip_space(ptr, end))
+      {
+         fail(REG_EBRACE);
+         return;
+      }
+      if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_digit)
+         max = traits_inst.toi(ptr, end, 10);
+      else
+         max = (unsigned)-1;
+   }
+   else
+      max = min;
+
+   // validate input:
+   if(skip_space(ptr, end))
+   {
+      fail(REG_EBRACE);
+      return;
+   }
+   if(max < min)
+   {
+      fail(REG_ERANGE);
+      return;
+   }
+   if(_flags & bk_braces)
+   {
+      if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_slash)
+      {
+         fail(REG_BADBR);
+         return;
+      }
+      else
+      {
+         // back\ is OK now check the }
+         ++ptr;
+         if((ptr == end) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace))
+         {
+            fail(REG_BADBR);
+            return;
+         }
+      }
+   }
+   else if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) != traits_type::syntax_close_brace)
+   {
+      fail(REG_BADBR);
+      return;
+   }
+}
+
+template <class charT, class traits, class Allocator>
+charT BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_escape(const charT*& first, const charT* last)
+{
+   charT c(*first);
+   traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*first;
+   // this is only used for the switch(), but cannot be folded in
+   // due to a bug in Comeau 4.2.44beta3
+   traits_size_type syntax = traits_inst.syntax_type(c_unsigned);
+   switch(syntax)
+   {
+   case traits_type::syntax_a:
+      c = '\a';
+      ++first;
+      break;
+   case traits_type::syntax_f:
+      c = '\f';
+      ++first;
+      break;
+   case traits_type::syntax_n:
+      c = '\n';
+      ++first;
+      break;
+   case traits_type::syntax_r:
+      c = '\r';
+      ++first;
+      break;
+   case traits_type::syntax_t:
+      c = '\t';
+      ++first;
+      break;
+   case traits_type::syntax_v:
+      c = '\v';
+      ++first;
+      break;
+   case traits_type::syntax_x:
+      ++first;
+      if(first == last)
+      {
+         fail(REG_EESCAPE);
+         break;
+      }
+      // maybe have \x{ddd}
+      if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) == traits_type::syntax_open_brace)
+      {
+         ++first;
+         if(first == last)
+         {
+            fail(REG_EESCAPE);
+            break;
+         }
+         if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false)
+         {
+            fail(REG_BADBR);
+            break;
+         }
+         c = (charT)traits_inst.toi(first, last, -16);
+         if((first == last) || (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*first)) != traits_type::syntax_close_brace))
+         {
+            fail(REG_BADBR);
+         }
+         ++first;
+         break;
+      }
+      else
+      {
+         if(traits_inst.is_class(*first, traits_type::char_class_xdigit) == false)
+         {
+            fail(REG_BADBR);
+            break;
+         }
+         c = (charT)traits_inst.toi(first, last, -16);
+      }
+      break;
+   case traits_type::syntax_c:
+      ++first;
+      if(first == last)
+      {
+         fail(REG_EESCAPE);
+         break;
+      }
+      if(((traits_uchar_type)(*first) < (traits_uchar_type)'@')
+            || ((traits_uchar_type)(*first) > (traits_uchar_type)127) )
+      {
+         fail(REG_EESCAPE);
+         return (charT)0;
+      }
+      c = (charT)((traits_uchar_type)(*first) - (traits_uchar_type)'@');
+      ++first;
+      break;
+   case traits_type::syntax_e:
+      c = (charT)27;
+      ++first;
+      break;
+   case traits_type::syntax_digit:
+      c = (charT)traits_inst.toi(first, last, -8);
+      break;
+   default:
+      //c = *first;
+      ++first;
+   }
+   return c;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_maps()
+{
+   re_detail::re_syntax_base* record = static_cast<re_detail::re_syntax_base*>(data.data());
+   // always compile the first _map:
+   std::memset(startmap, 0, 256);
+   record->can_be_null = 0;
+   compile_map(record, startmap, 0, re_detail::mask_all);
+
+   while(record->type != re_detail::syntax_element_match)
+   {
+      if((record->type == re_detail::syntax_element_alt) || (record->type == re_detail::syntax_element_rep))
+      {
+         std::memset(&(static_cast<re_detail::re_jump*>(record)->_map), 0, 256);
+         record->can_be_null = 0;
+         compile_map(record->next.p, static_cast<re_detail::re_jump*>(record)->_map, &(record->can_be_null), re_detail::mask_take, static_cast<re_detail::re_jump*>(record)->alt.p);
+         compile_map(static_cast<re_detail::re_jump*>(record)->alt.p, static_cast<re_detail::re_jump*>(record)->_map, &(record->can_be_null), re_detail::mask_skip);
+      }
+      else
+      {
+         record->can_be_null = 0;
+         compile_map(record, 0, &(record->can_be_null), re_detail::mask_all);
+      }
+      record = record->next.p;
+   }
+   record->can_be_null = re_detail::mask_all;
+}
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_start(
+                        re_detail::re_syntax_base* node, charT cc, re_detail::re_syntax_base* terminal) const
+{
+   unsigned int c;
+
+   switch(node->type)
+   {
+   case re_detail::syntax_element_startmark:
+      if(static_cast<const re_detail::re_brace*>(node)->index == -1)
+      {
+         return probe_start(node->next.p->next.p, cc, terminal)
+            && probe_start(static_cast<const re_detail::re_jump*>(node->next.p)->alt.p, cc, terminal);
+      }
+      // fall through:
+   case re_detail::syntax_element_endmark:
+   case re_detail::syntax_element_start_line:
+   case re_detail::syntax_element_word_boundary:
+   case re_detail::syntax_element_buffer_start:
+   case re_detail::syntax_element_restart_continue:
+      // doesn't tell us anything about the next character, so:
+      return probe_start(node->next.p, cc, terminal);
+   case re_detail::syntax_element_literal:
+      // only the first character of the literal can match:
+      // note these have already been translated:
+      if(*reinterpret_cast<charT*>(static_cast<re_detail::re_literal*>(node)+1) == traits_inst.translate(cc, (_flags & regbase::icase)))
+         return true;
+      return false;
+   case re_detail::syntax_element_end_line:
+      // next character (if there is one!) must be a newline:
+      if(traits_inst.is_separator(traits_inst.translate(cc, (_flags & regbase::icase))))
+         return true;
+      return false;
+   case re_detail::syntax_element_wild:
+      return true;
+   case re_detail::syntax_element_match:
+      return true;
+   case re_detail::syntax_element_within_word:
+   case re_detail::syntax_element_word_start:
+      return traits_inst.is_class(traits_inst.translate(cc, (_flags & regbase::icase)), traits_type::char_class_word);
+   case re_detail::syntax_element_word_end:
+      // what follows must not be a word character,
+      return traits_inst.is_class(traits_inst.translate(cc, (_flags & regbase::icase)), traits_type::char_class_word) ? false : true;
+   case re_detail::syntax_element_buffer_end:
+      // we can be null, nothing must follow,
+      // NB we assume that this is followed by
+      // re_detail::syntax_element_match, if its not then we can
+      // never match anything anyway!!
+      return false;
+   case re_detail::syntax_element_soft_buffer_end:
+      // we can be null, only newlines must follow,
+      // NB we assume that this is followed by
+      // re_detail::syntax_element_match, if its not then we can
+      // never match anything anyway!!
+      return traits_inst.is_separator(traits_inst.translate(cc, (_flags & regbase::icase)));
+   case re_detail::syntax_element_backref:
+      // there's no easy way to determine this
+      // which is not to say it can't be done!
+      // for now:
+      return true;
+   case re_detail::syntax_element_long_set:
+      // we can not be null,
+      // we need to add already translated values in the set
+      // to values in the _map
+      return re_detail::re_maybe_set_member(cc, static_cast<const re_detail::re_set_long*>(node), *this) || (re_detail::re_is_set_member(static_cast<const charT*>(&cc), static_cast<const charT*>(&cc+1), static_cast<re_detail::re_set_long*>(node), *this) != &cc);
+   case re_detail::syntax_element_set:
+      // set all the elements that are set in corresponding set:
+      c = (traits_size_type)(traits_uchar_type)traits_inst.translate(cc, (_flags & regbase::icase));
+      return static_cast<re_detail::re_set*>(node)->_map[c] != 0;
+   case re_detail::syntax_element_jump:
+      if(static_cast<re_detail::re_jump*>(node)->alt.p < node)
+      {
+         // backwards jump,
+         // caused only by end of repeat section, we'll treat this
+         // the same as a match, because the sub-expression has matched.
+         if(node->next.p == terminal)
+            return true; // null repeat - we can always take this
+         else
+         {
+            //
+            // take the jump, add in fix for the fact that if the
+            // repeat that we're jumping to has non-zero minimum count
+            // then we need to add in the possiblity that we could still
+            // skip that repeat.
+            re_detail::re_syntax_base* next = static_cast<re_detail::re_jump*>(node)->alt.p;
+            bool b = probe_start(next, cc, terminal);
+            if((next->type == re_detail::syntax_element_rep) && (static_cast<re_detail::re_repeat*>(next)->min != 0))
+            {
+               b = b || probe_start(static_cast<re_detail::re_jump*>(next)->alt.p, cc, terminal);
+            }
+            return b;
+         }
+      }
+      else
+         // take the jump and compile:
+         return probe_start(static_cast<re_detail::re_jump*>(node)->alt.p, cc, terminal);
+   case re_detail::syntax_element_alt:
+      // we need to take the OR of the two alternatives:
+      return probe_start(static_cast<re_detail::re_jump*>(node)->alt.p, cc, terminal) || probe_start(node->next.p, cc, terminal);
+   case re_detail::syntax_element_rep:
+      // we need to take the OR of the two alternatives
+      if(static_cast<re_detail::re_repeat*>(node)->min == 0)
+         return probe_start(node->next.p, cc, static_cast<re_detail::re_jump*>(node)->alt.p) || probe_start(static_cast<re_detail::re_jump*>(node)->alt.p, cc, terminal);
+      else
+         return probe_start(node->next.p, cc, static_cast<re_detail::re_jump*>(node)->alt.p);
+   case re_detail::syntax_element_combining:
+      return !traits_inst.is_combining(traits_inst.translate(cc, (_flags & regbase::icase)));
+   }
+   return false;
+}
+
+template <class charT, class traits, class Allocator>
+bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const
+{
+   switch(node->type)
+   {
+   case re_detail::syntax_element_startmark:
+   case re_detail::syntax_element_endmark:
+   case re_detail::syntax_element_start_line:
+   case re_detail::syntax_element_word_boundary:
+   case re_detail::syntax_element_buffer_start:
+   case re_detail::syntax_element_restart_continue:
+   case re_detail::syntax_element_end_line:
+   case re_detail::syntax_element_word_end:
+      // doesn't tell us anything about the next character, so:
+      return probe_start_null(node->next.p, terminal);
+   case re_detail::syntax_element_match:
+   case re_detail::syntax_element_buffer_end:
+   case re_detail::syntax_element_soft_buffer_end:
+   case re_detail::syntax_element_backref:
+      return true;
+   case re_detail::syntax_element_jump:
+      if(static_cast<re_detail::re_jump*>(node)->alt.p < node)
+      {
+         // backwards jump,
+         // caused only by end of repeat section, we'll treat this
+         // the same as a match, because the sub-expression has matched.
+         // this is only caused by NULL repeats as in "(a*)*" or "(\<)*"
+         // these are really nonsensence and make the matching code much
+         // harder, it would be nice to get rid of them altogether.
+         if(node->next.p == terminal)
+            return true;
+         else
+            return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal);
+      }
+      else
+         // take the jump and compile:
+         return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal);
+   case re_detail::syntax_element_alt:
+      // we need to take the OR of the two alternatives:
+      return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal) || probe_start_null(node->next.p, terminal);
+   case re_detail::syntax_element_rep:
+      // only need to consider skipping the repeat:
+      return probe_start_null(static_cast<re_detail::re_jump*>(node)->alt.p, terminal);
+   default:
+      break;
+   }
+   return false;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_map(
+                        re_detail::re_syntax_base* node, unsigned char* _map,
+                        unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const
+{
+   if(_map)
+   {
+      for(unsigned int i = 0; i < 256; ++i)
+      {
+         if(probe_start(node, (charT)i, terminal))
+            _map[i] |= mask;
+      }
+   }
+   if(pnull && probe_start_null(node, terminal))
+      *pnull |= mask;
+}
+  
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_detail::re_syntax_base* j, unsigned size)
+{
+   // move all offsets starting with j->link forward by size
+   // called after an insert:
+   j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i);
+   while(true)
+   {
+      switch(j->type)
+      {
+      case re_detail::syntax_element_rep:
+         static_cast<re_detail::re_jump*>(j)->alt.i += size;
+         j->next.i += size;
+         break;
+      case re_detail::syntax_element_jump:
+      case re_detail::syntax_element_alt:
+         static_cast<re_detail::re_jump*>(j)->alt.i += size;
+         j->next.i += size;
+         break;
+      default:
+         j->next.i += size;
+         break;
+      }
+      if(j->next.i == size)
+         break;
+      j = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + j->next.i);
+   }
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot)
+{
+   re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
+   re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
+   re_detail::jstack<boost::uint_fast32_t, Allocator> classes(64, data.allocator());
+   re_detail::jstack<traits_string_type, Allocator> equivalents(64, data.allocator());
+   classes.push(cls);
+   if(dat)
+   {
+      data.align();
+      dat->next.i = data.size();
+   }
+   return compile_set_aux(singles, ranges, classes, equivalents, isnot, re_detail::is_byte<charT>::width_type());
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set(const charT*& first, const charT* last)
+{
+   re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
+   re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
+   re_detail::jstack<boost::uint_fast32_t, Allocator> classes(64, data.allocator());
+   re_detail::jstack<traits_string_type, Allocator> equivalents(64, data.allocator());
+   bool has_digraphs = false;
+   jm_assert(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_open_set);
+   ++first;
+   bool started = false;
+   bool done = false;
+   bool isnot = false;
+
+   enum last_type
+   {
+      last_single,
+      last_none,
+      last_dash
+   };
+
+   unsigned l = last_none;
+   traits_string_type s;
+
+   while((first != last) && !done)
+   {
+      traits_size_type c = (traits_size_type)(traits_uchar_type)*first;
+      // this is only used for the switch(), but cannot be folded in
+      // due to a bug in Comeau 4.2.44beta3
+      traits_size_type syntax = traits_inst.syntax_type(c);
+      switch(syntax)
+      {
+      case traits_type::syntax_caret:
+         if(!started && !isnot)
+         {
+            isnot = true;
+         }
+         else
+         {
+            s = (charT)c;
+            goto char_set_literal;
+         }
+         break;
+      case traits_type::syntax_open_set:
+      {
+         if((_flags & char_classes) == 0)
+         {
+            s = (charT)c;
+            goto char_set_literal;
+         }
+         // check to see if we really have a class:
+         const charT* base = first;
+         // this is only used for the switch(), but cannot be folded in
+         // due to a bug in Comeau 4.2.44beta3
+    unsigned int inner_set = parse_inner_set(first, last);
+         switch(inner_set)
+         {
+         case traits_type::syntax_colon:
+            {
+               if(l == last_dash)
+               {
+                  fail(REG_ERANGE);
+                  return 0;
+               }
+               boost::uint_fast32_t id = traits_inst.lookup_classname(base+2, first-2);
+               if(_flags & regbase::icase)
+               {
+                  if((id == traits_type::char_class_upper) || (id == traits_type::char_class_lower))
+                  {
+                     id = traits_type::char_class_alpha;
+                  }
+               }
+               if(id == 0)
+               {
+                  fail(REG_ECTYPE);
+                  return 0;
+               }
+               classes.push(id);
+               started = true;
+               l = last_none;
+            }
+            break;
+         case traits_type::syntax_dot:
+            //
+            // we have a collating element [.collating-name.]
+            //
+            if(traits_inst.lookup_collatename(s, base+2, first-2))
+            {
+               --first;
+               if(s.size() > 1)
+                  has_digraphs = true;
+               if(s.size())goto char_set_literal;
+            }
+            fail(REG_ECOLLATE);
+            return 0;
+         case traits_type::syntax_equal:
+            //
+            // we have an equivalence class [=collating-name=]
+            //
+            if(traits_inst.lookup_collatename(s, base+2, first-2))
+            {
+               std::size_t len = s.size();
+               if(len)
+               {
+                  unsigned i = 0;
+                  while(i < len)
+                  {
+                     s[i] = traits_inst.translate(s[i], (_flags & regbase::icase));
+                     ++i;
+                  }
+                  traits_string_type s2;
+                  traits_inst.transform_primary(s2, s);
+                  equivalents.push(s2);
+                  started = true;
+                  l = last_none;
+                  break;
+               }
+            }
+            fail(REG_ECOLLATE);
+            return 0;
+         case traits_type::syntax_left_word:
+            if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set))
+            {
+               ++first;
+               return add_simple(0, re_detail::syntax_element_word_start);
+            }
+            fail(REG_EBRACK);
+            return 0;
+         case traits_type::syntax_right_word:
+            if((started == false) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set))
+            {
+               ++first;
+               return add_simple(0, re_detail::syntax_element_word_end);
+            }
+            fail(REG_EBRACK);
+            return 0;
+         default:
+            if(started == false)
+            {
+               unsigned int t = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*(base+1));
+               if((t != traits_type::syntax_colon) && (t != traits_type::syntax_dot) && (t != traits_type::syntax_equal))
+               {
+                  first = base;
+                  s = (charT)c;
+                  goto char_set_literal;
+               }
+            }
+            fail(REG_EBRACK);
+            return 0;
+         }
+         if(first == last)
+         {
+            fail(REG_EBRACK);
+            return 0;
+         }
+         continue;
+      }
+      case traits_type::syntax_close_set:
+         if(started == false)
+         {
+            s = (charT)c;
+            goto char_set_literal;
+         }
+         done = true;
+         break;
+      case traits_type::syntax_dash:
+         if(!started)
+         {
+            s = (charT)c;
+            goto char_set_literal;
+         }
+         ++first;
+         if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*first) == traits_type::syntax_close_set)
+         {
+            --first;
+            s = (charT)c;
+            goto char_set_literal;
+         }
+         if((singles.empty() == true) || (l != last_single))
+         {
+            fail(REG_ERANGE);
+            return 0;
+         }
+         ranges.push(singles.peek());
+         if(singles.peek().size() <= 1)  // leave digraphs and ligatures in place
+            singles.pop();
+         l = last_dash;
+         continue;
+      case traits_type::syntax_slash:
+         if(_flags & regbase::escape_in_lists)
+         {
+            ++first;
+            if(first == last)
+               continue;
+            traits_size_type c = (traits_size_type)(traits_uchar_type)*first;
+            // this is only used for the switch(), but cannot be folded in
+            // due to a bug in Comeau 4.2.44beta3
+            traits_size_type syntax = traits_inst.syntax_type(c);
+            switch(syntax)
+            {
+            case traits_type::syntax_w:
+               if(l == last_dash)
+               {
+                  fail(REG_ERANGE);
+                  return 0;
+               }
+               classes.push(traits_type::char_class_word);
+               started = true;
+               l = last_none;
+               ++first;
+               continue;
+            case traits_type::syntax_d:
+               if(l == last_dash)
+               {
+                  fail(REG_ERANGE);
+                  return 0;
+               }
+               classes.push(traits_type::char_class_digit);
+               started = true;
+               l = last_none;
+               ++first;
+               continue;
+            case traits_type::syntax_s:
+               if(l == last_dash)
+               {
+                  fail(REG_ERANGE);
+                  return 0;
+               }
+               classes.push(traits_type::char_class_space);
+               started = true;
+               l = last_none;
+               ++first;
+               continue;
+            case traits_type::syntax_l:
+               if(l == last_dash)
+               {
+                  fail(REG_ERANGE);
+                  return 0;
+               }
+               classes.push(traits_type::char_class_lower);
+               started = true;
+               l = last_none;
+               ++first;
+               continue;
+            case traits_type::syntax_u:
+               if(l == last_dash)
+               {
+                  fail(REG_ERANGE);
+                  return 0;
+               }
+               classes.push(traits_type::char_class_upper);
+               started = true;
+               l = last_none;
+               ++first;
+               continue;
+            case traits_type::syntax_W:
+            case traits_type::syntax_D:
+            case traits_type::syntax_S:
+            case traits_type::syntax_U:
+            case traits_type::syntax_L:
+               fail(REG_EESCAPE);
+               return 0;
+            default:
+               c = parse_escape(first, last);
+               --first;
+               s = (charT)c;
+               goto char_set_literal;
+            }
+         }
+         else
+         {
+            s = (charT)c;
+            goto char_set_literal;
+         }
+      default:
+         s = (charT)c;
+         char_set_literal:
+         unsigned i = 0;
+         // get string length to stop us going past the end of string (DWA)
+         std::size_t len = s.size();
+         while(i < len)
+         {
+            s[i] = traits_inst.translate(s[i], (_flags & regbase::icase));
+            ++i;
+         }
+         started = true;
+         if(l == last_dash)
+         {
+            ranges.push(s);
+            l = last_none;
+            if(s.size() > 1)   // add ligatures to singles list as well
+               singles.push(s);
+         }
+         else
+         {
+            singles.push(s);
+            l = last_single;
+         }
+      }
+      ++first;
+   }
+   if(!done)
+      return 0;
+
+   re_detail::re_syntax_base* result;
+   if(has_digraphs)
+      result = compile_set_aux(singles, ranges, classes, equivalents, isnot, re_detail::_wide_type());
+   else
+      result = compile_set_aux(singles, ranges, classes, equivalents, isnot, re_detail::is_byte<charT>::width_type());
+   #ifdef __BORLANDC__
+   // delayed throw:
+   if((result == 0) && (_flags & regbase::use_except))
+      fail(error_code());
+   #endif
+   return result;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_wide_type&)
+{
+   size_type base = data.size();
+   data.extend(sizeof(re_detail::re_set_long));
+   unsigned int csingles = 0;
+   unsigned int cranges = 0;
+   boost::uint_fast32_t cclasses = 0;
+   unsigned int cequivalents = 0;
+   bool nocollate_state = flags() & regbase::nocollate;
+
+   while(singles.empty() == false)
+   {
+      ++csingles;
+      const traits_string_type& s = singles.peek();
+      std::size_t len = (s.size() + 1) * sizeof(charT);
+      std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
+      singles.pop();
+   }
+   while(ranges.empty() == false)
+   {
+      traits_string_type c1, c2;
+      if(nocollate_state)
+         c1 = ranges.peek();
+      else
+         traits_inst.transform(c1, ranges.peek());
+      ranges.pop();
+      if(nocollate_state)
+         c2 = ranges.peek();
+      else
+         traits_inst.transform(c2, ranges.peek());
+      ranges.pop();
+      if(c1 < c2)
+      {
+         // for some reason bc5 crashes when throwing exceptions
+         // from here - probably an EH-compiler bug, but hard to
+         // be sure...
+         // delay throw to later:
+         #ifdef __BORLANDC__
+         boost::uint_fast32_t f = _flags;
+         _flags &= ~regbase::use_except;
+         #endif
+         fail(REG_ERANGE);
+         #ifdef __BORLANDC__
+         _flags = f;
+         #endif
+         return 0;
+      }
+      ++cranges;
+      std::size_t len = (re_detail::re_strlen(c1.c_str()) + 1) * sizeof(charT);
+      std::memcpy(data.extend(len), c1.c_str(), len);
+      len = (re_detail::re_strlen(c2.c_str()) + 1) * sizeof(charT);
+      std::memcpy(data.extend(len), c2.c_str(), len);
+   }
+   while(classes.empty() == false)
+   {
+      cclasses |= classes.peek();
+      classes.pop();
+   }
+   while(equivalents.empty() == false)
+   {
+      ++cequivalents;
+      const traits_string_type& s = equivalents.peek();
+      std::size_t len = (re_detail::re_strlen(s.c_str()) + 1) * sizeof(charT);
+      std::memcpy(reinterpret_cast<charT*>(data.extend(len)), s.c_str(), len);
+      equivalents.pop();
+   }
+
+   re_detail::re_set_long* dat = reinterpret_cast<re_detail::re_set_long*>(reinterpret_cast<unsigned char*>(data.data()) + base);
+   dat->type = re_detail::syntax_element_long_set;
+   dat->csingles = csingles;
+   dat->cranges = cranges;
+   dat->cclasses = cclasses;
+   dat->cequivalents = cequivalents;
+   dat->isnot = isnot;
+   dat->next.i = 0;
+   return dat;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_narrow_type&)
+{
+   re_detail::re_set* dat = reinterpret_cast<re_detail::re_set*>(data.extend(sizeof(re_detail::re_set)));
+   std::memset(dat, 0, sizeof(re_detail::re_set));
+
+   while(singles.empty() == false)
+   {
+      dat->_map[(traits_size_type)(traits_uchar_type)*(singles.peek().c_str())] = re_detail::mask_all;
+      singles.pop();
+   }
+   while(ranges.empty() == false)
+   {
+      traits_string_type c1, c2, c3, c4;
+
+      if(flags() & regbase::nocollate)
+         c1 = ranges.peek();
+      else
+         traits_inst.transform(c1, ranges.peek());
+      ranges.pop();
+      if(flags() & regbase::nocollate)
+         c2 = ranges.peek();
+      else
+         traits_inst.transform(c2, ranges.peek());
+      ranges.pop();
+
+      if(c1 < c2)
+      {
+         // for some reason bc5 crashes when throwing exceptions
+         // from here - probably an EH-compiler bug, but hard to
+         // be sure...
+         // delay throw to later:
+         #ifdef __BORLANDC__
+         boost::uint_fast32_t f = _flags;
+         _flags &= ~regbase::use_except;
+         #endif
+         fail(REG_ERANGE);
+         #ifdef __BORLANDC__
+         _flags = f;
+         #endif
+         return 0;
+      }
+      for(unsigned int i = 0; i < 256; ++i)
+      {
+         c4 = (charT)i;
+         if(flags() & regbase::nocollate)
+            c3 = c4;
+         else
+            traits_inst.transform(c3, c4);
+         if((c3 <= c1) && (c3 >= c2))
+            dat->_map[i] = re_detail::mask_all;
+      }
+   }
+   while(equivalents.empty() == false)
+   {
+      traits_string_type c1, c2;
+      for(unsigned int i = 0; i < 256; ++i)
+      {
+         c2 = (charT)i;
+         traits_inst.transform_primary(c1, c2);
+         if(c1 == equivalents.peek())
+            dat->_map[i] = re_detail::mask_all;
+      }
+      equivalents.pop();
+   }
+
+   boost::uint_fast32_t flags = 0;
+   while(classes.empty() == false)
+   {
+      flags |= classes.peek();
+      classes.pop();
+   }
+   if(flags)
+   {
+      for(unsigned int i = 0; i < 256; ++i)
+      {
+         if(traits_inst.is_class(charT(i), flags))
+            dat->_map[(traits_uchar_type)traits_inst.translate((charT)i, (_flags & regbase::icase))] = re_detail::mask_all;
+      }
+   }
+
+   if(isnot)
+   {
+      for(unsigned int i = 0; i < 256; ++i)
+      {
+         dat->_map[i] = !dat->_map[i];
+      }
+   }
+
+   dat->type = re_detail::syntax_element_set;
+   dat->next.i = 0;
+   return dat;
+}
+
+#ifndef __CODEGUARD__
+// this must not be inline when Borland's codeguard support is turned
+// on, otherwise we _will_ get surious codeguard errors...
+inline
+#endif
+ re_detail::re_syntax_base* add_offset(void* base, std::ptrdiff_t off)
+{
+   return reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(base) + off);
+}
+
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces)
+{
+   typedef typename boost::detail::rebind_allocator<bool, Allocator>::type b_alloc;
+   
+   register unsigned char* base = reinterpret_cast<unsigned char*>(b);
+   register re_detail::re_syntax_base* ptr = b;
+   bool* pb = 0;
+   b_alloc a(data.allocator());
+#ifndef BOOST_NO_EXCEPTIONS
+   try
+   {
+#endif
+      pb = a.allocate(cbraces);
+      BOOST_REGEX_NOEH_ASSERT(pb)
+      for(unsigned i = 0; i < cbraces; ++i)
+         pb[i] = false;
+
+      repeats = 0;
+
+      while(ptr->next.i)
+      {
+         switch(ptr->type)
+         {
+         case re_detail::syntax_element_rep:
+            jm_assert(data.size() > static_cast<re_detail::re_jump*>(ptr)->alt.i);
+            static_cast<re_detail::re_jump*>(ptr)->alt.p = add_offset(base, static_cast<re_detail::re_jump*>(ptr)->alt.i);
+#ifdef BOOST_REGEX_DEBUG
+            if((re_detail::padding_mask & reinterpret_cast<int>(static_cast<re_detail::re_jump*>(ptr)->alt.p)) && (static_cast<re_detail::re_jump*>(ptr)->alt.p != b))
+            {
+               jm_trace("padding mis-aligment in repeat jump to object type: " << static_cast<re_detail::re_jump*>(ptr)->alt.p->type)
+               //jm_assert(0 == (padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p));
+            }
+#endif
+            static_cast<re_detail::re_repeat*>(ptr)->id = repeats;
+            ++repeats;
+            goto rebase;
+         case re_detail::syntax_element_jump:
+         case re_detail::syntax_element_alt:
+            jm_assert(data.size() > static_cast<re_detail::re_jump*>(ptr)->alt.i);
+            static_cast<re_detail::re_jump*>(ptr)->alt.p = add_offset(base, static_cast<re_detail::re_jump*>(ptr)->alt.i);
+#ifdef BOOST_REGEX_DEBUG
+            if((re_detail::padding_mask & reinterpret_cast<int>(static_cast<re_detail::re_jump*>(ptr)->alt.p) && (static_cast<re_detail::re_jump*>(ptr)->alt.p != b)))
+            {
+               jm_trace("padding mis-aligment in alternation jump to object type: " << static_cast<re_detail::re_jump*>(ptr)->alt.p->type)
+               //jm_assert(0 == (padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p));
+            }
+#endif
+            goto rebase;
+         case re_detail::syntax_element_backref:
+            if((static_cast<re_detail::re_brace*>(ptr)->index >= (int)cbraces) || (pb[static_cast<re_detail::re_brace*>(ptr)->index] == false) )
+            {
+               fail(REG_ESUBREG);
+               a.deallocate(pb, cbraces);
+               return;
+            }
+            goto rebase;
+         case re_detail::syntax_element_endmark:
+            if(static_cast<re_detail::re_brace*>(ptr)->index > 0)
+               pb[static_cast<re_detail::re_brace*>(ptr)->index] = true;
+            goto rebase;
+         default:
+            rebase:
+            jm_assert(data.size() > ptr->next.i);
+            ptr->next.p = add_offset(base, ptr->next.i);
+#ifdef BOOST_REGEX_DEBUG
+            if((re_detail::padding_mask & (int)(ptr->next.p)) && (static_cast<re_detail::re_jump*>(ptr)->alt.p != b))
+            {
+               jm_trace("padding mis-alignment in next record of type " << ptr->next.p->type)
+               jm_assert(0 == (re_detail::padding_mask & (int)(ptr->next.p)));
+            }
+#endif
+            ptr = ptr->next.p;
+         }
+      }
+      a.deallocate(pb, cbraces);
+      pb = 0;
+#ifndef BOOST_NO_EXCEPTIONS
+   }
+   catch(...)
+   {
+      if(pb)
+         a.deallocate(pb, cbraces);
+      throw;
+   }
+#endif
+}
+
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expression(const charT* p, const charT* end, flag_type f)
+{
+   if(p == expression())
+   {
+      traits_string_type s(p, end);
+      return set_expression(s.c_str(), s.c_str() + s.size(), f);
+   }
+   typedef typename traits_type::sentry sentry_t;
+   sentry_t sent(traits_inst);
+   if(sent){
+
+   const charT* base = p;
+   data.clear();
+   _flags = f;
+   fail(REG_NOERROR);  // clear any error
+
+   if(p >= end)
+   {
+      fail(REG_EMPTY);
+      return error_code();
+   }
+
+   const charT* ptr = p;
+   marks = 0;
+   re_detail::jstack<std::size_t, Allocator> mark(64, data.allocator());
+   re_detail::jstack<int, Allocator> markid(64, data.allocator());
+   std::size_t last_mark_popped = 0;
+   register traits_size_type c;
+   register re_detail::re_syntax_base* dat;
+
+   unsigned rep_min = 0;
+   unsigned rep_max = 0;
+
+   //
+   // set up header:
+   //
+   ++marks;
+   dat = 0;
+
+   if(_flags & regbase::literal)
+   {
+      while(ptr != end)
+      {
+         dat = add_literal(dat, traits_inst.translate(*ptr, (_flags & regbase::icase)));
+         ++ptr;
+      }
+   }
+
+   while (ptr < end)
+   {
+      c = (traits_size_type)(traits_uchar_type)*ptr;
+      // this is only used for the switch(), but cannot be folded in
+      // due to a bug in Comeau 4.2.44beta3
+      traits_size_type syntax = traits_inst.syntax_type(c);
+      switch(syntax)
+      {
+      case traits_type::syntax_open_bracket:
+         if(_flags & bk_parens)
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+         open_bracked_jump:
+         // extend:
+         dat = add_simple(dat, re_detail::syntax_element_startmark, sizeof(re_detail::re_brace));
+         markid.push(marks);
+         static_cast<re_detail::re_brace*>(dat)->index = marks++;
+         mark.push(data.index(dat));
+         ++ptr;
+         //
+         // check for perl like (?...) extention syntax
+         c = (traits_size_type)(traits_uchar_type)*ptr;
+         if(((_flags & bk_parens) == 0) && (traits_type::syntax_question == traits_inst.syntax_type(c)))
+         {
+            ++ptr;
+            c = (traits_size_type)(traits_uchar_type)*ptr;
+            // this is only used for the switch(), but cannot be folded in
+            // due to a bug in Comeau 4.2.44beta3
+            traits_size_type syntax = traits_inst.syntax_type(c);
+            switch(syntax)
+            {
+            case traits_type::syntax_colon:
+               static_cast<re_detail::re_brace*>(dat)->index = 0;
+               --marks;
+               markid.pop();
+               markid.push(0);
+               ++ptr;
+               continue;
+            case traits_type::syntax_equal:
+               static_cast<re_detail::re_brace*>(dat)->index = -1;
+               markid.pop();
+               markid.push(-1);
+               common_forward_assert:
+               --marks;
+               ++ptr;
+               // extend:
+               dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
+               data.align();
+               //
+               // we don't know what value to put here yet,
+               // use an arbitrarily large value for now
+               // and check it later:
+               static_cast<re_detail::re_jump*>(dat)->alt.i = INT_MAX/2;
+               mark.push(data.size() - re_detail::re_jump_size);
+               continue;
+            case traits_type::syntax_not:
+               static_cast<re_detail::re_brace*>(dat)->index = -2;
+               markid.pop();
+               markid.push(-2);
+               goto common_forward_assert;
+            case traits_type::syntax_hash:
+               // comment just skip it:
+               static_cast<re_detail::re_brace*>(dat)->index = 0;
+               --marks;
+               markid.pop();
+               mark.pop();
+               do{
+                  ++ptr;
+                  c = (traits_size_type)(traits_uchar_type)*ptr;
+               }while(traits_type::syntax_close_bracket != traits_inst.syntax_type(c));
+               ++ptr;
+               continue;
+            default:
+               //
+               // error, return to standard parsing and let that handle the error:
+               --ptr;
+               continue;
+            }
+         }
+         break;
+      case traits_type::syntax_close_bracket:
+         if(_flags & bk_parens)
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+         
+         close_bracked_jump:
+         if(dat)
+         {
+            data.align();
+            dat->next.i = data.size();
+         }
+
+         if(mark.empty())
+         {
+            fail(REG_EPAREN);
+            return error_code();
+         }
+         // see if we have an empty alternative:
+         if(mark.peek() == data.index(dat) )
+         {
+            re_detail::re_syntax_base* para = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + mark.peek());
+            if(para->type == re_detail::syntax_element_jump)
+            {
+               fail(REG_EMPTY);
+               return error_code();
+            }
+         }
+
+         // pop any pushed alternatives and set the target end destination:
+         dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+         while(dat->type == re_detail::syntax_element_jump)
+         {
+            static_cast<re_detail::re_jump*>(dat)->alt.i = data.size();
+            mark.pop();
+            if(mark.empty())
+            {
+               fail(REG_EPAREN);
+               return error_code();
+            }
+            dat = reinterpret_cast<re_detail::re_jump*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+         }
+
+         dat = add_simple(0, re_detail::syntax_element_endmark, sizeof(re_detail::re_brace));
+         static_cast<re_detail::re_brace*>(dat)->index = markid.peek();
+         markid.pop();
+         last_mark_popped = mark.peek();
+         mark.pop();
+         ++ptr;
+         break;
+      case traits_type::syntax_char:
+         dat = add_literal(dat, (charT)c);
+         ++ptr;
+         break;
+      case traits_type::syntax_slash:
+      {
+         if(++ptr == end)
+         {
+            fail(REG_EESCAPE);
+            return error_code();
+         }
+         c = (traits_size_type)(traits_uchar_type)*ptr;
+         // this is only used for the switch(), but cannot be folded in
+         // due to a bug in Comeau 4.2.44beta3
+         traits_size_type syntax = traits_inst.syntax_type(c);
+         switch(syntax)
+         {
+         case traits_type::syntax_open_bracket:
+            if(_flags & bk_parens)
+               goto open_bracked_jump;
+            break;
+         case traits_type::syntax_close_bracket:
+            if(_flags & bk_parens)
+               goto close_bracked_jump;
+            break;
+         case traits_type::syntax_plus:
+            if((_flags & bk_plus_qm) && ((_flags & limited_ops) == 0))
+            {
+               rep_min = 1;
+               rep_max = (unsigned)-1;
+               goto repeat_jump;
+            }
+            break;
+         case traits_type::syntax_question:
+            if((_flags & bk_plus_qm) && ((_flags & limited_ops) == 0))
+            {
+               rep_min = 0;
+               rep_max = 1;
+               goto repeat_jump;
+            }
+            break;
+         case traits_type::syntax_or:
+            if(((_flags & bk_vbar) == 0) || (_flags & limited_ops))
+               break;
+            goto alt_string_jump;
+         case traits_type::syntax_open_brace:
+            if( ((_flags & bk_braces) == 0) || ((_flags & intervals) == 0))
+               break;
+
+            // we have {x} or {x,} or {x,y}:
+            parse_range(ptr, end, rep_min, rep_max);
+            goto repeat_jump;
+
+         case traits_type::syntax_digit:
+            if(_flags & bk_refs)
+            {
+               // update previous:
+               int i = traits_inst.toi((charT)c);
+               if(i == 0)
+               {
+                  // we can have \025 which means take char whose
+                  // code is 25 (octal), so parse string:
+                  c = traits_inst.toi(ptr, end, -8);
+                  --ptr;
+                  break;
+               }
+               dat = add_simple(dat, re_detail::syntax_element_backref, sizeof(re_detail::re_brace));
+               static_cast<re_detail::re_brace*>(dat)->index = i;
+               ++ptr;
+               continue;
+            }
+            break;
+         case traits_type::syntax_b:     // re_detail::syntax_element_word_boundary
+            dat = add_simple(dat, re_detail::syntax_element_word_boundary);
+            ++ptr;
+            continue;
+         case traits_type::syntax_B:
+            dat = add_simple(dat, re_detail::syntax_element_within_word);
+            ++ptr;
+            continue;
+         case traits_type::syntax_left_word:
+            dat = add_simple(dat, re_detail::syntax_element_word_start);
+            ++ptr;
+            continue;
+         case traits_type::syntax_right_word:
+            dat = add_simple(dat, re_detail::syntax_element_word_end);
+            ++ptr;
+            continue;
+         case traits_type::syntax_w:     //re_detail::syntax_element_word_char
+            dat = compile_set_simple(dat, traits_type::char_class_word);
+            ++ptr;
+            continue;
+         case traits_type::syntax_W:
+            dat = compile_set_simple(dat, traits_type::char_class_word, true);
+            ++ptr;
+            continue;
+         case traits_type::syntax_d:     //re_detail::syntax_element_word_char
+            dat = compile_set_simple(dat, traits_type::char_class_digit);
+            ++ptr;
+            continue;
+         case traits_type::syntax_D:
+            dat = compile_set_simple(dat, traits_type::char_class_digit, true);
+            ++ptr;
+            continue;
+         case traits_type::syntax_s:     //re_detail::syntax_element_word_char
+            dat = compile_set_simple(dat, traits_type::char_class_space);
+            ++ptr;
+            continue;
+         case traits_type::syntax_S:
+            dat = compile_set_simple(dat, traits_type::char_class_space, true);
+            ++ptr;
+            continue;
+         case traits_type::syntax_l:     //re_detail::syntax_element_word_char
+            dat = compile_set_simple(dat, traits_type::char_class_lower);
+            ++ptr;
+            continue;
+         case traits_type::syntax_L:
+            dat = compile_set_simple(dat, traits_type::char_class_lower, true);
+            ++ptr;
+            continue;
+         case traits_type::syntax_u:     //re_detail::syntax_element_word_char
+            dat = compile_set_simple(dat, traits_type::char_class_upper);
+            ++ptr;
+            continue;
+         case traits_type::syntax_U:
+            dat = compile_set_simple(dat, traits_type::char_class_upper, true);
+            ++ptr;
+            continue;
+         case traits_type::syntax_Q:
+            ++ptr;
+            while(true)
+            {
+               if(ptr == end)
+               {
+                  fail(REG_EESCAPE);
+                  return error_code();
+               }
+               if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_slash)
+               {
+                  ++ptr;
+                  if((ptr != end) && (traits_inst.syntax_type((traits_size_type)(traits_uchar_type)*ptr) == traits_type::syntax_E))
+                     break;
+                  else
+                  {
+                     dat = add_literal(dat, *(ptr-1));
+                     continue;
+                  }
+               }
+               dat = add_literal(dat, *ptr);
+               ++ptr;
+            }
+            ++ptr;
+            continue;
+         case traits_type::syntax_C:
+            dat = add_simple(dat, re_detail::syntax_element_wild);
+            ++ptr;
+            continue;
+         case traits_type::syntax_X:
+            dat = add_simple(dat, re_detail::syntax_element_combining);
+            ++ptr;
+            continue;
+         case traits_type::syntax_Z:
+            dat = add_simple(dat, re_detail::syntax_element_soft_buffer_end);
+            ++ptr;
+            continue;
+         case traits_type::syntax_G:
+            dat = add_simple(dat, re_detail::syntax_element_restart_continue);
+            ++ptr;
+            continue;
+         case traits_type::syntax_start_buffer:
+            dat = add_simple(dat, re_detail::syntax_element_buffer_start);
+            ++ptr;
+            continue;
+         case traits_type::syntax_end_buffer:
+            dat = add_simple(dat, re_detail::syntax_element_buffer_end);
+            ++ptr;
+            continue;
+         default:
+            c = (traits_size_type)(traits_uchar_type)parse_escape(ptr, end);
+            dat = add_literal(dat, (charT)c);
+            continue;
+         }
+         dat = add_literal(dat, (charT)c);
+         ++ptr;
+         break;
+      }
+      case traits_type::syntax_dollar:
+         dat = add_simple(dat, re_detail::syntax_element_end_line, sizeof(re_detail::re_syntax_base));
+         ++ptr;
+         continue;
+      case traits_type::syntax_caret:
+         dat = add_simple(dat, re_detail::syntax_element_start_line, sizeof(re_detail::re_syntax_base));
+         ++ptr;
+         continue;
+      case traits_type::syntax_dot:
+         dat = add_simple(dat, re_detail::syntax_element_wild, sizeof(re_detail::re_syntax_base));
+         ++ptr;
+         continue;
+      case traits_type::syntax_star:
+         rep_min = 0;
+         rep_max = (unsigned)-1;
+
+         repeat_jump:
+         {
+          std::ptrdiff_t offset;
+            if(dat == 0)
+            {
+               fail(REG_BADRPT);
+               return error_code();
+            }
+            switch(dat->type)
+            {
+            case re_detail::syntax_element_endmark:
+               offset = last_mark_popped;
+               break;
+            case re_detail::syntax_element_literal:
+               if(static_cast<re_detail::re_literal*>(dat)->length > 1)
+               {
+                  // update previous:
+                  charT lit = *reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal) + ((static_cast<re_detail::re_literal*>(dat)->length-1)*sizeof(charT)));
+                  --static_cast<re_detail::re_literal*>(dat)->length;
+                  dat = add_simple(dat, re_detail::syntax_element_literal, sizeof(re_detail::re_literal) + sizeof(charT));
+                  static_cast<re_detail::re_literal*>(dat)->length = 1;
+                  *reinterpret_cast<charT*>(static_cast<re_detail::re_literal*>(dat)+1) = lit;
+               }
+               offset = reinterpret_cast<char*>(dat) - reinterpret_cast<char*>(data.data());
+               break;
+            case re_detail::syntax_element_backref:
+            case re_detail::syntax_element_long_set:
+            case re_detail::syntax_element_set:
+            case re_detail::syntax_element_wild:
+            case re_detail::syntax_element_combining:
+               // we're repeating a single item:
+               offset = reinterpret_cast<char*>(dat) - reinterpret_cast<char*>(data.data());
+               break;
+            default:
+               fail(REG_BADRPT);
+               return error_code();
+            }
+            data.align();
+            dat->next.i = data.size();
+            //unsigned pos = (char*)dat - (char*)data.data();
+
+            // add the trailing jump:
+            dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
+            static_cast<re_detail::re_jump*>(dat)->alt.i = 0;
+
+            // now insert the leading repeater:
+            dat = static_cast<re_detail::re_syntax_base*>(data.insert(offset, re_detail::re_repeater_size));
+            dat->next.i = (reinterpret_cast<char*>(dat) - reinterpret_cast<char*>(data.data())) + re_detail::re_repeater_size;
+            dat->type = re_detail::syntax_element_rep;
+            static_cast<re_detail::re_repeat*>(dat)->alt.i = data.size();
+            static_cast<re_detail::re_repeat*>(dat)->min = rep_min;
+            static_cast<re_detail::re_repeat*>(dat)->max = rep_max;
+            static_cast<re_detail::re_repeat*>(dat)->leading = false;
+            static_cast<re_detail::re_repeat*>(dat)->greedy = true;
+            move_offsets(dat, re_detail::re_repeater_size);
+            ++ptr;
+            //
+            // now check to see if we have a non-greedy repeat:
+            if((ptr != end) && (_flags & (limited_ops | bk_plus_qm | bk_braces)) == 0)
+            {
+               c = (traits_size_type)(traits_uchar_type)*ptr;
+               if(traits_type::syntax_question == traits_inst.syntax_type(c))
+               {
+                  // OK repeat is non-greedy:
+                  static_cast<re_detail::re_repeat*>(dat)->greedy = false;
+                  ++ptr;
+               }
+            }
+            dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + data.size() - re_detail::re_jump_size);
+            static_cast<re_detail::re_repeat*>(dat)->alt.i = offset;
+            continue;
+         }
+      case traits_type::syntax_plus:
+         if(_flags & (bk_plus_qm | limited_ops))
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+         rep_min = 1;
+         rep_max = (unsigned)-1;
+         goto repeat_jump;
+      case traits_type::syntax_question:
+         if(_flags & (bk_plus_qm | limited_ops))
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+         rep_min = 0;
+         rep_max = 1;
+         goto repeat_jump;
+      case traits_type::syntax_open_set:
+         // update previous:
+         if(dat)
+         {
+            data.align();
+            dat->next.i = data.size();
+         }
+         // extend:
+         dat = compile_set(ptr, end);
+         if(dat == 0)
+         {
+            if((_flags & regbase::failbit) == 0)
+               fail(REG_EBRACK);
+            return error_code();
+         }
+         break;
+      case traits_type::syntax_or:
+      {
+         if(_flags & (bk_vbar | limited_ops))
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+
+         alt_string_jump:
+
+         // update previous:
+         if(dat == 0)
+         {
+            // start of pattern can't have empty "|"
+            fail(REG_EMPTY);
+            return error_code();
+         }
+         // see if we have an empty alternative:
+         if(mark.empty() == false)
+            if(mark.peek() == data.index(dat))
+            {
+               fail(REG_EMPTY);
+               return error_code();
+            }
+         // extend:
+         dat = add_simple(dat, re_detail::syntax_element_jump, re_detail::re_jump_size);
+         data.align();
+         //
+         // we don't know what value to put here yet,
+         // use an arbitrarily large value for now
+         // and check it later (TODO!)
+         static_cast<re_detail::re_jump*>(dat)->alt.i = INT_MAX/2;
+
+         // now work out where to insert:
+         std::size_t offset = 0;
+         if(mark.empty() == false)
+         {
+            // we have a '(' or '|' to go back to:
+            offset = mark.peek();
+            re_detail::re_syntax_base* base = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + offset);
+            offset = base->next.i;
+         }
+         re_detail::re_jump* j = static_cast<re_detail::re_jump*>(data.insert(offset, re_detail::re_jump_size));
+         j->type = re_detail::syntax_element_alt;
+         j->next.i = offset + re_detail::re_jump_size;
+         j->alt.i = data.size();
+         move_offsets(j, re_detail::re_jump_size);
+         dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + data.size() - re_detail::re_jump_size);
+         mark.push(data.size() - re_detail::re_jump_size);
+         ++ptr;
+         break;
+      }
+      case traits_type::syntax_open_brace:
+         if((_flags & bk_braces) || ((_flags & intervals) == 0))
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+         // we have {x} or {x,} or {x,y}:
+         parse_range(ptr, end, rep_min, rep_max);
+         goto repeat_jump;
+      case traits_type::syntax_newline:
+         if(_flags & newline_alt)
+            goto alt_string_jump;
+         dat = add_literal(dat, (charT)c);
+         ++ptr;
+         continue;
+      case traits_type::syntax_close_brace:
+         if(_flags & bk_braces)
+         {
+            dat = add_literal(dat, (charT)c);
+            ++ptr;
+            continue;
+         }
+         fail(REG_BADPAT);
+         return error_code();
+      default:
+         dat = add_literal(dat, (charT)c);
+         ++ptr;
+         break;
+      }  // switch
+   }     // while
+
+   //
+   // update previous:
+   if(dat)
+   {
+      data.align();
+      dat->next.i = data.size();
+   }
+
+   // see if we have an empty alternative:
+   if(mark.empty() == false)
+      if(mark.peek() == data.index(dat) )
+      {
+         re_detail::re_syntax_base* para = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<char*>(data.data()) + mark.peek());
+         if(para->type == re_detail::syntax_element_jump)
+         {
+            fail(REG_EMPTY);
+            return error_code();
+         }
+      }
+   //
+   // set up tail:
+   //
+   if(mark.empty() == false)
+   {
+      // pop any pushed alternatives and set the target end destination:
+      dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+      while(dat->type == re_detail::syntax_element_jump)
+      {
+         static_cast<re_detail::re_jump*>(dat)->alt.i = data.size();
+         mark.pop();
+         if(mark.empty() == true)
+            break;
+         dat = reinterpret_cast<re_detail::re_jump*>(reinterpret_cast<unsigned char*>(data.data()) + mark.peek());
+      }
+   }
+
+   dat = static_cast<re_detail::re_brace*>(data.extend(sizeof(re_detail::re_syntax_base)));
+   dat->type = re_detail::syntax_element_match;
+   dat->next.i = 0;
+
+   if(mark.empty() == false)
+   {
+      fail(REG_EPAREN);
+      return error_code();
+   }
+
+   //
+   // allocate space for start _map:
+   startmap = reinterpret_cast<unsigned char*>(data.extend(256 + ((end - base + 1) * sizeof(charT))));
+   //
+   // and copy the expression we just compiled:
+   _expression = reinterpret_cast<charT*>(reinterpret_cast<char*>(startmap) + 256);
+   _expression_len = end - base;
+   std::memcpy(_expression, base, _expression_len * sizeof(charT));
+   *(_expression + _expression_len) = charT(0);
+
+   //
+   // now we need to apply fixups to the array
+   // so that we can use pointers and not indexes
+   fixup_apply(static_cast<re_detail::re_syntax_base*>(data.data()), marks);
+
+   // check for error during fixup:
+   if(_flags & regbase::failbit)
+      return error_code();
+
+   //
+   // finally compile the maps so that we can make intelligent choices
+   // whenever we encounter an alternative:
+   compile_maps();
+   if(pkmp)
+   {
+      re_detail::kmp_free(pkmp, data.allocator());
+      pkmp = 0;
+   }
+   re_detail::re_syntax_base* sbase = static_cast<re_detail::re_syntax_base*>(data.data());
+   _restart_type = probe_restart(sbase);
+   _leading_len = fixup_leading_rep(sbase, 0);
+   if((sbase->type == re_detail::syntax_element_literal) && (sbase->next.p->type == re_detail::syntax_element_match))
+   {
+      _restart_type = restart_fixed_lit;
+      if(0 == pkmp)
+      {
+         charT* p1 = reinterpret_cast<charT*>(reinterpret_cast<char*>(sbase) + sizeof(re_detail::re_literal));
+         charT* p2 = p1 + static_cast<re_detail::re_literal*>(sbase)->length;
+         pkmp = re_detail::kmp_compile(p1, p2, charT(), re_detail::kmp_translator<traits>(_flags&regbase::icase, &traits_inst), data.allocator());
+      }
+   }
+   return error_code();
+
+   } // sentry
+   return REG_EMPTY;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size)
+{
+   if(dat)
+   {
+      data.align();
+      dat->next.i = data.size();
+   }
+   if(size < sizeof(re_detail::re_syntax_base))
+      size = sizeof(re_detail::re_syntax_base);
+   dat = static_cast<re_detail::re_syntax_base*>(data.extend(size));
+   dat->type = type;
+   dat->next.i = 0;
+   return dat;
+}
+
+template <class charT, class traits, class Allocator>
+re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_literal(re_detail::re_syntax_base* dat, charT c)
+{
+   if(dat && (dat->type == re_detail::syntax_element_literal))
+   {
+      // add another charT to the list:
+      std::ptrdiff_t pos = reinterpret_cast<unsigned char*>(dat) - reinterpret_cast<unsigned char*>(data.data());
+      *reinterpret_cast<charT*>(data.extend(sizeof(charT))) = traits_inst.translate(c, (_flags & regbase::icase));
+      dat = reinterpret_cast<re_detail::re_syntax_base*>(reinterpret_cast<unsigned char*>(data.data()) + pos);
+      ++(static_cast<re_detail::re_literal*>(dat)->length);
+   }
+   else
+   {
+      // extend:
+      dat = add_simple(dat, re_detail::syntax_element_literal, sizeof(re_detail::re_literal) + sizeof(charT));
+      static_cast<re_detail::re_literal*>(dat)->length = 1;
+      *reinterpret_cast<charT*>(reinterpret_cast<re_detail::re_literal*>(dat)+1) = traits_inst.translate(c, (_flags & regbase::icase));
+   }
+   return dat;
+}
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_restart(re_detail::re_syntax_base* dat)
+{
+   switch(dat->type)
+   {
+   case re_detail::syntax_element_startmark:
+   case re_detail::syntax_element_endmark:
+      return probe_restart(dat->next.p);
+   case re_detail::syntax_element_start_line:
+      return regbase::restart_line;
+   case re_detail::syntax_element_word_start:
+      return regbase::restart_word;
+   case re_detail::syntax_element_buffer_start:
+      return regbase::restart_buf;
+   case re_detail::syntax_element_restart_continue:
+      return regbase::restart_continue;
+   default:
+      return regbase::restart_any;
+   }
+}
+
+template <class charT, class traits, class Allocator>
+unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end)
+{
+   unsigned int len = 0;
+   bool leading_lit = end ? false : true;
+   while(dat != end)
+   {
+      switch(dat->type)
+      {
+      case re_detail::syntax_element_literal:
+         len += static_cast<re_detail::re_literal*>(dat)->length;
+         if((leading_lit) && (static_cast<re_detail::re_literal*>(dat)->length > 2))
+         {
+            // we can do a literal search for the leading literal string
+            // using Knuth-Morris-Pratt (or whatever), and only then check for 
+            // matches.  We need a decent length string though to make it
+            // worth while.
+            _leading_string = reinterpret_cast<charT*>(reinterpret_cast<char*>(dat) + sizeof(re_detail::re_literal));
+            _leading_string_len = static_cast<re_detail::re_literal*>(dat)->length;
+            _restart_type = restart_lit;
+            leading_lit = false;
+            const charT* p1 = _leading_string;
+            const charT* p2 = _leading_string + _leading_string_len;
+            pkmp = re_detail::kmp_compile(p1, p2, charT(), re_detail::kmp_translator<traits>(_flags&regbase::icase, &traits_inst), data.allocator());
+         }
+         leading_lit = false;
+         break;
+      case re_detail::syntax_element_wild:
+         ++len;
+         leading_lit = false;
+         break;
+      case re_detail::syntax_element_match:
+         return len;
+      case re_detail::syntax_element_backref:
+      //case re_detail::syntax_element_jump:
+      case re_detail::syntax_element_alt:
+      case re_detail::syntax_element_combining:
+         return 0;
+      case re_detail::syntax_element_long_set:
+      {
+         // we need to verify that there are no multi-character
+         // collating elements inside the repeat:
+         const charT* p = reinterpret_cast<const charT*>(reinterpret_cast<const char*>(dat) + sizeof(re_detail::re_set_long));
+         unsigned int csingles = static_cast<re_detail::re_set_long*>(dat)->csingles;
+         for(unsigned int i = 0; i < csingles; ++i)
+         {
+            if(re_detail::re_strlen(p) > 1)
+               return 0;
+            while(*p)++p;
+            ++p;
+         }
+         ++len;
+         leading_lit = false;
+         break;
+      }
+      case re_detail::syntax_element_set:
+         ++len;
+         leading_lit = false;
+         break;
+      case re_detail::syntax_element_rep:
+         if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast<re_detail::re_repeat*>(dat)->alt.p) ))
+         {
+            static_cast<re_detail::re_repeat*>(dat)->leading = true;
+            return len;
+         }
+         return len;
+      default:
+         break;
+      }
+      dat = dat->next.p;
+   }
+   return len;
+}
+
+template <class charT, class traits, class Allocator>
+void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fail(unsigned int err)
+{
+   error_code_  = err;
+   if(err)
+   {
+      _flags |= regbase::failbit;
+#ifndef BOOST_NO_EXCEPTIONS
+      if(_flags & regbase::use_except)
+      {
+         throw bad_expression(traits_inst.error_string(err));
+      }
+#endif
+   }
+   else
+      _flags &= ~regbase::failbit;
+}
+
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+
+#endif   // BOOST_REGEX_COMPILE_HPP
+
+
+
+
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_cstring.hpp b/boost/boost/regex/detail/regex_cstring.hpp
new file mode 100644 (file)
index 0000000..36620f3
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_cstring.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: This is an internal header file, do not include directly.
+  *                String support and helper functions, for regular
+  *                expression library.
+  */
+
+#ifndef BOOST_REGEX_CSTRING_HPP
+#define BOOST_REGEX_CSTRING_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#include <cstring>
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+//
+// start by defining some template function aliases for C API functions:
+//
+
+template <class charT>
+std::size_t BOOST_REGEX_CALL re_strlen(const charT *s)
+{
+   std::size_t len = 0;
+   while(*s)
+   {
+      ++s;
+      ++len;
+   }
+   return len;
+}
+
+inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s)
+{
+   return std::strlen(s);
+}
+
+#ifndef BOOST_NO_WREGEX
+
+inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s)
+{
+   return std::wcslen(s);
+}
+
+#endif
+
+#ifndef BOOST_NO_WREGEX
+BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
+#endif
+BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in);
+
+template <class charT>
+void BOOST_REGEX_CALL re_trunc_primary(std::basic_string<charT>& s)
+{
+   for(unsigned int i = 0; i < s.size(); ++i)
+   {
+      if(s[i] <= 1)
+      {
+         s.erase(i);
+         break;
+      }
+   }
+}
+
+inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2)
+{
+   #if defined(__BORLANDC__) && defined(strcpy)
+   return ::strcpy(s1, s2);
+   #else
+   return std::strcpy(s1, s2);
+   #endif
+}
+
+#ifndef BOOST_NO_WREGEX
+
+inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2)
+{
+   return std::wcscpy(s1, s2);
+}
+
+#endif
+
+
+template <class charT>
+charT* BOOST_REGEX_CALL re_strdup(const charT* p)
+{
+   charT* buf = new charT[re_strlen(p) + 1];
+   re_strcpy(buf, p);
+   return buf;
+}
+
+template <class charT>
+inline void BOOST_REGEX_CALL re_strfree(charT* p)
+{
+   delete[] p;
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif  // BOOST_REGEX_CSTRING_HPP
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_format.hpp b/boost/boost/regex/detail/regex_format.hpp
new file mode 100644 (file)
index 0000000..314c4f4
--- /dev/null
@@ -0,0 +1,579 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_format.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Provides formatting output routines for search and replace
+  *                operations.  Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+#ifndef BOOST_REGEX_FORMAT_HPP
+#define BOOST_REGEX_FORMAT_HPP
+
+
+namespace boost{
+
+enum format_flags_t{
+   format_all = 0,                      // enable all extentions to sytax
+   format_sed = match_max << 1,         // sed style replacement.
+   format_perl = format_sed << 1,       // perl style replacement.
+   format_no_copy = format_perl << 1,   // don't copy non-matching segments.
+   format_first_only = format_no_copy << 1,   // Only replace first occurance.
+   format_is_if = format_first_only << 1   // internal use only.
+};
+
+namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc -w-8037
+#endif
+
+template <class O, class I>
+O BOOST_REGEX_CALL re_copy_out(O out, I first, I last)
+{
+   while(first != last)
+   {
+      *out = *first;
+      ++out;
+      ++first;
+   }
+   return out;
+}
+
+template <class charT, class traits_type>
+void BOOST_REGEX_CALL re_skip_format(const charT*& fmt, const traits_type& traits_inst)
+{
+   // dwa 9/13/00 - suppress incorrect unused parameter warning for MSVC
+   (void)traits_inst;
+
+   typedef typename traits_type::size_type traits_size_type;
+   typedef typename traits_type::uchar_type traits_uchar_type;
+   typedef typename traits_type::string_type traits_string_type;
+
+   unsigned int parens = 0;
+   unsigned int c;
+   while(*fmt)
+   {
+      c = traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt));
+      if((c == traits_type::syntax_colon) && (parens == 0))
+      {
+         ++fmt;
+         return;
+      }
+      else if(c == traits_type::syntax_close_bracket)
+      {
+         if(parens == 0)
+         {
+            ++fmt;
+            return;
+         }
+         --parens;
+      }
+      else if(c == traits_type::syntax_open_bracket)
+         ++parens;
+      else if(c == traits_type::syntax_slash)
+      {
+         ++fmt;
+         if(*fmt == 0)
+            return;
+      }
+      ++fmt;
+   }
+}
+
+#ifdef BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
+
+//
+// ugly hack for buggy output iterators
+
+template <class T>
+inline void oi_assign(T* p, T v)
+{
+   ::boost::re_detail::pointer_destroy(p);
+   pointer_construct(p, v);
+}
+
+#else
+
+template <class T>
+inline void oi_assign(T* p, T v)
+{
+   //
+   // if you get a compile time error in here then you either
+   // need to rewrite your output iterator to make it assignable
+   // (as is required by the standard), or define
+   // BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN to use the ugly hack above
+   *p = v;
+}
+
+#endif
+
+
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+//
+// Ugly ugly hack,
+// template don't merge if they contain switch statements so declare these
+// templates in unnamed namespace (ie with internal linkage), each translation
+// unit then gets its own local copy, it works seemlessly but bloats the app.
+namespace{
+#endif
+
+//
+// algorithm reg_format:
+// takes the result of a match and a format string
+// and merges them to produce a new string which
+// is sent to an OutputIterator,
+// _reg_format_aux does the actual work:
+//
+template <class OutputIterator, class iterator, class Allocator, class charT, class traits_type>
+OutputIterator BOOST_REGEX_CALL _reg_format_aux(OutputIterator out, 
+                          const match_results<iterator, Allocator>& m, 
+                          const charT*& fmt,
+                          unsigned flags, const traits_type& traits_inst)
+{
+   const charT* fmt_end = fmt;
+   while(*fmt_end) ++ fmt_end;
+
+   typedef typename traits_type::size_type traits_size_type;
+   typedef typename traits_type::uchar_type traits_uchar_type;
+   typedef typename traits_type::string_type traits_string_type;
+
+   while(*fmt)
+   {
+      switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)))
+      {
+      case traits_type::syntax_dollar:
+         if(flags & format_sed)
+         {
+            // no perl style replacement,
+            // $ is an ordinary character:
+            goto default_opt;
+         }
+         ++fmt;
+         if(*fmt == 0) // oops trailing $
+         {
+            --fmt;
+            *out = *fmt;
+            ++out;
+            return out;
+         }
+         switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)))
+         {
+         case traits_type::syntax_start_buffer:
+            oi_assign(&out, re_copy_out(out, iterator(m[-1].first), iterator(m[-1].second)));
+            ++fmt;
+            continue;
+         case traits_type::syntax_end_buffer:
+            oi_assign(&out, re_copy_out(out, iterator(m[-2].first), iterator(m[-2].second)));
+            ++fmt;
+            continue;
+         case traits_type::syntax_digit:
+         {
+expand_sub:
+            unsigned int index = traits_inst.toi(fmt, fmt_end, 10);
+            oi_assign(&out, re_copy_out(out, iterator(m[index].first), iterator(m[index].second)));
+            continue;
+         }
+         }
+         // anything else:
+         if(*fmt == '&')
+         {
+            oi_assign(&out, re_copy_out(out, iterator(m[0].first), iterator(m[0].second)));
+            ++fmt;
+         }
+         else
+         {
+            // probably an error, treat as a literal '$'
+            --fmt;
+            *out = *fmt;
+            ++out;
+            ++fmt;
+         }
+         continue;
+      case traits_type::syntax_slash:
+      {
+         // escape sequence:
+         ++fmt;
+         charT c(*fmt);
+         if(*fmt == 0)
+         {
+            --fmt;
+            *out = *fmt;
+            ++out;
+            ++fmt;
+            return out;
+         }
+         switch(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)))
+         {
+         case traits_type::syntax_a:
+            c = '\a';
+            ++fmt;
+            break;
+         case traits_type::syntax_f:
+            c = '\f';
+            ++fmt;
+            break;
+         case traits_type::syntax_n:
+            c = '\n';
+            ++fmt;
+            break;
+         case traits_type::syntax_r:
+            c = '\r';
+            ++fmt;
+            break;
+         case traits_type::syntax_t:
+            c = '\t';
+            ++fmt;
+            break;
+         case traits_type::syntax_v:
+            c = '\v';
+            ++fmt;
+            break;
+         case traits_type::syntax_x:
+            ++fmt;
+            if(fmt == fmt_end)
+            {
+               *out = *--fmt;
+               ++out;
+               return out;
+            }
+            // maybe have \x{ddd}
+            if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) == traits_type::syntax_open_brace)
+            {
+               ++fmt;
+               if(fmt == fmt_end)
+               {
+                  fmt -= 2;
+                  *out = *fmt;
+                  ++out;
+                  ++fmt;
+                  continue;
+               }
+               if(traits_inst.is_class(*fmt, traits_type::char_class_xdigit) == false)
+               {
+                  fmt -= 2;
+                  *out = *fmt;
+                  ++out;
+                  ++fmt;
+                  continue;
+               }
+               c = (charT)traits_inst.toi(fmt, fmt_end, -16);
+               if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) != traits_type::syntax_close_brace)
+               {
+                  while(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*fmt)) != traits_type::syntax_slash)
+                     --fmt;
+                  ++fmt;
+                  *out = *fmt;
+                  ++out;
+                  ++fmt;
+                  continue;
+               }
+               ++fmt;
+               break;
+            }
+            else
+            {
+               if(traits_inst.is_class(*fmt, traits_type::char_class_xdigit) == false)
+               {
+                  --fmt;
+                  *out = *fmt;
+                  ++out;
+                  ++fmt;
+                  continue;
+               }
+               c = (charT)traits_inst.toi(fmt, fmt_end, -16);
+            }
+            break;
+         case traits_type::syntax_c:
+            ++fmt;
+            if(fmt == fmt_end)
+            {
+               --fmt;
+               *out = *fmt;
+               ++out;
+               return out;
+            }
+            if(((typename traits_type::uchar_type)(*fmt) < (typename traits_type::uchar_type)'@')
+                  || ((typename traits_type::uchar_type)(*fmt) > (typename traits_type::uchar_type)127) )
+            {
+               --fmt;
+               *out = *fmt;
+               ++out;
+               ++fmt;
+               break;
+            }
+            c = (charT)((typename traits_type::uchar_type)(*fmt) - (typename traits_type::uchar_type)'@');
+            ++fmt;
+            break;
+         case traits_type::syntax_e:
+            c = (charT)27;
+            ++fmt;
+            break;
+         case traits_type::syntax_digit:
+            if(flags & format_sed)
+               goto expand_sub;
+            else
+               c = (charT)traits_inst.toi(fmt, fmt_end, -8);
+            break;
+         default:
+            //c = *fmt;
+            ++fmt;
+         }
+         *out = c;
+         ++out;
+         continue;
+      }
+      case traits_type::syntax_open_bracket:
+         if(flags & (format_sed|format_perl))
+         {
+            *out = *fmt;
+            ++out;
+            ++fmt;
+            continue;
+         }
+         else
+         {
+            ++fmt;  // recurse
+            oi_assign(&out, _reg_format_aux(out, m, fmt, flags, traits_inst));
+            continue;
+         }
+      case traits_type::syntax_close_bracket:
+         if(flags & (format_sed|format_perl))
+         {
+            *out = *fmt;
+            ++out;
+            ++fmt;
+            continue;
+         }
+         else
+         {
+            ++fmt;  // return from recursion
+            return out;
+         }
+      case traits_type::syntax_colon:
+         if(flags & format_is_if)
+         {
+            ++fmt;
+            return out;
+         }
+         *out = *fmt;
+         ++out;
+         ++fmt;
+         continue;
+      case traits_type::syntax_question:
+      {
+         if(flags & (format_sed|format_perl))
+         {
+            *out = *fmt;
+            ++out;
+            ++fmt;
+            continue;
+         }
+         else
+         {
+            ++fmt;
+            if(*fmt == 0)
+            {
+               --fmt;
+               *out = *fmt;
+               ++out;
+               ++fmt;
+               return out;
+            }
+            unsigned int id = traits_inst.toi(fmt, fmt_end, 10);
+            if(m[id].matched)
+            {
+               oi_assign(&out, _reg_format_aux(out, m, fmt, flags | format_is_if, traits_inst));
+               if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon)
+                  re_skip_format(fmt, traits_inst);
+            }
+            else
+            {
+               re_skip_format(fmt, traits_inst);
+               if(traits_inst.syntax_type((traits_size_type)(traits_uchar_type)(*(fmt-1))) == traits_type::syntax_colon)
+                  oi_assign(&out, _reg_format_aux(out, m, fmt, flags | format_is_if, traits_inst));
+            }
+            return out;
+         }
+      }
+      default:
+default_opt:
+         if((flags & format_sed) && (*fmt == '&'))
+         {
+            oi_assign(&out, re_copy_out(out, iterator(m[0].first), iterator(m[0].second)));
+            ++fmt;
+            continue;
+         }
+         *out = *fmt;
+         ++out;
+         ++fmt;
+      }
+   }
+
+   return out;
+}
+
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+} // namespace
+#endif
+
+template <class S>
+class string_out_iterator
+{
+   S* out;
+public:
+   string_out_iterator(S& s) : out(&s) {}
+   string_out_iterator& operator++() { return *this; }
+   string_out_iterator& operator++(int) { return *this; }
+   string_out_iterator& operator*() { return *this; }
+   string_out_iterator& operator=(typename S::value_type v) 
+   { 
+      out->append(1, v); 
+      return *this; 
+   }
+};
+
+template <class OutputIterator, class iterator, class charT, class Allocator, class traits_type>
+class merge_out_predicate
+{
+   OutputIterator* out;
+   iterator* last;
+   const charT* fmt;
+   unsigned flags;
+   const traits_type* pt;
+
+public:
+   merge_out_predicate(OutputIterator& o, iterator& pi, const charT* f, unsigned format_flags, const traits_type& p)
+      : out(&o), last(&pi), fmt(f), flags(format_flags), pt(&p){}
+
+   ~merge_out_predicate() {}
+   bool BOOST_REGEX_CALL operator()(const boost::match_results<iterator, Allocator>& m)
+   {
+      const charT* f = fmt;
+      if(0 == (flags & format_no_copy))
+         oi_assign(out, re_copy_out(*out, iterator(m[-1].first), iterator(m[-1].second)));
+      oi_assign(out, _reg_format_aux(*out, m, f, flags, *pt));
+      *last = m[-2].first;
+      return flags & format_first_only ? false : true;
+   }
+};
+
+} // namespace re_detail
+
+template <class OutputIterator, class iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+                          const match_results<iterator, Allocator>& m,
+                          const charT* fmt,
+                          unsigned flags = 0
+                         )
+{
+   regex_traits<charT> t;
+   return re_detail::_reg_format_aux(out, m, fmt, flags, t);
+}
+
+template <class OutputIterator, class iterator, class Allocator, class charT>
+OutputIterator regex_format(OutputIterator out,
+                          const match_results<iterator, Allocator>& m,
+                          const std::basic_string<charT>& fmt,
+                          unsigned flags = 0
+                         )
+{
+   regex_traits<charT> t;
+   const charT* start = fmt.c_str();
+   return re_detail::_reg_format_aux(out, m, start, flags, t);
+}  
+
+template <class iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format(const match_results<iterator, Allocator>& m, const charT* fmt, unsigned flags = 0)
+{
+   std::basic_string<charT> result;
+   re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+   regex_format(i, m, fmt, flags);
+   return result;
+}
+
+template <class iterator, class Allocator, class charT>
+std::basic_string<charT> regex_format(const match_results<iterator, Allocator>& m, const std::basic_string<charT>& fmt, unsigned flags = 0)
+{
+   std::basic_string<charT> result;
+   re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+   regex_format(i, m, fmt.c_str(), flags);
+   return result;
+}
+
+template <class OutputIterator, class iterator, class traits, class Allocator, class charT>
+OutputIterator regex_merge(OutputIterator out,
+                         iterator first,
+                         iterator last,
+                         const reg_expression<charT, traits, Allocator>& e, 
+                         const charT* fmt, 
+                         unsigned int flags = match_default)
+{
+   iterator l = first;
+   re_detail::merge_out_predicate<OutputIterator, iterator, charT, Allocator, traits> oi(out, l, fmt, flags, e.get_traits());
+   regex_grep(oi, first, last, e, flags);
+   return (flags & format_no_copy) ? out : re_detail::re_copy_out(out, l, last);
+}
+
+template <class OutputIterator, class iterator, class traits, class Allocator, class charT>
+inline OutputIterator regex_merge(OutputIterator out,
+                         iterator first,
+                         iterator last,
+                         const reg_expression<charT, traits, Allocator>& e, 
+                         const std::basic_string<charT>& fmt,
+                         unsigned int flags = match_default)
+{
+   return regex_merge(out, first, last, e, fmt.c_str(), flags);
+}
+
+template <class traits, class Allocator, class charT>
+std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
+                         const reg_expression<charT, traits, Allocator>& e, 
+                         const charT* fmt,
+                         unsigned int flags = match_default)
+{
+   std::basic_string<charT> result;
+   re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+   regex_merge(i, s.begin(), s.end(), e, fmt, flags);
+   return result;
+}
+
+template <class traits, class Allocator, class charT>
+std::basic_string<charT> regex_merge(const std::basic_string<charT>& s,
+                         const reg_expression<charT, traits, Allocator>& e, 
+                         const std::basic_string<charT>& fmt,
+                         unsigned int flags = match_default)
+{
+   std::basic_string<charT> result;
+   re_detail::string_out_iterator<std::basic_string<charT> > i(result);
+   regex_merge(i, s.begin(), s.end(), e, fmt.c_str(), flags);
+   return result;
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#endif  // BOOST_REGEX_FORMAT_HPP
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_kmp.hpp b/boost/boost/regex/detail/regex_kmp.hpp
new file mode 100644 (file)
index 0000000..3a5db1e
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_kmp.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Provides Knuth Morris Pratt search operations.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+#ifndef BOOST_REGEX_KMP_HPP
+#define BOOST_REGEX_KMP_HPP
+
+#ifdef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+template <class charT>
+struct kmp_info
+{
+   std::size_t size;
+   std::size_t len;
+   const charT* pstr;
+   std::ptrdiff_t kmp_next[1];
+};
+
+template <class charT, class Allocator>
+void kmp_free(kmp_info<charT>* pinfo, const Allocator& a)
+{
+   typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
+   atype(a).deallocate(reinterpret_cast<char*>(pinfo), pinfo->size);
+}
+
+template <class iterator, class charT, class Trans, class Allocator>
+kmp_info<charT>* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a) 
+{    
+   typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
+   std::ptrdiff_t i, j, m;
+   i = 0;
+   m = boost::re_detail::distance(first, last);
+   ++m;
+   std::size_t size = sizeof(kmp_info<charT>) + sizeof(int)*m + sizeof(charT)*m;
+   --m;
+   //
+   // allocate struct and fill it in:
+   //
+   kmp_info<charT>* pinfo = reinterpret_cast<kmp_info<charT>*>(atype(a).allocate(size));
+   BOOST_REGEX_NOEH_ASSERT(pinfo)
+   pinfo->size = size;
+   pinfo->len = m;
+   charT* p = reinterpret_cast<charT*>(reinterpret_cast<char*>(pinfo) + sizeof(kmp_info<charT>) + sizeof(int)*(m+1));
+   pinfo->pstr = p;
+   while(first != last)
+   {
+      *p = translate(*first);
+      ++first;
+      ++p;
+   }
+   *p = 0;
+   //
+   // finally do regular kmp compile:
+   //
+   j = pinfo->kmp_next[0] = -1;
+   while (i < m) 
+   {
+      while ((j > -1) && (pinfo->pstr[i] != pinfo->pstr[j])) 
+         j = pinfo->kmp_next[j];
+      ++i;
+      ++j;
+      if (pinfo->pstr[i] == pinfo->pstr[j]) 
+         pinfo->kmp_next[i] = pinfo->kmp_next[j];
+      else 
+         pinfo->kmp_next[i] = j;
+   }
+
+   return pinfo;
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+   } // namepsace re_detail
+} // namespace boost
+
+#endif   // BOOST_REGEX_KMP_HPP
+
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_library_include.hpp b/boost/boost/regex/detail/regex_library_include.hpp
new file mode 100644 (file)
index 0000000..ec5f7c3
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_libary_include.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Automatic library inclusion for Borland/Microsoft compilers.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+/*************************************************************************
+
+Libraries for Borland and Microsoft compilers are automatically
+selected here, the name of the lib is selected according to the following
+formula:
+
+BOOST_LIB_NAME
+   + "_"
+   + BOOST_LIB_TOOLSET
+   + "_"
+   + BOOST_LIB_THREAD_OPT
+   + BOOST_LIB_RT_OPT
+   + BOOST_LIB_LINK_OPT
+   + BOOST_LIB_DEBUG_OPT
+
+These are defined as:
+
+BOOST_LIB_NAME:       The base name of the lib (boost_regex).
+
+BOOST_LIB_TOOLSET:    The compiler toolset name (vc6, vc7, bcb5 etc).
+
+BOOST_LIB_THREAD_OPT: "s" for single thread builds,
+                      "m" for multithread builds.
+
+BOOST_LIB_RT_OPT:     "s" for static runtime,
+                      "d" for dynamic runtime.
+
+BOOST_LIB_LINK_OPT:   "s" for static link,
+                      "i" for dynamic link.
+
+BOOST_LIB_DEBUG_OPT:  nothing for release builds,
+                      "d" for debug builds,
+                      "dd" for debug-diagnostic builds (_STLP_DEBUG).
+
+***************************************************************************/
+
+#if !defined(BOOST_REGEX_LIBRARY_INCLUDE_HPP) && !defined(BOOST_REGEX_NO_LIB)
+#define BOOST_REGEX_LIBRARY_INCLUDE_HPP
+
+#define BOOST_LIB_NAME "boost_regex"
+
+//
+// select toolset:
+//
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1200) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+
+   // vc6-stlport:
+#  define BOOST_LIB_TOOLSET "vc6-stlport"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC == 1200)
+
+   // vc6:
+#  define BOOST_LIB_TOOLSET "vc6"
+
+#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1300)
+
+   // vc7:
+#  define BOOST_LIB_TOOLSET "vc7"
+
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x560)
+
+   // CBuilder 6:
+#  define BOOST_LIB_TOOLSET "bcb6"
+
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
+
+   // CBuilder 6:
+#  define BOOST_LIB_TOOLSET "bcb5"
+
+#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x540)
+
+   // CBuilder 6:
+#  define BOOST_LIB_TOOLSET "bcb4"
+
+#endif
+
+//
+// select thread opt:
+//
+#if defined(_MT) || defined(__MT__)
+#  define BOOST_LIB_THREAD_OPT "m"
+#else
+#  define BOOST_LIB_THREAD_OPT "s"
+#endif
+
+//
+// select runtime opt:
+//
+#if defined(_DLL) || defined(_RTLDLL)
+#  define BOOST_LIB_RT_OPT "d"
+#else
+#  define BOOST_LIB_RT_OPT "s"
+#endif
+
+//
+// select linkage opt:
+//
+#if (defined(_DLL) || defined(_RTLDLL)) && !defined(BOOST_REGEX_STATIC_LINK)
+#  define BOOST_LIB_LINK_OPT "i"
+#else
+#  define BOOST_LIB_LINK_OPT "s"
+#endif
+
+//
+// select debug opt:
+//
+#if defined(BOOST_MSVC) && defined(_DEBUG) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
+#  define BOOST_LIB_DEBUG_OPT "dd"
+#elif defined(BOOST_MSVC) && defined(_DEBUG)
+#  define BOOST_LIB_DEBUG_OPT "d"
+#elif defined(__BORLANDC__) && (__BORLANDC__ == 0x560) && (defined(_STLP_DEBUG) || defined(__STL_DEBUG))
+#  define BOOST_LIB_DEBUG_OPT "dd"
+#else
+#  define BOOST_LIB_DEBUG_OPT 
+#endif
+
+//
+// now include the lib:
+//
+#if defined(BOOST_LIB_NAME) \
+      && defined(BOOST_LIB_TOOLSET) \
+      && defined(BOOST_LIB_THREAD_OPT) \
+      && defined(BOOST_LIB_RT_OPT) \
+      && defined(BOOST_LIB_LINK_OPT) \
+      && defined(BOOST_LIB_DEBUG_OPT)
+
+#  pragma comment(lib, BOOST_LIB_NAME "_" BOOST_LIB_TOOLSET "_" BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT BOOST_LIB_LINK_OPT BOOST_LIB_DEBUG_OPT ".lib")
+
+#endif
+
+//
+// finally undef any macros we may have set:
+//
+#if defined(BOOST_LIB_NAME)
+#  undef BOOST_LIB_NAME
+#endif
+#if defined(BOOST_LIB_TOOLSET)
+#  undef BOOST_LIB_TOOLSET
+#endif
+#if defined(BOOST_LIB_THREAD_OPT)
+#  undef BOOST_LIB_THREAD_OPT
+#endif
+#if defined(BOOST_LIB_RT_OPT)
+#  undef BOOST_LIB_RT_OPT
+#endif
+#if defined(BOOST_LIB_LINK_OPT)
+#  undef BOOST_LIB_LINK_OPT
+#endif
+#if defined(BOOST_LIB_DEBUG_OPT)
+#  undef BOOST_LIB_DEBUG_OPT
+#endif
+
+
+#endif // BOOST_REGEX_LIBRARY_INCLUDE_HPP
+
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_match.hpp b/boost/boost/regex/detail/regex_match.hpp
new file mode 100644 (file)
index 0000000..cdcfb00
--- /dev/null
@@ -0,0 +1,1915 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_match.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Regular expression matching algorithms.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+
+#ifndef BOOST_REGEX_MATCH_HPP
+#define BOOST_REGEX_MATCH_HPP
+
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc -w-8026
+#endif
+
+//
+// Unfortunately Rogue Waves standard library appears to have a bug
+// in std::basic_string::compare that results in eroneous answers
+// in some cases (tested with Borland C++ 5.1, Rogue Wave lib version
+// 0x020101) the test case was:
+// {39135,0} < {0xff,0}
+// which succeeds when it should not.
+//
+#ifndef _RWSTD_VER
+# define STR_COMP(s,p) s.compare(p)
+#else
+template <class C, class T, class A>
+inline int string_compare(const std::basic_string<C,T,A>& s, const C* p)
+{ return s.compare(p); }
+inline int string_compare(const std::string& s, const char* p)
+{ return std::strcmp(s.c_str(), p); }
+inline int string_compare(const std::wstring& s, const wchar_t* p)
+{ return std::wcscmp(s.c_str(), p); }
+# define STR_COMP(s,p) string_compare(s,p)
+#endif
+
+template <class iterator, class charT, class traits_type, class Allocator>
+iterator BOOST_REGEX_CALL re_is_set_member(iterator next, 
+                          iterator last, 
+                          const re_set_long* set_, 
+                          const reg_expression<charT, traits_type, Allocator>& e)
+{   
+   const charT* p = reinterpret_cast<const charT*>(set_+1);
+   iterator ptr;
+   unsigned int i;
+   bool icase = e.flags() & regbase::icase;
+
+   if(next == last) return next;
+
+   typedef typename traits_type::string_type traits_string_type;
+   const traits_type& traits_inst = e.get_traits();
+   
+   // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
+   // referenced
+   (void)traits_inst;
+
+   // try and match a single character, could be a multi-character
+   // collating element...
+   for(i = 0; i < set_->csingles; ++i)
+   {
+      ptr = next;
+      if(*p == 0)
+      {
+         // treat null string as special case:
+         if(traits_inst.translate(*ptr, icase) != *p)
+         {
+            while(*p == 0)++p;
+            continue;
+         }
+         return set_->isnot ? next : (ptr == next) ? ++next : ptr;
+      }
+      else
+      {
+         while(*p && (ptr != last))
+         {
+            if(traits_inst.translate(*ptr, icase) != *p)
+               break;
+            ++p;
+            ++ptr;
+         }
+
+         if(*p == 0) // if null we've matched
+            return set_->isnot ? next : (ptr == next) ? ++next : ptr;
+
+         while(*p)++p;
+         ++p;     // skip null
+      }
+   }
+
+   charT col = traits_inst.translate(*next, icase);
+
+
+   if(set_->cranges || set_->cequivalents)
+   {
+      traits_string_type s2(1, col);
+      traits_string_type s1;
+      //
+      // try and match a range, NB only a single character can match
+      if(set_->cranges)
+      {
+         if(e.flags() & regbase::nocollate)
+            s1 = s2;
+         else
+            traits_inst.transform(s1, s2);
+         for(i = 0; i < set_->cranges; ++i)
+         {
+            if(STR_COMP(s1, p) <= 0)
+            {
+               while(*p)++p;
+               ++p;
+               if(STR_COMP(s1, p) >= 0)
+                  return set_->isnot ? next : ++next;
+            }
+            else
+            {
+               // skip first string
+               while(*p)++p;
+               ++p;
+            }
+            // skip second string
+            while(*p)++p;
+            ++p;
+         }
+      }
+      //
+      // try and match an equivalence class, NB only a single character can match
+      if(set_->cequivalents)
+      {
+         traits_inst.transform_primary(s1, s2);
+         for(i = 0; i < set_->cequivalents; ++i)
+         {
+            if(STR_COMP(s1, p) == 0)
+               return set_->isnot ? next : ++next;
+            // skip string
+            while(*p)++p;
+            ++p;
+         }
+      }
+   }
+   if(traits_inst.is_class(col, set_->cclasses) == true)
+      return set_->isnot ? next : ++next;
+   return set_->isnot ? ++next : next;
+}
+
+template <class iterator, class Allocator>
+class _priv_match_data
+{
+public:
+   typedef typename boost::detail::rebind_allocator<int, Allocator>::type i_alloc;
+   typedef typename boost::detail::rebind_allocator<iterator, Allocator>::type it_alloc;
+
+   match_results_base<iterator, Allocator> temp_match;
+   // failure stacks:
+   jstack<match_results_base<iterator, Allocator>, Allocator> matches;
+   jstack<iterator, Allocator> prev_pos;
+   jstack<const re_syntax_base*, Allocator> prev_record;
+   jstack<int, Allocator> prev_acc;
+   int* accumulators;
+   unsigned int caccumulators;
+   iterator* loop_starts;
+
+   _priv_match_data(const match_results_base<iterator, Allocator>&);
+   
+   ~_priv_match_data()
+   {
+      m_free();
+   }
+   void m_free();
+   void set_accumulator_size(unsigned int size);
+   int* get_accumulators()
+   {
+      return accumulators;
+   }
+   iterator* get_loop_starts()
+   {
+      return loop_starts;
+   }
+};
+
+template <class iterator, class Allocator>
+_priv_match_data<iterator, Allocator>::_priv_match_data(const match_results_base<iterator, Allocator>& m)
+  : temp_match(m), matches(64, m.allocator()), prev_pos(64, m.allocator()), prev_record(64, m.allocator())
+{
+  accumulators = 0;
+  caccumulators = 0;
+  loop_starts = 0;
+}
+
+template <class iterator, class Allocator>
+void _priv_match_data<iterator, Allocator>::set_accumulator_size(unsigned int size)
+{
+   if(size > caccumulators)
+   {
+      m_free();
+      caccumulators = size;
+      accumulators = i_alloc(temp_match.allocator()).allocate(caccumulators);
+      BOOST_REGEX_NOEH_ASSERT(accumulators)
+      loop_starts = it_alloc(temp_match.allocator()).allocate(caccumulators);
+      BOOST_REGEX_NOEH_ASSERT(loop_starts)
+      for(unsigned i = 0; i < caccumulators; ++i)
+         new (loop_starts + i) iterator();
+   }
+}
+
+template <class iterator, class Allocator>
+void _priv_match_data<iterator, Allocator>::m_free()
+{
+   if(caccumulators)
+   {
+      i_alloc temp1(temp_match.allocator());
+      temp1.deallocate(accumulators, caccumulators);
+      for(unsigned i = 0; i < caccumulators; ++i)
+         ::boost::re_detail::pointer_destroy(loop_starts + i);
+      it_alloc temp2(temp_match.allocator());
+      temp2.deallocate(loop_starts, caccumulators);
+   }
+}
+
+template <class charT, class traits, class Allocator>
+struct access_t : public reg_expression<charT, traits, Allocator>
+{
+   typedef typename is_byte<charT>::width_type width_type;
+   typedef reg_expression<charT, traits, Allocator> base_type;
+   typedef charT char_type;
+   typedef traits traits_type;
+   typedef Allocator alloc_type;
+
+   static int repeat_count(const base_type& b) 
+   { return base_type::repeat_count(b); }
+   static unsigned int restart_type(const base_type& b) 
+   { return base_type::restart_type(b); }
+   static const re_syntax_base* first(const base_type& b)
+   { return base_type::first(b); }
+   static const unsigned char* get_map(const base_type& b)
+   { return base_type::get_map(b); }
+   static std::size_t leading_length(const base_type& b)
+   { return base_type::leading_length(b); }
+   static const kmp_info<charT>* get_kmp(const base_type& b)
+   { return base_type::get_kmp(b); }
+   static bool can_start(char_type c, const unsigned char* _map, unsigned char mask)
+   {
+      return reg_expression<char_type, traits_type, alloc_type>::can_start(c, _map, mask, width_type());
+   }
+};
+
+
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+//
+// Ugly ugly hack,
+// template don't merge if they contain switch statements so declare these
+// templates in unnamed namespace (ie with internal linkage), each translation
+// unit then gets its own local copy, it works seemlessly but bloats the app.
+namespace{
+#endif
+
+template <class iterator, class Allocator, class charT, class traits, class Allocator2>
+bool query_match_aux(iterator first, 
+                     iterator last, 
+                     match_results<iterator, Allocator>& m, 
+                     const reg_expression<charT, traits, Allocator2>& e, 
+                     unsigned flags,
+                     _priv_match_data<iterator, Allocator>& pd,
+                     iterator* restart)
+{
+   typedef access_t<charT, traits, Allocator2> access;
+
+   if(e.flags() & regbase::failbit)
+      return false;
+
+   typedef typename traits::size_type traits_size_type;
+   typedef typename traits::uchar_type traits_uchar_type;
+   typedef typename is_byte<charT>::width_type width_type;
+
+   // declare some local aliases to reduce pointer loads
+   // good optimising compilers should make this unnecessary!!
+   jstack<match_results_base<iterator, Allocator>, Allocator>& matches = pd.matches;
+   jstack<iterator, Allocator>& prev_pos = pd.prev_pos;
+   jstack<const re_syntax_base*, Allocator>& prev_record = pd.prev_record;
+   jstack<int, Allocator>& prev_acc = pd.prev_acc;
+   match_results_base<iterator, Allocator>& temp_match = pd.temp_match;
+   temp_match.set_first(first);
+
+   const re_syntax_base* ptr = access::first(e);
+   bool match_found = false;
+   bool have_partial_match = false;
+   bool unwind_stack = false;
+   bool need_push_match = (e.mark_count() > 1);
+   int cur_acc = -1;    // no active accumulator
+   pd.set_accumulator_size(access::repeat_count(e));
+   int* accumulators = pd.get_accumulators();
+   iterator* start_loop = pd.get_loop_starts();
+   int k; // for loops
+   bool icase = e.flags() & regbase::icase;
+   *restart = first;
+   iterator base = first;
+   const traits& traits_inst = e.get_traits();
+   // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
+   // referenced
+   (void)traits_inst;
+
+   // prepare m for failure:
+   /*
+   if((flags & match_init) == 0)
+   {
+      m.init_fail(first, last);
+   } */
+
+   retry:
+
+   while(first != last)
+   {
+      jm_assert(ptr);
+      switch(ptr->type)
+      {
+      case syntax_element_match:
+         match_jump:
+         {
+            // match found, save then fallback in case we missed a
+            // longer one.
+            if((flags & match_not_null) && (first == temp_match[0].first))
+               goto failure;
+            temp_match.set_second(first);
+            m.maybe_assign(temp_match);
+            match_found = true;
+            if(((flags & match_any) && ((first == last) || !(flags & match_all))) || ((first == last) && (need_push_match == false)))
+            {
+               // either we don't care what we match or we've matched
+               // the whole string and can't match anything longer.
+               while(matches.empty() == false)
+                  matches.pop();
+               while(prev_pos.empty() == false)
+                  prev_pos.pop();
+               while(prev_record.empty() == false)
+                  prev_record.pop();
+               while(prev_acc.empty() == false)
+                  prev_acc.pop();
+               return true;
+            }
+         }
+         goto failure;
+      case syntax_element_startmark:
+         start_mark_jump:
+         if(static_cast<const re_brace*>(ptr)->index > 0)
+         {
+            temp_match.set_first(first, static_cast<const re_brace*>(ptr)->index);
+         }
+         else if(
+            (static_cast<const re_brace*>(ptr)->index == -1)
+            || (static_cast<const re_brace*>(ptr)->index == -2)
+         )
+         {
+           matches.push(temp_match);
+            for(k = 0; k <= cur_acc; ++k)
+               prev_pos.push(start_loop[k]);
+            prev_pos.push(first);
+            prev_record.push(ptr);
+            for(k = 0; k <= cur_acc; ++k)
+               prev_acc.push(accumulators[k]);
+            prev_acc.push(cur_acc);
+            prev_acc.push(match_found);
+            match_found = false;
+            // skip next jump and fall through:
+            ptr = ptr->next.p;
+         }
+         ptr = ptr->next.p;
+         break;
+      case syntax_element_endmark:
+         end_mark_jump:
+         if(static_cast<const re_brace*>(ptr)->index > 0)
+         {
+            temp_match.set_second(first, static_cast<const re_brace*>(ptr)->index);
+         }
+         else if(
+            (static_cast<const re_brace*>(ptr)->index == -1)
+            || (static_cast<const re_brace*>(ptr)->index == -2)
+         )
+         {
+            match_found = true;
+            unwind_stack = true;
+            goto failure;
+         }
+         ptr = ptr->next.p;
+         break;
+      case syntax_element_literal:
+      {
+         unsigned int len = static_cast<const re_literal*>(ptr)->length;
+         const charT* what = reinterpret_cast<const charT*>(static_cast<const re_literal*>(ptr) + 1);
+         //
+         // compare string with what we stored in
+         // our records:
+         for(unsigned int i = 0; i < len; ++i, ++first)
+         {
+            if((first == last) || (traits_inst.translate(*first, icase) != what[i]))
+               goto failure;
+         }
+         ptr = ptr->next.p;
+         break;
+      }
+      case syntax_element_start_line:
+         outer_line_check:
+         if(first == temp_match[0].first)
+         {
+            // we're at the start of the buffer
+            if(flags & match_prev_avail)
+            {
+               inner_line_check:
+               // check the previous value even though its before
+               // the start of our "buffer".
+               iterator t(first);
+               --t;
+               if(traits::is_separator(*t) && !((*t == '\r') && (*first == '\n')) )
+               {
+                  ptr = ptr->next.p;
+                  continue;
+               }
+               goto failure;
+            }
+            if((flags & match_not_bol) == 0)
+            {
+               ptr = ptr->next.p;
+               continue;
+            }
+            goto failure;
+         }
+         // we're in the middle of the string
+         goto inner_line_check;
+      case syntax_element_end_line:
+         // we're not yet at the end so *first is always valid:
+         if(traits::is_separator(*first))
+         {
+            if((first != base) || (flags & match_prev_avail))
+            {
+               // check that we're not in the middle of \r\n sequence
+               iterator t(first);
+               --t;
+               if((*t == '\r') && (*first == '\n'))
+               {
+                  goto failure;
+               }
+            }
+            ptr = ptr->next.p;
+            continue;
+         }
+         goto failure;
+      case syntax_element_wild:
+         // anything except possibly NULL or \n:
+         if(traits::is_separator(*first))
+         {
+            if(flags & match_not_dot_newline)
+               goto failure;
+            ptr = ptr->next.p;
+            ++first;
+            continue;
+         }
+         if(*first == charT(0))
+         {
+            if(flags & match_not_dot_null)
+               goto failure;
+            ptr = ptr->next.p;
+            ++first;
+            continue;
+         }
+         ptr = ptr->next.p;
+         ++first;
+         break;
+      case syntax_element_word_boundary:
+      {
+         // prev and this character must be opposites:
+         bool b = traits_inst.is_class(*first, traits::char_class_word);
+         if((first == temp_match[0].first)  && ((flags & match_prev_avail) == 0))
+         {
+            if(flags & match_not_bow)
+               b ^= true;
+            else
+               b ^= false;
+         }
+         else
+         {
+            --first;
+            b ^= traits_inst.is_class(*first, traits::char_class_word);
+            ++first;
+         }
+         if(b)
+         {
+            ptr = ptr->next.p;
+            continue;
+         }
+         goto failure;
+      }
+      case syntax_element_within_word:
+         // both prev and this character must be traits::char_class_word:
+         if(traits_inst.is_class(*first, traits::char_class_word))
+         {
+            bool b;
+            if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
+               b = false;
+            else
+            {
+               --first;
+               b = traits_inst.is_class(*first, traits::char_class_word);
+               ++first;
+            }
+            if(b)
+            {
+               ptr = ptr->next.p;
+               continue;
+            }
+         }
+         goto failure;
+      case syntax_element_word_start:
+         if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
+         {
+            // start of buffer:
+            if(flags & match_not_bow)
+               goto failure;
+            if(traits_inst.is_class(*first, traits::char_class_word))
+            {
+               ptr = ptr->next.p;
+               continue;
+            }
+            goto failure;
+         }
+         // otherwise inside buffer:
+         if(traits_inst.is_class(*first, traits::char_class_word))
+         {
+            iterator t(first);
+            --t;
+            if(traits_inst.is_class(*t, traits::char_class_word) == false)
+            {
+               ptr = ptr->next.p;
+               continue;
+            }
+         }
+         goto failure;      // if we fall through to here then we've failed
+      case syntax_element_word_end:
+         if((first == temp_match[0].first) && ((flags & match_prev_avail) == 0))
+            goto failure;  // start of buffer can't be end of word
+
+         // otherwise inside buffer:
+         if(traits_inst.is_class(*first, traits::char_class_word) == false)
+         {
+            iterator t(first);
+            --t;
+            if(traits_inst.is_class(*t, traits::char_class_word))
+            {
+               ptr = ptr->next.p;
+               continue;
+            }
+         }
+         goto failure;      // if we fall through to here then we've failed
+      case syntax_element_buffer_start:
+         if((first != temp_match[0].first) || (flags & match_not_bob))
+            goto failure;
+         // OK match:
+         ptr = ptr->next.p;
+         break;
+      case syntax_element_buffer_end:
+         if((first != last) || (flags & match_not_eob))
+            goto failure;
+         // OK match:
+         ptr = ptr->next.p;
+         break;
+      case syntax_element_backref:
+      {
+         // compare with what we previously matched:
+         iterator i = temp_match[static_cast<const re_brace*>(ptr)->index].first;
+         iterator j = temp_match[static_cast<const re_brace*>(ptr)->index].second;
+         while(i != j)
+         {
+            if((first == last) || (traits_inst.translate(*first, icase) != traits_inst.translate(*i, icase)))
+               goto failure;
+            ++i;
+            ++first;
+         }
+         ptr = ptr->next.p;
+         break;
+      }
+      case syntax_element_long_set:
+      {
+         // let the traits class do the work:
+         iterator t = re_is_set_member(first, last, static_cast<const re_set_long*>(ptr), e);
+         if(t != first)
+         {
+            ptr = ptr->next.p;
+            first = t;
+            continue;
+         }
+         goto failure;
+      }
+      case syntax_element_set:
+         // lookup character in table:
+         if(static_cast<const re_set*>(ptr)->_map[(traits_uchar_type)traits_inst.translate(*first, icase)])
+         {
+            ptr = ptr->next.p;
+            ++first;
+            continue;
+         }
+         goto failure;
+      case syntax_element_jump:
+         ptr = static_cast<const re_jump*>(ptr)->alt.p;
+         continue;
+      case syntax_element_alt:
+      {
+         // alt_jump:
+         if(access::can_start(*first, static_cast<const re_jump*>(ptr)->_map, (unsigned char)mask_take))
+         {
+            // we can take the first alternative,
+            // see if we need to push next alternative:
+            if(access::can_start(*first, static_cast<const re_jump*>(ptr)->_map, mask_skip))
+            {
+               if(need_push_match)
+                  matches.push(temp_match);
+               for(k = 0; k <= cur_acc; ++k)
+                  prev_pos.push(start_loop[k]);
+               prev_pos.push(first);
+               prev_record.push(ptr);
+               for(k = 0; k <= cur_acc; ++k)
+                  prev_acc.push(accumulators[k]);
+               prev_acc.push(cur_acc);
+            }
+            ptr = ptr->next.p;
+            continue;
+         }
+         if(access::can_start(*first, static_cast<const re_jump*>(ptr)->_map, mask_skip))
+         {
+            ptr = static_cast<const re_jump*>(ptr)->alt.p;
+            continue;
+         }
+         goto failure;  // neither option is possible
+      }
+      case syntax_element_rep:
+      {
+         // repeater_jump:
+         // if we're moving to a higher id (nested repeats etc)
+         // zero out our accumualtors:
+         if(cur_acc < static_cast<const re_repeat*>(ptr)->id)
+         {
+            cur_acc = static_cast<const re_repeat*>(ptr)->id;
+            accumulators[cur_acc] = 0;
+            start_loop[cur_acc] = first;
+         }
+
+         cur_acc = static_cast<const re_repeat*>(ptr)->id;
+
+         if(static_cast<const re_repeat*>(ptr)->leading)
+            *restart = first;
+
+         //charT c = traits_inst.translate(*first);
+
+         // first of all test for special case where this is last element,
+         // if that is the case then repeat as many times as possible,
+         // as long as the repeat is greedy:
+
+         if((static_cast<const re_repeat*>(ptr)->alt.p->type == syntax_element_match)
+            && (static_cast<const re_repeat*>(ptr)->greedy == true))
+         {
+            // see if we can take the repeat:
+            if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
+                  && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_take))
+            {
+               // push terminating match as fallback:
+               if((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
+               {
+                  if((prev_record.empty() == false) && (prev_record.peek() == static_cast<const re_repeat*>(ptr)->alt.p))
+                  {
+                     // we already have the required fallback
+                     // don't add any more, just update this one:
+                     if(need_push_match)
+                        matches.peek() = temp_match;
+                     prev_pos.peek() = first;
+                  }
+                  else
+                  {
+                     if(need_push_match)
+                        matches.push(temp_match);
+                     prev_pos.push(first);
+                     prev_record.push(static_cast<const re_repeat*>(ptr)->alt.p);
+                  }
+               }
+               // move to next item in list:
+               if((first != start_loop[cur_acc]) || !accumulators[cur_acc])
+               {
+                  ++accumulators[cur_acc];
+                  ptr = ptr->next.p;
+                  start_loop[cur_acc] = first;
+                  continue;
+               }
+               goto failure;
+            }
+            // see if we can skip the repeat:
+            if(((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
+               && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_skip))
+            {
+               ptr = static_cast<const re_repeat*>(ptr)->alt.p;
+               continue;
+            }
+            // otherwise fail:
+            goto failure;
+         }
+
+         // OK if we get to here then the repeat is either non-terminal or non-greedy,
+         // see if we can skip the repeat:
+         if(((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
+            && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_skip))
+         {
+            // see if we can push failure info:
+            if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
+               && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_take))
+            {
+               // check to see if the last loop matched a NULL string
+               // if so then we really don't want to loop again:
+               if(((unsigned int)accumulators[cur_acc] == static_cast<const re_repeat*>(ptr)->min)
+                  || (first != start_loop[cur_acc]))
+               {
+                  if(need_push_match)
+                     matches.push(temp_match);
+                  prev_pos.push(first);
+                  prev_record.push(ptr);
+                  for(k = 0; k <= cur_acc; ++k)
+                     prev_acc.push(accumulators[k]);
+                  // for non-greedy repeats save whether we have a match already:
+                  if(static_cast<const re_repeat*>(ptr)->greedy == false)
+                  {
+                     prev_acc.push(match_found);
+                     match_found = false;
+                  }
+               }
+            }
+            ptr = static_cast<const re_repeat*>(ptr)->alt.p;
+            continue;
+         }
+
+         // otherwise see if we can take the repeat:
+         if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
+               && access::can_start(*first, static_cast<const re_repeat*>(ptr)->_map, mask_take) &&
+               ((first != start_loop[cur_acc]) || !accumulators[cur_acc]))
+         {
+            // move to next item in list:
+            ++accumulators[cur_acc];
+            ptr = ptr->next.p;
+            start_loop[cur_acc] = first;
+            continue;
+         }
+
+         // if we get here then neither option is allowed so fail:
+         goto failure;
+
+      }
+      case syntax_element_combining:
+         if(traits_inst.is_combining(traits_inst.translate(*first, icase)))
+            goto failure;
+         ++first;
+         while((first != last) && traits_inst.is_combining(traits_inst.translate(*first, icase)))++first;
+         ptr = ptr->next.p;
+         continue;
+      case syntax_element_soft_buffer_end:
+         {
+            if(flags & match_not_eob)
+               goto failure;
+            iterator p(first);
+            while((p != last) && traits_inst.is_separator(traits_inst.translate(*first, icase)))++p;
+            if(p != last)
+               goto failure;
+            ptr = ptr->next.p;
+            continue;
+         }
+      case syntax_element_restart_continue:
+         if(first != temp_match[-1].first)
+            goto failure;
+         ptr = ptr->next.p;
+         continue;
+      default:
+         jm_assert(0); // should never get to here!!
+         return false;
+      }
+   }
+
+   //
+   // if we get to here then we've run out of characters to match against,
+   // we could however still have non-character regex items left
+   if((ptr->can_be_null == 0) && ((flags & match_partial) == 0))
+      goto failure;
+   while(true)
+   {
+      jm_assert(ptr);
+      switch(ptr->type)
+      {
+      case syntax_element_match:
+         goto match_jump;
+      case syntax_element_startmark:
+         goto start_mark_jump;
+      case syntax_element_endmark:
+         goto end_mark_jump;
+      case syntax_element_start_line:
+         goto outer_line_check;
+      case syntax_element_end_line:
+         // we're at the end so *first is never valid:
+         if((flags & match_not_eol) == 0)
+         {
+            ptr = ptr->next.p;
+            continue;
+         }
+         goto failure;
+      case syntax_element_word_boundary:
+      case syntax_element_word_end:
+         if(((flags & match_not_eow) == 0) && (first != temp_match[0].first))
+         {
+            iterator t(first);
+            --t;
+            if(traits_inst.is_class(*t, traits::char_class_word))
+            {
+               ptr = ptr->next.p;
+               continue;
+            }
+         }
+         goto failure;
+      case syntax_element_buffer_end:
+      case syntax_element_soft_buffer_end:
+         if(flags & match_not_eob)
+            goto failure;
+         // OK match:
+         ptr = ptr->next.p;
+         break;
+      case syntax_element_jump:
+         ptr = static_cast<const re_jump*>(ptr)->alt.p;
+         continue;
+      case syntax_element_alt:
+         if(ptr->can_be_null & mask_take)
+         {
+            // we can test the first alternative,
+            // see if we need to push next alternative:
+            if(ptr->can_be_null & mask_skip)
+            {
+               if(need_push_match)
+                  matches.push(temp_match);
+               for(k = 0; k <= cur_acc; ++k)
+                  prev_pos.push(start_loop[k]);
+               prev_pos.push(first);
+               prev_record.push(ptr);
+               for(k = 0; k <= cur_acc; ++k)
+                  prev_acc.push(accumulators[k]);
+               prev_acc.push(cur_acc);
+            }
+            ptr = ptr->next.p;
+            continue;
+         }
+         if(ptr->can_be_null & mask_skip)
+         {
+            ptr = static_cast<const re_jump*>(ptr)->alt.p;
+            continue;
+         }
+         goto failure;  // neither option is possible
+      case syntax_element_rep:
+         // if we're moving to a higher id (nested repeats etc)
+         // zero out our accumualtors:
+         if(cur_acc < static_cast<const re_repeat*>(ptr)->id)
+         {
+            cur_acc = static_cast<const re_repeat*>(ptr)->id;
+            accumulators[cur_acc] = 0;
+            start_loop[cur_acc] = first;
+         }
+
+         cur_acc = static_cast<const re_repeat*>(ptr)->id;
+
+         // see if we can skip the repeat:
+         if(((unsigned int)accumulators[cur_acc] >= static_cast<const re_repeat*>(ptr)->min)
+            && ((ptr->can_be_null & mask_skip) || (flags & match_partial)))
+         {
+            // don't push failure info, there's no point:
+            ptr = static_cast<const re_repeat*>(ptr)->alt.p;
+            continue;
+         }
+
+         // otherwise see if we can take the repeat:
+         if(((unsigned int)accumulators[cur_acc] < static_cast<const re_repeat*>(ptr)->max)
+               && (((ptr->can_be_null & (mask_take | mask_skip)) == (mask_take | mask_skip))) || (flags & match_partial))
+         {
+            // move to next item in list:
+            ++accumulators[cur_acc];
+            ptr = ptr->next.p;
+            start_loop[cur_acc] = first;
+            continue;
+         }
+
+         // if we get here then neither option is allowed so fail:
+         goto failure;
+      case syntax_element_restart_continue:
+         if(first != temp_match[-1].first)
+            goto failure;
+         ptr = ptr->next.p;
+         continue;
+      default:
+         goto failure;
+      }
+   }
+
+   failure:
+
+   //
+   // check for possible partial match:
+   //
+   if((flags & match_partial)
+      && !match_found          // no full match already
+      && (base != first)       // some charcters have been consumed
+      && (first == last))      // end of input has been reached
+   {
+      have_partial_match = true;
+      temp_match.set_second(first, 0, false);
+      m.maybe_assign(temp_match);
+   }
+
+   if(prev_record.empty() == false)
+   {
+      ptr = prev_record.peek();
+      switch(ptr->type)
+      {
+      case syntax_element_alt:
+         // get next alternative:
+         ptr = static_cast<const re_jump*>(ptr)->alt.p;
+         if(need_push_match)
+            matches.pop(temp_match);
+         prev_acc.pop(cur_acc);
+         for(k = cur_acc; k >= 0; --k)
+            prev_acc.pop(accumulators[k]);
+         prev_pos.pop(first);
+         for(k = cur_acc; k >= 0; --k)
+            prev_pos.pop(start_loop[k]);
+         prev_record.pop();
+         if(unwind_stack) goto failure; // unwinding forward assert
+         goto retry;
+      case syntax_element_rep:
+      {
+         // we're doing least number of repeats first,
+         // increment count and repeat again:
+         bool saved_matched = match_found;
+         if(need_push_match)
+            matches.pop(temp_match);
+         prev_pos.pop(first);
+         cur_acc = static_cast<const re_repeat*>(ptr)->id;
+         if(static_cast<const re_repeat*>(ptr)->greedy == false)
+         {
+            saved_matched = prev_acc.peek();
+            prev_acc.pop();
+         }
+         for(k = cur_acc; k >= 0; --k)
+            prev_acc.pop(accumulators[k]);
+         prev_record.pop();
+         if(unwind_stack) goto failure; // unwinding forward assert
+         if((unsigned int)++accumulators[cur_acc] > static_cast<const re_repeat*>(ptr)->max)
+            goto failure;  // repetions exhausted.
+         //
+         // if the repeat is non-greedy, and we found a match then fail again:
+         if((static_cast<const re_repeat*>(ptr)->greedy == false) && (match_found == true))
+         {
+            goto failure;
+         }
+         else if (match_found == false)
+            match_found = saved_matched;
+         ptr = ptr->next.p;
+         start_loop[cur_acc] = first;
+         goto retry;
+      }
+      case syntax_element_startmark:
+      {
+         bool saved_matched = match_found;
+         matches.pop(temp_match);
+         match_found = prev_acc.peek();
+         prev_acc.pop();
+         prev_acc.pop(cur_acc);
+         for(k = cur_acc; k >= 0; --k)
+            prev_acc.pop(accumulators[k]);
+         prev_pos.pop(first);
+         for(k = cur_acc; k >= 0; --k)
+            prev_pos.pop(start_loop[k]);
+         prev_record.pop();
+         unwind_stack = false;
+         if(static_cast<const re_brace*>(ptr)->index == -1)
+         {
+            if (saved_matched == false)
+               goto failure;
+            ptr = static_cast<const re_jump*>(ptr->next.p)->alt.p->next.p;
+            goto retry;
+         }
+         if(static_cast<const re_brace*>(ptr)->index == -2)
+         {
+            if (saved_matched == true)
+               goto failure;
+            ptr = static_cast<const re_jump*>(ptr->next.p)->alt.p->next.p;
+            goto retry;
+         }
+         else goto failure;
+      }
+      case syntax_element_match:
+         if(need_push_match)
+            matches.pop(temp_match);
+         prev_pos.pop(first);
+         prev_record.pop();
+         if(unwind_stack) goto failure; // unwinding forward assert
+         goto retry;
+     default:
+         jm_assert(0);
+         // mustn't get here!!
+      }
+   }
+
+   if(match_found || have_partial_match)
+      return true;
+
+   // if we get to here then everything has failed
+   // and no match was found:
+   return false;
+}
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+} // namespace
+#endif
+
+
+template <class iterator>
+void _skip_and_inc(unsigned int& clines, iterator& last_line, iterator& first, const iterator last)
+{
+   while(first != last)
+   {
+      if(*first == '\n')
+      {
+         last_line = ++first;
+         ++clines;
+      }
+      else
+         ++first;
+   }
+}
+
+template <class iterator>
+void _skip_and_dec(unsigned int& clines, iterator& last_line, iterator& first, iterator base, std::size_t len)
+{
+   bool need_line = false;
+   for(std::size_t i = 0; i < len; ++i)
+   {
+      --first;
+      if(*first == '\n')
+      {
+         need_line = true;
+         --clines;
+      }
+   }
+
+   if(need_line)
+   {
+      last_line = first;
+
+      if(last_line != base)
+         --last_line;
+      else
+         return;
+
+      while((last_line != base) && (*last_line != '\n'))
+         --last_line;
+      if(*last_line == '\n')
+         ++last_line;
+   }
+}
+
+template <class iterator>
+inline void _inc_one(unsigned int& clines, iterator& last_line, iterator& first)
+{
+   if(*first == '\n')
+   {
+      last_line = ++first;
+      ++clines;
+   }
+   else
+      ++first;
+}
+
+template <class iterator, class Allocator>
+struct grep_search_predicate
+{
+   match_results<iterator, Allocator>* pm;
+   grep_search_predicate(match_results<iterator, Allocator>* p) : pm(p) {}
+   bool operator()(const match_results<iterator, Allocator>& m) 
+   {
+      *pm = static_cast<const match_results_base<iterator, Allocator>&>(m);
+      return false;
+   }
+};
+
+#if !defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+template <class iterator, class Allocator>
+inline const match_results_base<iterator, Allocator>& grep_out_type(const grep_search_predicate<iterator, Allocator>& o, const Allocator&)
+{
+   return *(o.pm);
+}
+
+#endif
+
+template <class T, class Allocator>
+inline const Allocator& grep_out_type(const T&, const Allocator& a)
+{
+   return a;
+}
+
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+//
+// Ugly ugly hack,
+// template don't merge if they contain switch statements so declare these
+// templates in unnamed namespace (ie with internal linkage), each translation
+// unit then gets its own local copy, it works seemlessly but bloats the app.
+namespace{
+#endif
+
+//
+// reg_grep2:
+// find all non-overlapping matches within the sequence first last:
+//
+template <class Predicate, class I, class charT, class traits, class A, class A2>
+unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<charT, traits, A>& e, unsigned flags, A2 a)
+{
+   typedef access_t<charT, traits, A> access;
+
+   if(e.flags() & regbase::failbit)
+      return 0;
+
+   typedef typename traits::size_type traits_size_type;
+   typedef typename traits::uchar_type traits_uchar_type;
+   typedef typename is_byte<charT>::width_type width_type;
+
+   match_results<I, A2> m(grep_out_type(foo, a));
+   I restart;
+   m.set_size(e.mark_count(), first, last);
+   m.set_line(1, first);
+   m.set_base(first);
+
+   unsigned int clines = 1;
+   unsigned int cmatches = 0;
+   I last_line = first;
+   I next_base;
+   I base = first;
+   bool need_init;
+   const traits& traits_inst = e.get_traits();
+   // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is never
+   // referenced
+   (void)traits_inst;
+
+   flags |= match_init;
+
+   _priv_match_data<I, A2> pd(m);
+
+   const unsigned char* _map = access::get_map(e);
+   unsigned int type;
+
+   if(first == last)
+   {
+      // special case, only test if can_be_null,
+      // don't dereference any pointers!!
+      if(access::first(e)->can_be_null)
+      {
+         if(query_match_aux(first, last, m, e, flags, pd, &restart))
+         {
+            foo(m);
+            ++cmatches;
+         }
+      }
+      return cmatches;
+   }
+
+   // try one time whatever:
+   if( access::can_start(*first, _map, (unsigned char)mask_any) )
+   {
+      if(query_match_aux(first, last, m, e, flags, pd, &restart))
+      {
+         ++cmatches;
+         if(foo(m) == false)
+            return cmatches;
+         if(m[0].second == last)
+            return cmatches;
+         // update to end of what matched
+         // trying to match again with match_not_null set if this 
+         // is a null match...
+         need_init = true;
+         if(first == m[0].second)
+         {
+            next_base = m[0].second;
+            pd.temp_match.init_fail(next_base, last);
+            m.init_fail(next_base, last);
+            if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
+            {
+               ++cmatches;
+               if(foo(m) == false)
+                  return cmatches;
+            }
+            else
+            {
+               need_init = false;
+               for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                   {} // dwa 10/20/2000 - warning suppression for MWCW
+               if(restart != last)
+                  ++restart;
+               _skip_and_inc(clines, last_line, first, restart);
+            }
+         }
+         if(need_init)
+         {
+            _skip_and_inc(clines, last_line, first, m[0].second);
+            next_base = m[0].second;
+            pd.temp_match.init_fail(next_base, last);
+            m.init_fail(next_base, last);
+         }
+      }
+      else
+      {
+         for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+             {} // dwa 10/20/2000 - warning suppression for MWCW
+         if(restart != last)
+            ++restart;
+         _skip_and_inc(clines, last_line, first, restart);
+      }
+   }
+   else
+      _inc_one(clines, last_line, first); 
+   flags |= match_prev_avail | match_not_bob;
+
+   
+   // depending on what the first record is we may be able to
+   // optimise the search:
+   type = (flags & match_continuous) ? 
+      static_cast<unsigned int>(regbase::restart_continue) 
+         : static_cast<unsigned int>(access::restart_type(e));
+
+   if(type == regbase::restart_buf)
+      return cmatches;
+
+   switch(type)
+   {
+   case regbase::restart_lit: 
+   case regbase::restart_fixed_lit:
+   {
+      const kmp_info<charT>* info = access::get_kmp(e);
+     std::ptrdiff_t len = info->len;
+      const charT* x = info->pstr;
+     std::ptrdiff_t j = 0; 
+      bool icase = e.flags() & regbase::icase;
+      while (first != last) 
+      {
+         while((j > -1) && (x[j] != traits_inst.translate(*first, icase))) 
+            j = info->kmp_next[j];
+         _inc_one(clines, last_line, first);
+         ++j;
+         if(j >= len) 
+         {
+            if(type == regbase::restart_fixed_lit)
+            {
+               _skip_and_dec(clines, last_line, first, base, j);
+               restart = first;
+               std::advance(restart, len);
+               m.set_first(first);
+               m.set_second(restart);
+               m.set_line(clines, last_line);
+               ++cmatches;
+               if(foo(m) == false)
+                  return cmatches;
+               if(m[0].second == last)
+                  return cmatches;
+               _skip_and_inc(clines, last_line, first, restart);
+               next_base = m[0].second;
+               pd.temp_match.init_fail(next_base, last);
+               m.init_fail(next_base, last);
+               j = 0;
+            }
+            else
+            {
+               restart = first;
+               _skip_and_dec(clines, last_line, first, base, j);
+               if(query_match_aux(first, last, m, e, flags, pd, &restart))
+               {
+
+                  m.set_line(clines, last_line);
+                  ++cmatches;
+                  if(foo(m) == false)
+                     return cmatches;
+                  if(m[0].second == last)
+                     return cmatches;
+                  // update to end of what matched
+                 _skip_and_inc(clines, last_line, first, m[0].second);
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+                  j = 0;
+               }
+               else
+               {
+                  for(int k = 0; (restart != first) && (k < j); ++k, --restart)
+                      {} // dwa 10/20/2000 - warning suppression for MWCW
+                  if(restart != last)
+                     ++restart;
+                  _skip_and_inc(clines, last_line, first, restart);
+                  j = 0;  //we could do better than this...
+               }
+            }
+         }
+      }
+      break;
+   }
+   case regbase::restart_any:
+   {
+      while(first != last)
+      {
+         if( access::can_start(*first, _map, (unsigned char)mask_any) )
+         {
+            if(query_match_aux(first, last, m, e, flags, pd, &restart))
+            {
+
+               m.set_line(clines, last_line);
+               ++cmatches;
+               if(foo(m) == false)
+                  return cmatches;
+               if(m[0].second == last)
+                  return cmatches;
+               // update to end of what matched
+               // trying to match again with match_not_null set if this 
+               // is a null match...
+               need_init = true;
+               if(first == m[0].second)
+               {
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+                  if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
+                  {
+                     m.set_line(clines, last_line);
+                     ++cmatches;
+                     if(foo(m) == false)
+                        return cmatches;
+                  }
+                  else
+                  {
+                     need_init = false;
+                     for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                         {} // dwa 10/20/2000 - warning suppression for MWCW
+                     if(restart != last)
+                        ++restart;
+                     _skip_and_inc(clines, last_line, first, restart);
+                  }
+               }
+               if(need_init)
+               {
+                 _skip_and_inc(clines, last_line, first, m[0].second);
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+               }
+               continue;
+            }
+            else
+            {
+               for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                   {} // dwa 10/20/2000 - warning suppression for MWCW
+               if(restart != last)
+                  ++restart;
+               _skip_and_inc(clines, last_line, first, restart);
+            }
+         }
+         else
+            _inc_one(clines, last_line, first);
+      }
+   }
+   break;
+   case regbase::restart_word:
+   {
+      // do search optimised for word starts:
+      while(first != last)
+      {
+         --first;
+         if(*first == '\n')
+            --clines;
+         // skip the word characters:
+         while((first != last) && traits_inst.is_class(*first, traits::char_class_word))
+            ++first;
+         // now skip the white space:
+         while((first != last) && (traits_inst.is_class(*first, traits::char_class_word) == false))
+         {
+         #ifdef __GNUC__
+            //
+            // hack to work around gcc optimisation bug
+            // just expand the contents of _inc_one here:
+            if(*first == '\n')
+            {
+               last_line = ++first;
+               ++clines;
+            }
+            else
+               ++first;
+         #else         
+            _inc_one(clines, last_line, first); 
+         #endif
+         }
+         if(first == last)
+            break;
+
+         if( access::can_start(*first, _map, (unsigned char)mask_any) )
+         {
+            if(query_match_aux(first, last, m, e, flags, pd, &restart))
+            {
+               m.set_line(clines, last_line);
+               ++cmatches;
+               if(foo(m) == false)
+                  return cmatches;
+               if(m[0].second == last)
+                  return cmatches;
+               // update to end of what matched
+               // trying to match again with match_not_null set if this
+               // is a null match...
+               need_init = true;
+               if(first == m[0].second)
+               {
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+                  if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
+                  {
+                     m.set_line(clines, last_line);
+                     ++cmatches;
+                     if(foo(m) == false)
+                        return cmatches;
+                  }
+                  else
+                  {
+                     need_init = false;
+                     for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                         {} // dwa 10/20/2000 - warning suppression for MWCW
+                     if(restart != last)
+                        ++restart;
+                     _skip_and_inc(clines, last_line, first, restart);
+                  }
+               }
+               if(need_init)
+               {
+                  _skip_and_inc(clines, last_line, first, m[0].second);
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+               }
+            }
+            else
+            {
+               for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                   {} // dwa 10/20/2000 - warning suppression for MWCW
+               if(restart != last)
+                  ++restart;
+               _skip_and_inc(clines, last_line, first, restart);
+            }
+         }
+         else
+            _inc_one(clines, last_line, first);
+      }
+   }
+   break;
+   case regbase::restart_line:
+   {
+      // do search optimised for line starts:
+      while(first != last)
+      {
+         // find first charcter after a line break:
+         --first;
+         if(*first == '\n')
+            --clines;
+         while((first != last) && (*first != '\n'))
+            ++first;
+         if(first == last)
+            break;
+         ++first;
+         if(first == last)
+            break;
+
+         ++clines;
+         last_line = first;
+
+         if( access::can_start(*first, _map, (unsigned char)mask_any) )
+         {
+            if(query_match_aux(first, last, m, e, flags, pd, &restart))
+            {
+               m.set_line(clines, last_line);
+               ++cmatches;
+               if(foo(m) == false)
+                  return cmatches;
+               if(m[0].second == last)
+                  return cmatches;
+               // update to end of what matched
+               // trying to match again with match_not_null set if this
+               // is a null match...
+               need_init = true;
+               if(first == m[0].second)
+               {
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+                  if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
+                  {
+                     m.set_line(clines, last_line);
+                     ++cmatches;
+                     if(foo(m) == false)
+                        return cmatches;
+                  }
+                  else
+                  {
+                     need_init = false;
+                     for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                         {} // dwa 10/20/2000 - warning suppression for MWCW
+                     if(restart != last)
+                        ++restart;
+                     _skip_and_inc(clines, last_line, first, restart);
+                  }
+               }
+               if(need_init)
+               {
+                  _skip_and_inc(clines, last_line, first, m[0].second);
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+               }
+            }
+            else
+            {
+               for(unsigned int i = 0; (restart != first) && (i < access::leading_length(e)); ++i, --restart)
+                   {} // dwa 10/20/2000 - warning suppression for MWCW
+               if(restart != last)
+                  ++restart;
+               _skip_and_inc(clines, last_line, first, restart);
+            }
+         }
+         else
+            _inc_one(clines, last_line, first);
+      }
+   }
+   break;
+   case regbase::restart_continue:
+   {
+      while(first != last)
+      {
+         if( access::can_start(*first, _map, (unsigned char)mask_any) )
+         {
+            if(query_match_aux(first, last, m, e, flags, pd, &restart))
+            {
+               m.set_line(clines, last_line);
+               ++cmatches;
+               if(foo(m) == false)
+                  return cmatches;
+               if(m[0].second == last)
+                  return cmatches;
+               // update to end of what matched
+               // trying to match again with match_not_null set if this
+               // is a null match...
+               if(first == m[0].second)
+               {
+                  next_base = m[0].second;
+                  pd.temp_match.init_fail(next_base, last);
+                  m.init_fail(next_base, last);
+                  if(query_match_aux(first, last, m, e, flags | match_not_null, pd, &restart))
+                  {
+                     m.set_line(clines, last_line);
+                     ++cmatches;
+                     if(foo(m) == false)
+                        return cmatches;
+                  }
+                  else
+                     return cmatches;  // can't continue from null match
+               }
+               _skip_and_inc(clines, last_line, first, m[0].second);
+               next_base = m[0].second;
+               pd.temp_match.init_fail(next_base, last);
+               m.init_fail(next_base, last);
+               continue;
+            }
+         }
+         return cmatches;
+      }
+   }
+   break;
+   }
+
+
+   // finally check trailing null string:
+   if(access::first(e)->can_be_null)
+   {
+      if(query_match_aux(first, last, m, e, flags, pd, &restart))
+      {
+         m.set_line(clines, last_line);
+         ++cmatches;
+         if(foo(m) == false)
+            return cmatches;
+      }
+   }
+
+   return cmatches;
+}
+#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
+} // namespace {anon}
+#endif
+
+} // namespace re_detail
+
+//
+// proc regex_match
+// returns true if the specified regular expression matches
+// the whole of the input.  Fills in what matched in m.
+//
+template <class iterator, class Allocator, class charT, class traits, class Allocator2>
+bool regex_match(iterator first, iterator last, match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
+{
+   // prepare m for failure:
+   if((flags & match_init) == 0)
+   {
+      m.set_size(e.mark_count(), first, last);
+      m.set_base(first);
+      m.set_line(1, first);
+   }
+   flags |= match_all; // must match all of input.
+   re_detail::_priv_match_data<iterator, Allocator> pd(m);
+   iterator restart;
+   bool result = re_detail::query_match_aux(first, last, m, e, flags, pd, &restart);
+   if(result && (last == m[0].second))
+      return true;
+   return false;
+}
+template <class iterator, class charT, class traits, class Allocator2>
+bool regex_match(iterator first, iterator last, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
+{
+   match_results<iterator> m;
+   return regex_match(first, last, m, e, flags);
+}
+//
+// query_match convenience interfaces:
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// this isn't really a partial specialisation, but template function
+// overloading - if the compiler doesn't support partial specialisation
+// then it really won't support this either:
+template <class charT, class Allocator, class traits, class Allocator2>
+inline bool regex_match(const charT* str, 
+                        match_results<const charT*, Allocator>& m, 
+                        const reg_expression<charT, traits, Allocator2>& e, 
+                        unsigned flags = match_default)
+{
+   return regex_match(str, str + traits::length(str), m, e, flags);
+}
+
+template <class ST, class SA, class Allocator, class charT, class traits, class Allocator2>
+inline bool regex_match(const std::basic_string<charT, ST, SA>& s, 
+                 match_results<typename std::basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
+                 const reg_expression<charT, traits, Allocator2>& e, 
+                 unsigned flags = match_default)
+{
+   return regex_match(s.begin(), s.end(), m, e, flags);
+}
+template <class charT, class traits, class Allocator2>
+inline bool regex_match(const charT* str, 
+                        const reg_expression<charT, traits, Allocator2>& e, 
+                        unsigned flags = match_default)
+{
+   match_results<const charT*> m;
+   return regex_match(str, str + traits::length(str), m, e, flags);
+}
+
+template <class ST, class SA, class charT, class traits, class Allocator2>
+inline bool regex_match(const std::basic_string<charT, ST, SA>& s, 
+                 const reg_expression<charT, traits, Allocator2>& e, 
+                 unsigned flags = match_default)
+{
+   typedef typename std::basic_string<charT, ST, SA>::const_iterator iterator;
+   match_results<iterator> m;
+   return regex_match(s.begin(), s.end(), m, e, flags);
+}
+#else  // partial ordering
+inline bool regex_match(const char* str, 
+                        cmatch& m, 
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
+}
+inline bool regex_match(const char* str, 
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   match_results<const char*> m;
+   return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline bool regex_match(const wchar_t* str, 
+                        wcmatch& m, 
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+inline bool regex_match(const wchar_t* str, 
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   match_results<const wchar_t*> m;
+   return regex_match(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+#endif
+inline bool regex_match(const std::string& s, 
+                        match_results<std::string::const_iterator, regex::allocator_type>& m,
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_match(s.begin(), s.end(), m, e, flags);
+}
+inline bool regex_match(const std::string& s, 
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   match_results<std::string::const_iterator, regex::allocator_type> m;
+   return regex_match(s.begin(), s.end(), m, e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline bool regex_match(const std::basic_string<wchar_t>& s, 
+                        match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>& m,
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_match(s.begin(), s.end(), m, e, flags);
+}
+inline bool regex_match(const std::basic_string<wchar_t>& s, 
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type> m;
+   return regex_match(s.begin(), s.end(), m, e, flags);
+}
+#endif
+
+#endif
+
+template <class iterator, class Allocator, class charT, class traits, class Allocator2>
+bool regex_search(iterator first, iterator last, match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
+{
+   if(e.flags() & regbase::failbit)
+      return false;
+
+   typedef typename traits::size_type traits_size_type;
+   typedef typename traits::uchar_type traits_uchar_type;
+
+   return re_detail::reg_grep2(re_detail::grep_search_predicate<iterator, Allocator>(&m), first, last, e, flags, m.allocator());
+}
+
+//
+// regex_search convenience interfaces:
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// this isn't really a partial specialisation, but template function
+// overloading - if the compiler doesn't support partial specialisation
+// then it really won't support this either:
+template <class charT, class Allocator, class traits, class Allocator2>
+inline bool regex_search(const charT* str, 
+                        match_results<const charT*, Allocator>& m, 
+                        const reg_expression<charT, traits, Allocator2>& e, 
+                        unsigned flags = match_default)
+{
+   return regex_search(str, str + traits::length(str), m, e, flags);
+}
+
+template <class ST, class SA, class Allocator, class charT, class traits, class Allocator2>
+inline bool regex_search(const std::basic_string<charT, ST, SA>& s, 
+                 match_results<typename std::basic_string<charT, ST, SA>::const_iterator, Allocator>& m, 
+                 const reg_expression<charT, traits, Allocator2>& e, 
+                 unsigned flags = match_default)
+{
+   return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#else  // partial specialisation
+inline bool regex_search(const char* str, 
+                        cmatch& m, 
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_search(str, str + regex::traits_type::length(str), m, e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline bool regex_search(const wchar_t* str, 
+                        wcmatch& m, 
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_search(str, str + wregex::traits_type::length(str), m, e, flags);
+}
+#endif
+inline bool regex_search(const std::string& s, 
+                        match_results<std::string::const_iterator, regex::allocator_type>& m,
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline bool regex_search(const std::basic_string<wchar_t>& s, 
+                        match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>& m,
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_search(s.begin(), s.end(), m, e, flags);
+}
+#endif
+
+#endif
+
+
+//
+// regex_grep:
+// find all non-overlapping matches within the sequence first last:
+//
+template <class Predicate, class iterator, class charT, class traits, class Allocator>
+inline unsigned int regex_grep(Predicate foo, iterator first, iterator last, const reg_expression<charT, traits, Allocator>& e, unsigned flags = match_default)
+{
+   return re_detail::reg_grep2(foo, first, last, e, flags, e.allocator());
+}
+
+//
+// regex_grep convenience interfaces:
+#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+//
+// this isn't really a partial specialisation, but template function
+// overloading - if the compiler doesn't support partial specialisation
+// then it really won't support this either:
+template <class Predicate, class charT, class Allocator, class traits>
+inline unsigned int regex_grep(Predicate foo, const charT* str, 
+                        const reg_expression<charT, traits, Allocator>& e, 
+                        unsigned flags = match_default)
+{
+   return regex_grep(foo, str, str + traits::length(str), e, flags);
+}
+
+template <class Predicate, class ST, class SA, class Allocator, class charT, class traits>
+inline unsigned int regex_grep(Predicate foo, const std::basic_string<charT, ST, SA>& s, 
+                 const reg_expression<charT, traits, Allocator>& e, 
+                 unsigned flags = match_default)
+{
+   return regex_grep(foo, s.begin(), s.end(), e, flags);
+}
+#else  // partial specialisation
+inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str, 
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags);
+}
+#ifndef BOOST_NO_WREGEX
+inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str, 
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_grep(foo, str, str + wregex::traits_type::length(str), e, flags);
+}
+#endif
+inline unsigned int regex_grep(bool (*foo)(const match_results<std::string::const_iterator, regex::allocator_type>&), const std::string& s,
+                        const regex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_grep(foo, s.begin(), s.end(), e, flags);
+}
+#if !defined(BOOST_NO_WREGEX)
+inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>&), 
+                     const std::basic_string<wchar_t>& s, 
+                        const wregex& e, 
+                        unsigned flags = match_default)
+{
+   return regex_grep(foo, s.begin(), s.end(), e, flags);
+}
+#endif
+
+#endif
+
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#endif   // BOOST_REGEX_MATCH_HPP
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_raw_buffer.hpp b/boost/boost/regex/detail/regex_raw_buffer.hpp
new file mode 100644 (file)
index 0000000..e4a6c71
--- /dev/null
@@ -0,0 +1,249 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_raw_buffer.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Raw character buffer for regex code.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+#ifndef BOOST_REGEX_RAW_BUFFER_HPP
+#define BOOST_REGEX_RAW_BUFFER_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+struct empty_padding{};
+
+union padding
+{
+   void* p;
+   unsigned int i;
+};
+
+template <int N>
+struct padding3
+{
+   enum{
+      padding_size = 8,
+      padding_mask = 7
+   };
+};
+
+template<>
+struct padding3<2>
+{
+   enum{
+      padding_size = 2,
+      padding_mask = 1
+   };
+};
+
+template<>
+struct padding3<4>
+{
+   enum{
+      padding_size = 4,
+      padding_mask = 3
+   };
+};
+
+template<>
+struct padding3<8>
+{
+   enum{
+      padding_size = 8,
+      padding_mask = 7
+   };
+};
+
+template<>
+struct padding3<16>
+{
+   enum{
+      padding_size = 16,
+      padding_mask = 15
+   };
+};
+
+enum{
+   padding_size = padding3<sizeof(padding)>::padding_size,
+   padding_mask = padding3<sizeof(padding)>::padding_mask
+};
+
+//
+// class raw_storage
+// basically this is a simplified vector<unsigned char>
+// this is used by reg_expression for expression storage
+//
+
+template <class Allocator>
+class raw_storage
+{
+public:
+   typedef Allocator allocator_type;
+   typedef typename boost::detail::rebind_allocator<unsigned char, allocator_type>::type alloc_inst_type;
+   typedef typename alloc_inst_type::size_type                                size_type;
+   typedef typename alloc_inst_type::pointer                                  pointer;
+private:
+   //
+   // empty member optimisation:
+   struct alloc_data : public alloc_inst_type
+   {
+      typename alloc_inst_type::pointer last;
+      alloc_data(const Allocator& a) : alloc_inst_type(a){}
+   } alloc_inst;
+   pointer start, end;
+public:
+
+   raw_storage(const Allocator& a = Allocator());
+   raw_storage(size_type n, const Allocator& a = Allocator());
+
+   ~raw_storage()
+   {
+      alloc_inst.deallocate(start, (alloc_inst.last - start));
+   }
+
+   void BOOST_REGEX_CALL resize(size_type n);
+   
+   void* BOOST_REGEX_CALL extend(size_type n)
+   {
+      if(size_type(alloc_inst.last - end) < n)
+         resize(n + (end - start));
+      register void* result = end;
+      end += n;
+      return result;
+   }
+
+   void* BOOST_REGEX_CALL insert(size_type pos, size_type n);
+
+   size_type BOOST_REGEX_CALL size()
+   {
+      return end - start;
+   }
+
+   size_type BOOST_REGEX_CALL capacity()
+   {
+      return alloc_inst.last - start;
+   }
+
+   void* BOOST_REGEX_CALL data()const
+   {
+      return start;
+   }
+
+   size_type BOOST_REGEX_CALL index(void* ptr)
+   {
+      return reinterpret_cast<unsigned char*>(ptr) - reinterpret_cast<unsigned char*>(data());
+   }
+
+   void BOOST_REGEX_CALL clear()
+   {
+      end = start;
+   }
+
+   void BOOST_REGEX_CALL align()
+   {
+      // move end up to a boundary:
+      end = reinterpret_cast<unsigned char*>(start) + (((reinterpret_cast<unsigned char*>(end) - reinterpret_cast<unsigned char*>(start)) + padding_mask) & ~padding_mask);
+   }
+
+   Allocator BOOST_REGEX_CALL allocator()const;
+};
+
+template <class Allocator>
+raw_storage<Allocator>::raw_storage(const Allocator& a)
+  : alloc_inst(a)
+{
+  start = end = alloc_inst.allocate(1024);
+  BOOST_REGEX_NOEH_ASSERT(start)
+  alloc_inst.last = start + 1024;
+}
+
+template <class Allocator>
+raw_storage<Allocator>::raw_storage(size_type n, const Allocator& a)
+  : alloc_inst(a)
+{
+  start = end = alloc_inst.allocate(n);
+  BOOST_REGEX_NOEH_ASSERT(start)
+  alloc_inst.last = start + n;
+}
+
+template <class Allocator>
+Allocator BOOST_REGEX_CALL raw_storage<Allocator>::allocator()const
+{
+  return alloc_inst;
+}
+
+template <class Allocator>
+void BOOST_REGEX_CALL raw_storage<Allocator>::resize(size_type n)
+{
+   register size_type newsize = (alloc_inst.last - start) * 2;
+   register size_type datasize = end - start;
+   if(newsize < n)
+      newsize = n;
+   // extend newsize to WORD/DWORD boundary:
+   newsize = (newsize + padding_mask) & ~(padding_mask);
+
+   // allocate and copy data:
+   register unsigned char* ptr = alloc_inst.allocate(newsize);
+   BOOST_REGEX_NOEH_ASSERT(ptr)
+   std::memcpy(ptr, start, datasize);
+
+   // get rid of old buffer:
+   alloc_inst.deallocate(start, (alloc_inst.last - start));
+
+   // and set up pointers:
+   start = ptr;
+   end = ptr + datasize;
+   alloc_inst.last = ptr + newsize;
+}
+
+template <class Allocator>
+void* BOOST_REGEX_CALL raw_storage<Allocator>::insert(size_type pos, size_type n)
+{
+   jm_assert(pos <= size_type(end - start));
+   if(size_type(alloc_inst.last - end) < n)
+      resize(n + (end - start));
+   register void* result = start + pos;
+   std::memmove(start + pos + n, start + pos, (end - start) - pos);
+   end += n;
+   return result;
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_split.hpp b/boost/boost/regex/detail/regex_split.hpp
new file mode 100644 (file)
index 0000000..f25383e
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_split.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Implements regex_split and associated functions.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+#ifndef BOOST_REGEX_SPLIT_HPP
+#define BOOST_REGEX_SPLIT_HPP
+
+namespace boost{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+namespace re_detail{
+
+template <class charT>
+const reg_expression<charT>& get_default_expression(charT)
+{
+   static const charT expression_text[] = { '\\', 's', '+', '\00', };
+   static const reg_expression<charT> e(expression_text);
+   return e;
+}
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Alloc2>
+class split_pred
+{
+   typedef std::basic_string<charT, Traits1, Alloc1> string_type;
+   typedef typename string_type::const_iterator iterator_type;
+   iterator_type* p_last;
+   OutputIterator* p_out;
+   std::size_t* p_max;
+   std::size_t initial_max;
+public:
+   split_pred(iterator_type* a, OutputIterator* b, std::size_t* c)
+      : p_last(a), p_out(b), p_max(c), initial_max(*c) {}
+
+   bool operator()(const match_results<iterator_type, Alloc2>& what);
+};
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Alloc2>
+bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
+   (const match_results<iterator_type, Alloc2>& what)
+{
+   *p_last = what[0].second;
+   if(what.size() > 1)
+   {
+      // output sub-expressions only:
+      for(unsigned i = 1; i < what.size(); ++i)
+      {
+         *(*p_out) = static_cast<string_type>(what[i]);
+         ++(*p_out);
+         if(0 == --*p_max) return false;
+      }
+      return *p_max != 0;
+   }
+   else
+   {
+      // output $` only if it's not-null or not at the start of the input:
+      const sub_match<iterator_type>& sub = what[-1];
+      if((sub.first != sub.second) || (*p_max != initial_max))
+      {
+         *(*p_out) = static_cast<string_type>(sub);
+         ++(*p_out);
+         return --*p_max;
+      }
+   }
+   //
+   // initial null, do nothing:
+   return true;
+}
+
+} // namespace re_detail
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+std::size_t regex_split(OutputIterator out,
+                   std::basic_string<charT, Traits1, Alloc1>& s, 
+                   const reg_expression<charT, Traits2, Alloc2>& e,
+                   unsigned flags,
+                   std::size_t max_split)
+{
+   typedef typename std::basic_string<charT, Traits1, Alloc1>::const_iterator ci_t;
+   ci_t last = s.begin();
+   std::size_t init_size = max_split;
+   re_detail::split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2> pred(&last, &out, &max_split);
+   ci_t i, j;
+   i = s.begin();
+   j = s.end();
+   regex_grep(pred, i, j, e, flags);
+   //
+   // if there is still input left, do a final push as long as max_split
+   // is not exhausted, and we're not splitting sub-expressions rather 
+   // than whitespace:
+   if(max_split && (last != s.end()) && (e.mark_count() == 1))
+   {
+      *out = std::basic_string<charT, Traits1, Alloc1>((ci_t)last, (ci_t)s.end());
+      ++out;
+      last = s.end();
+      --max_split;
+   }
+   //
+   // delete from the string everything that has been processed so far:
+   s.erase(0, last - s.begin());
+   //
+   // return the number of new records pushed:
+   return init_size - max_split;
+}
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1, class Traits2, class Alloc2>
+inline std::size_t regex_split(OutputIterator out,
+                   std::basic_string<charT, Traits1, Alloc1>& s, 
+                   const reg_expression<charT, Traits2, Alloc2>& e,
+                   unsigned flags = match_default)
+{
+   return regex_split(out, s, e, flags, UINT_MAX);
+}
+
+template <class OutputIterator, class charT, class Traits1, class Alloc1>
+inline std::size_t regex_split(OutputIterator out,
+                   std::basic_string<charT, Traits1, Alloc1>& s)
+{
+   return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX);
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#endif
+
diff --git a/boost/boost/regex/detail/regex_stack.hpp b/boost/boost/regex/detail/regex_stack.hpp
new file mode 100644 (file)
index 0000000..59590b6
--- /dev/null
@@ -0,0 +1,226 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_stack.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Implements customised internal regex stacks.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+#ifndef BOOST_REGEX_STACK_HPP
+#define BOOST_REGEX_STACK_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+#ifndef BOOST_REGEX_RAW_BUFFER_HPP
+#include <boost/regex/detail/regex_raw_buffer.hpp>
+#endif
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+//
+// class jstack
+// simplified stack optimised for push/peek/pop
+// operations, we could use std::stack<std::vector<T>> instead...
+//
+template <class T, class Allocator = BOOST_DEFAULT_ALLOCATOR(T) >
+class jstack
+{
+private:
+   typedef typename boost::detail::rebind_allocator<unsigned char, Allocator>::type allocator_type;
+   typedef typename boost::detail::rebind_allocator<T, Allocator>::type             T_alloc_type;
+   typedef typename T_alloc_type::size_type                              size_type;
+   typedef T value_type;
+   struct node
+   {
+      node* next;
+      T* start;  // first item
+      T* end;    // last item
+      T* last;   // end of storage
+   };
+   
+   //
+   // empty base member optimisation:
+   struct data : public allocator_type
+   {
+      padding buf[(sizeof(T) * 16 + sizeof(padding) - 1) / sizeof(padding)];
+      data(const Allocator& a) : allocator_type(a){}
+   };
+
+   data alloc_inst;
+   mutable node* m_stack;
+   mutable node* unused;
+   node base;
+   size_type block_size;
+
+   void BOOST_REGEX_CALL pop_aux()const;
+   void BOOST_REGEX_CALL push_aux();
+
+public:
+   jstack(size_type n = 64, const Allocator& a = Allocator());
+
+   ~jstack();
+
+   node* BOOST_REGEX_CALL get_node()
+   {
+      node* new_stack = reinterpret_cast<node*>(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size));
+      BOOST_REGEX_NOEH_ASSERT(new_stack)
+      new_stack->last = reinterpret_cast<T*>(new_stack+1);
+      new_stack->start = new_stack->end = new_stack->last + block_size;
+      new_stack->next = 0;
+      return new_stack;
+   }
+
+   bool BOOST_REGEX_CALL empty()
+   {
+      return (m_stack->start == m_stack->end) && (m_stack->next == 0);
+   }
+
+   bool BOOST_REGEX_CALL good()
+   {
+      return (m_stack->start != m_stack->end) || (m_stack->next != 0);
+   }
+
+   T& BOOST_REGEX_CALL peek()
+   {
+      if(m_stack->start == m_stack->end)
+         pop_aux();
+      return *m_stack->end;
+   }
+
+   const T& BOOST_REGEX_CALL peek()const
+   {
+      if(m_stack->start == m_stack->end)
+         pop_aux();
+      return *m_stack->end;
+   }
+
+   void BOOST_REGEX_CALL pop()
+   {
+      if(m_stack->start == m_stack->end)
+         pop_aux();
+      ::boost::re_detail::pointer_destroy(m_stack->end);
+      ++(m_stack->end);
+   }
+
+   void BOOST_REGEX_CALL pop(T& t)
+   {
+      if(m_stack->start == m_stack->end)
+         pop_aux();
+      t = *m_stack->end;
+      ::boost::re_detail::pointer_destroy(m_stack->end);
+      ++(m_stack->end);
+   }
+
+   void BOOST_REGEX_CALL push(const T& t)
+   {
+      if(m_stack->end == m_stack->last)
+         push_aux();
+      --(m_stack->end);
+      pointer_construct(m_stack->end, t);
+   }
+
+};
+
+template <class T, class Allocator>
+jstack<T, Allocator>::jstack(size_type n, const Allocator& a)
+    : alloc_inst(a)
+{
+  unused = 0;
+  block_size = n;
+  m_stack = &base;
+  base.last = reinterpret_cast<T*>(alloc_inst.buf);
+  base.end = base.start = base.last + 16;
+  base.next = 0;
+}
+
+template <class T, class Allocator>
+void BOOST_REGEX_CALL jstack<T, Allocator>::push_aux()
+{
+   // make sure we have spare space on TOS:
+   register node* new_node;
+   if(unused)
+   {
+      new_node = unused;
+      unused = new_node->next;
+      new_node->next = m_stack;
+      m_stack = new_node;
+   }
+   else
+   {
+      new_node = get_node();
+      new_node->next = m_stack;
+      m_stack = new_node;
+   }
+}
+
+template <class T, class Allocator>
+void BOOST_REGEX_CALL jstack<T, Allocator>::pop_aux()const
+{
+   // make sure that we have a valid item
+   // on TOS:
+   jm_assert(m_stack->next);
+   register node* p = m_stack;
+   m_stack = p->next;
+   p->next = unused;
+   unused = p;
+}
+
+template <class T, class Allocator>
+jstack<T, Allocator>::~jstack()
+{
+   node* condemned;
+   while(good())
+      pop();
+   while(unused)
+   {
+      condemned = unused;
+      unused = unused->next;
+      alloc_inst.deallocate(reinterpret_cast<unsigned char*>(condemned), sizeof(node) + sizeof(T) * block_size);
+   }
+   while(m_stack != &base)
+   {
+      condemned = m_stack;
+      m_stack = m_stack->next;
+      alloc_inst.deallocate(reinterpret_cast<unsigned char*>(condemned), sizeof(node) + sizeof(T) * block_size);
+   }
+}
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif
+
+
+
+
+
+
+
+
+
diff --git a/boost/boost/regex/detail/regex_synch.hpp b/boost/boost/regex/detail/regex_synch.hpp
new file mode 100644 (file)
index 0000000..89df81c
--- /dev/null
@@ -0,0 +1,213 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_synch.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Thread synchronisation for regex code.
+  *                Note this is an internal header file included
+  *                by regex.hpp, do not include on its own.
+  */
+
+#ifndef BOOST_REGEX_SYNCH_HPP
+#define BOOST_REGEX_SYNCH_HPP
+
+#ifndef BOOST_REGEX_CONFIG_HPP
+#include <boost/regex/config.hpp>
+#endif
+
+#if defined(BOOST_HAS_THREADS)
+#  if defined(BOOST_HAS_WINTHREADS)
+#     include <windows.h>
+#  elif defined(BOOST_HAS_BETHREADS)
+#     include <OS.h>
+#     include <cassert>
+#  elif defined(BOOST_HAS_PTHREADS)
+#     include <pthread.h>
+#  else
+#     error "Unknown threading API"
+#  endif
+#endif
+
+
+namespace boost{
+   namespace re_detail{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+void BOOST_REGEX_CALL re_init_threads();
+void BOOST_REGEX_CALL re_free_threads();
+
+#ifdef BOOST_HAS_THREADS
+
+#  ifdef BOOST_HAS_BETHREADS
+
+typedef sem_id CRITICAL_SECTION;
+
+inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
+{
+    *ps = create_sem(1, "regex++");
+    assert(*ps > 0);
+}
+
+inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
+{
+    int t = delete_sem(*ps);
+    assert(t == B_NO_ERROR);
+}
+
+inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
+{
+   status_t t = acquire_sem(*ps);
+   assert(t == B_NO_ERROR);
+}
+
+inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
+{
+    status_t t = release_sem(*ps);
+    assert(t == B_NO_ERROR);
+}
+
+#  elif defined(BOOST_HAS_PTHREADS)
+
+typedef pthread_mutex_t CRITICAL_SECTION;
+
+inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
+{
+   pthread_mutex_init(ps, 0);
+}
+
+inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
+{
+   pthread_mutex_destroy(ps);
+}
+
+inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
+{
+   pthread_mutex_lock(ps);
+}
+
+inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
+{
+   pthread_mutex_unlock(ps);
+}
+
+#  elif !defined(BOOST_HAS_WINTHREADS)
+#    error "Unknown threading API"
+#  endif
+
+template <class Lock>
+class lock_guard
+{
+   typedef Lock lock_type;
+public:
+   lock_guard(lock_type& m, bool aq = true)
+      : mut(m), owned(false){ acquire(aq); }
+
+   ~lock_guard()
+   { acquire(false); }
+
+   void BOOST_REGEX_CALL acquire(bool aq = true)
+   {
+      if(aq && !owned)
+      {
+         mut.acquire(true);
+         owned = true;
+      }
+      else if(!aq && owned)
+      {
+         mut.acquire(false);
+         owned = false;
+      }
+   }
+private:
+   lock_type& mut;
+   bool owned;
+   // VC6 warning suppression:
+   lock_guard& operator=(const lock_guard&);
+};
+
+
+class critical_section
+{
+public:
+   critical_section()
+   { InitializeCriticalSection(&hmutex);}
+
+   critical_section(const critical_section&)
+   { InitializeCriticalSection(&hmutex);}
+
+   const critical_section& BOOST_REGEX_CALL operator=(const critical_section&)
+   {return *this;}
+
+   ~critical_section()
+   {DeleteCriticalSection(&hmutex);}
+
+private:
+
+   void BOOST_REGEX_CALL acquire(bool aq)
+   { if(aq) EnterCriticalSection(&hmutex);
+      else LeaveCriticalSection(&hmutex);
+   }
+
+   CRITICAL_SECTION hmutex;
+
+public:
+   typedef lock_guard<critical_section> ro_guard;
+   typedef lock_guard<critical_section> rw_guard;
+
+   friend class lock_guard<critical_section>;
+};
+
+inline bool BOOST_REGEX_CALL operator==(const critical_section&, const critical_section&)
+{
+   return false;
+}
+
+inline bool BOOST_REGEX_CALL operator<(const critical_section&, const critical_section&)
+{
+   return true;
+}
+
+typedef lock_guard<critical_section> cs_guard;
+
+BOOST_REGEX_DECL extern critical_section* p_re_lock;
+BOOST_REGEX_DECL extern unsigned int re_lock_count;
+
+#define BOOST_REGEX_GUARD(inst) boost::re_detail::critical_section::rw_guard g(inst);
+
+#else  // BOOST_HAS_THREADS
+
+#define BOOST_REGEX_GUARD(inst)
+
+#endif // BOOST_HAS_THREADS
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace re_detail
+} // namespace boost
+
+#endif // sentry
+
+
+
+
+
+
diff --git a/boost/boost/regex/pattern_except.hpp b/boost/boost/regex/pattern_except.hpp
new file mode 100644 (file)
index 0000000..4a9540f
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         pattern_except.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Declares pattern-matching exception classes.
+  */
+
+#ifndef BOOST_RE_PAT_EXCEPT_HPP
+#define BOOST_RE_PAT_EXCEPT_HPP
+
+#include <boost/regex/config.hpp>
+
+namespace boost{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+class BOOST_REGEX_DECL bad_pattern : public std::runtime_error
+{
+public:
+   explicit bad_pattern(const std::string& s) : std::runtime_error(s){};
+   ~bad_pattern() throw();
+};
+
+class BOOST_REGEX_DECL bad_expression : public bad_pattern
+{
+public:
+   explicit bad_expression(const std::string& s) : bad_pattern(s) {}
+   ~bad_expression() throw();
+};
+
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#endif
+
+
diff --git a/boost/boost/regex/regex_traits.hpp b/boost/boost/regex/regex_traits.hpp
new file mode 100644 (file)
index 0000000..16c19c0
--- /dev/null
@@ -0,0 +1,807 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_traits.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Declares regular expression traits classes.
+  */
+
+#ifndef BOOST_REGEX_TRAITS_HPP
+#define BOOST_REGEX_TRAITS_HPP
+
+#include <boost/cregex.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/regex/detail/regex_cstring.hpp>
+
+namespace boost{
+
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+template <class charT>
+class c_regex_traits;
+
+namespace re_detail{
+
+struct mss
+{
+   unsigned int id;
+   const char* what;
+};
+
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
+BOOST_REGEX_DECL std::size_t BOOST_REGEX_CALL re_get_default_message(char* buf, std::size_t len, std::size_t id);
+extern BOOST_REGEX_DECL const char *re_default_error_messages[];
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL re_lookup_def_collate_name(std::string& buf, const char* name);
+//extern BOOST_REGEX_DECL const wchar_t combining_ranges[];
+
+#ifndef BOOST_NO_WREGEX
+extern BOOST_REGEX_DECL wchar_t wide_lower_case_map[];
+extern BOOST_REGEX_DECL unsigned short wide_unicode_classes[];
+BOOST_REGEX_DECL bool BOOST_REGEX_CALL is_combining(wchar_t c);
+#endif
+
+
+struct BOOST_REGEX_DECL regex_traits_base
+{
+   enum char_syntax_type
+   {
+      syntax_char = 0,
+      syntax_open_bracket = 1,                  // (
+      syntax_close_bracket = 2,                 // )
+      syntax_dollar = 3,                        // $
+      syntax_caret = 4,                         // ^
+      syntax_dot = 5,                           // .
+      syntax_star = 6,                          // *
+      syntax_plus = 7,                          // +
+      syntax_question = 8,                      // ?
+      syntax_open_set = 9,                      // [
+      syntax_close_set = 10,                    // ]
+      syntax_or = 11,                           // |
+      syntax_slash = 12,                        //
+      syntax_hash = 13,                         // #
+      syntax_dash = 14,                         // -
+      syntax_open_brace = 15,                   // {
+      syntax_close_brace = 16,                  // }
+      syntax_digit = 17,                        // 0-9
+      syntax_b = 18,                            // for \b
+      syntax_B = 19,                            // for \B
+      syntax_left_word = 20,                    // for \<
+      syntax_right_word = 21,                   // for \>
+      syntax_w = 22,                            // for \w
+      syntax_W = 23,                            // for \W
+      syntax_start_buffer = 24,                 // for \`
+      syntax_end_buffer = 25,                   // for \'
+      syntax_newline = 26,                      // for newline alt
+      syntax_comma = 27,                        // for {x,y}
+
+      syntax_a = 28,                            // for \a
+      syntax_f = 29,                            // for \f
+      syntax_n = 30,                            // for \n
+      syntax_r = 31,                            // for \r
+      syntax_t = 32,                            // for \t
+      syntax_v = 33,                            // for \v
+      syntax_x = 34,                            // for \xdd
+      syntax_c = 35,                            // for \cx
+      syntax_colon = 36,                        // for [:...:]
+      syntax_equal = 37,                        // for [=...=]
+   
+      // perl ops:
+      syntax_e = 38,                            // for \e
+      syntax_l = 39,                            // for \l
+      syntax_L = 40,                            // for \L
+      syntax_u = 41,                            // for \u
+      syntax_U = 42,                            // for \U
+      syntax_s = 43,                            // for \s
+      syntax_S = 44,                            // for \S
+      syntax_d = 45,                            // for \d
+      syntax_D = 46,                            // for \D
+      syntax_E = 47,                            // for \Q\E
+      syntax_Q = 48,                            // for \Q\E
+      syntax_X = 49,                            // for \X
+      syntax_C = 50,                            // for \C
+      syntax_Z = 51,                            // for \Z
+      syntax_G = 52,                            // for \G
+
+      // new extentions:
+      syntax_not = 53,                          // for (?!...)
+
+      syntax_max = 54
+   };
+};
+
+struct BOOST_REGEX_DECL c_traits_base : public regex_traits_base
+{
+public:
+   enum{
+      char_class_none = 0,
+      char_class_alpha = 0x0001,
+      char_class_cntrl = 0x0002,
+      char_class_digit = 0x0004,
+      char_class_lower = 0x0008,
+      char_class_punct = 0x0010,
+      char_class_space = 0x0020,
+      char_class_upper = 0x0040,
+      char_class_xdigit = 0x0080,
+      char_class_blank = 0x0100,
+      char_class_underscore = 0x4000,
+      char_class_unicode = 0x8000,
+
+      char_class_alnum = char_class_alpha | char_class_digit,
+      char_class_graph = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore,
+      char_class_print = char_class_alpha | char_class_digit | char_class_punct | char_class_underscore | char_class_blank,
+      char_class_word = char_class_alpha | char_class_digit | char_class_underscore
+   };
+   static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
+protected:
+#if defined(__MWERKS__) && __MWERKS__ <= 0x6000
+   friend class c_regex_traits<char>;
+   friend class c_regex_traits<wchar_t>;
+#endif 
+
+   static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
+   enum syntax_map_size
+   {
+      map_size = UCHAR_MAX + 1
+   };
+
+   static unsigned char syntax_map[map_size];
+   static unsigned short class_map[map_size];
+   static char lower_case_map[map_size];
+
+   static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
+   static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
+   static void BOOST_REGEX_CALL do_update_ctype();
+   static void BOOST_REGEX_CALL do_update_collate();
+public:
+   static std::string BOOST_REGEX_CALL error_string(unsigned id);
+   static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
+};
+
+} // namespace re_detail
+
+
+template<>
+class BOOST_REGEX_DECL c_regex_traits<char> : public re_detail::c_traits_base
+{
+   typedef re_detail::c_traits_base base_type;
+public:
+   typedef char char_type;
+   typedef unsigned char uchar_type;
+   typedef unsigned int size_type;
+   typedef std::string string_type;
+   typedef int locale_type;
+
+   static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+   {
+      return std::strlen(p);
+   }
+   static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
+   {
+      return syntax_map[c];
+   }
+   static char BOOST_REGEX_CALL translate(char c, bool icase)
+   {
+      return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
+   }
+   static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
+
+   static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
+
+   static bool BOOST_REGEX_CALL is_separator(char c)
+   {
+      return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
+   }
+
+   static bool BOOST_REGEX_CALL is_combining(char)
+   {
+      return false;
+   }
+   
+   static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
+   {
+      return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
+   }
+
+   static int BOOST_REGEX_CALL toi(char c);
+   static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
+
+   static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
+   {
+      std::string s(first, last);
+      return do_lookup_class(s.c_str());
+   }
+
+   static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
+   {
+      std::string s(first, last);
+      return do_lookup_collate(buf, s.c_str());
+   }
+
+   static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+   locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+   c_regex_traits()
+   {
+      init();
+   }
+   ~c_regex_traits()
+   {
+      m_free();
+   }
+   struct sentry
+   {
+      sentry(const c_regex_traits<char>&)
+      { c_regex_traits<char>::update(); }
+      operator void*() { return this; }
+   };
+   static void BOOST_REGEX_CALL update();
+private:
+   static void BOOST_REGEX_CALL init();
+   static void BOOST_REGEX_CALL m_free();
+   static c_regex_traits<char> i;
+
+   static unsigned sort_type;
+   static char sort_delim;
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class BOOST_REGEX_DECL c_regex_traits<wchar_t> : public re_detail::c_traits_base
+{
+   typedef re_detail::c_traits_base base_type;
+public:
+   typedef wchar_t char_type;
+   typedef unsigned short uchar_type;
+   typedef unsigned int size_type;
+   typedef std::basic_string<wchar_t> string_type;
+   typedef int locale_type; 
+   static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+   {
+      return std::wcslen(p);
+   }
+   static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
+   static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
+   {
+      return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : std::towlower(c)) : c;
+   }
+
+   static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
+
+   static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
+
+   static bool BOOST_REGEX_CALL is_separator(wchar_t c)
+   {
+      return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
+   }
+
+   static bool BOOST_REGEX_CALL is_combining(wchar_t c)
+   { return re_detail::is_combining(c); }
+   
+   static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
+   {
+      return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (re_detail::wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
+   }
+
+   static int BOOST_REGEX_CALL toi(wchar_t c);
+   static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
+
+   static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
+
+   static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
+
+   static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+   locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+   c_regex_traits<wchar_t>()
+   { init(); }
+   ~c_regex_traits<wchar_t>()
+   { m_free(); }
+   struct sentry
+   {
+      sentry(const c_regex_traits<wchar_t>&)
+      { c_regex_traits<wchar_t>::update(); }
+      operator void*() { return this; }
+   };
+   static void BOOST_REGEX_CALL update();
+   static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
+   static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
+private:
+   static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
+   static void BOOST_REGEX_CALL m_free();
+   static void BOOST_REGEX_CALL init();
+   static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
+   static c_regex_traits<wchar_t> init_;
+
+   static unsigned sort_type;
+   static wchar_t sort_delim;
+};
+#endif
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+
+namespace re_detail{
+
+struct BOOST_REGEX_DECL w32_traits_base : public regex_traits_base
+{
+   enum{
+   char_class_none = 0,
+   char_class_alnum = C1_ALPHA | C1_DIGIT,
+   char_class_alpha = C1_ALPHA,
+   char_class_cntrl = C1_CNTRL,
+   char_class_digit = C1_DIGIT,
+   char_class_graph = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_ALPHA,
+   char_class_lower = C1_LOWER,
+   char_class_print = C1_UPPER | C1_LOWER | C1_DIGIT | C1_PUNCT | C1_BLANK | C1_ALPHA,
+   char_class_punct = C1_PUNCT,
+   char_class_space = C1_SPACE,
+   char_class_upper = C1_UPPER,
+   char_class_xdigit = C1_XDIGIT,
+   char_class_blank = C1_BLANK,
+   char_class_underscore = 0x4000,
+   char_class_word = C1_ALPHA | C1_DIGIT | char_class_underscore,
+   char_class_unicode = 0x8000,
+   char_class_win = 0x01FF
+   };
+
+
+public:
+   static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
+protected:
+   static char regex_message_catalogue[BOOST_REGEX_MAX_PATH];
+   enum syntax_map_size
+   {
+      map_size = UCHAR_MAX + 1
+   };
+
+   static unsigned char syntax_map[map_size];
+   static unsigned short class_map[map_size];
+   static char lower_case_map[map_size];
+
+   static boost::uint_fast32_t BOOST_REGEX_CALL do_lookup_class(const char* p);
+   static bool BOOST_REGEX_CALL do_lookup_collate(std::string& buf, const char* p);
+   static void BOOST_REGEX_CALL do_free();
+   static void BOOST_REGEX_CALL do_init();
+public:
+   static std::string BOOST_REGEX_CALL error_string(unsigned id);
+   static char* BOOST_REGEX_CALL get_catalogue() { return regex_message_catalogue; }
+};
+
+
+} // namespace re_detail
+
+template<class charT>
+class w32_regex_traits;
+
+template<>
+class BOOST_REGEX_DECL w32_regex_traits<char> : public re_detail::w32_traits_base
+{
+   typedef re_detail::w32_traits_base base_type;
+public:
+   typedef char char_type;
+   typedef unsigned char uchar_type;
+   typedef unsigned int size_type;
+   typedef std::string string_type;
+   typedef int locale_type;
+
+   static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+   {
+      return std::strlen(p);
+   }
+   static unsigned int BOOST_REGEX_CALL syntax_type(size_type c)
+   {
+      return syntax_map[c];
+   }
+   static char BOOST_REGEX_CALL translate(char c, bool icase)
+   {
+      return icase ? lower_case_map[(size_type)(uchar_type)c] : c;
+   }
+   static void BOOST_REGEX_CALL transform(std::string& out, const std::string& in);
+
+   static void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in);
+
+   static bool BOOST_REGEX_CALL is_separator(char c)
+   {
+      return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
+   }
+
+   static bool BOOST_REGEX_CALL is_combining(char)
+   {
+      return false;
+   }
+   
+   static bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)
+   {
+      return BOOST_REGEX_MAKE_BOOL(class_map[(size_type)(uchar_type)c] & f);
+   }
+
+   static int BOOST_REGEX_CALL toi(char c);
+   static int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix);
+
+   static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)
+   {
+      std::string s(first, last);
+      return do_lookup_class(s.c_str());
+   }
+
+   static bool BOOST_REGEX_CALL lookup_collatename(std::string& buf, const char* first, const char* last)
+   {
+      std::string s(first, last);
+      return do_lookup_collate(buf, s.c_str());
+   }
+
+   static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+   locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+   struct sentry
+   {
+      sentry(const w32_regex_traits<char>&)
+      { w32_regex_traits<char>::update(); }
+      ~sentry(){}
+      operator void*() { return this; }
+   };
+   static void BOOST_REGEX_CALL update();
+   w32_regex_traits();
+   ~w32_regex_traits();
+private:
+   static w32_regex_traits<char> i;
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class BOOST_REGEX_DECL w32_regex_traits<wchar_t> : public re_detail::w32_traits_base
+{
+   typedef re_detail::w32_traits_base base_type;
+public:
+   typedef wchar_t char_type;
+   typedef unsigned short uchar_type;
+   typedef unsigned int size_type;
+   typedef std::basic_string<wchar_t> string_type;
+   typedef int locale_type; 
+   static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+   {
+      return std::wcslen(p);
+   }
+   static unsigned int BOOST_REGEX_CALL syntax_type(size_type c);
+   static wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)
+   {
+      return icase ? ((c < 256) ? re_detail::wide_lower_case_map[(uchar_type)c] : wtolower(c)) : c;
+   }
+
+   static void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
+
+   static void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
+
+   static bool BOOST_REGEX_CALL is_separator(wchar_t c)
+   {
+      return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
+   }
+
+   static bool BOOST_REGEX_CALL is_combining(wchar_t c)
+   { return re_detail::is_combining(c); }
+   
+   static bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)
+   {
+      return BOOST_REGEX_MAKE_BOOL(((uchar_type)c < 256) ? (wide_unicode_classes[(size_type)(uchar_type)c] & f) : do_iswclass(c, f));
+   }
+
+   static int BOOST_REGEX_CALL toi(wchar_t c);
+   static int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix);
+
+   static boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last);
+
+   static bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last);
+
+   static locale_type BOOST_REGEX_CALL imbue(locale_type l){ return l; }
+   locale_type BOOST_REGEX_CALL getloc()const{ return locale_type(); }
+
+   struct sentry
+   {
+      sentry(const w32_regex_traits<wchar_t>&)
+      { w32_regex_traits<wchar_t>::update(); }
+      ~sentry(){}
+      operator void*() { return this; }
+   };
+   static void BOOST_REGEX_CALL update();
+   w32_regex_traits();
+   ~w32_regex_traits();
+   static std::size_t BOOST_REGEX_CALL strnarrow(char *s1, std::size_t len, const wchar_t *s2);
+   static std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2);
+
+private:
+   static bool BOOST_REGEX_CALL do_iswclass(wchar_t c, boost::uint_fast32_t f);
+   static bool BOOST_REGEX_CALL do_lookup_collate(std::basic_string<wchar_t>& out, const wchar_t* first, const wchar_t* last);
+   static w32_regex_traits<wchar_t> init_;
+   static wchar_t BOOST_REGEX_CALL wtolower(wchar_t c);
+   static unsigned short wide_unicode_classes[];
+};
+#endif // Wide strings
+#endif // Win32
+
+#ifndef BOOST_NO_STD_LOCALE
+
+} // namspace boost
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+#include <locale>
+#ifdef __BORLANDC__
+   #pragma option push -a4 -b -Ve -pc
+#endif
+
+namespace boost{
+
+namespace re_detail
+{
+
+template <class charT>
+struct message_data;
+
+template <>
+struct message_data<char>;
+
+template <>
+struct message_data<wchar_t>;
+
+struct BOOST_REGEX_DECL cpp_regex_traits_base : public regex_traits_base
+{
+   enum char_class_type
+   {
+      char_class_none = 0,
+      char_class_alnum = std::ctype_base::alnum,
+      char_class_alpha = std::ctype_base::alpha,
+      char_class_cntrl = std::ctype_base::cntrl,
+      char_class_digit = std::ctype_base::digit,
+      char_class_graph = std::ctype_base::graph,
+      char_class_lower = std::ctype_base::lower,
+      char_class_print = std::ctype_base::print,
+      char_class_punct = std::ctype_base::punct,
+      char_class_space = std::ctype_base::space,
+      char_class_upper = std::ctype_base::upper,
+      char_class_xdigit = std::ctype_base::xdigit,
+      char_class_blank = 1<<12,
+      char_class_underscore = 1<<13,
+      char_class_word = std::ctype_base::alnum | char_class_underscore,
+      char_class_unicode = 1<<14,
+      char_class_all_base = char_class_alnum | char_class_alpha | char_class_cntrl
+                         | char_class_digit | char_class_graph | char_class_lower
+                         | char_class_print | char_class_punct | char_class_space
+                         | char_class_upper | char_class_xdigit
+   };
+
+   static std::string BOOST_REGEX_CALL set_message_catalogue(const std::string& s);
+protected:
+   static char regex_message_cat[BOOST_REGEX_MAX_PATH];
+};
+
+} // namespace re_detail
+
+template <class charT>
+class cpp_regex_traits;
+
+template<>
+class BOOST_REGEX_DECL cpp_regex_traits<char> : public re_detail::cpp_regex_traits_base
+{
+   typedef re_detail::cpp_regex_traits_base base_type;
+private:
+   re_detail::message_data<char>* pmd;
+   const unsigned char* psyntax;
+   char* lower_map;
+   const std::ctype<char>* pctype;
+   const std::collate<char>* pcollate;
+   std::locale locale_inst;
+   unsigned sort_type;
+   char sort_delim;
+
+   cpp_regex_traits(const cpp_regex_traits&);
+   cpp_regex_traits& operator=(const cpp_regex_traits&);
+
+public:
+   typedef char char_type;
+   typedef unsigned char uchar_type;
+   typedef unsigned int size_type;
+   typedef std::string string_type;
+   typedef std::locale locale_type;
+
+   cpp_regex_traits();
+   ~cpp_regex_traits();
+
+   static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+   {
+      return std::strlen(p);
+   }
+   unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
+   {
+      return psyntax[c];
+   }
+   char BOOST_REGEX_CALL translate(char c, bool icase)const
+   {
+      return icase ? lower_map[(size_type)(uchar_type)c] : c;
+   }
+   void BOOST_REGEX_CALL transform(std::string& out, const std::string& in)const
+   {
+      out = pcollate->transform(in.c_str(), in.c_str() + in.size()).c_str();
+   }
+
+   void BOOST_REGEX_CALL transform_primary(std::string& out, const std::string& in)const;
+
+   static bool BOOST_REGEX_CALL is_separator(char c)
+   {
+      return BOOST_REGEX_MAKE_BOOL((c == '\n') || (c == '\r'));
+   }
+
+   static bool BOOST_REGEX_CALL is_combining(char)
+   {
+      return false;
+   }
+   
+   bool BOOST_REGEX_CALL is_class(char c, boost::uint_fast32_t f)const
+   {
+      if(pctype->is((std::ctype<char>::mask)(f & char_class_all_base), c))
+         return true;
+      if((f & char_class_underscore) && (c == '_'))
+         return true;
+      if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
+         return true;
+      return false;
+   }
+
+   int BOOST_REGEX_CALL toi(char c)const;
+   int BOOST_REGEX_CALL toi(const char*& first, const char* last, int radix)const;
+
+   boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const char* first, const char* last)const;
+   bool BOOST_REGEX_CALL lookup_collatename(std::string& s, const char* first, const char* last)const;
+
+   std::string BOOST_REGEX_CALL error_string(unsigned id)const;
+   locale_type BOOST_REGEX_CALL imbue(locale_type l);
+   locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
+
+   struct sentry
+   {
+      sentry(const cpp_regex_traits<char>&){}
+      operator void*() { return this; }
+   };
+};
+
+#ifndef BOOST_NO_WREGEX
+template<>
+class BOOST_REGEX_DECL cpp_regex_traits<wchar_t> : public re_detail::cpp_regex_traits_base
+{
+   typedef re_detail::cpp_regex_traits_base base_type;
+public:
+   typedef wchar_t char_type;
+   typedef unsigned short uchar_type;
+   typedef unsigned int size_type;
+   typedef std::basic_string<wchar_t> string_type;
+   typedef std::locale locale_type;
+
+private:
+   re_detail::message_data<wchar_t>* pmd;
+   const unsigned char* psyntax;
+   wchar_t* lower_map;
+   const std::ctype<wchar_t>* pctype;
+   const std::collate<wchar_t>* pcollate;
+   const std::codecvt<wchar_t, char, std::mbstate_t>* pcdv;
+   std::locale locale_inst;
+   unsigned int BOOST_REGEX_CALL do_syntax_type(size_type c)const;
+   unsigned sort_type;
+   wchar_t sort_delim;
+
+   cpp_regex_traits(const cpp_regex_traits&);
+   cpp_regex_traits& operator=(const cpp_regex_traits&);
+
+public:
+
+   static std::size_t BOOST_REGEX_CALL length(const char_type* p)
+   {
+      return std::wcslen(p);
+   }
+   unsigned int BOOST_REGEX_CALL syntax_type(size_type c)const
+   {
+      return (c < UCHAR_MAX) ? psyntax[c] : do_syntax_type(c);
+   }
+   wchar_t BOOST_REGEX_CALL translate(wchar_t c, bool icase)const
+   {
+      return icase ? (((uchar_type)c) <= UCHAR_MAX) ? lower_map[c] : pctype->tolower(c) : c;
+   }
+   void BOOST_REGEX_CALL transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const
+   {
+      out = pcollate->transform(in.c_str(), in.c_str() + in.size());
+   }
+
+   void BOOST_REGEX_CALL transform_primary(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in)const;
+
+   static bool BOOST_REGEX_CALL is_separator(wchar_t c)
+   {
+      return BOOST_REGEX_MAKE_BOOL((c == L'\n') || (c == L'\r') || (c == (wchar_t)0x2028) || (c == (wchar_t)0x2029));
+   }
+
+   static bool BOOST_REGEX_CALL is_combining(wchar_t c)
+   { return re_detail::is_combining(c); }
+   
+   bool BOOST_REGEX_CALL is_class(wchar_t c, boost::uint_fast32_t f)const
+   {
+      if(pctype->is((std::ctype<wchar_t>::mask)(f & char_class_all_base), c))
+         return true;
+      if((f & char_class_underscore) && (c == '_'))
+         return true;
+      if((f & char_class_blank) && ((c == ' ') || (c == '\t')))
+         return true;
+      if((f & char_class_unicode) && ((uchar_type)c > (uchar_type)255))
+         return true;
+      return false;
+   }
+
+   int BOOST_REGEX_CALL toi(wchar_t c)const;
+   int BOOST_REGEX_CALL toi(const wchar_t*& first, const wchar_t* last, int radix)const;
+
+   boost::uint_fast32_t BOOST_REGEX_CALL lookup_classname(const wchar_t* first, const wchar_t* last)const;
+   bool BOOST_REGEX_CALL lookup_collatename(std::basic_string<wchar_t>& s, const wchar_t* first, const wchar_t* last)const;
+
+   std::string BOOST_REGEX_CALL error_string(unsigned id)const;
+   cpp_regex_traits();
+   ~cpp_regex_traits();
+   locale_type BOOST_REGEX_CALL imbue(locale_type l);
+   locale_type BOOST_REGEX_CALL getloc()const{ return locale_inst; }
+   std::size_t BOOST_REGEX_CALL strwiden(wchar_t *s1, std::size_t len, const char *s2)const;
+
+   struct sentry
+   {
+      sentry(const cpp_regex_traits<wchar_t>&){}
+      operator void*() { return this; }
+   };
+};
+#endif // BOOST_NO_WREGEX
+
+#endif // BOOST_NO_STD_LOCALE
+
+#ifdef BOOST_REGEX_USE_WIN32_LOCALE
+
+template <class charT>
+class regex_traits : public w32_regex_traits<charT>
+{
+};
+
+#elif defined(BOOST_REGEX_USE_C_LOCALE)
+
+template <class charT>
+class regex_traits : public c_regex_traits<charT>
+{
+};
+
+#elif defined(BOOST_REGEX_USE_CPP_LOCALE)
+
+template <class charT>
+class regex_traits : public cpp_regex_traits<charT>
+{
+};
+
+#else
+#error No default localisation model defined
+#endif
+
+#ifdef __BORLANDC__
+  #pragma option pop
+#endif
+
+} // namespace boost
+
+#endif // include
+
+
+
diff --git a/boost/boost/regex/src.cpp b/boost/boost/regex/src.cpp
new file mode 100644 (file)
index 0000000..f7458b0
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         src.cpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Includes all the regex source files, include this
+  *                file only if you need to build the regex library
+  *                as a single file.  Before including this file you
+  *                must define BOOST_REGEX_NO_LIB, or include this file
+  *                before any other regex header.
+  */
+
+#if !defined(BOOST_REGEX_NO_LIB) && defined(BOOST_REGEX_CONFIG_HPP)
+#error too late you have already included a regex header - try defining BOOST_REGEX_NO_LIB when you build
+#endif
+
+//
+// include library source files:
+//
+#ifdef BOOST_REGEX_USE_WIN32_LOCALE
+#include "libs/regex/src/w32_regex_traits.cpp"
+#elif defined(BOOST_REGEX_USE_C_LOCALE)
+#include "libs/regex/src/c_regex_traits.cpp"
+#else
+#include "libs/regex/src/cpp_regex_traits.cpp"
+#endif
+#include "libs/regex/src/c_regex_traits_common.cpp"
+#include "libs/regex/src/cregex.cpp"
+#include "libs/regex/src/fileiter.cpp"
+#include "libs/regex/src/posix_api.cpp"
+#include "libs/regex/src/wide_posix_api.cpp"
+#include "libs/regex/src/regex.cpp"
+#include "libs/regex/src/regex_debug.cpp"
+#include "libs/regex/src/regex_synch.cpp"
+
diff --git a/boost/boost/regex/user.hpp b/boost/boost/regex/user.hpp
new file mode 100644 (file)
index 0000000..463c0f2
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.  
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         user.hpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: User settable options.
+  */
+
+// define if you want the regex library to use the C locale
+// even on Win32:
+// #define BOOST_REGEX_USE_C_LOCALE
+
+// define this is you want the regex library to use the C++
+// locale:
+// #define BOOST_REGEX_USE_CPP_LOCALE
+
+// define this if you want to statically link to regex,
+// even when the runtime is a dll (Probably Win32 specific):
+// #define BOOST_REGEX_STATIC_LINK
+
+// define this if you don't want the lib to automatically
+// select its link libraries:
+// #define BOOST_REGEX_NO_LIB
+
+// define this if templates with switch statements cause problems:
+// #define BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE
+// define this to disable Win32 support when available:
+// #define BOOST_REGEX_NO_W32
+
+// define this if bool is not a real type:
+// #define BOOST_REGEX_NO_BOOL
+
+// define this if no template instances are to be placed in
+// the library rather than users object files:
+// #define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+
+// define this if the forward declarations in regex_fwd.hpp
+// cause more problems than they are worth:
+// #define BOOST_REGEX_NO_FWD
+
+
+
diff --git a/boost/boost/regex_fwd.hpp b/boost/boost/regex_fwd.hpp
new file mode 100644 (file)
index 0000000..07aea14
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *
+ * Copyright (c) 1998-2002
+ * Dr John Maddock
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation.  Dr John Maddock makes no representations
+ * about the suitability of this software for any purpose.
+ * It is provided "as is" without express or implied warranty.
+ *
+ */
+
+ /*
+  *   LOCATION:    see http://www.boost.org for most recent version.
+  *   FILE         regex_fwd.cpp
+  *   VERSION      see <boost/version.hpp>
+  *   DESCRIPTION: Forward declares boost::reg_expression<> and
+  *                associated typedefs.
+  */
+
+#ifndef BOOST_REGEX_FWD_HPP
+#define BOOST_REGEX_FWD_HPP
+
+#include <boost/config.hpp>
+#include <boost/detail/allocator.hpp>
+
+//
+// define BOOST_REGEX_NO_FWD if this
+// header doesn't work!
+//
+#ifdef BOOST_REGEX_NO_FWD
+#  ifndef BOOST_RE_REGEX_HPP
+#     include <boost/regex.hpp>
+#  endif
+#else
+
+//
+// If there isn't good enough wide character support then there will
+// be no wide character regular expressions:
+//
+#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX)
+#  define BOOST_NO_WREGEX
+#endif
+
+namespace boost{
+
+template <class charT>
+class regex_traits;
+
+template <class charT, class traits = regex_traits<charT>, class Allocator = BOOST_DEFAULT_ALLOCATOR(charT) >
+class reg_expression;
+
+typedef reg_expression<char, regex_traits<char>, BOOST_DEFAULT_ALLOCATOR(char)> regex;
+#ifndef BOOST_NO_WREGEX
+typedef reg_expression<wchar_t, regex_traits<wchar_t>, BOOST_DEFAULT_ALLOCATOR(wchar_t)> wregex;
+#endif
+
+} // namespace boost
+
+#endif  // BOOST_REGEX_NO_FWD
+
+#endif
+
+
diff --git a/boost/boost/scoped_array.hpp b/boost/boost/scoped_array.hpp
new file mode 100644 (file)
index 0000000..070925c
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
+#define BOOST_SCOPED_ARRAY_HPP_INCLUDED
+
+//  (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.
+//
+//  See http://www.boost.org/libs/smart_ptr/scoped_array.htm for documentation.
+//
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+#include <boost/config.hpp>   // in case ptrdiff_t not in std
+#include <cstddef>            // for std::ptrdiff_t
+
+namespace boost
+{
+
+//  scoped_array extends scoped_ptr to arrays. Deletion of the array pointed to
+//  is guaranteed, either on destruction of the scoped_array or via an explicit
+//  reset(). Use shared_array or std::vector if your needs are more complex.
+
+template<typename T> class scoped_array // noncopyable
+{
+private:
+
+    T * ptr;
+
+    scoped_array(scoped_array const &);
+    scoped_array & operator=(scoped_array const &);
+
+public:
+
+    typedef T element_type;
+
+    explicit scoped_array(T * p = 0) : ptr(p) // never throws
+    {
+    }
+
+    ~scoped_array() // never throws
+    {
+        checked_array_delete(ptr);
+    }
+
+    void reset(T * p = 0) // never throws
+    {
+        if (ptr != p)
+        {
+            checked_array_delete(ptr);
+            ptr = p;
+        }
+    }
+
+    T & operator[](std::ptrdiff_t i) const // never throws
+    {
+        BOOST_ASSERT(ptr != 0);
+        BOOST_ASSERT(i >= 0);
+        return ptr[i];
+    }
+
+    T * get() const // never throws
+    {
+        return ptr;
+    }
+
+    void swap(scoped_array & b) // never throws
+    {
+        T * tmp = b.ptr;
+        b.ptr = ptr;
+        ptr = tmp;
+    }
+
+};
+
+template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) // never throws
+{
+    a.swap(b);
+}
+
+} // namespace boost
+
+#endif  // #ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
diff --git a/boost/boost/scoped_ptr.hpp b/boost/boost/scoped_ptr.hpp
new file mode 100644 (file)
index 0000000..f452f7a
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
+#define BOOST_SCOPED_PTR_HPP_INCLUDED
+
+//  (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.
+//
+//  See http://www.boost.org/libs/smart_ptr/scoped_ptr.htm for documentation.
+//
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+
+namespace boost
+{
+
+//  scoped_ptr mimics a built-in pointer except that it guarantees deletion
+//  of the object pointed to, either on destruction of the scoped_ptr or via
+//  an explicit reset(). scoped_ptr is a simple solution for simple needs;
+//  use shared_ptr or std::auto_ptr if your needs are more complex.
+
+template<typename T> class scoped_ptr // noncopyable
+{
+private:
+
+    T* ptr;
+
+    scoped_ptr(scoped_ptr const &);
+    scoped_ptr & operator=(scoped_ptr const &);
+
+public:
+
+    typedef T element_type;
+
+    explicit scoped_ptr(T * p = 0): ptr(p) // never throws
+    {
+    }
+
+    ~scoped_ptr() // never throws
+    {
+        checked_delete(ptr);
+    }
+
+    void reset(T * p = 0) // never throws
+    {
+        if (ptr != p)
+        {
+            checked_delete(ptr);
+            ptr = p;
+        }
+    }
+
+    T & operator*() const // never throws
+    {
+        BOOST_ASSERT(ptr != 0);
+        return *ptr;
+    }
+
+    T * operator->() const // never throws
+    {
+        BOOST_ASSERT(ptr != 0);
+        return ptr;
+    }
+
+    T * get() const // never throws
+    {
+        return ptr;
+    }
+
+    void swap(scoped_ptr & b) // never throws
+    {
+        T * tmp = b.ptr;
+        b.ptr = ptr;
+        ptr = tmp;
+    }
+};
+
+template<typename T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) // never throws
+{
+    a.swap(b);
+}
+
+} // namespace boost
+
+#endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
diff --git a/boost/boost/shared_array.hpp b/boost/boost/shared_array.hpp
new file mode 100644 (file)
index 0000000..a820abc
--- /dev/null
@@ -0,0 +1,142 @@
+#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
+#define BOOST_SHARED_ARRAY_HPP_INCLUDED
+
+//
+//  shared_array.hpp
+//
+//  (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.
+//
+//  See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
+//
+
+#include <boost/config.hpp>   // for broken compiler workarounds
+
+#ifndef BOOST_MSVC6_MEMBER_TEMPLATES
+#include <boost/detail/shared_array_nmt.hpp>
+#else
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+
+#include <boost/detail/shared_count.hpp>
+
+#include <cstddef>            // for std::ptrdiff_t
+#include <algorithm>          // for std::swap
+#include <functional>         // for std::less
+
+namespace boost
+{
+
+//
+//  shared_array
+//
+//  shared_array extends shared_ptr to arrays.
+//  The array pointed to is deleted when the last shared_array pointing to it
+//  is destroyed or reset.
+//
+
+template<typename T> class shared_array
+{
+private:
+
+    // Borland 5.5.1 specific workarounds
+    typedef checked_array_deleter<T> deleter;
+    typedef shared_array<T> this_type;
+
+public:
+
+    typedef T element_type;
+
+    explicit shared_array(T * p = 0): px(p), pn(p, deleter())
+    {
+    }
+
+    //
+    // Requirements: D's copy constructor must not throw
+    //
+    // shared_array will release p by calling d(p)
+    //
+
+    template<typename D> shared_array(T * p, D d): px(p), pn(p, d)
+    {
+    }
+
+//  generated copy constructor, assignment, destructor are fine
+
+    void reset(T * p = 0)
+    {
+        BOOST_ASSERT(p == 0 || p != px);
+        this_type(p).swap(*this);
+    }
+
+    template <typename D> void reset(T * p, D d)
+    {
+        this_type(p, d).swap(*this);
+    }
+
+    T & operator[] (std::ptrdiff_t i) const // never throws
+    {
+        BOOST_ASSERT(px != 0);
+        BOOST_ASSERT(i >= 0);
+        return px[i];
+    }
+    
+    T * get() const // never throws
+    {
+        return px;
+    }
+
+    bool unique() const // never throws
+    {
+        return pn.unique();
+    }
+
+    long use_count() const // never throws
+    {
+        return pn.use_count();
+    }
+
+    void swap(shared_array<T> & other) // never throws
+    {
+        std::swap(px, other.px);
+        pn.swap(other.pn);
+    }
+
+private:
+
+    T * px;                     // contained pointer
+    detail::shared_count pn;    // reference counter
+
+};  // shared_array
+
+template<typename T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) // never throws
+{
+    return a.get() == b.get();
+}
+
+template<typename T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) // never throws
+{
+    return a.get() != b.get();
+}
+
+template<typename T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) // never throws
+{
+    return std::less<T*>()(a.get(), b.get());
+}
+
+template<typename T> void swap(shared_array<T> & a, shared_array<T> & b) // never throws
+{
+    a.swap(b);
+}
+
+} // namespace boost
+
+#endif  // #ifndef BOOST_MSVC6_MEMBER_TEMPLATES
+
+#endif  // #ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
diff --git a/boost/boost/shared_ptr.hpp b/boost/boost/shared_ptr.hpp
new file mode 100644 (file)
index 0000000..39df95f
--- /dev/null
@@ -0,0 +1,324 @@
+#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
+#define BOOST_SHARED_PTR_HPP_INCLUDED
+
+//
+//  shared_ptr.hpp
+//
+//  (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.
+//
+//  See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
+//
+
+#include <boost/config.hpp>   // for broken compiler workarounds
+
+#ifndef BOOST_MSVC6_MEMBER_TEMPLATES
+#include <boost/detail/shared_ptr_nmt.hpp>
+#else
+
+#include <boost/assert.hpp>
+#include <boost/checked_delete.hpp>
+
+#include <boost/detail/shared_count.hpp>
+
+#include <memory>             // for std::auto_ptr
+#include <algorithm>          // for std::swap
+#include <functional>         // for std::less
+#include <typeinfo>           // for std::bad_cast
+
+#ifdef BOOST_MSVC  // moved here to work around VC++ compiler crash
+# pragma warning(push)
+# pragma warning(disable:4284) // odd return type for operator->
+#endif
+
+namespace boost
+{
+
+namespace detail
+{
+
+struct static_cast_tag {};
+struct dynamic_cast_tag {};
+struct polymorphic_cast_tag {};
+
+template<typename T> struct shared_ptr_traits
+{
+    typedef T & reference;
+};
+
+template<> struct shared_ptr_traits<void>
+{
+    typedef void reference;
+};
+
+} // namespace detail
+
+
+//
+//  shared_ptr
+//
+//  An enhanced relative of scoped_ptr with reference counted copy semantics.
+//  The object pointed to is deleted when the last shared_ptr pointing to it
+//  is destroyed or reset.
+//
+
+template<typename T> class weak_ptr;
+template<typename T> class intrusive_ptr;
+
+template<typename T> class shared_ptr
+{
+private:
+
+    // Borland 5.5.1 specific workarounds
+//  typedef checked_deleter<T> deleter;
+    typedef shared_ptr<T> this_type;
+
+public:
+
+    typedef T element_type;
+
+    shared_ptr(): px(0), pn()
+    {
+    }
+
+    template<typename Y>
+    explicit shared_ptr(Y * p): px(p), pn(p, checked_deleter<Y>(), p) // Y must be complete
+    {
+    }
+
+    //
+    // Requirements: D's copy constructor must not throw
+    //
+    // shared_ptr will release p by calling d(p)
+    //
+
+    template<typename Y, typename D> shared_ptr(Y * p, D d): px(p), pn(p, d)
+    {
+    }
+
+//  generated copy constructor, assignment, destructor are fine
+
+    template<typename Y>
+    explicit shared_ptr(weak_ptr<Y> const & r): px(r.px), pn(r.pn) // may throw
+    {
+    }
+
+    template<typename Y>
+    shared_ptr(shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
+    {
+    }
+
+    template<typename Y>
+    shared_ptr(intrusive_ptr<Y> const & r): px(r.get()), pn(r.get()) // never throws
+    {
+    }
+
+    template<typename Y>
+    shared_ptr(shared_ptr<Y> const & r, detail::static_cast_tag): px(static_cast<element_type *>(r.px)), pn(r.pn)
+    {
+    }
+
+    template<typename Y>
+    shared_ptr(shared_ptr<Y> const & r, detail::dynamic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
+    {
+        if (px == 0) // need to allocate new counter -- the cast failed
+        {
+            pn = detail::shared_count();
+        }
+    }
+
+    template<typename Y>
+    shared_ptr(shared_ptr<Y> const & r, detail::polymorphic_cast_tag): px(dynamic_cast<element_type *>(r.px)), pn(r.pn)
+    {
+        if (px == 0)
+        {
+            throw std::bad_cast();
+        }
+    }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+    template<typename Y>
+    explicit shared_ptr(std::auto_ptr<Y> & r): px(r.get()), pn(r)
+    {
+    }
+
+#endif
+
+#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
+
+    template<typename Y>
+    shared_ptr & operator=(shared_ptr<Y> const & r) // never throws
+    {
+        px = r.px;
+        pn = r.pn; // shared_count::op= doesn't throw
+        return *this;
+    }
+
+#endif
+
+#ifndef BOOST_NO_AUTO_PTR
+
+    template<typename Y>
+    shared_ptr & operator=(std::auto_ptr<Y> & r)
+    {
+        this_type(r).swap(*this);
+        return *this;
+    }
+
+#endif
+
+    void reset()
+    {
+        this_type().swap(*this);
+    }
+
+    template<typename Y> void reset(Y * p) // Y must be complete
+    {
+        BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors
+        this_type(p).swap(*this);
+    }
+
+    template<typename Y, typename D> void reset(Y * p, D d)
+    {
+        this_type(p, d).swap(*this);
+    }
+
+    typename detail::shared_ptr_traits<T>::reference operator* () const // never throws
+    {
+        BOOST_ASSERT(px != 0);
+        return *px;
+    }
+
+    T * operator-> () const // never throws
+    {
+        BOOST_ASSERT(px != 0);
+        return px;
+    }
+    
+    T * get() const // never throws
+    {
+        return px;
+    }
+
+    bool unique() const // never throws
+    {
+        return pn.unique();
+    }
+
+    long use_count() const // never throws
+    {
+        return pn.use_count();
+    }
+
+    // implicit conversion to "bool"
+
+    typedef long (this_type::*bool_type)() const;
+
+    operator bool_type() const // never throws
+    {
+        return px == 0? 0: &this_type::use_count;
+    }
+
+    bool operator! () const // never throws
+    {
+        return px == 0;
+    }
+
+    void swap(shared_ptr<T> & other) // never throws
+    {
+        std::swap(px, other.px);
+        pn.swap(other.pn);
+    }
+
+// Tasteless as this may seem, making all members public allows member templates
+// to work in the absence of member template friends. (Matthew Langston)
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+
+private:
+
+    template<typename Y> friend class shared_ptr;
+    template<typename Y> friend class weak_ptr;
+
+
+#endif
+
+    T * px;                     // contained pointer
+    detail::shared_count pn;    // reference counter
+
+};  // shared_ptr
+
+template<typename T, typename U> inline bool operator==(shared_ptr<T> const & a, shared_ptr<U> const & b)
+{
+    return a.get() == b.get();
+}
+
+template<typename T, typename U> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<U> const & b)
+{
+    return a.get() != b.get();
+}
+
+#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
+
+// Resolve the ambiguity between our op!= and the one in rel_ops
+
+template<typename T> inline bool operator!=(shared_ptr<T> const & a, shared_ptr<T> const & b)
+{
+    return a.get() != b.get();
+}
+
+#endif
+
+template<typename T> inline bool operator<(shared_ptr<T> const & a, shared_ptr<T> const & b)
+{
+    return std::less<T*>()(a.get(), b.get());
+}
+
+template<typename T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b)
+{
+    a.swap(b);
+}
+
+template<typename T, typename U> shared_ptr<T> shared_static_cast(shared_ptr<U> const & r)
+{
+    return shared_ptr<T>(r, detail::static_cast_tag());
+}
+
+template<typename T, typename U> shared_ptr<T> shared_dynamic_cast(shared_ptr<U> const & r)
+{
+    return shared_ptr<T>(r, detail::dynamic_cast_tag());
+}
+
+template<typename T, typename U> shared_ptr<T> shared_polymorphic_cast(shared_ptr<U> const & r)
+{
+    return shared_ptr<T>(r, detail::polymorphic_cast_tag());
+}
+
+template<typename T, typename U> shared_ptr<T> shared_polymorphic_downcast(shared_ptr<U> const & r)
+{
+    BOOST_ASSERT(dynamic_cast<T *>(r.get()) == r.get());
+    return shared_static_cast<T>(r);
+}
+
+// get_pointer() enables boost::mem_fn to recognize shared_ptr
+
+template<typename T> inline T * get_pointer(shared_ptr<T> const & p)
+{
+    return p.get();
+}
+
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif    
+
+#endif  // #ifndef BOOST_MSVC6_MEMBER_TEMPLATES
+
+#endif  // #ifndef BOOST_SHARED_PTR_HPP_INCLUDED
diff --git a/boost/boost/signal.hpp b/boost/boost/signal.hpp
new file mode 100644 (file)
index 0000000..a740009
--- /dev/null
@@ -0,0 +1,388 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNAL_HPP
+#define BOOST_SIGNAL_HPP
+
+#define BOOST_SIGNALS_MAX_ARGS 10
+
+#include <boost/config.hpp>
+#include <boost/signals/signal0.hpp>
+#include <boost/signals/signal1.hpp>
+#include <boost/signals/signal2.hpp>
+#include <boost/signals/signal3.hpp>
+#include <boost/signals/signal4.hpp>
+#include <boost/signals/signal5.hpp>
+#include <boost/signals/signal6.hpp>
+#include <boost/signals/signal7.hpp>
+#include <boost/signals/signal8.hpp>
+#include <boost/signals/signal9.hpp>
+#include <boost/signals/signal10.hpp>
+
+namespace boost {
+  namespace signals {
+    namespace detail {
+      // The unusable class is a placeholder for unused function arguments.
+      struct unused {};
+
+      // value=1 if the given type is not "unused"
+      template<typename T>
+      struct count_if_used
+      {
+        BOOST_STATIC_CONSTANT(int, value = 1);
+      };
+    
+      // value=0 for unused types
+      template<>
+      struct count_if_used<unused>
+      {
+        BOOST_STATIC_CONSTANT(int, value = 0);
+      };
+    
+      // Count the number of arguments (from the given set) which are not 
+      // "unused" (therefore, count those arguments that are used).
+      template<typename T1, typename T2, typename T3, typename T4, 
+               typename T5, typename T6, typename T7, typename T8, 
+               typename T9, typename T10>
+      struct count_used_args
+      {
+        BOOST_STATIC_CONSTANT(int, value = 
+                              (count_if_used<T1>::value + 
+                               count_if_used<T2>::value +
+                               count_if_used<T3>::value + 
+                               count_if_used<T4>::value +
+                               count_if_used<T5>::value + 
+                               count_if_used<T6>::value +
+                               count_if_used<T7>::value + 
+                               count_if_used<T8>::value +
+                               count_if_used<T9>::value +
+                               count_if_used<T10>::value));
+      };
+
+      // Choose the appropriate underlying implementation
+      template<int Args> struct real_get_signal_impl {};
+
+      template<>
+      struct real_get_signal_impl<0>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal0<R, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<1>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal1<R, T1, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<2>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal2<R, T1, T2, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<3>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal3<R, T1, T2, T3, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<4>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal4<R, T1, T2, T3, T4, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<5>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal5<R, T1, T2, T3, T4, T5, Combiner> 
+          type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<6>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal6<R, T1, T2, T3, T4, T5, T6, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<7>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal7<R, T1, T2, T3, T4, T5, T6, T7, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<8>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal8<R, T1, T2, T3, T4, T5, T6, T7, T8, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<9>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal9<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, Combiner> type;
+        };
+      };
+
+      template<>
+      struct real_get_signal_impl<10>
+      {
+        template<
+          typename R, 
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5,
+          typename T6,
+          typename T7,
+          typename T8,
+          typename T9,
+          typename T10,
+          typename Combiner = last_value<R>
+        >
+        struct params
+        {
+          typedef signal10<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 
+                           Combiner> type;
+        };
+      };
+
+      template<
+        typename R, 
+        typename T1, 
+        typename T2, 
+        typename T3, 
+        typename T4,
+        typename T5, 
+        typename T6, 
+        typename T7, 
+        typename T8, 
+        typename T9,
+        typename T10,
+        typename Combiner = last_value<R>
+      >
+      struct get_signal_impl
+      {
+        typedef typename real_get_signal_impl<
+          (count_used_args<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::value)
+          >::template params<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, 
+                             Combiner>::type
+        type;
+      };
+    } // end namespace detail
+  } // end namespace signals
+
+  // Very lightweight wrapper around the signalN classes that allows signals to
+  // be created where the number of arguments does not need to be part of the
+  // class name.
+  template<
+    typename R, 
+    typename T1  = signals::detail::unused, 
+    typename T2  = signals::detail::unused,
+    typename T3  = signals::detail::unused,
+    typename T4  = signals::detail::unused,
+    typename T5  = signals::detail::unused,
+    typename T6  = signals::detail::unused,
+    typename T7  = signals::detail::unused,
+    typename T8  = signals::detail::unused,
+    typename T9  = signals::detail::unused,
+    typename T10 = signals::detail::unused
+  >
+  class signal :
+    public signals::detail::get_signal_impl<R, T1, T2, T3, T4, T5, T6, T7, 
+                                            T8, T9, T10>::type
+  {
+  public:
+    template<typename Combiner>
+    struct combiner {
+      typedef typename signals::detail::get_signal_impl<R, T1, T2, T3, T4, T5,
+                                                        T6, T7, T8, T9, T10, 
+                                                        Combiner>::type
+        type;
+    };
+  };
+} // end namespace boost
+
+#endif // BOOST_SIGNAL_HPP
diff --git a/boost/boost/signals/connection.hpp b/boost/boost/signals/connection.hpp
new file mode 100644 (file)
index 0000000..25cec74
--- /dev/null
@@ -0,0 +1,291 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_CONNECTION_HPP
+#define BOOST_SIGNALS_CONNECTION_HPP
+
+#include <boost/signals/detail/signals_common.hpp>
+#include <boost/smart_ptr.hpp>
+#include <boost/operators.hpp>
+#include <boost/any.hpp>
+#include <list>
+#include <cassert>
+#include <utility>
+
+namespace boost {
+  namespace signals {
+    class trackable;
+
+    namespace detail {
+      // Represents an object that has been bound as part of a slot, and how
+      // to notify that object of a disconnect
+      struct bound_object {
+        void* obj;
+        void* data;
+        void (*disconnect)(void*, void*);
+
+        bool operator==(const bound_object& other) const
+          { return obj == other.obj && data == other.data; }
+        bool operator<(const bound_object& other) const 
+          { return obj < other.obj; }
+      };
+      
+      // Describes the connection between a signal and the objects that are
+      // bound for a specific slot. Enables notification of the signal and the
+      // slots when a disconnect is requested.
+      struct basic_connection {
+        void* signal;
+        void* signal_data;
+        void (*signal_disconnect)(void*, void*);
+        
+        std::list<bound_object> bound_objects;
+      };
+    } // end namespace detail
+
+    // The user may freely pass around the "connection" object and terminate
+    // the connection at any time using disconnect().
+    class connection : 
+      private less_than_comparable1<connection>,
+      private equality_comparable1<connection>
+    {
+    public:
+      connection();
+      connection(const connection&);
+      ~connection();
+
+      // Disconnect the signal and slot, if they are connected
+      void disconnect() const;
+
+      // Returns true if the signal and slot are connected
+      bool connected() const { return con.get() && con->signal_disconnect; }
+
+      // Comparison of connections
+      inline bool operator==(const connection& other) const;
+      inline bool operator<(const connection& other) const;
+
+      // Connection assignment
+      connection& operator=(const connection& other) ;
+
+      // Swap connections
+      void swap(connection& other);
+
+    public: // TBD: CHANGE THIS
+      // Set whether this connection object is controlling or not
+      void set_controlling() { controlling_connection = true; }
+
+    private:
+      friend class detail::signal_base_impl;
+      friend class detail::slot_base;
+      friend class trackable;
+
+      // Reset this connection to refer to a different actual connection
+      void reset(signals::detail::basic_connection*);
+
+      // Add a bound object to this connection (not for users)
+      void add_bound_object(const signals::detail::bound_object& b);
+
+      friend class signals::detail::bound_objects_visitor;
+
+      // Pointer to the actual contents of the connection
+      shared_ptr<signals::detail::basic_connection> con;
+
+      // True if the destruction of this connection object should disconnect
+      bool controlling_connection;
+    };
+
+    // Similar to connection, but will disconnect the connection when it is
+    // destroyed unless release() has been called.
+    class scoped_connection : public connection {
+    public:
+      scoped_connection() : connection(), released(false) {}
+      scoped_connection(const connection&);
+      scoped_connection(const scoped_connection&);
+      ~scoped_connection();
+
+      connection release();
+
+      void swap(scoped_connection&);
+
+      scoped_connection& operator=(const connection&);
+      scoped_connection& operator=(const scoped_connection&);
+
+    private:
+      bool released;
+    };
+
+    inline connection::connection() :
+      con(), controlling_connection(false)
+    {
+    }
+
+    inline connection::connection(const connection& other) :
+      con(other.con), controlling_connection(other.controlling_connection) 
+    {
+    }
+
+    inline connection::~connection()
+    {
+      if (controlling_connection) {
+        disconnect();
+      }
+    }
+
+    inline void 
+    connection::reset(signals::detail::basic_connection* new_con)
+    {
+      con.reset(new_con);
+    }
+
+    inline void 
+    connection::add_bound_object(const signals::detail::bound_object& b)
+    {
+      assert(con.get());
+      con->bound_objects.push_back(b);
+    }
+
+    inline bool connection::operator==(const connection& other) const
+    {
+      return con.get() == other.con.get();
+    }
+
+    inline bool connection::operator<(const connection& other) const
+    {
+      return con.get() < other.con.get();
+    }
+
+    inline connection& connection::operator=(const connection& other)
+    { 
+      connection(other).swap(*this);
+      return *this;
+    }
+
+    inline void connection::swap(connection& other)
+    {
+      this->con.swap(other.con);
+      std::swap(this->controlling_connection, other.controlling_connection);
+    }
+
+    inline void swap(connection& c1, connection& c2)
+    {
+      c1.swap(c2);
+    }
+
+    inline scoped_connection::scoped_connection(const connection& other) :
+      connection(other),
+      released(false)
+    {
+    }
+
+    inline 
+    scoped_connection::scoped_connection(const scoped_connection& other) :
+      connection(other),
+      released(other.released)
+    {
+    }
+
+    inline scoped_connection::~scoped_connection()
+    {
+      if (!released) {
+        this->disconnect();
+      }
+    }
+
+    inline connection scoped_connection::release()
+    {
+      released = true;
+      return *this;
+    }
+
+    inline void scoped_connection::swap(scoped_connection& other)
+    {
+      this->connection::swap(other);
+      bool other_released = other.released;
+      other.released = this->released;
+      this->released = other_released;
+    }
+
+    inline void swap(scoped_connection& c1, scoped_connection& c2)
+    {
+      c1.swap(c2);
+    }
+
+    inline scoped_connection& 
+    scoped_connection::operator=(const connection& other)
+    {
+      scoped_connection(other).swap(*this);
+      return *this;
+    }
+
+    inline scoped_connection& 
+    scoped_connection::operator=(const scoped_connection& other)
+    {
+      scoped_connection(other).swap(*this);
+      return *this;
+    }
+
+    namespace detail {
+      struct connection_slot_pair {
+        connection first;
+        any second;
+
+        connection_slot_pair() {}
+
+        connection_slot_pair(const connection& c, const any& a) 
+          : first(c), second(a) 
+        {
+        }
+
+        // Dummys to allow explicit instantiation to work
+        bool operator==(const connection_slot_pair&) const { return false; }
+        bool operator<(const connection_slot_pair&) const { return false;} 
+      };
+      
+      // Determines if the underlying connection is disconnected
+      struct is_disconnected {
+        typedef std::pair<const any, connection_slot_pair> argument_type;
+        typedef bool result_type;
+
+        inline bool operator()(const argument_type& c) const
+        {
+          return !c.second.first.connected();
+        }
+      };
+
+      // Autodisconnects the bound object when it is destroyed unless the
+      // release method is invoked.
+      class auto_disconnect_bound_object {
+      public:
+        auto_disconnect_bound_object(const bound_object& b) : 
+          binding(b), auto_disconnect(true)
+        {
+        }
+
+        ~auto_disconnect_bound_object()
+        {
+          if (auto_disconnect)
+            binding.disconnect(binding.obj, binding.data);
+        }
+
+        void release() { auto_disconnect = false; }
+
+      private:
+        bound_object binding;
+        bool auto_disconnect;
+      };
+    } // end namespace detail
+  } // end namespace signals
+} // end namespace boost
+
+#endif // BOOST_SIGNALS_CONNECTION_HPP
diff --git a/boost/boost/signals/detail/gen_signal_N.pl b/boost/boost/signals/detail/gen_signal_N.pl
new file mode 100755 (executable)
index 0000000..1dfd577
--- /dev/null
@@ -0,0 +1,138 @@
+#!/usr/bin/perl -w
+#
+# Boost.Signals library
+#
+# Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+#
+# Permission to copy, use, sell and distribute this software is granted
+# provided this copyright notice appears in all copies.
+# Permission to modify the code and to distribute modified code is granted
+# provided this copyright notice appears in all copies, and a notice
+# that the code was modified is included with the copyright notice.
+#
+# This software is provided "as is" without express or implied warranty,
+# and with no claim as to its suitability for any purpose.
+#
+# For more information, see http://www.boost.org
+use English;
+
+if ($#ARGV < 0) {
+  print "Usage: perl gen_signal_N <number of arguments>\n";
+  exit;
+}
+
+
+$totalNumArgs = $ARGV[0];
+for ($numArgs = 0; $numArgs <= $totalNumArgs; ++$numArgs) {
+  open OUT, ">signal$numArgs.hpp";
+  print OUT "// Boost.Signals library\n";
+  print OUT "//\n";
+  print OUT "// Copyright (C) 2001 Doug Gregor (gregod\@cs.rpi.edu)\n";
+  print OUT "//\n";
+  print OUT "// Permission to copy, use, sell and distribute this software is granted\n";
+  print OUT "// provided this copyright notice appears in all copies.\n";
+  print OUT "// Permission to modify the code and to distribute modified code is granted\n";
+  print OUT "// provided this copyright notice appears in all copies, and a notice\n";
+  print OUT "// that the code was modified is included with the copyright notice.\n";
+  print OUT "//\n";
+  print OUT "// This software is provided \"as is\" without express or implied warranty,\n";
+  print OUT "// and with no claim as to its suitability for any purpose.\n";
+  print OUT " \n";
+  print OUT "// For more information, see http://www.boost.org\n";
+  print OUT "\n";
+  print OUT "#ifndef BOOST_SIGNALS_SIGNAL" . $numArgs . "_HEADER\n";
+  print OUT "#define BOOST_SIGNALS_SIGNAL" , $numArgs . "_HEADER\n";
+  print OUT "\n";
+  print OUT "#define BOOST_SIGNALS_NUM_ARGS $numArgs\n";
+
+  $templateParms = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    if ($i > 1) {
+      $templateParms .= ", ";
+    }
+    $templateParms .= "typename T$i";
+  }
+  print OUT "#define BOOST_SIGNALS_TEMPLATE_PARMS $templateParms\n";
+
+  $_ = $templateParms;
+  s/typename //g;
+  $templateArgs = $_;
+  print OUT "#define BOOST_SIGNALS_TEMPLATE_ARGS $templateArgs\n";
+
+  $parms = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    if ($i > 1) {
+      $parms .= ", ";
+    }
+    $parms .= "T$i a$i";
+  }
+  print OUT "#define BOOST_SIGNALS_PARMS $parms\n";
+
+  $args = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    if ($i > 1) {
+      $args .= ", ";
+    }
+    $args .= "a$i";
+  }
+  print OUT "#define BOOST_SIGNALS_ARGS $args\n";
+
+  $boundArgs = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    if ($i > 1) {
+      $boundArgs .= ", ";
+    }
+    $boundArgs .= "args->a$i";
+  }
+  print OUT "#define BOOST_SIGNALS_BOUND_ARGS $boundArgs\n";
+
+  $argsAsMembers = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    $argsAsMembers .= "T$i a$i;";
+  }
+  print OUT "#define BOOST_SIGNALS_ARGS_AS_MEMBERS $argsAsMembers\n";
+
+  $copyParms = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    if ($i > 1) {
+      $copyParms .= ", ";
+    }
+    $copyParms .= "T$i ia$i";
+  }
+  print OUT "#define BOOST_SIGNALS_COPY_PARMS $copyParms\n";
+
+  $initArgs = "";
+  if ($numArgs > 0) {
+      $initArgs = ":";
+  }
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    if ($i > 1) {
+      $initArgs .= ", ";
+    }
+    $initArgs .= "a$i(ia$i)";
+  }
+  print OUT "#define BOOST_SIGNALS_INIT_ARGS $initArgs\n";
+
+  $argTypes = "";
+  for ($i = 1; $i <= $numArgs; ++$i) {
+    $argTypes .= "typedef T$i arg". ($i+1) . "_type; ";
+  }
+
+  print OUT "#define BOOST_SIGNALS_ARG_TYPES $argTypes\n";
+  print OUT "\n";
+  print OUT "#include <boost/signals/signal_template.hpp>\n";
+  print OUT "\n";
+  print OUT "#undef BOOST_SIGNALS_ARG_TYPES\n";
+  print OUT "#undef BOOST_SIGNALS_INIT_ARGS\n";
+  print OUT "#undef BOOST_SIGNALS_COPY_PARMS\n";
+  print OUT "#undef BOOST_SIGNALS_ARGS_AS_MEMBERS\n";
+  print OUT "#undef BOOST_SIGNALS_BOUND_ARGS\n";
+  print OUT "#undef BOOST_SIGNALS_ARGS\n";
+  print OUT "#undef BOOST_SIGNALS_PARMS\n";
+  print OUT "#undef BOOST_SIGNALS_TEMPLATE_ARGS\n";
+  print OUT "#undef BOOST_SIGNALS_TEMPLATE_PARMS\n";
+  print OUT "#undef BOOST_SIGNALS_NUM_ARGS\n";
+  print OUT "\n";
+  print OUT "#endif // BOOST_SIGNALS_SIGNAL" . $numArgs . "_HEADER\n";
+  close OUT;
+}
diff --git a/boost/boost/signals/detail/signal_base.hpp b/boost/boost/signals/detail/signal_base.hpp
new file mode 100644 (file)
index 0000000..c6e50f4
--- /dev/null
@@ -0,0 +1,188 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001-2 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL_BASE_HEADER
+#define BOOST_SIGNALS_SIGNAL_BASE_HEADER
+
+#include <boost/signals/detail/signals_common.hpp>
+#include <boost/signals/connection.hpp>
+#include <boost/signals/trackable.hpp>
+#include <boost/smart_ptr.hpp>
+#include <boost/any.hpp>
+#include <boost/utility.hpp>
+#include <boost/function/function2.hpp>
+#include <map>
+#include <utility>
+#include <vector>
+
+namespace boost {
+  namespace signals {
+    namespace detail {
+      // Forward declaration for the mapping from slot names to connections
+      class named_slot_map;
+
+      // This function object bridges from a pair of any objects that hold
+      // values of type Key to the underlying function object that compares
+      // values of type Key.
+      template<typename Compare, typename Key>
+      class any_bridge_compare {
+      public:
+        typedef bool result_type;
+        typedef const any& first_argument_type;
+        typedef const any& second_argument_type;
+
+        any_bridge_compare(const Compare& c) : comp(c) {}
+
+        bool operator()(const any& k1, const any& k2) const
+        {
+          // if k1 is empty, then it precedes nothing
+          if (k1.empty())
+            return false;
+
+          // if k2 is empty, then k1 must precede it
+          if (k2.empty())
+            return true;
+
+          // Neither is empty, so compare their values to order them
+          // The strange */& is so that we will get a reference to the
+          // value stored in the any object instead of a copy
+          return comp(*any_cast<Key>(&k1), *any_cast<Key>(&k2));
+        }
+
+      private:
+        Compare comp;
+      };
+
+      // Must be constructed before calling the slots, because it safely
+      // manages call depth
+      class call_notification {
+      public:
+       call_notification(const shared_ptr<signal_base_impl>&);
+       ~call_notification();
+       
+       shared_ptr<signal_base_impl> impl;
+      };
+        
+      // Implementation of base class for all signals. It handles the 
+      // management of the underlying slot lists.
+      class signal_base_impl {
+      public:
+       friend class call_notification;
+
+        typedef function2<bool, any, any> compare_type;
+
+        // Make sure that an exception does not cause the "clearing" flag to
+        // remain set
+        class temporarily_set_clearing {
+        public:
+          temporarily_set_clearing(signal_base_impl* b) : base(b)
+          {
+            base->flags.clearing = true;
+          }
+
+          ~temporarily_set_clearing()
+          {
+            base->flags.clearing = false;
+          }
+
+        private:
+          signal_base_impl* base;
+        };
+
+       friend class temporarily_set_clearing;
+
+        signal_base_impl(const compare_type&);
+        ~signal_base_impl();
+
+        // Disconnect all slots connected to this signal
+        void disconnect_all_slots();
+
+        // Are there any connected slots?
+        bool empty() const;
+
+        // Disconnect all slots in the given group
+        void disconnect(const any&);
+
+        // We're being notified that a slot has disconnected
+        static void slot_disconnected(void* obj, void* data);
+
+        connection connect_slot(const any& slot,
+                                const any& name,
+                                const std::vector<const trackable*>&);
+
+      private:
+        // Remove all of the slots that have been marked "disconnected"
+        void remove_disconnected_slots() const;
+
+      public:
+       // Our call depth when invoking slots (> 1 when we have a loop)
+       mutable int call_depth;
+       
+       struct {
+         // True if some slots have disconnected, but we were not able to
+         // remove them from the list of slots because there are valid 
+         // iterators into the slot list
+         mutable bool delayed_disconnect:1;
+         
+         // True if we are disconnecting all disconnected slots
+         bool clearing:1;
+       } flags;
+       
+        // Slots
+        typedef std::multimap<any, connection_slot_pair, compare_type>
+          slot_container_type;
+        typedef slot_container_type::iterator slot_iterator;
+        typedef slot_container_type::value_type stored_slot_type;
+        mutable slot_container_type slots;
+      };
+
+      class signal_base : public noncopyable {
+      public:
+        typedef signal_base_impl::compare_type compare_type;
+
+        friend class call_notification;
+
+        signal_base(const compare_type& comp) : impl()
+       {
+          impl.reset(new signal_base_impl(comp));
+       }
+
+        ~signal_base();
+
+      public:
+        // Disconnect all slots connected to this signal
+        void disconnect_all_slots() { impl->disconnect_all_slots(); }
+
+        // Are there any connected slots?
+        bool empty() const { return impl->empty(); }
+       
+      protected:
+        connection connect_slot(const any& slot,
+                                const any& name,
+                                const std::vector<const trackable*>& bound)
+        {
+          return impl->connect_slot(slot, name, bound);
+        }
+
+        typedef signal_base_impl::slot_iterator slot_iterator;
+        typedef signal_base_impl::stored_slot_type stored_slot_type;
+
+       shared_ptr<signal_base_impl> impl;
+      };
+    } // end namespace detail
+  } // end namespace signals
+} // end namespace boost
+
+#endif // BOOST_SIGNALS_SIGNAL_BASE_HEADER
diff --git a/boost/boost/signals/detail/signals_common.hpp b/boost/boost/signals/detail/signals_common.hpp
new file mode 100644 (file)
index 0000000..606e8d4
--- /dev/null
@@ -0,0 +1,155 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_COMMON_HEADER
+#define BOOST_SIGNALS_COMMON_HEADER
+
+#include <boost/type_traits/conversion_traits.hpp>
+#include <boost/ref.hpp>
+
+namespace boost {
+  namespace signals {
+    namespace detail {
+      // The unusable class is a placeholder for unused function arguments
+      // It is also completely unusable except that it constructable from
+      // anything. This helps compilers without partial specialization
+      // handle slots returning void.  
+      struct unusable {
+        unusable() {}
+      };
+
+      // Determine the result type of a slot call
+      template<typename R>
+      struct slot_result_type {
+       typedef R type;
+      };
+
+      template<>
+      struct slot_result_type<void> {
+       typedef unusable type;
+      };
+
+      // Determine if the given type T is a signal
+      class signal_base;
+
+      template<typename T>
+      struct is_signal {
+       BOOST_STATIC_CONSTANT(bool, 
+         value = (is_convertible<T*, signal_base*>::value));
+      };
+
+      /*
+       * The IF implementation is temporary code. When a Boost metaprogramming
+       * library is introduced, Boost.Signals will use it instead. 
+       */
+      namespace intimate {
+        struct SelectThen 
+        {       
+          template<typename Then, typename Else>
+          struct Result
+          {       
+            typedef Then type;
+          };
+        };
+        struct SelectElse
+        {
+          template<typename Then, typename Else>
+          struct Result
+          { 
+            typedef Else type;
+          };
+        };
+        template<bool Condition>
+        struct Selector
+        {
+          typedef SelectThen type;
+        };
+        template<>
+        struct Selector<false>
+        {
+          typedef SelectElse type;
+        };
+      } // end namespace intimate 
+      template<bool Condition, typename Then, typename Else>
+      struct IF
+      {
+        typedef typename intimate::Selector<Condition>::type select;
+        typedef typename select::template Result<Then,Else>::type type;
+      };
+
+      // Determine if the incoming argument is a reference_wrapper
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+      template<typename T>
+      struct is_ref
+      {
+       BOOST_STATIC_CONSTANT(bool, value = false); 
+      };
+
+      template<typename T>
+      struct is_ref<reference_wrapper<T> >
+      {
+       BOOST_STATIC_CONSTANT(bool, value = true);
+      };
+#else // no partial specialization
+      typedef char yes_type;
+      typedef double no_type;
+      
+      no_type is_ref_tester(...);
+
+      template<typename T>
+      yes_type is_ref_tester(reference_wrapper<T>*);
+
+      template<typename T>
+      struct is_ref
+      {
+       static T* t;
+       BOOST_STATIC_CONSTANT(bool, 
+         value = (sizeof(is_ref_tester(t)) == sizeof(yes_type)));
+      };
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+      // A slot can be a signal, a reference to a function object, or a 
+      // function object.
+      struct signal_tag {};
+      struct reference_tag {};
+      struct value_tag {};
+
+      // Classify the given slot as a signal, a reference-to-slot, or a 
+      // standard slot
+      template<typename S>
+      class get_slot_tag {
+       typedef typename IF<(is_signal<S>::value),
+                           signal_tag,
+                           value_tag>::type signal_or_value;
+
+      public:  
+       typedef typename IF<(is_ref<S>::value),
+                           reference_tag,
+                           signal_or_value>::type type;
+      };
+
+      // Forward declaration needed in lots of places
+      class signal_base_impl;
+      class bound_objects_visitor;
+      class slot_base;
+    } // end namespace detail
+  } // end namespace signals
+} // end namespace boost
+
+#endif // BOOST_SIGNALS_COMMON_HEADER
diff --git a/boost/boost/signals/detail/slot_call_iterator.hpp b/boost/boost/signals/detail/slot_call_iterator.hpp
new file mode 100644 (file)
index 0000000..ed611d5
--- /dev/null
@@ -0,0 +1,119 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SLOT_CALL_ITERATOR
+#define BOOST_SIGNALS_SLOT_CALL_ITERATOR
+
+#include <functional>
+#include <boost/iterator_adaptors.hpp>
+#include <boost/smart_ptr.hpp>
+#include <boost/signals/connection.hpp>
+
+namespace boost {
+  namespace signals {
+    namespace detail {
+      // A cached return value from a slot
+      template<typename T>
+      struct cached_return_value {
+        cached_return_value(const T& t) : value(t) {}
+        
+        T value;
+      };
+
+      // Generates a slot call iterator. Essentially, this is an iterator that:
+      //   - skips over disconnected slots in the underlying list
+      //   - calls the connected slots when dereferenced
+      //   - caches the result of calling the slots
+      template<typename Function, typename Iterator>
+      class slot_call_policies : public default_iterator_policies {
+      public:
+        typedef typename Function::result_type result_type;
+
+        slot_call_policies() {}
+
+       slot_call_policies(const Iterator& x, Function fi) :
+         end(x), f(fi), cache()
+       {
+       }
+       
+       void initialize(Iterator& x)
+       { 
+         x = std::find_if(x, end, std::not1(is_disconnected()));
+         cache.reset();
+       }
+       
+       template <class IteratorAdaptor>
+       typename IteratorAdaptor::reference 
+       dereference(const IteratorAdaptor& x) const
+       {
+         if (!cache.get()) {
+           cache.reset(new cached_return_value<result_type>(f(*x.base())));
+         }
+         
+         return cache->value;
+       }
+
+       template<typename IteratorAdaptor>
+       void increment(IteratorAdaptor& x)
+       {
+         ++x.base();
+         x.base() = std::find_if(x.base(), x.policies().end, 
+                                 std::not1(is_disconnected()));
+          cache.reset();
+       }
+       
+       template<typename IteratorAdaptor1, typename IteratorAdaptor2>
+       bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const
+       {
+         Iterator xb = std::find_if(x.base(), x.policies().end, 
+                                    std::not1(is_disconnected()));
+         Iterator yb = std::find_if(y.base(), y.policies().end, 
+                                    std::not1(is_disconnected()));
+          const_cast<IteratorAdaptor1&>(x).base() = xb;
+          const_cast<IteratorAdaptor1&>(y).base() = yb;
+         return xb == yb; 
+       }
+       
+      private:
+       Iterator end;
+       Function f;
+        mutable shared_ptr< cached_return_value<result_type> > cache;
+      };
+
+      template<typename Function, typename Iterator>
+      class slot_call_iterator_generator {
+      private:
+       typedef typename Function::result_type value_type;
+      public:
+       typedef slot_call_policies<Function, Iterator> policy_type;
+       typedef iterator_adaptor<Iterator, policy_type, value_type,
+                                value_type&, value_type*, 
+                                std::input_iterator_tag> type;
+      };
+
+      template<typename Function, typename Iterator>
+      inline typename slot_call_iterator_generator<Function, Iterator>::type
+      make_slot_call_iterator(Iterator first, Iterator last, Function f)
+      {
+       typedef slot_call_iterator_generator<Function, Iterator> gen;
+       typedef typename gen::type sc_iterator;
+       typedef typename gen::policy_type sc_policy;
+
+       return sc_iterator(first, sc_policy(last, f));
+      }
+    } // end namespace detail
+  } // end namespace signals
+} // end namespace boost
+#endif // BOOST_SIGNALS_SLOT_CALL_ITERATOR
diff --git a/boost/boost/signals/signal0.hpp b/boost/boost/signals/signal0.hpp
new file mode 100644 (file)
index 0000000..6b9ac29
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL0_HEADER
+#define BOOST_SIGNALS_SIGNAL0_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 0
+#define BOOST_SIGNALS_TEMPLATE_PARMS 
+#define BOOST_SIGNALS_TEMPLATE_ARGS 
+#define BOOST_SIGNALS_PARMS 
+#define BOOST_SIGNALS_ARGS 
+#define BOOST_SIGNALS_BOUND_ARGS 
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS 
+#define BOOST_SIGNALS_COPY_PARMS 
+#define BOOST_SIGNALS_INIT_ARGS 
+#define BOOST_SIGNALS_ARG_TYPES 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL0_HEADER
diff --git a/boost/boost/signals/signal1.hpp b/boost/boost/signals/signal1.hpp
new file mode 100644 (file)
index 0000000..b2daffc
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL1_HEADER
+#define BOOST_SIGNALS_SIGNAL1_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 1
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1
+#define BOOST_SIGNALS_PARMS T1 a1
+#define BOOST_SIGNALS_ARGS a1
+#define BOOST_SIGNALS_BOUND_ARGS args->a1
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL1_HEADER
diff --git a/boost/boost/signals/signal10.hpp b/boost/boost/signals/signal10.hpp
new file mode 100644 (file)
index 0000000..2665f03
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL10_HEADER
+#define BOOST_SIGNALS_SIGNAL10_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 10
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8, T9, T10
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9, T10 a10
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9, a10
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7, args->a8, args->a9, args->a10
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;T10 a10;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9, T10 ia10
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9), a10(ia10)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; typedef T10 arg11_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL10_HEADER
diff --git a/boost/boost/signals/signal2.hpp b/boost/boost/signals/signal2.hpp
new file mode 100644 (file)
index 0000000..371ec4f
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL2_HEADER
+#define BOOST_SIGNALS_SIGNAL2_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 2
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2
+#define BOOST_SIGNALS_ARGS a1, a2
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL2_HEADER
diff --git a/boost/boost/signals/signal3.hpp b/boost/boost/signals/signal3.hpp
new file mode 100644 (file)
index 0000000..5fbc9e6
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL3_HEADER
+#define BOOST_SIGNALS_SIGNAL3_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 3
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3
+#define BOOST_SIGNALS_ARGS a1, a2, a3
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL3_HEADER
diff --git a/boost/boost/signals/signal4.hpp b/boost/boost/signals/signal4.hpp
new file mode 100644 (file)
index 0000000..1f473bc
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL4_HEADER
+#define BOOST_SIGNALS_SIGNAL4_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 4
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL4_HEADER
diff --git a/boost/boost/signals/signal5.hpp b/boost/boost/signals/signal5.hpp
new file mode 100644 (file)
index 0000000..b2ad9bb
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL5_HEADER
+#define BOOST_SIGNALS_SIGNAL5_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 5
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL5_HEADER
diff --git a/boost/boost/signals/signal6.hpp b/boost/boost/signals/signal6.hpp
new file mode 100644 (file)
index 0000000..b538f5e
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL6_HEADER
+#define BOOST_SIGNALS_SIGNAL6_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 6
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL6_HEADER
diff --git a/boost/boost/signals/signal7.hpp b/boost/boost/signals/signal7.hpp
new file mode 100644 (file)
index 0000000..2185558
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL7_HEADER
+#define BOOST_SIGNALS_SIGNAL7_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 7
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL7_HEADER
diff --git a/boost/boost/signals/signal8.hpp b/boost/boost/signals/signal8.hpp
new file mode 100644 (file)
index 0000000..f13599a
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL8_HEADER
+#define BOOST_SIGNALS_SIGNAL8_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 8
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7, a8
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7, args->a8
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL8_HEADER
diff --git a/boost/boost/signals/signal9.hpp b/boost/boost/signals/signal9.hpp
new file mode 100644 (file)
index 0000000..1288b21
--- /dev/null
@@ -0,0 +1,43 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SIGNAL9_HEADER
+#define BOOST_SIGNALS_SIGNAL9_HEADER
+
+#define BOOST_SIGNALS_NUM_ARGS 9
+#define BOOST_SIGNALS_TEMPLATE_PARMS typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9
+#define BOOST_SIGNALS_TEMPLATE_ARGS T1, T2, T3, T4, T5, T6, T7, T8, T9
+#define BOOST_SIGNALS_PARMS T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7, T8 a8, T9 a9
+#define BOOST_SIGNALS_ARGS a1, a2, a3, a4, a5, a6, a7, a8, a9
+#define BOOST_SIGNALS_BOUND_ARGS args->a1, args->a2, args->a3, args->a4, args->a5, args->a6, args->a7, args->a8, args->a9
+#define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;
+#define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9
+#define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9)
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; 
+
+#include <boost/signals/signal_template.hpp>
+
+#undef BOOST_SIGNALS_ARG_TYPES
+#undef BOOST_SIGNALS_INIT_ARGS
+#undef BOOST_SIGNALS_COPY_PARMS
+#undef BOOST_SIGNALS_ARGS_AS_MEMBERS
+#undef BOOST_SIGNALS_BOUND_ARGS
+#undef BOOST_SIGNALS_ARGS
+#undef BOOST_SIGNALS_PARMS
+#undef BOOST_SIGNALS_TEMPLATE_ARGS
+#undef BOOST_SIGNALS_TEMPLATE_PARMS
+#undef BOOST_SIGNALS_NUM_ARGS
+
+#endif // BOOST_SIGNALS_SIGNAL9_HEADER
diff --git a/boost/boost/signals/signal_template.hpp b/boost/boost/signals/signal_template.hpp
new file mode 100644 (file)
index 0000000..11eaae1
--- /dev/null
@@ -0,0 +1,353 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+// This file intentionally does not have include guards, because it is meant
+// to be included multiple times (one for each signalN class). The 
+// BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED macro merely serves to
+// suppress reinclusion of the files that this header depends on.
+#ifndef BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
+#define BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
+#  include <boost/config.hpp>
+#  include <boost/signals/connection.hpp>
+#  include <boost/utility.hpp>
+#  include <boost/ref.hpp>
+#  include <boost/signals/slot.hpp>
+#  include <boost/last_value.hpp>
+#  include <boost/signals/detail/signal_base.hpp>
+#  include <boost/signals/detail/slot_call_iterator.hpp>
+#  include <cassert>
+#  include <functional>
+#  include <memory>
+#  include <string>
+#endif // !BOOST_SIGNALS_SIGNAL_TEMPLATE_HEADER_INCLUDED
+
+// Include the appropriate functionN header
+#define BOOST_SIGNAL_FUNCTION_N_HEADER BOOST_JOIN(<boost/function/function,BOOST_SIGNALS_NUM_ARGS.hpp>)
+#include BOOST_SIGNAL_FUNCTION_N_HEADER
+
+// Determine if a comma should follow a listing of the arguments/parameters
+#if BOOST_SIGNALS_NUM_ARGS == 0
+#  define BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+#else
+#  define BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS ,
+#endif // BOOST_SIGNALS_NUM_ARGS > 0
+
+// Define class names used
+#define BOOST_SIGNALS_SIGNAL BOOST_JOIN(signal,BOOST_SIGNALS_NUM_ARGS)
+#define BOOST_SIGNALS_FUNCTION BOOST_JOIN(function,BOOST_SIGNALS_NUM_ARGS)
+#define BOOST_SIGNALS_ARGS_STRUCT BOOST_JOIN(args,BOOST_SIGNALS_NUM_ARGS)
+#define BOOST_SIGNALS_CALL_BOUND BOOST_JOIN(call_bound,BOOST_SIGNALS_NUM_ARGS)
+
+// Define commonly-used instantiations
+#define BOOST_SIGNALS_ARGS_STRUCT_INST \
+  signals::detail::BOOST_SIGNALS_ARGS_STRUCT<BOOST_SIGNALS_TEMPLATE_ARGS>
+
+namespace boost {
+  namespace signals {
+    namespace detail {
+      // Holds the arguments for a bound slot call in a single place
+      template<BOOST_SIGNALS_TEMPLATE_PARMS
+               BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+               typename Dummy = int>
+      struct BOOST_SIGNALS_ARGS_STRUCT {
+       BOOST_SIGNALS_ARGS_STRUCT(BOOST_SIGNALS_COPY_PARMS)
+         BOOST_SIGNALS_INIT_ARGS
+       {
+       }
+
+        BOOST_SIGNALS_ARGS_AS_MEMBERS
+      };
+
+      // Function object that calls the function object given to it, passing
+      // the bound arguments along to that underlying function object
+      template<typename R>
+      struct BOOST_SIGNALS_CALL_BOUND {
+       template<BOOST_SIGNALS_TEMPLATE_PARMS
+                BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+                 typename F>
+       struct caller {
+         typedef BOOST_SIGNALS_ARGS_STRUCT<BOOST_SIGNALS_TEMPLATE_ARGS>*
+           args_type;
+
+          args_type args;
+
+          typedef R result_type;
+
+          caller() {}
+         caller(args_type a) : args(a) {}
+
+          template<typename Pair>
+          R operator()(const Pair& slot) const
+          {
+            F* target = const_cast<F*>(any_cast<F>(&slot.second.second));
+            return (*target)(BOOST_SIGNALS_BOUND_ARGS);
+          }
+       };
+      };
+
+      template<>
+      struct BOOST_SIGNALS_CALL_BOUND<void> {
+       template<BOOST_SIGNALS_TEMPLATE_PARMS
+                BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+                 typename F>
+       struct caller {
+         typedef BOOST_SIGNALS_ARGS_STRUCT<BOOST_SIGNALS_TEMPLATE_ARGS>*
+           args_type;
+
+          args_type args;
+
+          typedef unusable result_type;
+
+         caller(args_type a) : args(a) {}
+
+          template<typename Pair>
+          unusable operator()(const Pair& slot) const
+          {
+            F* target = const_cast<F*>(any_cast<F>(&slot.second.second));
+            (*target)(BOOST_SIGNALS_BOUND_ARGS);
+           return unusable();
+          }
+       };
+      };
+    } // namespace detail
+  } // namespace signals
+
+  // The actual signalN class
+  template<
+    typename R,
+    BOOST_SIGNALS_TEMPLATE_PARMS 
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+    typename Combiner = last_value<R>,
+    typename Group = int,
+    typename GroupCompare = std::less<Group>,
+    typename SlotFunction = BOOST_SIGNALS_FUNCTION<
+                              R BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+                              BOOST_SIGNALS_TEMPLATE_ARGS> 
+  >
+  class BOOST_SIGNALS_SIGNAL : 
+    public signals::detail::signal_base, // management of slot list
+    public signals::trackable // signals are trackable
+  {
+  public:
+    // The slot function type
+    typedef SlotFunction slot_function_type;
+
+    // Result type of a slot
+    typedef typename signals::detail::slot_result_type<R>::type
+      slot_result_type;
+
+    // Argument types
+    BOOST_SIGNALS_ARG_TYPES
+
+#if BOOST_SIGNALS_NUM_ARGS == 1
+    typedef T1 argument_type;
+#elif BOOST_SIGNALS_NUM_ARGS == 2
+    typedef T1 first_argument_type;
+    typedef T2 second_argument_type;
+#endif
+
+  private:
+    // The real slot name comparison object type
+    typedef signals::detail::any_bridge_compare<GroupCompare, Group>
+      real_group_compare_type;
+
+    // The function object passed to the slot call iterator that will call
+    // the underlying slot function with its arguments bound
+    typedef signals::detail::BOOST_SIGNALS_CALL_BOUND<R> 
+      outer_bound_slot_caller;
+    typedef typename outer_bound_slot_caller::template
+              caller<BOOST_SIGNALS_TEMPLATE_ARGS
+                     BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+                     slot_function_type>
+      call_bound_slot;
+
+  public:
+    // Combiner's result type
+    typedef typename Combiner::result_type result_type; 
+
+    // Combiner type
+    typedef Combiner combiner_type;
+
+    // Slot type
+    typedef slot<slot_function_type> slot_type;
+
+    // Slot name type and comparison
+    typedef Group group_type;
+    typedef GroupCompare group_compare_type;
+
+    typedef typename signals::detail::slot_call_iterator_generator<
+                       call_bound_slot, 
+                       slot_iterator>::type slot_call_iterator;
+
+    explicit 
+    BOOST_SIGNALS_SIGNAL(const Combiner& c = Combiner(),
+                         const GroupCompare& comp = GroupCompare()) : 
+      signals::detail::signal_base(real_group_compare_type(comp)),
+      combiner(c)
+    {
+    }
+
+    // Connect a slot to this signal
+    signals::connection connect(const slot_type&);
+    signals::connection connect(const group_type&, const slot_type&);
+
+    // Disconnect a named slot
+    void disconnect(const group_type& group)
+    {
+      impl->disconnect(group);
+    }
+
+    // Emit the signal
+    result_type operator()(BOOST_SIGNALS_PARMS);
+    result_type operator()(BOOST_SIGNALS_PARMS) const;
+
+  private:
+    Combiner combiner;
+  };
+
+  template<
+    typename R,
+    BOOST_SIGNALS_TEMPLATE_PARMS
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+    typename Combiner,
+    typename Group,
+    typename GroupCompare,
+    typename SlotFunction
+  >
+  signals::connection 
+  BOOST_SIGNALS_SIGNAL<                                 
+    R, BOOST_SIGNALS_TEMPLATE_ARGS                      
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS  
+    Combiner, Group, GroupCompare, SlotFunction
+  >::connect(const slot_type& in_slot)
+  {
+    // If the slot has been disconnected, just return a disconnected 
+    // connection
+    if (!in_slot.is_active()) {
+      return signals::connection();
+    }
+
+    return impl->connect_slot(in_slot.get_slot_function(),
+                              any(),
+                              in_slot.get_bound_objects());
+  }
+
+  template<
+    typename R,
+    BOOST_SIGNALS_TEMPLATE_PARMS
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+    typename Combiner,
+    typename Group,
+    typename GroupCompare,
+    typename SlotFunction
+  >
+  signals::connection 
+  BOOST_SIGNALS_SIGNAL<                                 
+    R, BOOST_SIGNALS_TEMPLATE_ARGS                      
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS  
+    Combiner, Group, GroupCompare, SlotFunction
+  >::connect(const group_type& group, 
+             const slot_type& in_slot)
+  {
+    return impl->connect_slot(in_slot.get_slot_function(),
+                              group,
+                              in_slot.get_bound_objects());
+  }
+
+  template<
+    typename R,
+    BOOST_SIGNALS_TEMPLATE_PARMS
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+    typename Combiner,
+    typename Group,
+    typename GroupCompare,
+    typename SlotFunction
+  >                                                          
+  typename BOOST_SIGNALS_SIGNAL<                                 
+             R, BOOST_SIGNALS_TEMPLATE_ARGS                      
+             BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS  
+             Combiner, Group, GroupCompare, SlotFunction>::result_type
+  BOOST_SIGNALS_SIGNAL<                                 
+    R, BOOST_SIGNALS_TEMPLATE_ARGS                      
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS  
+    Combiner, Group, GroupCompare, SlotFunction
+  >::operator()(BOOST_SIGNALS_PARMS)
+  {
+    // Notify the slot handling code that we are making a call
+    signals::detail::call_notification notification(this->impl);
+
+    // Construct a function object that will call the underlying slots
+    // with the given arguments. 
+#if BOOST_SIGNALS_NUM_ARGS == 0
+    BOOST_SIGNALS_ARGS_STRUCT_INST args;
+#else
+    BOOST_SIGNALS_ARGS_STRUCT_INST args(BOOST_SIGNALS_ARGS);
+#endif // BOOST_SIGNALS_NUM_ARGS > 0
+    call_bound_slot f(&args);
+
+    // Let the combiner call the slots via a pair of input iterators
+    return combiner(signals::detail::make_slot_call_iterator(
+                     notification.impl->slots.begin(), impl->slots.end(), f),
+                   signals::detail::make_slot_call_iterator(
+                     notification.impl->slots.end(), impl->slots.end(), f));
+  }
+
+  template<
+    typename R,
+    BOOST_SIGNALS_TEMPLATE_PARMS
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
+    typename Combiner,
+    typename Group,
+    typename GroupCompare,
+    typename SlotFunction
+  >                                                          
+  typename BOOST_SIGNALS_SIGNAL<                                 
+             R, BOOST_SIGNALS_TEMPLATE_ARGS                      
+             BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS  
+             Combiner, Group, GroupCompare, SlotFunction>::result_type
+  BOOST_SIGNALS_SIGNAL<                                 
+    R, BOOST_SIGNALS_TEMPLATE_ARGS                      
+    BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS  
+    Combiner, Group, GroupCompare, SlotFunction
+  >::operator()(BOOST_SIGNALS_PARMS) const
+  {
+    // Notify the slot handling code that we are making a call
+    signals::detail::call_notification notification(this->impl);
+
+    // Construct a function object that will call the underlying slots
+    // with the given arguments. 
+#if BOOST_SIGNALS_NUM_ARGS == 0
+    BOOST_SIGNALS_ARGS_STRUCT_INST args;
+#else
+    BOOST_SIGNALS_ARGS_STRUCT_INST args(BOOST_SIGNALS_ARGS);
+#endif // BOOST_SIGNALS_NUM_ARGS > 0
+
+    call_bound_slot f(&args);
+
+    // Let the combiner call the slots via a pair of input iterators
+    return combiner(signals::detail::make_slot_call_iterator(
+                     notification.impl->slots.begin(), impl->slots.end(), f),
+                   signals::detail::make_slot_call_iterator(
+                     notification.impl->slots.end(), impl->slots.end(), f));
+  }
+} // namespace boost
+
+#undef BOOST_SIGNAL_FUNCTION_N_HEADER
+#undef BOOST_SIGNALS_ARGS_STRUCT_INST
+#undef BOOST_SIGNALS_CALL_BOUND
+#undef BOOST_SIGNALS_ARGS_STRUCT
+#undef BOOST_SIGNALS_FUNCTION
+#undef BOOST_SIGNALS_SIGNAL
+#undef BOOST_SIGNALS_COMMA_IF_NONZERO_ARGS
diff --git a/boost/boost/signals/slot.hpp b/boost/boost/signals/slot.hpp
new file mode 100644 (file)
index 0000000..427e1a7
--- /dev/null
@@ -0,0 +1,132 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_SLOT_HEADER
+#define BOOST_SIGNALS_SLOT_HEADER
+
+#include <boost/signals/detail/signals_common.hpp>
+#include <boost/signals/connection.hpp>
+#include <boost/signals/trackable.hpp>
+#include <boost/visit_each.hpp>
+#include <cassert>
+
+namespace boost {
+  namespace signals {
+    namespace detail {
+      class slot_base {
+        // We would have to enumerate all of the signalN classes here as 
+        // friends to make this private (as it otherwise should be). We can't
+        // name all of them because we don't know how many there are.
+      public:
+        // Get the set of bound objects
+        std::vector<const trackable*>& get_bound_objects() const 
+        { return bound_objects; }
+        
+        // Determine if this slot is still "active", i.e., all of the bound
+        // objects still exist
+        bool is_active() const { return watch_bound_objects.connected(); }
+
+      protected:
+        // Create a connection for this slot
+        void create_connection();
+
+        // Get the slot so that it can be copied
+        template<typename F> 
+        reference_wrapper<const F> 
+        get_invocable_slot(const F& f, signals::detail::signal_tag)
+          { return reference_wrapper<const F>(f); }
+
+        template<typename F> 
+        const F& get_invocable_slot(const F& f, signals::detail::reference_tag)
+          { return f; }
+
+        template<typename F>
+        const F& get_invocable_slot(const F& f, signals::detail::value_tag)
+          { return f; }
+
+        // Get the slot so that it can be inspected for trackable objects
+        template<typename F> 
+        const F& get_inspectable_slot(const F& f,
+                                      signals::detail::signal_tag)
+          { return f; }
+
+        template<typename F> 
+        const F& get_inspectable_slot(const F& f, 
+                                      signals::detail::reference_tag)
+          { return f.get(); }
+
+        template<typename F>
+        const F& get_inspectable_slot(const F& f, signals::detail::value_tag)
+          { return f; }
+
+        // Determines the type of the slot - is it a signal, a reference to a
+        // slot or just a normal slot.
+        template<typename F>
+        typename signals::detail::get_slot_tag<F>::type
+        tag_type(const F&)
+        {
+          typename signals::detail::get_slot_tag<F>::type tag;
+          return tag;
+        }
+
+        mutable std::vector<const trackable*> bound_objects;
+        connection watch_bound_objects;
+
+      private:
+        static void bound_object_destructed(void*, void*) {}
+      };
+    } // end namespace detail
+  } // end namespace signals
+
+  template<typename SlotFunction>
+  class slot : public signals::detail::slot_base {
+  public:
+    template<typename F> 
+    slot(const F& f) : slot_function(get_invocable_slot(f, tag_type(f)))
+    {
+      // Visit each of the bound objects and store them for later use
+      // An exception thrown here will allow the basic_connection to be
+      // destroyed when this goes out of scope, and no other connections
+      // have been made.
+      signals::detail::bound_objects_visitor do_bind(bound_objects);
+      visit_each(do_bind, get_inspectable_slot(f, tag_type(f)));
+
+      create_connection();
+    }
+
+#ifdef __BORLANDC__
+    template<typename F>
+    slot(F* f) : slot_function(f)
+    {
+      create_connection();
+    }
+#endif // __BORLANDC__
+
+    // We would have to enumerate all of the signalN classes here as friends
+    // to make this private (as it otherwise should be). We can't name all of
+    // them because we don't know how many there are.
+  public: 
+    // Get the slot function to call the actual slot
+    const SlotFunction& get_slot_function() const { return slot_function; }
+
+  private:
+    slot(); // no default constructor
+    slot& operator=(const slot&); // no assignment operator
+
+    SlotFunction slot_function;
+  };
+} // end namespace boost
+
+#endif // BOOST_SIGNALS_SLOT_HEADER
diff --git a/boost/boost/signals/trackable.hpp b/boost/boost/signals/trackable.hpp
new file mode 100644 (file)
index 0000000..a6ed2df
--- /dev/null
@@ -0,0 +1,109 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_SIGNALS_TRACKABLE_HPP
+#define BOOST_SIGNALS_TRACKABLE_HPP
+
+#include <boost/type_traits.hpp>
+#include <boost/signals/connection.hpp>
+#include <boost/ref.hpp>
+#include <list>
+#include <vector>
+
+namespace boost {
+  namespace signals {
+    // Base class for "trackable" objects that can be tracked when they are
+    // bound in slot target functions. When a trackable object is destroyed,
+    // the signal/slot connections are disconnected automatically.
+    class trackable {
+    private:
+      static void signal_disconnected(void* obj, void* data);
+
+      friend class detail::signal_base_impl;
+      friend class detail::slot_base;
+      void signal_connected(connection, signals::detail::bound_object&) const;
+      
+    protected:
+      trackable() : connected_signals(), dying(false) {}
+      trackable(const trackable&) : connected_signals(), dying(false) {}
+      ~trackable();
+      
+      trackable& operator=(const trackable&)
+      {
+        connected_signals.clear();
+        return *this;
+      }
+      
+    private:
+      typedef std::list<connection> connection_list;
+      typedef connection_list::iterator connection_iterator;
+      
+      // List of connections that this object is part of
+      mutable connection_list connected_signals;
+      
+      // True when the object is being destroyed
+      mutable bool dying;
+    };
+
+    namespace detail {
+      template<bool Cond> struct truth {};
+
+      // A visitor that adds each trackable object to a vector
+      class bound_objects_visitor {
+      public:
+        bound_objects_visitor(std::vector<const trackable*>& v) : 
+          bound_objects(v) 
+        {
+        }
+        
+        template<typename T>
+        inline void operator()(const T& t) const
+        {
+          visit(t, truth<is_convertible<T, trackable*>::value>());
+          visit(&t, truth<is_convertible<T*, trackable*>::value>());
+        }
+
+        template<typename T>
+        inline void operator()(const boost::reference_wrapper<T>& r) const
+        {
+          (*this)(r.get());
+        }
+
+        inline void operator()(const trackable* b) const
+        {
+          if (b) {
+            bound_objects.push_back(b);
+          }
+        }
+
+      private:
+        template<typename T>
+        inline void visit(const T&, truth<false>) const
+        {
+        }
+
+        template<typename T>
+        inline void visit(const T& t, truth<true>) const
+        {
+          (*this)(static_cast<const trackable*>(t));
+        }
+
+        mutable std::vector<const trackable*>& bound_objects;
+      };
+    } // end namespace detail
+  } // end namespace signals
+}
+
+#endif // BOOST_SIGNALS_TRACKABLE_HPP
index 7de81b19eceabafc221faba7a47529d49d0fb907..da28e87b6c7aed1ecf8cce1a9b9bbb98acfc452e 100644 (file)
@@ -1,434 +1,9 @@
-// Baruch Even  baruch@ev-en.org  2001-02-20
-//  This version is a modified version for use in LyX
-//  The modifications are done in order to use it where exceptions are disabled
-//  Currently it has no "no memory" checks in place, asserts are probably the
-//  only real way.
-//  all changed are #ifded'ed by LYX_NO_EXCEPTIONS
-#define LYX_NO_EXCEPTIONS
-
 //  Boost smart_ptr.hpp header file  -----------------------------------------//
 
-//  (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. Permission to copy,
-//  use, modify, sell and distribute this software is granted provided this
-//  copyright notice appears in all copies. This software is provided "as is"
-//  without express or implied warranty, and with no claim as to its
-//  suitability for any purpose.
-
-//  See http://www.boost.org for most recent version including documentation.
-
-//  Revision History
-//   6 Jul 01  Reorder shared_ptr code so VC++ 6 member templates work, allowing
-//             polymorphic pointers to now work with that compiler (Gary Powell)
-//  21 May 01  Require complete type where incomplete type is unsafe.
-//             (suggested by Vladimir Prus)
-//  21 May 01  operator= fails if operand transitively owned by *this, as in a
-//             linked list (report by Ken Johnson, fix by Beman Dawes)
-//  21 Jan 01  Suppress some useless warnings with MSVC (David Abrahams)
-//  19 Oct 00  Make shared_ptr ctor from auto_ptr explicit. (Robert Vugts) 
-//  24 Jul 00  Change throw() to // never throws.  See lib guidelines
-//             Exception-specification rationale. (Beman Dawes)
-//  22 Jun 00  Remove #if continuations to fix GCC 2.95.2 problem (Beman Dawes)
-//   1 Feb 00  Additional shared_ptr BOOST_NO_MEMBER_TEMPLATES workarounds
-//             (Dave Abrahams)
-//  31 Dec 99  Condition tightened for no member template friend workaround
-//             (Dave Abrahams)
-//  30 Dec 99  Moved BOOST_NMEMBER_TEMPLATES compatibility code to config.hpp
-//             (Dave Abrahams)
-//  30 Nov 99  added operator ==, operator !=, and std::swap and std::less
-//             specializations for shared types (Darin Adler)
-//  11 Oct 99  replaced op[](int) with op[](std::size_t) (Ed Brey, Valentin
-//             Bonnard), added shared_ptr workaround for no member template
-//             friends (Matthew Langston)
-//  25 Sep 99  added shared_ptr::swap and shared_array::swap (Luis Coelho).
-//  20 Jul 99  changed name to smart_ptr.hpp, #include <boost/config.hpp>,
-//             #include <boost/utility.hpp> and use boost::noncopyable
-//  17 May 99  remove scoped_array and shared_array operator*() as
-//             unnecessary (Beman Dawes)
-//  14 May 99  reorder code so no effects when bad_alloc thrown (Abrahams/Dawes)
-//  13 May 99  remove certain throw() specifiers to avoid generated try/catch
-//             code cost (Beman Dawes)
-//  11 May 99  get() added, conversion to T* placed in macro guard (Valentin
-//             Bonnard, Dave Abrahams, and others argued for elimination
-//             of the automatic conversion)
-//  28 Apr 99  #include <memory> fix (Valentin Bonnard)
-//  28 Apr 99  rename transfer() to share() for clarity (Dave Abrahams)
-//  28 Apr 99  remove unsafe shared_array template conversions(Valentin Bonnard)
-//  28 Apr 99  p(r) changed to p(r.px) for clarity (Dave Abrahams)
-//  21 Apr 99  reset() self assignment fix (Valentin Bonnard)
-//  21 Apr 99  dispose() provided to improve clarity (Valentin Bonnard)
-//  27 Apr 99  leak when new throws fixes (Dave Abrahams)
-//  21 Oct 98  initial Version (Greg Colvin/Beman Dawes)
-
-#ifndef BOOST_SMART_PTR_HPP
-#define BOOST_SMART_PTR_HPP
-
-#include <boost/config.hpp>   // for broken compiler workarounds
-#include <cstddef>            // for std::size_t
-#include <memory>             // for std::auto_ptr
-#include <algorithm>          // for std::swap
-#include <boost/utility.hpp>  // for boost::noncopyable, checked_delete, checked_array_delete
-#include <functional>         // for std::less
-#include <boost/static_assert.hpp> // for BOOST_STATIC_ASSERT
-
-#ifdef LYX_NO_EXCEPTIONS
-#include <cassert>
-#endif
-
-#ifdef BOOST_MSVC  // moved here to work around VC++ compiler crash
-# pragma warning(push)
-# pragma warning(disable:4284) // return type for 'identifier::operator->' is not a UDT or reference to a UDT. Will produce errors if applied using infix notation
-#endif    
-
-namespace boost {
-
-//  scoped_ptr  --------------------------------------------------------------//
-
-//  scoped_ptr mimics a built-in pointer except that it guarantees deletion
-//  of the object pointed to, either on destruction of the scoped_ptr or via
-//  an explicit reset().  scoped_ptr is a simple solution for simple needs;
-//  see shared_ptr (below) or std::auto_ptr if your needs are more complex.
-
-template<typename T> class scoped_ptr : noncopyable {
-
-  T* ptr;
-
- public:
-  typedef T element_type;
-
-  explicit scoped_ptr( T* p=0 ) : ptr(p) {}  // never throws
-  ~scoped_ptr()                 { checked_delete(ptr); }
-  void reset( T* p=0 )          { if ( ptr != p ) { checked_delete(ptr); ptr = p; } }
-  T& operator*() const          { return *ptr; }  // never throws
-  T* operator->() const         { return ptr; }  // never throws
-  T* get() const                { return ptr; }  // never throws
-#ifdef BOOST_SMART_PTR_CONVERSION
-  // get() is safer! Define BOOST_SMART_PTR_CONVERSION at your own risk!
-  operator T*() const           { return ptr; }  // never throws 
-#endif
-  };  // scoped_ptr
-
-//  scoped_array  ------------------------------------------------------------//
-
-//  scoped_array extends scoped_ptr to arrays. Deletion of the array pointed to
-//  is guaranteed, either on destruction of the scoped_array or via an explicit
-//  reset(). See shared_array or std::vector if your needs are more complex.
-
-template<typename T> class scoped_array : noncopyable {
-
-  T* ptr;
-
- public:
-  typedef T element_type;
-
-  explicit scoped_array( T* p=0 ) : ptr(p) {}  // never throws
-  ~scoped_array()                    { checked_array_delete(ptr); }
-
-  void reset( T* p=0 )               { if ( ptr != p )
-                                         {checked_array_delete(ptr); ptr=p;} }
-
-  T* get() const                     { return ptr; }  // never throws
-#ifdef BOOST_SMART_PTR_CONVERSION
-  // get() is safer! Define BOOST_SMART_PTR_CONVERSION at your own risk!
-  operator T*() const                { return ptr; }  // never throws
-#else 
-  T& operator[](std::size_t i) const { return ptr[i]; }  // never throws
-#endif
-  };  // scoped_array
-
-//  shared_ptr  --------------------------------------------------------------//
-
-//  An enhanced relative of scoped_ptr with reference counted copy semantics.
-//  The object pointed to is deleted when the last shared_ptr pointing to it
-//  is destroyed or reset.
-
-template<typename T> class shared_ptr {
-  public:
-   typedef T element_type;
-
-   explicit shared_ptr(T* p =0) : px(p) {
-#ifndef LYX_NO_EXCEPTIONS
-      try { pn = new long(1); }  // fix: prevent leak if new throws
-      catch (...) { checked_delete(p); throw; }
-#else
-      pn = new long(1);
-      assert(pn != 0);
-#endif
-   }
-
-   ~shared_ptr() { dispose(); }
-
-#if !defined( BOOST_NO_MEMBER_TEMPLATES ) || defined (BOOST_MSVC6_MEMBER_TEMPLATES)
-   template<typename Y>
-      shared_ptr(const shared_ptr<Y>& r) : px(r.px) {  // never throws 
-         ++*(pn = r.pn); 
-      }
-#ifndef BOOST_NO_AUTO_PTR
-   template<typename Y>
-      explicit shared_ptr(std::auto_ptr<Y>& r) { 
-         pn = new long(1); // may throw
-         px = r.release(); // fix: moved here to stop leak if new throws
-      }
-#endif 
-
-   template<typename Y>
-      shared_ptr& operator=(const shared_ptr<Y>& r) { 
-         share(r.px,r.pn);
-         return *this;
-      }
-
-#ifndef BOOST_NO_AUTO_PTR
-   template<typename Y>
-      shared_ptr& operator=(std::auto_ptr<Y>& r) {
-         // code choice driven by guarantee of "no effect if new throws"
-         if (*pn == 1) { checked_delete(px); }
-         else { // allocate new reference counter
-           long * tmp = new long(1); // may throw
-           --*pn; // only decrement once danger of new throwing is past
-           pn = tmp;
-         } // allocate new reference counter
-         px = r.release(); // fix: moved here so doesn't leak if new throws 
-         return *this;
-      }
-#endif
-#else
-#ifndef BOOST_NO_AUTO_PTR
-      explicit shared_ptr(std::auto_ptr<T>& r) { 
-         pn = new long(1); // may throw
-         px = r.release(); // fix: moved here to stop leak if new throws
-      } 
-
-      shared_ptr& operator=(std::auto_ptr<T>& r) {
-         // code choice driven by guarantee of "no effect if new throws"
-         if (*pn == 1) { checked_delete(px); }
-         else { // allocate new reference counter
-           long * tmp = new long(1); // may throw
-           --*pn; // only decrement once danger of new throwing is past
-           pn = tmp;
-         } // allocate new reference counter
-         px = r.release(); // fix: moved here so doesn't leak if new throws 
-         return *this;
-      }
-#endif
-#endif
-
-   // The assignment operator and the copy constructor must come after
-   // the templated versions for MSVC6 to work. (Gary Powell)
-   shared_ptr(const shared_ptr& r) : px(r.px) { ++*(pn = r.pn); }  // never throws
-
-   shared_ptr& operator=(const shared_ptr& r) {
-      share(r.px,r.pn);
-      return *this;
-   }
-
-   void reset(T* p=0) {
-      if ( px == p ) return;  // fix: self-assignment safe
-      if (--*pn == 0) { checked_delete(px); }
-      else { // allocate new reference counter
-#ifndef LYX_NO_EXCEPTIONS
-        try { pn = new long; }  // fix: prevent leak if new throws
-        catch (...) {
-          ++*pn;  // undo effect of --*pn above to meet effects guarantee 
-          checked_delete(p);
-          throw;
-        } // catch
-#else
-       pn = new long;
-       assert(pn != 0);
-#endif
-      } // allocate new reference counter
-      *pn = 1;
-      px = p;
-   } // reset
-
-   T& operator*() const          { return *px; }  // never throws
-   T* operator->() const         { return px; }  // never throws
-   T* get() const                { return px; }  // never throws
- #ifdef BOOST_SMART_PTR_CONVERSION
-   // get() is safer! Define BOOST_SMART_PTR_CONVERSION at your own risk!
-   operator T*() const           { return px; }  // never throws 
- #endif
-
-   long use_count() const        { return *pn; }  // never throws
-   bool unique() const           { return *pn == 1; }  // never throws
-
-   void swap(shared_ptr<T>& other)  // never throws
-     { std::swap(px,other.px); std::swap(pn,other.pn); }
-
-// Tasteless as this may seem, making all members public allows member templates
-// to work in the absence of member template friends. (Matthew Langston)
-// Don't split this line into two; that causes problems for some GCC 2.95.2 builds
-#if ( defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) ) || !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )
-   private:
-#endif
-
-   T*     px;     // contained pointer
-   long*  pn;     // ptr to reference counter
-
-// Don't split this line into two; that causes problems for some GCC 2.95.2 builds
-#if !defined( BOOST_NO_MEMBER_TEMPLATES ) && !defined( BOOST_NO_MEMBER_TEMPLATE_FRIENDS )
-   template<typename Y> friend class shared_ptr;
-#endif
-
-   void dispose() { if (--*pn == 0) { checked_delete(px); delete pn; } }
-
-   void share(T* rpx, long* rpn) {
-      if (pn != rpn) { // Q: why not px != rpx? A: fails when both == 0
-         ++*rpn; // done before dispose() in case rpn transitively
-                 // dependent on *this (bug reported by Ken Johnson)
-         dispose();
-         px = rpx;
-         pn = rpn;
-      }
-   } // share
-};  // shared_ptr
-
-template<typename T, typename U>
-  inline bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b)
-    { return a.get() == b.get(); }
-
-template<typename T, typename U>
-  inline bool operator!=(const shared_ptr<T>& a, const shared_ptr<U>& b)
-    { return a.get() != b.get(); }
-
-//  shared_array  ------------------------------------------------------------//
-
-//  shared_array extends shared_ptr to arrays.
-//  The array pointed to is deleted when the last shared_array pointing to it
-//  is destroyed or reset.
-
-template<typename T> class shared_array {
-  public:
-   typedef T element_type;
-
-   explicit shared_array(T* p =0) : px(p) {
-#ifndef LYX_NO_EXCEPTIONS
-      try { pn = new long(1); }  // fix: prevent leak if new throws
-      catch (...) { checked_array_delete(p); throw; }
-#else
-      pn = new long(1);
-      assert(pn != 0);
-#endif
-   }
-
-   shared_array(const shared_array& r) : px(r.px)  // never throws
-      { ++*(pn = r.pn); }
-
-   ~shared_array() { dispose(); }
-
-   shared_array& operator=(const shared_array& r) {
-      if (pn != r.pn) { // Q: why not px != r.px? A: fails when both px == 0
-         ++*r.pn; // done before dispose() in case r.pn transitively
-                  // dependent on *this (bug reported by Ken Johnson)
-         dispose();
-         px = r.px;
-         pn = r.pn;
-      }
-      return *this;
-   } // operator=
-
-   void reset(T* p=0) {
-      if ( px == p ) return;  // fix: self-assignment safe
-      if (--*pn == 0) { checked_array_delete(px); }
-      else { // allocate new reference counter
-#ifndef LYX_NO_EXCEPTIONS
-        try { pn = new long; }  // fix: prevent leak if new throws
-        catch (...) {
-          ++*pn;  // undo effect of --*pn above to meet effects guarantee 
-          checked_array_delete(p);
-          throw;
-        } // catch
-#else
-       pn = new long;
-       assert(pn != 0);
-#endif
-      } // allocate new reference counter
-      *pn = 1;
-      px = p;
-   } // reset
-
-   T* get() const                     { return px; }  // never throws
- #ifdef BOOST_SMART_PTR_CONVERSION
-   // get() is safer! Define BOOST_SMART_PTR_CONVERSION at your own risk!
-   operator T*() const                { return px; }  // never throws
- #else 
-   T& operator[](std::size_t i) const { return px[i]; }  // never throws
- #endif
-
-   long use_count() const             { return *pn; }  // never throws
-   bool unique() const                { return *pn == 1; }  // never throws
-
-   void swap(shared_array<T>& other)  // never throws
-     { std::swap(px,other.px); std::swap(pn,other.pn); }
-
-  private:
-
-   T*     px;     // contained pointer
-   long*  pn;     // ptr to reference counter
-
-   void dispose() { if (--*pn == 0) { checked_array_delete(px); delete pn; } }
-
-};  // shared_array
-
-template<typename T>
-  inline bool operator==(const shared_array<T>& a, const shared_array<T>& b)
-    { return a.get() == b.get(); }
-
-template<typename T>
-  inline bool operator!=(const shared_array<T>& a, const shared_array<T>& b)
-    { return a.get() != b.get(); }
-
-} // namespace boost
-
-//  specializations for things in namespace std  -----------------------------//
-
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-namespace std {
-
-// Specialize std::swap to use the fast, non-throwing swap that's provided
-// as a member function instead of using the default algorithm which creates
-// a temporary and uses assignment.
-
-template<typename T>
-  inline void swap(boost::shared_ptr<T>& a, boost::shared_ptr<T>& b)
-    { a.swap(b); }
-
-template<typename T>
-  inline void swap(boost::shared_array<T>& a, boost::shared_array<T>& b)
-    { a.swap(b); }
-
-// Specialize std::less so we can use shared pointers and arrays as keys in
-// associative collections.
-
-// It's still a controversial question whether this is better than supplying
-// a full range of comparison operators (<, >, <=, >=).
-
-template<typename T>
-  struct less< boost::shared_ptr<T> >
-    : binary_function<boost::shared_ptr<T>, boost::shared_ptr<T>, bool>
-  {
-    bool operator()(const boost::shared_ptr<T>& a,
-        const boost::shared_ptr<T>& b) const
-      { return less<T*>()(a.get(),b.get()); }
-  };
-
-template<typename T>
-  struct less< boost::shared_array<T> >
-    : binary_function<boost::shared_array<T>, boost::shared_array<T>, bool>
-  {
-    bool operator()(const boost::shared_array<T>& a,
-        const boost::shared_array<T>& b) const
-      { return less<T*>()(a.get(),b.get()); }
-  };
-
-} // namespace std
-
-#endif  // ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-#ifdef BOOST_MSVC
-# pragma warning(pop)
-#endif    
-
-#endif  // BOOST_SMART_PTR_HPP
-
+// For compatibility, this header includes the header for the four "classic"
+// smart pointer class templates.
 
+#include <boost/scoped_ptr.hpp> 
+#include <boost/scoped_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/shared_array.hpp>
index 4d38b9d718a19e4bd9591f0d208459481af89e59..4ba29d71eee68fdabbd65134c2838a8963abb20c 100644 (file)
@@ -8,8 +8,8 @@
 
 /*
  Revision history:
-       02 August 2000
-               Initial version.
+   02 August 2000
+      Initial version.
 */
 
 #ifndef BOOST_STATIC_ASSERT_HPP
@@ -62,7 +62,7 @@ template<int x> struct static_assert_test{};
 #define BOOST_STATIC_ASSERT( B ) \
    typedef ::boost::static_assert_test<\
       sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
-         BOOST_ASSERT_JOIN(boost_static_assert_typedef_, __LINE__)
+         BOOST_JOIN(boost_static_assert_typedef_, __LINE__)
 #else
 // __LINE__ macro broken when -ZI is used see Q199057
 // fortunately MSVC ignores duplicate typedef's.
@@ -74,19 +74,10 @@ template<int x> struct static_assert_test{};
 #else
 // alternative enum based implementation:
 #define BOOST_STATIC_ASSERT( B ) \
-   enum { BOOST_ASSERT_JOIN(boost_static_assert_enum_, __LINE__) \
+   enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
       = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
 #endif
 
-//
-// The following piece of macro magic joins the two 
-// arguments together, even when one of the arguments is
-// itself a macro (see 16.3.1 in C++ standard).  The key
-// is that macro expansion of macro arguments does not
-// occur in BOOST_DO_ASSERT_JOIN but does in BOOST_ASSERT_JOIN
-// provided it is called from within another macro.
-#define BOOST_ASSERT_JOIN( X, Y ) BOOST_DO_ASSERT_JOIN( X, Y )
-#define BOOST_DO_ASSERT_JOIN( X, Y ) X##Y
 
 #endif // BOOST_STATIC_ASSERT_HPP
 
diff --git a/boost/boost/timer.hpp b/boost/boost/timer.hpp
new file mode 100644 (file)
index 0000000..87159c8
--- /dev/null
@@ -0,0 +1,73 @@
+//  boost timer.hpp header file  ---------------------------------------------//
+
+//  (C) Copyright Beman Dawes 1994-99. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+//  Revision History
+//  01 Apr 01  Modified to use new <boost/limits.hpp> header. (JMaddock)
+//  12 Jan 01  Change to inline implementation to allow use without library
+//             builds. See docs for more rationale. (Beman Dawes) 
+//  25 Sep 99  elapsed_max() and elapsed_min() added (John Maddock)
+//  16 Jul 99  Second beta
+//   6 Jul 99  Initial boost version
+
+#ifndef BOOST_TIMER_HPP
+#define BOOST_TIMER_HPP
+
+#include <boost/config.hpp>
+#include <ctime>
+#include <boost/limits.hpp>
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+    namespace std { using ::clock_t; using ::clock; }
+# endif
+
+
+namespace boost {
+
+//  timer  -------------------------------------------------------------------//
+
+//  A timer object measures elapsed time.
+
+//  It is recommended that implementations measure wall clock rather than CPU
+//  time since the intended use is performance measurement on systems where
+//  total elapsed time is more important than just process or CPU time.
+
+//  Warnings: The maximum measurable elapsed time may well be only 596.5+ hours
+//  due to implementation limitations.  The accuracy of timings depends on the
+//  accuracy of timing information provided by the underlying platform, and
+//  this varies a great deal from platform to platform.
+
+class timer
+{
+ public:
+         timer() { _start_time = std::clock(); } // postcondition: elapsed()==0
+//         timer( const timer& src );      // post: elapsed()==src.elapsed()
+//        ~timer(){}
+//  timer& operator=( const timer& src );  // post: elapsed()==src.elapsed()
+  void   restart() { _start_time = std::clock(); } // post: elapsed()==0
+  double elapsed() const                  // return elapsed time in seconds
+    { return  double(std::clock() - _start_time) / CLOCKS_PER_SEC; }
+
+  double elapsed_max() const   // return estimated maximum value for elapsed()
+  // Portability warning: elapsed_max() may return too high a value on systems
+  // where std::clock_t overflows or resets at surprising values.
+  {
+    return (double(std::numeric_limits<std::clock_t>::max())
+       - double(_start_time)) / double(CLOCKS_PER_SEC); 
+  }
+
+  double elapsed_min() const            // return minimum value for elapsed()
+   { return double(1)/double(CLOCKS_PER_SEC); }
+
+ private:
+  std::clock_t _start_time;
+}; // timer
+
+} // namespace boost
+
+#endif  // BOOST_TIMER_HPP
diff --git a/boost/boost/token_functions.hpp b/boost/boost/token_functions.hpp
new file mode 100644 (file)
index 0000000..938d88e
--- /dev/null
@@ -0,0 +1,486 @@
+// Boost token_functions.hpp  ------------------------------------------------//
+
+// Copyright John R. Bandela 2001. 
+
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all
+// copies. This software is provided "as is" without express or
+// implied warranty, and with no claim as to its suitability for any
+// purpose.
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// Revision History:
+
+// 20 Feb 2002   John Maddock
+//      Removed using namespace std declarations and added
+//      workaround for BOOST_NO_STDC_NAMESPACE (the library
+//      can be safely mixed with regex).
+// 06 Feb 2002   Jeremy Siek
+//      Added char_separator.
+// 02 Feb 2002   Jeremy Siek
+//      Removed tabs and a little cleanup.
+
+
+#ifndef BOOST_TOKEN_FUNCTIONS_JRB051801_HPP_
+#define BOOST_TOKEN_FUNCTIONS_JRB051801_HPP_
+
+#include <vector>
+#include <stdexcept>
+#include <cassert>
+#include <string>
+#include <cctype>
+
+//
+// the following must not be macros if we are to prefix them
+// with std:: (they shouldn't be macros anyway...)
+//
+#ifdef ispunct
+#  undef ispunct
+#endif
+#ifdef isspace
+#  undef isspace
+#endif
+//
+// fix namespace problems:
+//
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std{
+ using ::ispunct;
+ using ::isspace;
+}
+#endif
+
+namespace boost{
+
+  //===========================================================================
+  // The escaped_list_separator class. Which is a model of TokenizerFunction
+  // An escaped list is a super-set of what is commonly known as a comma 
+  // separated value (csv) list.It is separated into fields by a comma or 
+  // other character. If the delimiting character is inside quotes, then it is
+  // counted as a regular character.To allow for embedded quotes in a field,
+  // there can be escape sequences using the \ much like C. 
+  // The role of the comma, the quotation mark, and the escape 
+  // character (backslash \), can be assigned to other characters.
+
+  struct escaped_list_error : public std::runtime_error{
+    escaped_list_error(const std::string& what):std::runtime_error(what) { }
+  };
+  
+
+// The out of the box GCC 2.95 on cygwin does not have a char_traits class.
+// MSVC does not like the following typename
+#ifndef BOOST_MSVC
+  template <class Char, 
+    class Traits = typename std::basic_string<Char>::traits_type >
+#else
+  template <class Char, 
+    class Traits = std::basic_string<Char>::traits_type >
+#endif
+  class escaped_list_separator {
+
+  private:
+    typedef std::basic_string<Char,Traits> string_type;
+    struct char_eq {
+      Char e_;
+      char_eq(Char e):e_(e) { }
+      bool operator()(Char c) {
+        return Traits::eq(e_,c);
+      }
+    };
+    string_type  escape_;
+    string_type  c_;
+    string_type  quote_;      
+    bool last_;
+
+    bool is_escape(Char e) {
+      char_eq f(e);
+      return std::find_if(escape_.begin(),escape_.end(),f)!=escape_.end();
+    }
+    bool is_c(Char e) {
+      char_eq f(e);
+      return std::find_if(c_.begin(),c_.end(),f)!=c_.end();
+    }
+    bool is_quote(Char e) {
+      char_eq f(e);
+      return std::find_if(quote_.begin(),quote_.end(),f)!=quote_.end();
+    }
+    template <typename iterator, typename Token>
+    void do_escape(iterator& next,iterator end,Token& tok) {
+      if (++next == end)
+        throw escaped_list_error(std::string("cannot end with escape"));
+      if (Traits::eq(*next,'n')) {
+        tok+='\n';
+        return;
+      }
+      else if (is_quote(*next)) {
+        tok+=*next;
+        return;
+      }
+      else if (is_c(*next)) {
+        tok+=*next;
+        return;
+      }
+      else if (is_escape(*next)) {
+        tok+=*next;
+        return;
+      }
+      else
+        throw escaped_list_error(std::string("unknown escape sequence"));
+    }
+
+    public:
+    
+    explicit escaped_list_separator(Char  e = '\\',
+                                    Char c = ',',Char  q = '\"')
+      : escape_(1,e), c_(1,c), quote_(1,q), last_(false) { }
+    
+    escaped_list_separator(string_type e, string_type c, string_type q)
+      : escape_(e), c_(c), quote_(q), last_(false) { }
+    
+    void reset() {last_=false;}
+
+    template <typename InputIterator, typename Token>
+    bool operator()(InputIterator& next,InputIterator end,Token& tok) {
+      bool bInQuote = false;
+      tok = Token();
+      
+      if (next == end) {
+        if (last_) {
+          last_ = false;
+          return true;
+        }
+        else
+          return false;
+      }
+      last_ = false;
+      for (;next != end;++next) {
+        if (is_escape(*next)) {
+          do_escape(next,end,tok);
+        }
+        else if (is_c(*next)) {
+          if (!bInQuote) {
+            // If we are not in quote, then we are done
+            ++next;
+            // The last character was a c, that means there is
+            // 1 more blank field
+            last_ = true; 
+            return true;
+          }
+          else tok+=*next;
+        }
+        else if (is_quote(*next)) {
+          bInQuote=!bInQuote;
+        }
+        else {
+          tok += *next;
+        }
+      }
+      return true;
+    }
+  };
+
+   
+  //===========================================================================
+  // The offset_separator class, which is a model of TokenizerFunction.
+  // Offset breaks a string into tokens based on a range of offsets
+
+  class offset_separator {
+  private:
+
+    std::vector<int> offsets_;
+    unsigned int current_offset_;
+    bool wrap_offsets_;
+    bool return_partial_last_;
+    
+  public:
+    template <typename Iter>
+    offset_separator(Iter begin, Iter end, bool wrap_offsets = true,
+                     bool return_partial_last = true)
+      : offsets_(begin,end), current_offset_(0),
+        wrap_offsets_(wrap_offsets),
+        return_partial_last_(return_partial_last) { }
+   
+    offset_separator()
+      : offsets_(1,1), current_offset_(),
+        wrap_offsets_(true), return_partial_last_(true) { }
+
+    void reset() {
+      current_offset_ = 0;
+    }
+
+    template <typename InputIterator, typename Token>
+    bool operator()(InputIterator& next, InputIterator end, Token& tok)
+    {
+      assert(!offsets_.empty());
+    
+      tok = Token();
+      
+      if (next == end)
+        return false;
+
+      if (current_offset_ == offsets_.size())
+        if (wrap_offsets_)
+          current_offset_=0;
+        else
+          return false;
+      
+      int c = offsets_[current_offset_];
+      int i = 0;
+      for (; i < c; ++i) {
+        if (next == end)break;
+        tok+=*next++;
+      }
+    
+      if (!return_partial_last_)
+        if (i < (c-1) )
+          return false;
+      
+      ++current_offset_;
+      return true;
+    }
+  };
+
+
+  //===========================================================================
+  // The char_separator class breaks a sequence of characters into
+  // tokens based on the character delimiters (very much like bad old
+  // strtok). A delimiter character can either be kept or dropped. A
+  // kept delimiter shows up as an output token, whereas a dropped
+  // delimiter does not.
+
+  // This class replaces the char_delimiters_separator class. The
+  // constructor for the char_delimiters_separator class was too
+  // confusing and needed to be deprecated. However, because of the
+  // default arguments to the constructor, adding the new constructor
+  // would cause ambiguity, so instead I deprecated the whole class.
+  // The implementation of the class was also simplified considerably.
+
+  enum empty_token_policy { drop_empty_tokens, keep_empty_tokens };
+
+  // The out of the box GCC 2.95 on cygwin does not have a char_traits class.
+#ifndef BOOST_MSVC
+  template <typename Char, 
+    typename Traits = typename std::basic_string<Char>::traits_type >
+#else
+  template <typename Char, 
+    typename Traits = std::basic_string<Char>::traits_type >
+#endif
+  class char_separator
+  {
+    typedef std::basic_string<Char,Traits> string_type;
+  public:
+    explicit 
+    char_separator(const Char* dropped_delims,
+                   const Char* kept_delims = 0,
+                   empty_token_policy empty_tokens = drop_empty_tokens)
+      : m_dropped_delims(dropped_delims),
+        m_use_ispunct(false),
+        m_use_isspace(false),
+        m_empty_tokens(empty_tokens),
+        m_output_done(false)
+    {
+      // Borland workaround
+      if (kept_delims)
+       m_kept_delims = kept_delims;
+    }
+
+               // use ispunct() for kept delimiters and isspace for dropped.
+    explicit
+    char_separator()
+      : m_use_ispunct(true), 
+        m_use_isspace(true), 
+        m_empty_tokens(drop_empty_tokens) { }
+
+    void reset() { }
+
+    template <typename InputIterator, typename Token>
+    bool operator()(InputIterator& next, InputIterator end, Token& tok)
+    {
+      tok = Token();
+
+      // skip past all dropped_delims
+      if (m_empty_tokens == drop_empty_tokens)
+        for (; next != end  && is_dropped(*next); ++next)
+          { }
+      
+      if (m_empty_tokens == drop_empty_tokens) {
+
+        if (next == end)
+          return false;
+
+        // if we are on a kept_delims move past it and stop
+        if (is_kept(*next)) {
+          tok += *next;
+          ++next;
+        } else
+          // append all the non delim characters
+          for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next)
+            tok += *next;
+      } 
+      else { // m_empty_tokens == keep_empty_tokens
+        
+        // Handle empty token at the end
+        if (next == end)
+          if (m_output_done == false) {
+            m_output_done = true;
+            return true;
+          } else
+            return false;
+
+        if (is_kept(*next)) {
+          if (m_output_done == false)
+            m_output_done = true;
+          else {
+            tok += *next;
+            ++next;
+            m_output_done = false;
+          }
+        } 
+        else if (m_output_done == false && is_dropped(*next)) {
+          m_output_done = true;
+        } 
+        else {
+          if (is_dropped(*next))
+            ++next;
+          for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next)
+            tok += *next;
+          m_output_done = true;
+        }
+      }
+      return true;
+    }
+
+  private:
+    string_type m_kept_delims;
+    string_type m_dropped_delims;
+    bool m_use_ispunct;
+    bool m_use_isspace;
+    empty_token_policy m_empty_tokens;
+    bool m_output_done;
+    
+    bool is_kept(Char E) const
+    {  
+      if (m_kept_delims.length())
+        return m_kept_delims.find(E) != string_type::npos;
+      else if (m_use_ispunct) {
+        return std::ispunct(E) != 0;
+      } else
+        return false;
+    }
+    bool is_dropped(Char E) const
+    {
+      if (m_dropped_delims.length())
+        return m_dropped_delims.find(E) != string_type::npos;
+      else if (m_use_isspace) {
+        return std::isspace(E) != 0;
+      } else
+        return false;
+    }
+  };
+
+  //===========================================================================
+  // The following class is DEPRECATED, use class char_separators instead.
+  //
+  // The char_delimiters_separator class, which is a model of
+  // TokenizerFunction.  char_delimiters_separator breaks a string
+  // into tokens based on character delimiters. There are 2 types of
+  // delimiters. returnable delimiters can be returned as
+  // tokens. These are often punctuation. nonreturnable delimiters
+  // cannot be returned as tokens. These are often whitespace
+
+  // The out of the box GCC 2.95 on cygwin does not have a char_traits class.
+#ifndef BOOST_MSVC
+  template <class Char, 
+    class Traits = typename std::basic_string<Char>::traits_type >
+#else
+  template <class Char, 
+    class Traits = std::basic_string<Char>::traits_type >
+#endif
+  class char_delimiters_separator {
+  private:  
+
+    typedef std::basic_string<Char,Traits> string_type;
+    string_type returnable_;
+    string_type nonreturnable_;
+    bool return_delims_;
+    bool no_ispunct_;
+    bool no_isspace_;
+    
+    bool is_ret(Char E)const
+    {  
+      if (returnable_.length())
+        return  returnable_.find(E) != string_type::npos;
+      else{
+        if (no_ispunct_) {return false;}
+        else{
+          int r = std::ispunct(E);
+          return r != 0;
+        }
+      }
+    }
+    bool is_nonret(Char E)const
+    {
+      if (nonreturnable_.length())
+        return  nonreturnable_.find(E) != string_type::npos;
+      else{
+        if (no_isspace_) {return false;}
+        else{
+          int r = std::isspace(E);
+          return r != 0;
+        }
+      }
+    }
+    
+  public:
+    explicit char_delimiters_separator(bool return_delims = false, 
+                                       const Char* returnable = 0,
+                                       const Char* nonreturnable = 0)
+      : returnable_(returnable ? returnable : string_type().c_str()),
+        nonreturnable_(nonreturnable ? nonreturnable:string_type().c_str()),
+        return_delims_(return_delims), no_ispunct_(returnable!=0),
+        no_isspace_(nonreturnable!=0) { }
+    
+    void reset() { }
+
+  public:
+
+     template <typename InputIterator, typename Token>
+     bool operator()(InputIterator& next, InputIterator end,Token& tok) {
+     tok = Token();
+     
+     // skip past all nonreturnable delims
+     // skip past the returnable only if we are not returning delims
+     for (;next!=end && ( is_nonret(*next) || (is_ret(*next) 
+       && !return_delims_ ) );++next) { }
+     
+     if (next == end) {
+       return false;
+     }
+     
+     // if we are to return delims and we are one a returnable one
+     // move past it and stop
+     if (is_ret(*next) && return_delims_) {
+       tok+=*next;
+       ++next;
+     }
+     else
+       // append all the non delim characters
+       for (;next!=end && !is_nonret(*next) && !is_ret(*next);++next)
+         tok+=*next;
+       
+       
+     return true;
+   }
+  };
+
+
+} //namespace boost
+
+
+#endif 
+
+
+
+
+
diff --git a/boost/boost/token_iterator.hpp b/boost/boost/token_iterator.hpp
new file mode 100644 (file)
index 0000000..f0b46db
--- /dev/null
@@ -0,0 +1,116 @@
+// Boost token_iterator.hpp  -------------------------------------------------//
+
+// Copyright John R. Bandela 2001
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all
+// copies. This software is provided "as is" without express or
+// implied warranty, and with no claim as to its suitability for any
+// purpose.
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_TOKENIZER_POLICY_JRB051801_HPP_
+#define BOOST_TOKENIZER_POLICY_JRB051801_HPP_
+
+#include<boost/iterator_adaptors.hpp>
+#include<boost/token_functions.hpp>
+#include<utility>
+#include<cassert>
+
+namespace boost {
+    namespace detail{
+        // The base "iterator" for iterator adapter
+        template<class It>
+        class token_iterator_base
+        {
+        public:
+            std::pair<It,It> p_;
+            bool valid_;
+            token_iterator_base():p_(It(),It()),valid_(false){}
+            token_iterator_base(const It& b , const It& e )
+                :p_(b,e),valid_(false){}
+            operator It(){return p_.first;}
+            
+            template<class T>
+            token_iterator_base(const token_iterator_base<T>& other)
+                :p_(other.p_),valid_(other.valid_){}
+        };
+        
+        
+        template<class Type, class TokenizerFunc>
+        class tokenizer_policy{
+        private:
+            TokenizerFunc func_;
+            Type tok_;
+        public:
+            tokenizer_policy(){}
+            tokenizer_policy(const TokenizerFunc& f):func_(f){};
+            
+            template<class Base>
+            void initialize(Base& b){
+                if(b.valid_) return;
+                func_.reset();
+                b.valid_ = (b.p_.first != b.p_.second)?
+                    func_(b.p_.first,b.p_.second,tok_):false;
+            }
+            
+            template<class Iterator1, class Iterator2>
+                bool equal(const Iterator1& a, const Iterator2& b) const{
+                return (a.base().valid_ && b.base().valid_)
+                    ?(a.base().p_==b.base().p_)
+                    :(a.base().valid_==b.base().valid_);
+                
+            }
+            
+            template<class Iterator>
+                typename Iterator::reference
+                dereference(const Iterator& a) const{
+                using namespace std;
+                assert(a.base().valid_);
+                return tok_;
+            }   
+            template <class Iterator>
+                void increment(Iterator& b){
+                using namespace std;
+                assert(b.base().valid_);
+                b.base().valid_ = func_(b.base().p_.first,b.base().p_.second,tok_);
+            }
+            
+        };
+        
+    } // namespace detail
+
+    template <
+        class TokenizerFunc = char_delimiters_separator<char>, 
+        class Iterator = std::string::const_iterator,
+        class Type = std::string
+    >
+    class token_iterator_generator {
+
+    private: 
+        typedef Type value_type;
+        typedef detail::tokenizer_policy<Type, TokenizerFunc> policies;
+        typedef detail::token_iterator_base<Iterator> base;
+        typedef typename boost::detail::non_bidirectional_category<
+            Iterator>::type category;
+    public:
+        typedef boost::iterator_adaptor<base,policies,value_type, 
+            const value_type&,const value_type*,category,std::ptrdiff_t> type;
+    };
+    
+    
+    // Type has to be first because it needs to be explicitly specified
+    // because there is no way the function can deduce it.
+    template<class Type, class Iterator, class TokenizerFunc>
+        typename token_iterator_generator<TokenizerFunc,Iterator,Type>::type 
+    make_token_iterator(Iterator begin, Iterator end,const TokenizerFunc& fun){
+        typedef typename 
+            token_iterator_generator<TokenizerFunc,Iterator,Type>::type ret_type;
+        detail::token_iterator_base<Iterator> b(begin,end);
+        detail::tokenizer_policy<Type,TokenizerFunc> f(fun);
+        return ret_type(b,f);
+    }
+
+} // namespace boost
+
+#endif
diff --git a/boost/boost/tokenizer.hpp b/boost/boost/tokenizer.hpp
new file mode 100644 (file)
index 0000000..336c717
--- /dev/null
@@ -0,0 +1,101 @@
+// Boost tokenizer.hpp  -----------------------------------------------------//
+
+// © Copyright Jeremy Siek and John R. Bandela 2001. 
+
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all
+// copies. This software is provided "as is" without express or
+// implied warranty, and with no claim as to its suitability for any
+// purpose.
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+// Revision History:
+
+// 02 Feb 2002   Jeremy Siek
+//      Removed tabs and a little cleanup.
+
+#ifndef BOOST_TOKENIZER_JRB051801_HPP_
+#define BOOST_TOKENIZER_JRB051801_HPP_
+
+#include <boost/token_iterator.hpp>
+#include <cassert>
+namespace boost {
+
+  
+  //===========================================================================
+  // A container-view of a tokenized "sequence"
+  template <
+    typename TokenizerFunc = char_delimiters_separator<char>, 
+    typename Iterator = std::string::const_iterator,
+    typename Type = std::string
+  >
+  class tokenizer {
+  private:
+    typedef detail::tokenizer_policy<Type, TokenizerFunc> Pol;
+    typedef detail::token_iterator_base<Iterator> TBase;
+    typedef token_iterator_generator<TokenizerFunc,Iterator,Type> TGen;
+        
+    // It seems that MSVC does not like the unqualified use of iterator,
+    // Thus we use iter internally when it is used unqualified and
+    // the users of this class will always qualify iterator.     
+    typedef typename TGen::type iter;
+    
+  public:
+    
+    typedef iter iterator;
+    typedef iter const_iterator;
+    typedef Type value_type;
+    typedef value_type& reference;
+    typedef const value_type& const_reference;
+    typedef value_type* pointer;
+    typedef const pointer const_pointer;
+    typedef void size_type;
+    typedef void difference_type;
+
+    tokenizer(Iterator first, Iterator last,
+              const TokenizerFunc& f = TokenizerFunc()) 
+      : first_(first), last_(last), f_(f) { }
+        
+    template <typename Container>
+    tokenizer(const Container& c)
+      : first_(c.begin()), last_(c.end()), f_() { }
+    
+    template <typename Container>
+    tokenizer(const Container& c,const TokenizerFunc& f)
+      : first_(c.begin()), last_(c.end()), f_(f) { }
+    
+    void assign(Iterator first, Iterator last){
+      first_ = first;
+      last_ = last;
+    }
+    
+    void assign(Iterator first, Iterator last, const TokenizerFunc& f){
+      assign(first,last);
+      f_ = f;
+    }
+    
+    template <typename Container>
+    void assign(const Container& c){
+      assign(c.begin(),c.end());
+    }
+    
+    
+    template <typename Container>
+    void assign(const Container& c, const TokenizerFunc& f){
+      assign(c.begin(),c.end(),f);
+    }
+    
+    iter begin() const { return iter(TBase(first_,last_),Pol(f_)); }
+    iter end() const { return iter(TBase(last_,last_),Pol(f_)); }
+        
+  private:
+    Iterator first_;
+    Iterator last_;
+    TokenizerFunc f_;
+  };
+
+
+} // namespace boost
+
+#endif
index 779e4dd405118c384513c7ca00bebd0675bd4ca0..0263f969259280827da2b4ef533dd1f70059a49e 100644 (file)
 // William Kempf, Vesa Karvonen, John Max Skaller, Ed Brey, Beman Davis,
 // David Abrahams.
 
+// Revision history:
+// 2002 05 01 Hugo Duncan: Fix for Borland after Jaakko's previous changes
+// 2002 04 18 Jaakko: tuple element types can be void or plain function 
+//                    types, as long as no object is created.
+//                    Tuple objects can no hold even noncopyable types
+//                    such as arrays.             
+// 2001 10 22 John Maddock
+//      Fixes for Borland C++
+// 2001 08 30 David Abrahams
+//      Added default constructor for cons<>.
 // ----------------------------------------------------------------- 
 
 #ifndef BOOST_TUPLE_BASIC_HPP
 #include <utility> // needed for the assignment from pair to tuple
 
 #include "boost/type_traits/cv_traits.hpp"
-                                                           
+#include "boost/type_traits/function_traits.hpp"
+    
 namespace boost {
+namespace tuples {
 
 // -- null_type --------------------------------------------------------
 struct null_type {};
 
 // a helper function to provide a const null_type type temporary
 namespace detail {
-namespace tuples {
-  inline const null_type cnull_type() { return null_type(); }
-} // end tuples
+  inline const null_type cnull() { return null_type(); }
+
+
+// -- if construct ------------------------------------------------
+// Proposed by Krzysztof Czarnecki and Ulrich Eisenecker
+
+template <bool If, class Then, class Else> struct IF { typedef Then RET; };
+
+template <class Then, class Else> struct IF<false, Then, Else> {
+  typedef Else RET;
+};
+
 } // end detail
 
 // - cons forward declaration -----------------------------------------------
@@ -57,55 +78,47 @@ template <
 class tuple; 
 
 // tuple_length forward declaration
-template<class T> struct tuple_length;
+template<class T> struct length;
 
 
 
 namespace detail {
-namespace tuples {
+
+#ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+
+  template<int N> struct workaround_holder {};
+
+#  define BOOST_TUPLE_DUMMY_PARM        , detail::workaround_holder<N>* = 0
+#  define BOOST_TUPLE_SINGLE_DUMMY_PARM detail::workaround_holder<N>* = 0
+#else
+#  define BOOST_TUPLE_DUMMY_PARM
+#  define BOOST_TUPLE_SINGLE_DUMMY_PARM
+#endif
 
 // -- generate error template, referencing to non-existing members of this 
 // template is used to produce compilation errors intentionally
 template<class T>
 class generate_error;
 
-// tuple default argument wrappers ---------------------------------------
-// Work for non-reference types, intentionally not for references
-template <class T>
-struct default_arg {
-
-// Non-class temporaries cannot have qualifiers.
-// To prevent f to return for example const int, we remove cv-qualifiers
-// from all temporaries. 
-     static typename boost::remove_cv<T>::type f() { return T(); }
-};
-   
-template <class T>
-struct default_arg<T&> {
-  static T& f() { 
-    return generate_error<T>::no_default_values_for_reference_types;
-  }
-};
-
 // - cons getters --------------------------------------------------------
-// called: element<N>::get<RETURN_TYPE>(aTuple)
+// called: get_class<N>::get<RETURN_TYPE>(aTuple)
 
 template< int N >
-struct element {
+struct get_class {
   template<class RET, class HT, class TT >
   inline static RET get(const cons<HT, TT>& t)
   {
-    return element<N-1>::template get<RET>(t.tail);
+    return get_class<N-1>::template get<RET>(t.tail);
   }
   template<class RET, class HT, class TT >
   inline static RET get(cons<HT, TT>& t)
   {
-    return element<N-1>::template get<RET>(t.tail);
+    return get_class<N-1>::template get<RET>(t.tail);
   }
 };
 
 template<>
-struct element<0> {
+struct get_class<0> {
   template<class RET, class HT, class TT> 
   inline static RET get(const cons<HT, TT>& t)
   {
@@ -118,25 +131,24 @@ struct element<0> {
   }
 };
 
-} // end of namespace tuples
 } // end of namespace detail
 
 
 // -cons type accessors ----------------------------------------
-// typename tuple_element<N,T>::type gets the type of the 
+// typename tuples::element<N,T>::type gets the type of the 
 // Nth element ot T, first element is at index 0
 // -------------------------------------------------------
 
 template<int N, class T>
-struct tuple_element
+struct element
 {
 private:
   typedef typename T::tail_type Next;
 public:
-  typedef typename tuple_element<N-1, Next>::type type;
+  typedef typename element<N-1, Next>::type type;
 };
 template<class T>
-struct tuple_element<0,T>
+struct element<0,T>
 {
   typedef typename T::head_type type;
 };
@@ -150,11 +162,12 @@ struct tuple_element<0,T>
 // (Joel de Guzman's suggestion). Rationale: get functions are part of the
 // interface, so should the way to express their return types be.
 
-template <class T> struct tuple_access_traits {
+template <class T> struct access_traits {
   typedef const T& const_type;
   typedef T& non_const_type;
 
   typedef const typename boost::remove_cv<T>::type& parameter_type;
+
 // used as the tuple constructors parameter types
 // Rationale: non-reference tuple element types can be cv-qualified.
 // It should be possible to initialize such types with temporaries,
@@ -162,7 +175,7 @@ template <class T> struct tuple_access_traits {
 // be non-volatile and const. 8.5.3. (5)
 };
 
-template <class T> struct tuple_access_traits<T&> {
+template <class T> struct access_traits<T&> {
 
   typedef T& const_type;
   typedef T& non_const_type;
@@ -170,18 +183,17 @@ template <class T> struct tuple_access_traits<T&> {
   typedef T& parameter_type;   
 };
 
-
 // get function for non-const cons-lists, returns a reference to the element
 
 template<int N, class HT, class TT>
-inline typename tuple_access_traits<
-                  typename tuple_element<N, cons<HT, TT> >::type
+inline typename access_traits<
+                  typename element<N, cons<HT, TT> >::type
                 >::non_const_type
-get(cons<HT, TT>& c) { 
-  return detail::tuples::element<N>::template 
+get(cons<HT, TT>& c BOOST_TUPLE_DUMMY_PARM) { 
+  return detail::get_class<N>::template 
          get<
-           typename tuple_access_traits<
-             typename tuple_element<N, cons<HT, TT> >::type
+           typename access_traits<
+             typename element<N, cons<HT, TT> >::type
            >::non_const_type>(c); 
 } 
 
@@ -189,21 +201,40 @@ get(cons<HT, TT>& c) {
 // the element. If the element is a reference, returns the reference
 // as such (that is, can return a non-const reference)
 template<int N, class HT, class TT>
-inline typename tuple_access_traits<
-                  typename tuple_element<N, cons<HT, TT> >::type
+inline typename access_traits<
+                  typename element<N, cons<HT, TT> >::type
                 >::const_type
-get(const cons<HT, TT>& c) { 
-  return detail::tuples::element<N>::template 
+get(const cons<HT, TT>& c BOOST_TUPLE_DUMMY_PARM) { 
+  return detail::get_class<N>::template 
          get<
-           typename tuple_access_traits<
-             typename tuple_element<N, cons<HT, TT> >::type
+           typename access_traits<
+             typename element<N, cons<HT, TT> >::type
          >::const_type>(c);
 } 
 
+// -- the cons template  --------------------------------------------------
+namespace detail {
+
+//  These helper templates wrap void types and plain function types.
+//  The reationale is to allow one to write tuple types with those types
+//  as elements, even though it is not possible to instantiate such object.
+//  E.g: typedef tuple<void> some_type; // ok
+//  but: some_type x; // fails
 
+template <class T> class non_storeable_type {
+  non_storeable_type();
+};
 
+template <class T> struct wrap_non_storeable_type {
+  typedef typename IF<
+    ::boost::is_function<T>::value, non_storeable_type<T>, T
+  >::RET type;
+};
+template <> struct wrap_non_storeable_type<void> {
+  typedef non_storeable_type<void> type; 
+};
 
-// -- the cons template  --------------------------------------------------
+} // detail
 
 template <class HT, class TT>
 struct cons {
@@ -211,22 +242,33 @@ struct cons {
   typedef HT head_type;
   typedef TT tail_type;
 
-  head_type head;
+  typedef typename 
+    detail::wrap_non_storeable_type<head_type>::type stored_head_type;
+
+  stored_head_type head;
   tail_type tail;
 
-  typename tuple_access_traits<head_type>::non_const_type 
+  typename access_traits<stored_head_type>::non_const_type 
   get_head() { return head; }
 
-  typename tuple_access_traits<tail_type>::non_const_type 
+  typename access_traits<tail_type>::non_const_type 
   get_tail() { return tail; }  
 
-  typename tuple_access_traits<head_type>::const_type 
+  typename access_traits<stored_head_type>::const_type 
   get_head() const { return head; }
   
-  typename tuple_access_traits<tail_type>::const_type 
+  typename access_traits<tail_type>::const_type 
   get_tail() const { return tail; }  
 
-  cons(typename tuple_access_traits<head_type>::parameter_type h,
+  cons() : head(), tail() {}
+  //  cons() : head(detail::default_arg<HT>::f()), tail() {}
+
+  // the argument for head is not strictly needed, but it prevents 
+  // array type elements. This is good, since array type elements 
+  // cannot be supported properly in any case (no assignment, 
+  // copy works only if the tails are exactly the same type, ...)
+  
+  cons(typename access_traits<stored_head_type>::parameter_type h,
        const tail_type& t)
     : head (h), tail(t) {}  
 
@@ -235,9 +277,18 @@ struct cons {
   cons( T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, 
         T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) 
     : head (t1), 
-      tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::tuples::cnull_type())
+      tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull())
+      {}
+
+  template <class T2, class T3, class T4, class T5, 
+            class T6, class T7, class T8, class T9, class T10>
+  cons( const null_type& t1, T2& t2, T3& t3, T4& t4, T5& t5, 
+        T6& t6, T7& t7, T8& t8, T9& t9, T10& t10 ) 
+    : head (), 
+      tail (t2, t3, t4, t5, t6, t7, t8, t9, t10, detail::cnull())
       {}
 
+
   template <class HT2, class TT2>
   cons( const cons<HT2, TT2>& u ) : head(u.head), tail(u.tail) {}
 
@@ -254,25 +305,25 @@ struct cons {
 
   template <class T1, class T2>
   cons& operator=( const std::pair<T1, T2>& u ) { 
-    BOOST_STATIC_ASSERT(tuple_length<cons>::value == 2); // check length = 2
+    BOOST_STATIC_ASSERT(length<cons>::value == 2); // check length = 2
     head = u.first; tail.head = u.second; return *this;
   }
 
   // get member functions (non-const and const)
   template <int N>
-  typename tuple_access_traits<
-             typename tuple_element<N, cons<HT, TT> >::type
+  typename access_traits<
+             typename element<N, cons<HT, TT> >::type
            >::non_const_type
   get() {
-    return boost::get<N>(*this); // delegate to non-member get
+    return boost::tuples::get<N>(*this); // delegate to non-member get
   }
 
   template <int N>
-  typename tuple_access_traits<
-             typename tuple_element<N, cons<HT, TT> >::type
+  typename access_traits<
+             typename element<N, cons<HT, TT> >::type
            >::const_type
   get() const {
-    return boost::get<N>(*this); // delegate to non-member get
+    return boost::tuples::get<N>(*this); // delegate to non-member get
   }
 };
 
@@ -282,19 +333,24 @@ struct cons<HT, null_type> {
   typedef HT head_type;
   typedef null_type tail_type;
 
-  head_type head;
+  typedef typename 
+    detail::wrap_non_storeable_type<head_type>::type stored_head_type;
+  stored_head_type head;
  
-  typename tuple_access_traits<head_type>::non_const_type 
+  typename access_traits<stored_head_type>::non_const_type 
   get_head() { return head; }
   
   null_type get_tail() { return null_type(); }  
 
-  typename tuple_access_traits<head_type>::const_type 
+  typename access_traits<stored_head_type>::const_type 
   get_head() const { return head; }
   
   const null_type get_tail() const { return null_type(); }  
-  
-  cons(typename tuple_access_traits<head_type>::parameter_type h,
+
+  //  cons() : head(detail::default_arg<HT>::f()) {}
+  cons() : head() {}
+
+  cons(typename access_traits<stored_head_type>::parameter_type h,
        const null_type& = null_type())
     : head (h) {}  
 
@@ -304,6 +360,12 @@ struct cons<HT, null_type> {
        const null_type&, const null_type&, const null_type&)
   : head (t1) {}
 
+  cons(const null_type& t1, 
+       const null_type&, const null_type&, const null_type&, 
+       const null_type&, const null_type&, const null_type&, 
+       const null_type&, const null_type&, const null_type&)
+  : head () {}
+
   template <class HT2>
   cons( const cons<HT2, null_type>& u ) : head(u.head) {}
   
@@ -316,19 +378,19 @@ struct cons<HT, null_type> {
   cons& operator=(const cons& u) { head = u.head; return *this; }
 
   template <int N>
-  typename tuple_access_traits<
-             typename tuple_element<N, cons>::type
+  typename access_traits<
+             typename element<N, cons>::type
             >::non_const_type
-  get() {
-    return boost::get<N>(*this);
+  get(BOOST_TUPLE_SINGLE_DUMMY_PARM) {
+    return boost::tuples::get<N>(*this);
   }
 
   template <int N>
-  typename tuple_access_traits<
-             typename tuple_element<N, cons>::type
+  typename access_traits<
+             typename element<N, cons>::type
            >::const_type
-  get() const {
-    return boost::get<N>(*this);
+  get(BOOST_TUPLE_SINGLE_DUMMY_PARM) const {
+    return boost::tuples::get<N>(*this);
   }
 
 };
@@ -336,18 +398,22 @@ struct cons<HT, null_type> {
 // templates for finding out the length of the tuple -------------------
 
 template<class T>
-struct tuple_length  {
-  BOOST_STATIC_CONSTANT(int, value = 1 + tuple_length<typename T::tail_type>::value);
+struct length  {
+  BOOST_STATIC_CONSTANT(int, value = 1 + length<typename T::tail_type>::value);
+};
+
+template<>
+struct length<tuple<> > {
+  BOOST_STATIC_CONSTANT(int, value = 0);
 };
 
 template<>
-struct tuple_length<null_type> {
+struct length<null_type> {
   BOOST_STATIC_CONSTANT(int, value = 0);
 };
 
 
 namespace detail {
-namespace tuples {
 
 // Tuple to cons mapper --------------------------------------------------
 template <class T0, class T1, class T2, class T3, class T4, 
@@ -367,7 +433,6 @@ struct map_tuple_to_cons<null_type, null_type, null_type, null_type, null_type,
   typedef null_type type;
 };
 
-} // end tuples
 } // end detail
 
 // -------------------------------------------------------------------
@@ -376,39 +441,105 @@ template <class T0, class T1, class T2, class T3, class T4,
           class T5, class T6, class T7, class T8, class T9>
 
 class tuple : 
-  public detail::tuples::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type   
+  public detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type   
 {
 public:
   typedef typename 
-    detail::tuples::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type inherited;
+    detail::map_tuple_to_cons<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type inherited;
   typedef typename inherited::head_type head_type;
   typedef typename inherited::tail_type tail_type;  
 
 
-// tuple_access_traits<T>::parameter_type takes non-reference types as const T& 
-  explicit tuple(
-    typename tuple_access_traits<T0>::parameter_type t0 
-      = detail::tuples::default_arg<T0>::f(),
-    typename tuple_access_traits<T1>::parameter_type t1 
-      = detail::tuples::default_arg<T1>::f(),
-    typename tuple_access_traits<T2>::parameter_type t2 
-      = detail::tuples::default_arg<T2>::f(),
-    typename tuple_access_traits<T3>::parameter_type t3 
-      = detail::tuples::default_arg<T3>::f(),
-    typename tuple_access_traits<T4>::parameter_type t4 
-      = detail::tuples::default_arg<T4>::f(),
-    typename tuple_access_traits<T5>::parameter_type t5 
-      = detail::tuples::default_arg<T5>::f(),
-    typename tuple_access_traits<T6>::parameter_type t6 
-      = detail::tuples::default_arg<T6>::f(),
-    typename tuple_access_traits<T7>::parameter_type t7 
-      = detail::tuples::default_arg<T7>::f(),
-    typename tuple_access_traits<T8>::parameter_type t8 
-      = detail::tuples::default_arg<T8>::f(),
-    typename tuple_access_traits<T9>::parameter_type t9 
-      = detail::tuples::default_arg<T9>::f())
-
-        : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {}
+// access_traits<T>::parameter_type takes non-reference types as const T& 
+  tuple() {}
+  
+  tuple(typename access_traits<T0>::parameter_type t0)
+    : inherited(t0, detail::cnull(), detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1)
+    : inherited(t0, t1, detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2)
+    : inherited(t0, t1, t2, detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3)
+    : inherited(t0, t1, t2, t3, detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull(), 
+                detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3,
+        typename access_traits<T4>::parameter_type t4)
+    : inherited(t0, t1, t2, t3, t4, detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull(), detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3,
+        typename access_traits<T4>::parameter_type t4,
+        typename access_traits<T5>::parameter_type t5)
+    : inherited(t0, t1, t2, t3, t4, t5, detail::cnull(), detail::cnull(), 
+                detail::cnull(), detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3,
+        typename access_traits<T4>::parameter_type t4,
+        typename access_traits<T5>::parameter_type t5,
+        typename access_traits<T6>::parameter_type t6)
+    : inherited(t0, t1, t2, t3, t4, t5, t6, detail::cnull(), 
+                detail::cnull(), detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3,
+        typename access_traits<T4>::parameter_type t4,
+        typename access_traits<T5>::parameter_type t5,
+        typename access_traits<T6>::parameter_type t6,
+        typename access_traits<T7>::parameter_type t7)
+    : inherited(t0, t1, t2, t3, t4, t5, t6, t7, detail::cnull(), 
+                detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3,
+        typename access_traits<T4>::parameter_type t4,
+        typename access_traits<T5>::parameter_type t5,
+        typename access_traits<T6>::parameter_type t6,
+        typename access_traits<T7>::parameter_type t7,
+        typename access_traits<T8>::parameter_type t8)
+    : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, detail::cnull()) {}
+
+  tuple(typename access_traits<T0>::parameter_type t0,
+        typename access_traits<T1>::parameter_type t1,
+        typename access_traits<T2>::parameter_type t2,
+        typename access_traits<T3>::parameter_type t3,
+        typename access_traits<T4>::parameter_type t4,
+        typename access_traits<T5>::parameter_type t5,
+        typename access_traits<T6>::parameter_type t6,
+        typename access_traits<T7>::parameter_type t7,
+        typename access_traits<T8>::parameter_type t8,
+        typename access_traits<T9>::parameter_type t9)
+    : inherited(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) {}
+
 
   template<class U1, class U2>
   tuple(const cons<U1, U2>& p) : inherited(p) {}
@@ -421,7 +552,7 @@ public:
 
   template <class U1, class U2>
   tuple& operator=(const std::pair<U1, U2>& k) { 
-    BOOST_STATIC_ASSERT(tuple_length<tuple>::value == 2);// check_length = 2
+    BOOST_STATIC_ASSERT(length<tuple>::value == 2);// check_length = 2
     this->head = k.first;
     this->tail.head = k.second; 
     return *this;
@@ -441,7 +572,6 @@ public:
 
 // Swallows any assignment   (by Doug Gregor)
 namespace detail {
-namespace tuples {
 
 struct swallow_assign {
       
@@ -450,12 +580,12 @@ struct swallow_assign {
     return *this;
   }
 };
-} // namespace tuples
+
 } // namespace detail
 
 // "ignore" allows tuple positions to be ignored when using "tie". 
 namespace {
- detail::tuples::swallow_assign ignore;
+ detail::swallow_assign ignore;
 }
 
 // ---------------------------------------------------------------------------
@@ -502,7 +632,7 @@ struct make_tuple_traits {
 template<class T>
 struct make_tuple_traits<T&> {
   typedef typename
-     detail::tuples::generate_error<T&>::
+     detail::generate_error<T&>::
        do_not_use_with_reference_type error;
 }; 
 
@@ -542,7 +672,6 @@ struct make_tuple_traits<const reference_wrapper<T> >{
 
 
 namespace detail {
-namespace tuples {
 
 // a helper traits to make the make_tuple functions shorter (Vesa Karvonen's
 // suggestion)
@@ -566,7 +695,6 @@ struct make_tuple_mapper {
           typename make_tuple_traits<T9>::type> type;
 };
 
-} // end tuples
 } // end detail
 
 // -make_tuple function templates -----------------------------------
@@ -575,87 +703,90 @@ inline tuple<> make_tuple() {
 }
 
 template<class T0>
-inline typename boost::detail::tuples::make_tuple_mapper<T0>::type
+inline typename detail::make_tuple_mapper<T0>::type
 make_tuple(const T0& t0) {
-  return typename boost::detail::tuples::make_tuple_mapper<T0>::type(t0); 
+  typedef typename detail::make_tuple_mapper<T0>::type t;
+  return t(t0);
 }
 
 template<class T0, class T1>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1>::type
+inline typename detail::make_tuple_mapper<T0, T1>::type
 make_tuple(const T0& t0, const T1& t1) {
-  return typename boost::detail::tuples::make_tuple_mapper<T0, T1>::type(t0, t1); 
+  typedef typename detail::make_tuple_mapper<T0, T1>::type t;
+  return t(t0, t1);
 }
 
 template<class T0, class T1, class T2>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2>::type
+inline typename detail::make_tuple_mapper<T0, T1, T2>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2) {
-  return typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2>::type(t0, t1, t2); 
+  typedef typename detail::make_tuple_mapper<T0, T1, T2>::type t;
+  return t(t0, t1, t2);
 }
 
 template<class T0, class T1, class T2, class T3>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3>::type
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3) {
-  return typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3>::type
-           (t0, t1, t2, t3); 
+  typedef typename detail::make_tuple_mapper<T0, T1, T2, T3>::type t;
+  return t(t0, t1, t2, t3);
 }
 
 template<class T0, class T1, class T2, class T3, class T4>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3, T4>::type
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
                   const T4& t4) {
-  return typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3, T4>::type
-           (t0, t1, t2, t3, t4); 
+  typedef typename detail::make_tuple_mapper<T0, T1, T2, T3, T4>::type t;
+  return t(t0, t1, t2, t3, t4); 
 }
 
 template<class T0, class T1, class T2, class T3, class T4, class T5>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
                   const T4& t4, const T5& t5) {
-  return typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type
-           (t0, t1, t2, t3, t4, t5); 
+  typedef typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5>::type t;
+  return t(t0, t1, t2, t3, t4, t5); 
 }
 
 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6>::type
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
                   const T4& t4, const T5& t5, const T6& t6) {
-  return typename boost::detail::tuples::make_tuple_mapper
-           <T0, T1, T2, T3, T4, T5, T6>::type
-           (t0, t1, t2, t3, t4, t5, t6); 
+  typedef typename detail::make_tuple_mapper
+           <T0, T1, T2, T3, T4, T5, T6>::type t;
+  return t(t0, t1, t2, t3, t4, t5, t6);
 }
 
 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
          class T7>
-inline typename boost::detail::tuples::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
+inline typename detail::make_tuple_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
                   const T4& t4, const T5& t5, const T6& t6, const T7& t7) {
-  return typename boost::detail::tuples::make_tuple_mapper
-           <T0, T1, T2, T3, T4, T5, T6, T7>::type
-           (t0, t1, t2, t3, t4, t5, t6, t7); 
+  typedef typename detail::make_tuple_mapper
+           <T0, T1, T2, T3, T4, T5, T6, T7>::type t;
+  return t(t0, t1, t2, t3, t4, t5, t6, t7); 
 }
 
 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
          class T7, class T8>
-inline typename boost::detail::tuples::make_tuple_mapper
+inline typename detail::make_tuple_mapper
   <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
                   const T4& t4, const T5& t5, const T6& t6, const T7& t7,
                   const T8& t8) {
-  return typename boost::detail::tuples::make_tuple_mapper
-           <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
-           (t0, t1, t2, t3, t4, t5, t6, t7, t8); 
+  typedef typename detail::make_tuple_mapper
+           <T0, T1, T2, T3, T4, T5, T6, T7, T8>::type t;
+  return t(t0, t1, t2, t3, t4, t5, t6, t7, t8); 
 }
 
 template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
          class T7, class T8, class T9>
-inline typename boost::detail::tuples::make_tuple_mapper
+inline typename detail::make_tuple_mapper
   <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
 make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
                   const T4& t4, const T5& t5, const T6& t6, const T7& t7,
                   const T8& t8, const T9& t9) {
-  return typename boost::detail::tuples::make_tuple_mapper
-           <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
-           (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); 
+  typedef typename detail::make_tuple_mapper
+           <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type t;
+  return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); 
 }
 
 
@@ -725,9 +856,12 @@ tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
            (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
 }
 
+} // end of namespace tuples
 } // end of namespace boost
 
+#undef BOOST_TUPLE_DUMMY_PARM
+#undef BOOST_TUPLE_SINGLE_DUMMY_PARM
 
-#endif // BOOST_TUPLE_BASIC_HPP
+#endif // BOOST_TUPLE_BASIC_HPP
 
 
index fa197b1968312a2ab53efa746ef916adcaeb51f1..ec45df1481795fb8bc50a4270464d84e0379b0d3 100644 (file)
@@ -32,6 +32,7 @@
 #define BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP
 
 #include "boost/type_traits.hpp"
+#include <utility>
 
 #if defined BOOST_MSVC
 #pragma warning(disable:4518) // storage-class or type specifier(s) unexpected here; ignored
@@ -40,6 +41,7 @@
 #endif
 
 namespace boost {
+namespace tuples {
 
     // null_type denotes the end of a list built with "cons"
     struct null_type 
@@ -51,8 +53,23 @@ namespace boost {
     // a helper function to provide a const null_type type temporary
     inline const null_type cnull_type() { return null_type(); }
 
+// forward declaration of tuple
+    template<
+      typename T1 = null_type, 
+      typename T2 = null_type, 
+      typename T3 = null_type, 
+      typename T4 = null_type,
+      typename T5 = null_type,
+      typename T6 = null_type,
+      typename T7 = null_type,
+      typename T8 = null_type,
+      typename T9 = null_type,
+      typename T10 = null_type
+    >
+    class tuple;
+
     namespace detail {
-    namespace tuples {
+
       // Takes a pointer and routes all assignments to whatever it points to
       template<typename T>
       struct assign_to_pointee
@@ -81,38 +98,44 @@ namespace boost {
         }
       };
 
-  } // end of namespace tuples
   } // end of namespace detail
 
     // cons builds a heterogenous list of types
    template<typename Head, typename Tail = null_type>
-    struct cons
-    {
-      typedef cons self_type;
-      typedef Head head_type;
-      typedef Tail tail_type;
+   struct cons
+   {
+     typedef cons self_type;
+     typedef Head head_type;
+     typedef Tail tail_type;
 
-      head_type head;
-      tail_type tail;
+     head_type head;
+     tail_type tail;
 
-      typename boost::add_reference<head_type>::type get_head() { return head; }
-      typename boost::add_reference<tail_type>::type get_tail() { return tail; }  
+     typename boost::add_reference<head_type>::type get_head() { return head; }
+     typename boost::add_reference<tail_type>::type get_tail() { return tail; }  
 
-      typename boost::add_reference<const head_type>::type get_head() const { return head; }
-      typename boost::add_reference<const tail_type>::type get_tail() const { return tail; }
+     typename boost::add_reference<const head_type>::type get_head() const { return head; }
+     typename boost::add_reference<const tail_type>::type get_tail() const { return tail; }
   
-      template<typename Other>
-      explicit cons(const Other& other) : head(other.head), tail(other.tail)
+#if defined BOOST_MSVC
+      template<typename Tail>
+      explicit cons(const head_type& h /* = head_type() */, // causes MSVC 6.5 to barf.
+                    const Tail& t) : head(h), tail(t.head, t.tail)
       {
       }
 
-#if defined BOOST_MSVC
       explicit cons(const head_type& h /* = head_type() */, // causes MSVC 6.5 to barf.
-        const tail_type& t = tail_type()) :
-          head(h), tail(t)
+                    const null_type& t) : head(h), tail(t)
       {
       }
+
 #else
+      template<typename T>
+      explicit cons(const head_type& h, const T& t) : 
+        head(h), tail(t.head, t.tail)
+      {
+      }
+
       explicit cons(const head_type& h = head_type(),
                     const tail_type& t = tail_type()) :
         head(h), tail(t)
@@ -131,7 +154,7 @@ namespace boost {
     };
   
     namespace detail {
-    namespace tuples {
+
       // Determines if the parameter is null_type
       template<typename T> struct is_null_type { enum { RET = 0 }; };
       template<> struct is_null_type<null_type> { enum { RET = 1 }; };
@@ -168,16 +191,16 @@ namespace boost {
       >
       struct map_tuple_to_cons
       {
-        typedef typename detail::tuples::build_cons<T10, null_type  >::RET cons10;
-        typedef typename detail::tuples::build_cons<T9, cons10>::RET cons9;
-        typedef typename detail::tuples::build_cons<T8, cons9>::RET cons8;
-        typedef typename detail::tuples::build_cons<T7, cons8>::RET cons7;
-        typedef typename detail::tuples::build_cons<T6, cons7>::RET cons6;
-        typedef typename detail::tuples::build_cons<T5, cons6>::RET cons5;
-        typedef typename detail::tuples::build_cons<T4, cons5>::RET cons4;
-        typedef typename detail::tuples::build_cons<T3, cons4>::RET cons3;
-        typedef typename detail::tuples::build_cons<T2, cons3>::RET cons2;
-        typedef typename detail::tuples::build_cons<T1, cons2>::RET cons1;
+        typedef typename detail::build_cons<T10, null_type  >::RET cons10;
+        typedef typename detail::build_cons<T9, cons10>::RET cons9;
+        typedef typename detail::build_cons<T8, cons9>::RET cons8;
+        typedef typename detail::build_cons<T7, cons8>::RET cons7;
+        typedef typename detail::build_cons<T6, cons7>::RET cons6;
+        typedef typename detail::build_cons<T5, cons6>::RET cons5;
+        typedef typename detail::build_cons<T4, cons5>::RET cons4;
+        typedef typename detail::build_cons<T3, cons4>::RET cons3;
+        typedef typename detail::build_cons<T2, cons3>::RET cons2;
+        typedef typename detail::build_cons<T1, cons2>::RET cons1;
       };
 
       // Workaround the lack of partial specialization in some compilers
@@ -205,15 +228,16 @@ namespace boost {
           typedef typename Tuple::head_type RET;
         };
       };
-    } // detail
-    } // tuples
+
+    } // namespace detail
+
 
     // Return the Nth type of the given Tuple
     template<int N, typename Tuple>
-    struct tuple_element
+    struct element
     {
     private:
-      typedef detail::tuples::_element_type<N> nth_type;
+      typedef detail::_element_type<N> nth_type;
 
     public:
       typedef typename nth_type::template inner<Tuple>::RET RET;
@@ -221,13 +245,65 @@ namespace boost {
     };
 
     namespace detail {
-    namespace tuples {
+
+#if defined(BOOST_MSVC) && (BOOST_MSVC == 1300)
+      // special workaround for vc7:
+
+      template <bool x>
+      struct reference_adder
+      {
+         template <class T>
+         struct rebind
+         {
+            typedef T& type;
+         };
+      };
+
+      template <>
+      struct reference_adder<true>
+      {
+         template <class T>
+         struct rebind
+         {
+            typedef T type;
+         };
+      };
+
+
+      // Return a reference to the Nth type of the given Tuple
+      template<int N, typename Tuple>
+      struct element_ref
+      {
+      private:
+         typedef typename element<N, Tuple>::RET elt_type;
+         enum { is_ref = is_reference<elt_type>::value };
+
+      public:
+         typedef reference_adder<is_ref>::rebind<elt_type>::type RET;
+         typedef RET type;
+      };
+
+      // Return a const reference to the Nth type of the given Tuple
+      template<int N, typename Tuple>
+      struct element_const_ref
+      {
+      private:
+         typedef typename element<N, Tuple>::RET elt_type;
+         enum { is_ref = is_reference<elt_type>::value };
+
+      public:
+         typedef reference_adder<is_ref>::rebind<const elt_type>::type RET;
+         typedef RET type;
+      };
+
+#else // vc7
+
       // Return a reference to the Nth type of the given Tuple
       template<int N, typename Tuple>
-      struct tuple_element_ref
+      struct element_ref
       {
       private:
-        typedef typename tuple_element<N, Tuple>::RET elt_type;
+        typedef typename element<N, Tuple>::RET elt_type;
 
       public:
         typedef typename add_reference<elt_type>::type RET;
@@ -236,89 +312,99 @@ namespace boost {
 
       // Return a const reference to the Nth type of the given Tuple
       template<int N, typename Tuple>
-      struct tuple_element_const_ref
+      struct element_const_ref
       {
       private:
-        typedef typename tuple_element<N, Tuple>::RET elt_type;
+        typedef typename element<N, Tuple>::RET elt_type;
 
       public:
         typedef typename add_reference<const elt_type>::type RET;
         typedef RET type;
       };
-    }
-    }
+#endif // vc7
+
+    } // namespace detail
+
     // Get length of this tuple
     template<typename Tuple>
-    struct tuple_length
+    struct length
     {
-      enum { value = 1 + tuple_length<typename Tuple::tail_type>::value };
+      BOOST_STATIC_CONSTANT(int, value = 1 + length<typename Tuple::tail_type>::value);
+    };
+    
+    template<> struct length<tuple<> > {
+      BOOST_STATIC_CONSTANT(int, value = 0);
     };
 
     template<>
-    struct tuple_length<null_type>
+    struct length<null_type>
     {
-      enum { value = 0 };
+      BOOST_STATIC_CONSTANT(int, value = 0);
     };
 
+    namespace detail {
+
     // Reference the Nth element in a tuple and retrieve it with "get"
     template<int N>
-    struct element
+    struct get_class
     {
-      template<typename Tuple>
+      template<typename Head, typename Tail>
       static inline
-      typename detail::tuples::tuple_element_ref<N, Tuple>::RET
-      get(Tuple& t)
+      typename detail::element_ref<N, cons<Head, Tail> >::RET
+      get(cons<Head, Tail>& t)
       {
-        return element<N-1>::get(t.tail);
+        return get_class<N-1>::get(t.tail);
       }
 
-      template<typename Tuple>
+      template<typename Head, typename Tail>
       static inline
-      typename detail::tuples::tuple_element_const_ref<N, Tuple>::RET
-      get(const Tuple& t)
+      typename detail::element_const_ref<N, cons<Head, Tail> >::RET
+      get(const cons<Head, Tail>& t)
       {
-        return element<N-1>::get(t.tail);
+        return get_class<N-1>::get(t.tail);
       }
     };
 
     template<>
-    struct element<0>
+    struct get_class<0>
     {
-      template<typename Tuple>
+      template<typename Head, typename Tail>
       static inline
-      typename add_reference<typename Tuple::head_type>::type
-      get(Tuple& t)
+      typename add_reference<Head>::type
+      get(cons<Head, Tail>& t)
       {
         return t.head;
       }
 
-      template<typename Tuple>
+      template<typename Head, typename Tail>
       static inline
-      typename add_reference<const typename Tuple::head_type>::type
-      get(const Tuple& t)
+      typename add_reference<const Head>::type
+      get(const cons<Head, Tail>& t)
       {
         return t.head;
       }
     };
 
+    } // namespace detail
+
     // tuple class
     template<
       typename T1, 
-      typename T2 = null_type
-      typename T3 = null_type
-      typename T4 = null_type,
-      typename T5 = null_type,
-      typename T6 = null_type,
-      typename T7 = null_type,
-      typename T8 = null_type,
-      typename T9 = null_type,
-      typename T10 = null_type
+      typename T2, 
+      typename T3, 
+      typename T4,
+      typename T5,
+      typename T6,
+      typename T7,
+      typename T8,
+      typename T9,
+      typename T10
     >
     class tuple : 
-      public detail::tuples::map_tuple_to_cons<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::cons1
+      public detail::map_tuple_to_cons<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::cons1
     {
     private:
-      typedef detail::tuples::map_tuple_to_cons<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> mapped_tuple;
+      typedef detail::map_tuple_to_cons<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> mapped_tuple;
       typedef typename mapped_tuple::cons10 cons10;
       typedef typename mapped_tuple::cons9 cons9;
       typedef typename mapped_tuple::cons8 cons8;
@@ -331,6 +417,7 @@ namespace boost {
       typedef typename mapped_tuple::cons1 cons1;
 
     public:
+      typedef cons1 inherited;
       typedef tuple self_type;
 
       explicit tuple(const T1& t1 = T1(), 
@@ -347,36 +434,50 @@ namespace boost {
       {
       }
 
-      template<typename Other>
-      explicit tuple(const Other& other) : cons1(other)
+      template<typename Head, typename Tail>
+      explicit tuple(const cons<Head, Tail>& other) : 
+        cons1(other.head, other.tail)
       {
       }
 
-      template<typename Other>
-      self_type& operator=(const Other& other)
+      template<typename First, typename Second>
+      self_type& operator=(const std::pair<First, Second>& other)
+      {
+        this->head = other.first;
+        this->tail.head = other.second;
+        return *this;
+      }
+
+      template<typename Head, typename Tail>
+      self_type& operator=(const cons<Head, Tail>& other)
       {
         this->head = other.head;
         this->tail = other.tail;
+
         return *this;
       }
     };
 
-    // Retrieve the Nth element in the typle
-    template<int N, typename Tuple>
-    typename detail::tuples::tuple_element_ref<N, Tuple>::RET
-    get(Tuple& t)
+    namespace detail {
+
+      template<int N> struct workaround_holder {};
+
+    } // namespace detail
+
+    template<int N, typename Head, typename Tail>
+    typename detail::element_ref<N, cons<Head, Tail> >::RET
+    get(cons<Head, Tail>& t, detail::workaround_holder<N>* = 0)
     {
-      return element<N>::get(t);
+      return detail::get_class<N>::get(t);
     }
 
-    // Retrieve the Nth element in the typle
-    template<int N, typename Tuple>
-    typename detail::tuples::tuple_element_const_ref<N, Tuple>::RET
-    get(const Tuple& t) 
+    template<int N, typename Head, typename Tail>
+    typename detail::element_const_ref<N, cons<Head, Tail> >::RET
+    get(const cons<Head, Tail>& t, detail::workaround_holder<N>* = 0)
     {
-      return element<N>::get(t);
+      return detail::get_class<N>::get(t);
     }
-     
+
     // Make a tuple
     template<typename T1>
     inline
@@ -470,185 +571,186 @@ namespace boost {
     // Tie variables into a tuple
     template<typename T1>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1> >
+    tuple<detail::assign_to_pointee<T1> >
     tie(T1& t1)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2> >
     tie(T1& t1, T2& t2)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3> >
     tie(T1& t1, T2& t2, T3& t3)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4, typename T5>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4>, 
-      detail::tuples::assign_to_pointee<T5> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4>, 
+      detail::assign_to_pointee<T5> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4),
-                        detail::tuples::assign_to_pointee<T5>(&t5));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4),
+                        detail::assign_to_pointee<T5>(&t5));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4>, 
-      detail::tuples::assign_to_pointee<T5>, 
-      detail::tuples::assign_to_pointee<T6> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4>, 
+      detail::assign_to_pointee<T5>, 
+      detail::assign_to_pointee<T6> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4),
-                        detail::tuples::assign_to_pointee<T6>(&t5),
-                        detail::tuples::assign_to_pointee<T5>(&t6));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4),
+                        detail::assign_to_pointee<T6>(&t5),
+                        detail::assign_to_pointee<T5>(&t6));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4>, 
-      detail::tuples::assign_to_pointee<T5>, 
-      detail::tuples::assign_to_pointee<T6>, 
-      detail::tuples::assign_to_pointee<T7> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4>, 
+      detail::assign_to_pointee<T5>, 
+      detail::assign_to_pointee<T6>, 
+      detail::assign_to_pointee<T7> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4),
-                        detail::tuples::assign_to_pointee<T5>(&t5),
-                        detail::tuples::assign_to_pointee<T6>(&t6),
-                        detail::tuples::assign_to_pointee<T7>(&t7));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4),
+                        detail::assign_to_pointee<T5>(&t5),
+                        detail::assign_to_pointee<T6>(&t6),
+                        detail::assign_to_pointee<T7>(&t7));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4>, 
-      detail::tuples::assign_to_pointee<T5>, 
-      detail::tuples::assign_to_pointee<T6>, 
-      detail::tuples::assign_to_pointee<T7>, 
-      detail::tuples::assign_to_pointee<T8> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4>, 
+      detail::assign_to_pointee<T5>, 
+      detail::assign_to_pointee<T6>, 
+      detail::assign_to_pointee<T7>, 
+      detail::assign_to_pointee<T8> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4),
-                        detail::tuples::assign_to_pointee<T5>(&t5),
-                        detail::tuples::assign_to_pointee<T6>(&t6),
-                        detail::tuples::assign_to_pointee<T7>(&t7),
-                        detail::tuples::assign_to_pointee<T8>(&t8));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4),
+                        detail::assign_to_pointee<T5>(&t5),
+                        detail::assign_to_pointee<T6>(&t6),
+                        detail::assign_to_pointee<T7>(&t7),
+                        detail::assign_to_pointee<T8>(&t8));
     }
 
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4>, 
-      detail::tuples::assign_to_pointee<T5>, 
-      detail::tuples::assign_to_pointee<T6>, 
-      detail::tuples::assign_to_pointee<T7>, 
-      detail::tuples::assign_to_pointee<T8>, 
-      detail::tuples::assign_to_pointee<T9> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4>, 
+      detail::assign_to_pointee<T5>, 
+      detail::assign_to_pointee<T6>, 
+      detail::assign_to_pointee<T7>, 
+      detail::assign_to_pointee<T8>, 
+      detail::assign_to_pointee<T9> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8, T9 &t9)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4),
-                        detail::tuples::assign_to_pointee<T5>(&t5),
-                        detail::tuples::assign_to_pointee<T6>(&t6),
-                        detail::tuples::assign_to_pointee<T7>(&t7),
-                        detail::tuples::assign_to_pointee<T8>(&t8),
-                        detail::tuples::assign_to_pointee<T9>(&t9));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4),
+                        detail::assign_to_pointee<T5>(&t5),
+                        detail::assign_to_pointee<T6>(&t6),
+                        detail::assign_to_pointee<T7>(&t7),
+                        detail::assign_to_pointee<T8>(&t8),
+                        detail::assign_to_pointee<T9>(&t9));
     }
     // Tie variables into a tuple
     template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
     inline
-    tuple<detail::tuples::assign_to_pointee<T1>, 
-      detail::tuples::assign_to_pointee<T2>, 
-      detail::tuples::assign_to_pointee<T3>, 
-      detail::tuples::assign_to_pointee<T4>, 
-      detail::tuples::assign_to_pointee<T5>, 
-      detail::tuples::assign_to_pointee<T6>, 
-      detail::tuples::assign_to_pointee<T7>, 
-      detail::tuples::assign_to_pointee<T8>, 
-      detail::tuples::assign_to_pointee<T9>, 
-      detail::tuples::assign_to_pointee<T10> >
+    tuple<detail::assign_to_pointee<T1>, 
+      detail::assign_to_pointee<T2>, 
+      detail::assign_to_pointee<T3>, 
+      detail::assign_to_pointee<T4>, 
+      detail::assign_to_pointee<T5>, 
+      detail::assign_to_pointee<T6>, 
+      detail::assign_to_pointee<T7>, 
+      detail::assign_to_pointee<T8>, 
+      detail::assign_to_pointee<T9>, 
+      detail::assign_to_pointee<T10> >
     tie(T1& t1, T2& t2, T3& t3, T4& t4, T5 &t5, T6 &t6, T7 &t7, T8 &t8, T9 &t9, T10 &t10)
     {
-      return make_tuple(detail::tuples::assign_to_pointee<T1>(&t1),
-                        detail::tuples::assign_to_pointee<T2>(&t2),
-                        detail::tuples::assign_to_pointee<T3>(&t3),
-                        detail::tuples::assign_to_pointee<T4>(&t4),
-                        detail::tuples::assign_to_pointee<T5>(&t5),
-                        detail::tuples::assign_to_pointee<T6>(&t6),
-                        detail::tuples::assign_to_pointee<T7>(&t7),
-                        detail::tuples::assign_to_pointee<T8>(&t8),
-                        detail::tuples::assign_to_pointee<T9>(&t9),
-                        detail::tuples::assign_to_pointee<T10>(&t10));
+      return make_tuple(detail::assign_to_pointee<T1>(&t1),
+                        detail::assign_to_pointee<T2>(&t2),
+                        detail::assign_to_pointee<T3>(&t3),
+                        detail::assign_to_pointee<T4>(&t4),
+                        detail::assign_to_pointee<T5>(&t5),
+                        detail::assign_to_pointee<T6>(&t6),
+                        detail::assign_to_pointee<T7>(&t7),
+                        detail::assign_to_pointee<T8>(&t8),
+                        detail::assign_to_pointee<T9>(&t9),
+                        detail::assign_to_pointee<T10>(&t10));
     }
     // "ignore" allows tuple positions to be ignored when using "tie". 
     namespace {
-      detail::tuples::swallow_assign ignore;
+      detail::swallow_assign ignore;
     }
 
+} // namespace tuples
 } // namespace boost
 #endif // BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP
diff --git a/boost/boost/tuple/reference_wrappers.hpp b/boost/boost/tuple/reference_wrappers.hpp
deleted file mode 100644 (file)
index 52df59f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// -- reference_wrappers - Boost Tuple Library -----------------------------
-
-// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
-//
-// Permission to copy, use, sell and distribute this software is granted
-// provided this copyright notice appears in all copies. 
-// Permission to modify the code and to distribute modified code is granted
-// provided this copyright notice appears in all copies, and a notice 
-// that the code was modified is included with the copyright notice.
-//
-// This software is provided "as is" without express or implied warranty, 
-// and with no claim as to its suitability for any purpose.
-//
-// For more information, see http://www.boost.org 
-
-// ----------------------------------------------------------------- 
-
-#ifndef BOOST_TUPLE_REFERENCE_WRAPPERS_HPP
-#define BOOST_TUPLE_REFERENCE_WRAPPERS_HPP
-
-namespace boost {
-
-
-// reference wrappers -------------------------------------------------------
-  
-// These wrappers are handle classes that hold references to objects.
-
-// reference_wrapper is used to specify that a tuple element should be 
-// a reference to the wrapped object - rather than a copy of it.
-// The wrapper acts as a disguise for passing non-const reference 
-// parameters via a reference to const parameter.
-
-template<class T>
-class reference_wrapper { 
-  T& x; 
-public:
-  explicit 
-  reference_wrapper(T& t) : x(t) {} 
-  operator T&() const { return x; }
-};
-
-// store as a reference to T
-template<class T> 
-inline const reference_wrapper<T> ref(T& t) { 
-  return reference_wrapper<T>(t); 
-}
-
-// store as a reference to const T
-template<class T> 
-inline const reference_wrapper<const T> cref(const T& t) {
-  return reference_wrapper<const T>(t); 
-}
-   
-} // end of namespace boost
-
-
-#endif // BOOST_TUPLE_REFERENCE_WRAPPERS_HPP
index bd39730dc130ecde138b9fa611bff0b49056d05a..71d6dabf6104272875846dba775afd552cb180b5 100644 (file)
 
 #else
 // other compilers
-#include "boost/tuple/reference_wrappers.hpp"
+#include "boost/ref.hpp"
 #include "boost/tuple/detail/tuple_basic.hpp"
 
 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
+namespace boost {    
 
-#endif // BOOST_TUPLE_HPP
+using tuples::tuple;
+using tuples::make_tuple;
+using tuples::tie;
+#if !defined(BOOST_NO_USING_TEMPLATE)
+using tuples::get;
+#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+//
+// The "using tuples::get" statement causes the
+// Borland compiler to ICE, use forwarding
+// functions instead:
+//
+template<int N, class HT, class TT>
+inline typename tuples::access_traits<
+                  typename tuples::element<N, tuples::cons<HT, TT> >::type
+                >::non_const_type
+get(tuples::cons<HT, TT>& c) {
+  return tuples::get<N,HT,TT>(c);
+} 
+// get function for const cons-lists, returns a const reference to
+// the element. If the element is a reference, returns the reference
+// as such (that is, can return a non-const reference)
+template<int N, class HT, class TT>
+inline typename tuples::access_traits<
+                  typename tuples::element<N, tuples::cons<HT, TT> >::type
+                >::const_type
+get(const tuples::cons<HT, TT>& c) {
+  return tuples::get<N,HT,TT>(c);
+}
+#else  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+//
+// MSVC, using declarations don't mix with templates well,
+// so use forwarding functions instead:
+//
+template<int N, typename Head, typename Tail>
+typename tuples::detail::element_ref<N, tuples::cons<Head, Tail> >::RET
+get(tuples::cons<Head, Tail>& t, tuples::detail::workaround_holder<N>* = 0)
+{
+   return tuples::detail::get_class<N>::get(t);
+}
+
+template<int N, typename Head, typename Tail>
+typename tuples::detail::element_const_ref<N, tuples::cons<Head, Tail> >::RET
+get(const tuples::cons<Head, Tail>& t, tuples::detail::workaround_holder<N>* = 0)
+{
+   return tuples::detail::get_class<N>::get(t);
+}
+#endif // BOOST_NO_USING_TEMPLATE
+   
+} // end namespace boost
+
+
+#endif // BOOST_TUPLE_HPP
index a34d67df7d86c885e19cdb0a1fea2c1b9b297492..2062c604ed29d915de769c498ded7c47fd963779 100644 (file)
@@ -38,6 +38,7 @@
 
 
 namespace boost {
+namespace tuples {
 
 inline bool operator==(const null_type&, const null_type&) { return true; }
 inline bool operator>=(const null_type&, const null_type&) { return true; }
@@ -48,7 +49,6 @@ inline bool operator>(const null_type&, const null_type&) { return false; }
 
 
 namespace detail {
-namespace tuples {
   // comparison operators check statically the length of its operands and
   // delegate the comparing task to the following functions. Hence
   // the static check is only made once (should help the compiler).  
@@ -107,7 +107,6 @@ inline bool gte(const T1& lhs, const T2& rhs) {
 template<>
 inline bool gte<null_type,null_type>(const null_type&, const null_type&) { return true; }
 
-} // end of namespace tuples
 } // end of namespace detail
 
 
@@ -116,10 +115,10 @@ inline bool gte<null_type,null_type>(const null_type&, const null_type&) { retur
 template<class T1, class T2, class S1, class S2>
 inline bool operator==(const cons<T1, T2>& lhs, const cons<S1, S2>& rhs)
 {
-  // check that tuple_lengths are equal
-  BOOST_STATIC_ASSERT(tuple_length<T2>::value == tuple_length<S2>::value);
+  // check that tuple lengths are equal
+  BOOST_STATIC_ASSERT(length<T2>::value == length<S2>::value);
 
-  return  detail::tuples::eq(lhs, rhs);
+  return  detail::eq(lhs, rhs);
 }
 
 // not equal -----
@@ -128,53 +127,54 @@ template<class T1, class T2, class S1, class S2>
 inline bool operator!=(const cons<T1, T2>& lhs, const cons<S1, S2>& rhs)
 {
 
-  // check that tuple_lengths are equal
-  BOOST_STATIC_ASSERT(tuple_length<T2>::value == tuple_length<S2>::value);
+  // check that tuple lengths are equal
+  BOOST_STATIC_ASSERT(length<T2>::value == length<S2>::value);
 
-  return detail::tuples::neq(lhs, rhs);
+  return detail::neq(lhs, rhs);
 }
 
 // <
 template<class T1, class T2, class S1, class S2>
 inline bool operator<(const cons<T1, T2>& lhs, const cons<S1, S2>& rhs)
 {
-  // check that tuple_lengths are equal
-  BOOST_STATIC_ASSERT(tuple_length<T2>::value == tuple_length<S2>::value);
+  // check that tuple lengths are equal
+  BOOST_STATIC_ASSERT(length<T2>::value == length<S2>::value);
 
-  return detail::tuples::lt(lhs, rhs);
+  return detail::lt(lhs, rhs);
 }
 
 // >
 template<class T1, class T2, class S1, class S2>
 inline bool operator>(const cons<T1, T2>& lhs, const cons<S1, S2>& rhs)
 {
-  // check that tuple_lengths are equal
-  BOOST_STATIC_ASSERT(tuple_length<T2>::value == tuple_length<S2>::value);
+  // check that tuple lengths are equal
+  BOOST_STATIC_ASSERT(length<T2>::value == length<S2>::value);
 
-  return detail::tuples::gt(lhs, rhs);
+  return detail::gt(lhs, rhs);
 }
 
 // <=
 template<class T1, class T2, class S1, class S2>
 inline bool operator<=(const cons<T1, T2>& lhs, const cons<S1, S2>& rhs)
 {
-  // check that tuple_lengths are equal
-  BOOST_STATIC_ASSERT(tuple_length<T2>::value == tuple_length<S2>::value);
+  // check that tuple lengths are equal
+  BOOST_STATIC_ASSERT(length<T2>::value == length<S2>::value);
 
-  return detail::tuples::lte(lhs, rhs);
+  return detail::lte(lhs, rhs);
 }
 
 // >=
 template<class T1, class T2, class S1, class S2>
 inline bool operator>=(const cons<T1, T2>& lhs, const cons<S1, S2>& rhs)
 {
-  // check that tuple_lengths are equal
-  BOOST_STATIC_ASSERT(tuple_length<T2>::value == tuple_length<S2>::value);
+  // check that tuple lengths are equal
+  BOOST_STATIC_ASSERT(length<T2>::value == length<S2>::value);
 
-  return detail::tuples::gte(lhs, rhs);
+  return detail::gte(lhs, rhs);
 }
 
+} // end of namespace tuples
 } // end of namespace boost
 
 
-#endif // BOOST_TUPLE_COMPARISON_HPP
+#endif // BOOST_TUPLE_COMPARISON_HPP
index 3e8896fe72d73e43155dbdb663802883376254b3..2869ff32d7b20ab80f14d76752f8487b4e757bdc 100644 (file)
@@ -25,7 +25,7 @@
 #   if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97) 
 #define BOOST_NO_TEMPLATED_STREAMS
 #endif
-#endif // __GNUC__
+#endif // __GNUC__
 
 #if defined BOOST_NO_TEMPLATED_STREAMS
 #include <iostream>
 
 #include "boost/tuple/tuple.hpp"
 
-
-                                   
 namespace boost {
+namespace tuples {
 
 namespace detail {
-namespace tuples {
 
 class format_info {
 public:   
+
    enum manipulator_type { open, close, delimiter };
    BOOST_STATIC_CONSTANT(int, number_of_manipulators = delimiter + 1);
 private:
    
-   static const int stream_index[number_of_manipulators];
+   static int get_stream_index (int m)
+   {
+     static const int stream_index[number_of_manipulators]
+        = { std::ios::xalloc(), std::ios::xalloc(), std::ios::xalloc() };
+
+     return stream_index[m];
+   }
+
    format_info(const format_info&);
    format_info();   
 
@@ -58,13 +64,13 @@ public:
 
 #if defined (BOOST_NO_TEMPLATED_STREAMS)
    static char get_manipulator(std::ios& i, manipulator_type m) {
-     char c = static_cast<char>(i.iword(stream_index[m])); 
+     char c = static_cast<char>(i.iword(get_stream_index(m))); 
      
      // parentheses and space are the default manipulators
      if (!c) {
        switch(m) {
-         case open : c = '('; break;                                       
-         case close : c = ')'; break;                                      
+         case open : c = '('; break;
+         case close : c = ')'; break;
          case delimiter : c = ' '; break;
        }
      }
@@ -72,7 +78,7 @@ public:
    }
 
    static void set_manipulator(std::ios& i, manipulator_type m, char c) {
-      i.iword(stream_index[m]) = static_cast<long>(c);
+      i.iword(get_stream_index(m)) = static_cast<long>(c);
    }
 #else
    template<class CharType, class CharTrait>
@@ -82,12 +88,12 @@ public:
      // A valid instanitation of basic_stream allows CharType to be any POD,
      // hence, the static_cast may fail (it fails if long is not convertible 
      // to CharType
-     CharType c = static_cast<CharType>(i.iword(stream_index[m]) ); 
+     CharType c = static_cast<CharType>(i.iword(get_stream_index(m)) ); 
      // parentheses and space are the default manipulators
      if (!c) {
        switch(m) {
-         case open :  c = i.widen('('); break;                                     
-         case close : c = i.widen(')'); break;                                     
+         case open :  c = i.widen('('); break;
+         case close : c = i.widen(')'); break;
          case delimiter : c = i.widen(' '); break;
        }
      }
@@ -102,51 +108,50 @@ public:
      // A valid instanitation of basic_stream allows CharType to be any POD,
      // hence, the static_cast may fail (it fails if CharType is not 
      // convertible long.
-      i.iword(stream_index[m]) = static_cast<long>(c);
+      i.iword(get_stream_index(m)) = static_cast<long>(c);
    }
-#endif // BOOST_NO_TEMPLATED_STREAMS
+#endif // BOOST_NO_TEMPLATED_STREAMS
 };
+
+} // end of namespace detail
  
 template<class CharType>    
 class tuple_manipulator {
-  const format_info::manipulator_type mt;
+  const detail::format_info::manipulator_type mt;
   CharType f_c;
 public:
-  explicit tuple_manipulator(format_info::manipulator_type m, const char c = 0)
+  explicit tuple_manipulator(detail::format_info::manipulator_type m, 
+                             const char c = 0)
      : mt(m), f_c(c) {}
   
 #if defined (BOOST_NO_TEMPLATED_STREAMS)
   void set(std::ios &io) const {
-     format_info::set_manipulator(io, mt, f_c);
+     detail::format_info::set_manipulator(io, mt, f_c);
   }
 #else
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
    template<class CharType2, class CharTrait>
   void set(std::basic_ios<CharType2, CharTrait> &io) const {
-     format_info::set_manipulator(io, mt, f_c);
+     detail::format_info::set_manipulator(io, mt, f_c);
   }
 #else
    template<class CharTrait>
   void set(std::basic_ios<CharType, CharTrait> &io) const {
-     format_info::set_manipulator(io, mt, f_c);
+     detail::format_info::set_manipulator(io, mt, f_c);
   }
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#endif // BOOST_NO_TEMPLATED_STREAMS
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#endif // BOOST_NO_TEMPLATED_STREAMS
 };
 
-} // end of namespace tuples
-} // end of namespace detail
-   
-
 #if defined (BOOST_NO_TEMPLATED_STREAMS)
 inline std::ostream&
-operator<<(std::ostream& o, const detail::tuples::tuple_manipulator<char>& m) {
+operator<<(std::ostream& o, const tuple_manipulator<char>& m) {
   m.set(o);
   return o;
 }
 
 inline std::istream&
-operator>>(std::istream& i, const detail::tuples::tuple_manipulator<char>& m) {
+operator>>(std::istream& i, const tuple_manipulator<char>& m) {
   m.set(i);
   return i;
 }
@@ -155,14 +160,14 @@ operator>>(std::istream& i, const detail::tuples::tuple_manipulator<char>& m) {
 
 template<class CharType, class CharTrait>
 inline std::basic_ostream<CharType, CharTrait>&
-operator<<(std::basic_ostream<CharType, CharTrait>& o, const detail::tuples::tuple_manipulator<CharType>& m) {
+operator<<(std::basic_ostream<CharType, CharTrait>& o, const tuple_manipulator<CharType>& m) {
   m.set(o);
   return o;
 }
 
 template<class CharType, class CharTrait>
 inline std::basic_istream<CharType, CharTrait>&
-operator>>(std::basic_istream<CharType, CharTrait>& i, const detail::tuples::tuple_manipulator<CharType>& m) {
+operator>>(std::basic_istream<CharType, CharTrait>& i, const tuple_manipulator<CharType>& m) {
   m.set(i);
   return i;
 }
@@ -170,18 +175,18 @@ operator>>(std::basic_istream<CharType, CharTrait>& i, const detail::tuples::tup
 #endif   // BOOST_NO_TEMPLATED_STREAMS
    
 template<class CharType>
-inline detail::tuples::tuple_manipulator<CharType> set_open(const CharType c) {
-   return detail::tuples::tuple_manipulator<CharType>(detail::tuples::format_info::open, c);
+inline tuple_manipulator<CharType> set_open(const CharType c) {
+   return tuple_manipulator<CharType>(detail::format_info::open, c);
 }
 
 template<class CharType>
-inline detail::tuples::tuple_manipulator<CharType> set_close(const CharType c) {
-   return detail::tuples::tuple_manipulator<CharType>(detail::tuples::format_info::close, c);
+inline tuple_manipulator<CharType> set_close(const CharType c) {
+   return tuple_manipulator<CharType>(detail::format_info::close, c);
 }
 
 template<class CharType>
-inline detail::tuples::tuple_manipulator<CharType> set_delimiter(const CharType c) {
-   return detail::tuples::tuple_manipulator<CharType>(detail::tuples::format_info::delimiter, c);
+inline tuple_manipulator<CharType> set_delimiter(const CharType c) {
+   return tuple_manipulator<CharType>(detail::format_info::delimiter, c);
 }
 
 
@@ -194,7 +199,6 @@ inline detail::tuples::tuple_manipulator<CharType> set_delimiter(const CharType
 // set_open, set_close and set_delimiter
    
 namespace detail {
-namespace tuples {
 
 // Note: The order of the print functions is critical 
 // to let a conforming compiler  find and select the correct one.
@@ -206,7 +210,7 @@ template<class T1>
 inline std::ostream& print(std::ostream& o, const cons<T1, null_type>& t) {
   return o << t.head;
 }
-#endif // BOOST_NO_TEMPLATED_STREAMS
+#endif // BOOST_NO_TEMPLATED_STREAMS
  
 inline std::ostream& print(std::ostream& o, const null_type&) { return o; }
 
@@ -219,8 +223,8 @@ print(std::ostream& o, const cons<T1, T2>& t) {
   o << t.head;
 
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-  if (tuple_length<T2>::value == 0)
-       return o;
+  if (tuples::length<T2>::value == 0)
+    return o;
 #endif  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
   o << d;
   
@@ -256,17 +260,16 @@ print(std::basic_ostream<CharType, CharTrait>& o, const cons<T1, T2>& t) {
   o << t.head;
 
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-  if (tuple_length<T2>::value == 0)
-       return o;
+  if (tuples::length<T2>::value == 0)
+    return o;
 #endif  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
   o << d;
 
   return print(o, t.tail);
 }
 
-#endif // BOOST_NO_TEMPLATED_STREAMS
+#endif  // BOOST_NO_TEMPLATED_STREAMS
 
-} // namespace tuples
 } // namespace detail
 
 #if defined (BOOST_NO_TEMPLATED_STREAMS)
@@ -275,13 +278,13 @@ inline std::ostream& operator<<(std::ostream& o, const cons<T1, T2>& t) {
   if (!o.good() ) return o;
  
   const char l = 
-    detail::tuples::format_info::get_manipulator(o, detail::tuples::format_info::open);
+    detail::format_info::get_manipulator(o, detail::format_info::open);
   const char r = 
-    detail::tuples::format_info::get_manipulator(o, detail::tuples::format_info::close);
+    detail::format_info::get_manipulator(o, detail::format_info::close);
    
   o << l;
   
-  detail::tuples::print(o, t);  
+  detail::print(o, t);  
 
   o << r;
 
@@ -297,26 +300,25 @@ operator<<(std::basic_ostream<CharType, CharTrait>& o,
   if (!o.good() ) return o;
  
   const CharType l = 
-    detail::tuples::format_info::get_manipulator(o, detail::tuples::format_info::open);
+    detail::format_info::get_manipulator(o, detail::format_info::open);
   const CharType r = 
-    detail::tuples::format_info::get_manipulator(o, detail::tuples::format_info::close);
+    detail::format_info::get_manipulator(o, detail::format_info::close);
    
   o << l;   
 
-  detail::tuples::print(o, t);  
+  detail::print(o, t);  
 
   o << r;
 
   return o;
 }
-#endif // BOOST_NO_TEMPLATED_STREAMS
+#endif // BOOST_NO_TEMPLATED_STREAMS
 
    
 // -------------------------------------------------------------
 // input stream operators
 
 namespace detail {
-namespace tuples {
 
 #if defined (BOOST_NO_TEMPLATED_STREAMS)
 
@@ -353,7 +355,7 @@ read (std::istream &is, cons<T1, null_type>& t1) {
 }
 #else
 inline std::istream& read(std::istream& i, const null_type&) { return i; }
-#endif // !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#endif // !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    
 template<class T1, class T2>
 inline std::istream& 
@@ -364,8 +366,8 @@ read(std::istream &is, cons<T1, T2>& t1) {
   is >> t1.head;
 
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-  if (tuple_length<T2>::value == 0)
-       return is;
+  if (tuples::length<T2>::value == 0)
+    return is;
 #endif  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
   extract_and_check_delimiter(is, format_info::delimiter);
@@ -373,7 +375,6 @@ read(std::istream &is, cons<T1, T2>& t1) {
   return read(is, t1.tail);
 }
 
-} // end namespace tuples
 } // end namespace detail
 
 inline std::istream& 
@@ -381,8 +382,8 @@ operator>>(std::istream &is, null_type&) {
 
   if (!is.good() ) return is;
 
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::open);
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::close);
+  detail::extract_and_check_delimiter(is, detail::format_info::open);
+  detail::extract_and_check_delimiter(is, detail::format_info::close);
 
   return is;
 }
@@ -394,11 +395,11 @@ operator>>(std::istream& is, cons<T1, T2>& t1) {
 
   if (!is.good() ) return is;
 
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::open);
+  detail::extract_and_check_delimiter(is, detail::format_info::open);
                       
-  detail::tuples::read(is, t1);
+  detail::read(is, t1);
    
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::close);
+  detail::extract_and_check_delimiter(is, detail::format_info::close);
 
   return is;
 }
@@ -441,7 +442,7 @@ template<class CharType, class CharTrait>
 inline std::basic_istream<CharType, CharTrait>& 
 read(std::basic_istream<CharType, CharTrait>& i, const null_type&) { return i; }
 
-#endif // !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#endif // !BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
 template<class CharType, class CharTrait, class T1, class T2>
 inline std::basic_istream<CharType, CharTrait>& 
@@ -452,8 +453,8 @@ read(std::basic_istream<CharType, CharTrait> &is, cons<T1, T2>& t1) {
   is >> t1.head;
 
 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-  if (tuple_length<T2>::value == 0)
-       return is;
+  if (tuples::length<T2>::value == 0)
+    return is;
 #endif  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
   extract_and_check_delimiter(is, format_info::delimiter);
@@ -461,7 +462,6 @@ read(std::basic_istream<CharType, CharTrait> &is, cons<T1, T2>& t1) {
   return read(is, t1.tail);
 }
 
-} // end namespace tuples
 } // end namespace detail
 
 
@@ -471,8 +471,8 @@ operator>>(std::basic_istream<CharType, CharTrait> &is, null_type&) {
 
   if (!is.good() ) return is;
 
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::open);
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::close);
+  detail::extract_and_check_delimiter(is, detail::format_info::open);
+  detail::extract_and_check_delimiter(is, detail::format_info::close);
 
   return is;
 }
@@ -483,19 +483,20 @@ operator>>(std::basic_istream<CharType, CharTrait>& is, cons<T1, T2>& t1) {
 
   if (!is.good() ) return is;
 
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::open);
+  detail::extract_and_check_delimiter(is, detail::format_info::open);
                       
-  detail::tuples::read(is, t1);
+  detail::read(is, t1);
    
-  detail::tuples::extract_and_check_delimiter(is, detail::tuples::format_info::close);
+  detail::extract_and_check_delimiter(is, detail::format_info::close);
 
   return is;
 }
 
-#endif // BOOST_NO_TEMPLATED_STREAMS
+#endif // BOOST_NO_TEMPLATED_STREAMS
 
+} // end of namespace tuples
 } // end of namespace boost
 
-#endif // BOOST_TUPLE_IO_HPP
+#endif // BOOST_TUPLE_IO_HPP
 
 
diff --git a/boost/boost/type.hpp b/boost/boost/type.hpp
new file mode 100644 (file)
index 0000000..a6d17f6
--- /dev/null
@@ -0,0 +1,19 @@
+// (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.
+
+#ifndef BOOST_TYPE_DWA20010120_HPP
+# define BOOST_TYPE_DWA20010120_HPP
+
+namespace boost {
+
+  // Just a simple "type envelope". Useful in various contexts, mostly to work
+  // around some MSVC deficiencies.
+  template <class T>
+  struct type {};
+
+}
+
+#endif // BOOST_TYPE_DWA20010120_HPP
diff --git a/boost/boost/type_traits.hpp b/boost/boost/type_traits.hpp
new file mode 100644 (file)
index 0000000..d84f05b
--- /dev/null
@@ -0,0 +1,43 @@
+//  (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.
+
+//  See http://www.boost.org for most recent version including documentation.
+//  See boost/detail/type_traits.hpp and boost/detail/ob_type_traits.hpp
+//  for full copyright notices.
+
+#ifndef BOOST_TYPE_TRAITS_HPP
+#define BOOST_TYPE_TRAITS_HPP
+
+#include <boost/type_traits/fwd.hpp>
+#include <boost/type_traits/ice.hpp>
+#include <boost/type_traits/conversion_traits.hpp>
+#include <boost/type_traits/arithmetic_traits.hpp>
+#include <boost/type_traits/cv_traits.hpp>
+#include <boost/type_traits/composite_traits.hpp>
+#include <boost/type_traits/alignment_traits.hpp>
+#include <boost/type_traits/object_traits.hpp>
+#include <boost/type_traits/transform_traits.hpp>
+#include <boost/type_traits/same_traits.hpp>
+#include <boost/type_traits/function_traits.hpp>
+
+/**************************************************************************/
+
+//
+// undefine helper macro's:
+//
+#undef BOOST_IS_CLASS
+#undef BOOST_IS_ENUM
+#undef BOOST_IS_UNION
+#undef BOOST_IS_POD
+#undef BOOST_IS_EMPTY
+#undef BOOST_HAS_TRIVIAL_CONSTRUCTOR
+#undef BOOST_HAS_TRIVIAL_COPY
+#undef BOOST_HAS_TRIVIAL_ASSIGN
+#undef BOOST_HAS_TRIVIAL_DESTRUCTOR
+
+#endif // BOOST_TYPE_TRAITS_HPP
+
+
+
index 52af79a8fd10ed9861c3586bb46740dbfb6bd544..b509f67361957d739fb4170e9f184cdd8a71925a 100644 (file)
 #ifndef BOOST_ICE_TYPE_TRAITS_HPP
 #include <boost/type_traits/ice.hpp>
 #endif
+#include <boost/preprocessor/list/for_each_i.hpp>
+#include <boost/preprocessor/tuple/to_list.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/type_traits/transform_traits.hpp>
+#include <boost/static_assert.hpp>
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4121) // alignment is sensitive to packing
+#endif
 
 namespace boost{
+template <class T> struct alignment_of;
+
 //
 // get the alignment of some arbitrary type:
 namespace detail{
@@ -30,6 +42,7 @@ struct alignment_of_hack
    alignment_of_hack();
 };
 
+
 template <unsigned A, unsigned S>
 struct alignment_logic
 {
@@ -56,7 +69,7 @@ template <class T>
 struct alignment_of<T&>
 {
 public:
-   BOOST_STATIC_CONSTANT(std::size_t, value = alignment_of<T*>::value);
+   BOOST_STATIC_CONSTANT(std::size_t, value = ::boost::alignment_of<T*>::value);
 };
 #endif
 //
@@ -76,9 +89,120 @@ struct alignment_of<const volatile void>
 { BOOST_STATIC_CONSTANT(std::size_t, value = 0); };
 #endif
 
-} // namespace boost
-
-#endif // ALIGNMENT_TYPE_TRAITS_HPP
+namespace detail {
+class alignment_dummy;
+typedef void (*function_ptr)();
+typedef int (alignment_dummy::*member_ptr);
+typedef int (alignment_dummy::*member_function_ptr)();
 
+/*
+ * The ct_if implementation is temporary code. It will be replaced with MPL
+ * in the future...
+ */
+struct select_then
+{
+  template<typename Then, typename Else>
+  struct result
+  {
+    typedef Then type;
+  };
+};
+struct select_else
+{
+  template<typename Then, typename Else>
+  struct result
+  { 
+    typedef Else type;
+  };
+};
  
+template<bool Condition>
+struct ct_if_selector
+{
+  typedef select_then type;
+};
+template<>
+struct ct_if_selector<false>
+{
+  typedef select_else type;
+};
+template<bool Condition, typename Then, typename Else>
+struct ct_if
+{
+  typedef typename ct_if_selector<Condition>::type select;
+  typedef typename select::template result<Then,Else>::type type;
+};
+
+#define BOOST_TT_ALIGNMENT_TYPES BOOST_PP_TUPLE_TO_LIST( \
+        11, ( \
+        char, short, int, long, float, double, long double \
+        , void*, function_ptr, member_ptr, member_function_ptr))
 
+#define BOOST_TT_CHOOSE_LOWER_ALIGNMENT(R,P,I,T) \
+        typename ct_if< \
+           alignment_of<T>::value <= target, T, char>::type BOOST_PP_CAT(t,I);
+
+#define BOOST_TT_CHOOSE_T(R,P,I,T) T BOOST_PP_CAT(t,I);
+           
+template <std::size_t target>
+union lower_alignment
+{
+  BOOST_PP_LIST_FOR_EACH_I(
+      BOOST_TT_CHOOSE_LOWER_ALIGNMENT
+      , ignored, BOOST_TT_ALIGNMENT_TYPES)
+};
+
+union max_align
+{
+  BOOST_PP_LIST_FOR_EACH_I(
+      BOOST_TT_CHOOSE_T
+      , ignored, BOOST_TT_ALIGNMENT_TYPES)
+};
+
+#undef BOOST_TT_ALIGNMENT_TYPES
+#undef BOOST_TT_CHOOSE_LOWER_ALIGNMENT
+#undef BOOST_TT_CHOOSE_T
+
+template<int TAlign, int Align>
+struct is_aligned 
+{
+  BOOST_STATIC_CONSTANT(bool, 
+                        value = (TAlign >= Align) & (TAlign % Align == 0));
+};
+
+}
+
+// This alignment method originally due to Brian Parker, implemented by David
+// Abrahams, and then ported here by Doug Gregor. 
+template <int Align>
+class type_with_alignment
+{
+  typedef detail::lower_alignment<Align> t1;
+
+  typedef type_with_alignment<Align> this_type;
+
+  typedef typename detail::ct_if<
+              (detail::is_aligned<(alignment_of<t1>::value), Align>::value)
+            , t1
+            , detail::max_align
+          >::type align_t;
+
+  BOOST_STATIC_CONSTANT(std::size_t, found = alignment_of<align_t>::value);
+  
+  BOOST_STATIC_ASSERT(found >= Align);
+  BOOST_STATIC_ASSERT(found % Align == 0);
+  
+public:
+  typedef align_t type;
+};
+
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+#endif // ALIGNMENT_TYPE_TRAITS_HPP
index bccac512477d1d3ea94670f4747eb3d57911b23c..1d111c4b98499533f51887b9e3dcbe9e15092d03 100644 (file)
@@ -32,7 +32,7 @@ template <typename T> struct is_void{ BOOST_STATIC_CONSTANT(bool, value = false)
 template <> struct is_void<void>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 
 //* is a type T an [cv-qualified-] integral type described in the standard (3.9.1p3)
-// as an extention we include long long, as this is likely to be added to the 
+// as an extention we include long long, as this is likely to be added to the
 // standard at a later date
 template <typename T> struct is_integral
 { BOOST_STATIC_CONSTANT(bool, value = false); };
@@ -61,13 +61,12 @@ template <> struct is_integral<wchar_t>
 template <> struct is_integral<bool>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 
-# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
+# if defined(BOOST_HAS_LONG_LONG)
 template <> struct is_integral<unsigned long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
-#endif
-#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
+#elif defined(BOOST_HAS_MS_INT64)
 template <> struct is_integral<unsigned __int64>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<__int64>
@@ -122,13 +121,12 @@ template <> struct is_integral<const wchar_t>
 template <> struct is_integral<const bool>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 
-# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
+# if defined(BOOST_HAS_LONG_LONG)
 template <> struct is_integral<const unsigned long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<const long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
-#endif  // ULLONG_MAX
-#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
+#elif defined(BOOST_HAS_MS_INT64)
 template <> struct is_integral<const unsigned __int64>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<const __int64>
@@ -168,13 +166,12 @@ template <> struct is_integral<volatile  wchar_t>
 template <> struct is_integral<volatile  bool>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 
-# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
+# if defined(BOOST_HAS_LONG_LONG)
 template <> struct is_integral<volatile  unsigned long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<volatile  long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
-#endif  // ULLONG_MAX
-#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
+#elif defined(BOOST_HAS_MS_INT64)
 template <> struct is_integral<volatile  unsigned __int64>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<volatile  __int64>
@@ -214,13 +211,12 @@ template <> struct is_integral<const volatile wchar_t>
 template <> struct is_integral<const volatile bool>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 
-# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX))
+# if defined(BOOST_HAS_LONG_LONG)
 template <> struct is_integral<const volatile unsigned long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<const volatile long long>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
-#endif  // ULLONG_MAX
-#if defined(__BORLANDC__) || defined(_MSC_VER) && !defined(__MWERKS__)
+#elif defined(BOOST_HAS_MS_INT64)
 template <> struct is_integral<const volatile unsigned __int64>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 template <> struct is_integral<const volatile __int64>
@@ -240,22 +236,22 @@ template <> struct is_float<const volatile long double>
 template <typename T> 
 struct is_arithmetic
 { 
-       BOOST_STATIC_CONSTANT(bool, value = 
-               (::boost::type_traits::ice_or< 
-                       ::boost::is_integral<T>::value,
-                       ::boost::is_float<T>::value
-               >::value)); 
+   BOOST_STATIC_CONSTANT(bool, value = 
+      (::boost::type_traits::ice_or< 
+         ::boost::is_integral<T>::value,
+         ::boost::is_float<T>::value
+      >::value)); 
 };
 
 //* is a type T a fundamental type described in the standard (3.9.1)
 template <typename T> 
 struct is_fundamental
 { 
-       BOOST_STATIC_CONSTANT(bool, value = 
-               (::boost::type_traits::ice_or< 
-                       ::boost::is_arithmetic<T>::value, 
-                       ::boost::is_void<T>::value
-               >::value)); 
+   BOOST_STATIC_CONSTANT(bool, value = 
+      (::boost::type_traits::ice_or< 
+         ::boost::is_arithmetic<T>::value, 
+         ::boost::is_void<T>::value
+      >::value)); 
 };
 
 } // namespace boost
diff --git a/boost/boost/type_traits/array_traits.hpp b/boost/boost/type_traits/array_traits.hpp
new file mode 100644 (file)
index 0000000..975f801
--- /dev/null
@@ -0,0 +1,86 @@
+//  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+//  Hinnant & John Maddock 2000.  Permission to copy, use, modify,
+//  sell and distribute this software is granted provided this
+//  copyright notice appears in all copies. This software is provided
+//  "as is" without express or implied warranty, and with no claim as
+//  to its suitability for any purpose.
+//
+//  See http://www.boost.org for most recent version including documentation.
+//
+#ifndef BOOST_TT_ARRAY_TRAITS_HPP
+# define BOOST_TT_ARRAY_TRAITS_HPP
+# include <boost/type_traits/utility.hpp>
+# include <boost/type_traits/ice.hpp>
+
+namespace boost { 
+
+/**********************************************
+ *
+ * is_array
+ *
+ **********************************************/
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <typename T> struct is_array
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+template <typename T, std::size_t N> struct is_array<T[N]>
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <typename T, std::size_t N> struct is_array<const T[N]>
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <typename T, std::size_t N> struct is_array<volatile T[N]>
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <typename T, std::size_t N> struct is_array<const volatile T[N]>
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+namespace detail
+{
+  using ::boost::type_traits::yes_type;
+  using ::boost::type_traits::no_type;
+  using ::boost::type_traits::wrap;
+  
+  template <class T> T(* is_array_helper1(wrap<T>) )(wrap<T>);
+  char is_array_helper1(...);
+
+  template <class T> no_type is_array_helper2(T(*)(wrap<T>));
+  yes_type is_array_helper2(...);
+}
+
+template <typename T> 
+struct is_array
+{ 
+public:
+   BOOST_STATIC_CONSTANT(
+       bool, value = sizeof(
+           ::boost::detail::is_array_helper2(
+               ::boost::detail::is_array_helper1(
+                   ::boost::type_traits::wrap<T>()))) == 1
+       );
+};
+
+template <> 
+struct is_array<void>
+{ 
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+# ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+template <> 
+struct is_array<const void>
+{ 
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <> 
+struct is_array<volatile void>
+{ 
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <> 
+struct is_array<const volatile void>
+{ 
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+# endif
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace boost
+
+#endif // BOOST_TT_ARRAY_TRAITS_HPP
index b3df3007f470f534852607ccf2949d3184c1bb12..4a4980ec2b212896307ee9da8cc611a7bd9363c5 100644 (file)
@@ -1,8 +1,9 @@
-//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-//  Permission to copy, use, modify, sell and
-//  distribute this software is granted provided this copyright notice appears
-//  in all copies. This software is provided "as is" without express or implied
-//  warranty, and with no claim as to its suitability for any purpose.
+//  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+//  Hinnant & John Maddock 2000.  Permission to copy, use, modify,
+//  sell and distribute this software is granted provided this
+//  copyright notice appears in all copies. This software is provided
+//  "as is" without express or implied warranty, and with no claim as
+//  to its suitability for any purpose.
 //
 //  See http://www.boost.org for most recent version including documentation.
 //
@@ -11,7 +12,7 @@
 //
 //    Fixed is_pointer, is_reference, is_const, is_volatile, is_same, 
 //    is_member_pointer based on the Simulated Partial Specialization work 
-//    of Mat Marcus and Jesse Jones. See       http://opensource.adobe.com or 
+//    of Mat Marcus and Jesse Jones. See  http://opensource.adobe.com or 
 //    http://groups.yahoo.com/group/boost/message/5441 
 //    Some workarounds in here use ideas suggested from "Generic<Programming>: 
 //    Mappings between Types and Values" 
 #define BOOST_COMPOSITE_TYPE_TRAITS_HPP
 
 #ifndef BOOST_ICE_TYPE_TRAITS_HPP
-#include <boost/type_traits/ice.hpp>
+# include <boost/type_traits/ice.hpp>
 #endif
 #ifndef BOOST_FWD_TYPE_TRAITS_HPP
-#include <boost/type_traits/fwd.hpp>
+# include <boost/type_traits/fwd.hpp>
 #endif
 #ifndef BOOST_CONVERSION_TYPE_TRAITS_HPP
-#include <boost/type_traits/conversion_traits.hpp>
+# include <boost/type_traits/conversion_traits.hpp>
 #endif
 #ifndef BOOST_CV_TYPE_TRAITS_HPP
-#include <boost/type_traits/cv_traits.hpp>
+# include <boost/type_traits/cv_traits.hpp>
 #endif
 #ifndef BOOST_ARITHMETIC_TYPE_TRAITS_HPP
-#include <boost/type_traits/arithmetic_traits.hpp>
+# include <boost/type_traits/arithmetic_traits.hpp>
 #endif
 #ifndef BOOST_TRANSFORM_TRAITS_HPP
-#include <boost/type_traits/transform_traits.hpp>
+# include <boost/type_traits/transform_traits.hpp>
 #endif
+#ifndef BOOST_TT_REFERENCE_TRAITS_HPP
+# include <boost/type_traits/reference_traits.hpp>
+#endif
+#ifndef BOOST_TT_ARRAY_TRAITS_HPP
+# include <boost/type_traits/array_traits.hpp>
+#endif 
+#ifndef BOOST_TYPE_TRAITS_IS_CLASS_HPP
+# include <boost/type_traits/is_class.hpp>
+#endif 
 
 namespace boost{
 
-/**********************************************
- *
- * is_array
- *
- **********************************************/
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-template <typename T> struct is_array
-{ BOOST_STATIC_CONSTANT(bool, value = false); };
-template <typename T, std::size_t N> struct is_array<T[N]>
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-template <typename T, std::size_t N> struct is_array<const T[N]>
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-template <typename T, std::size_t N> struct is_array<volatile T[N]>
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-template <typename T, std::size_t N> struct is_array<const volatile T[N]>
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 namespace detail{
+
    struct pointer_helper
    {
       pointer_helper(const volatile void*);
    };
-   yes_type is_pointer_helper(pointer_helper);
-   no_type is_pointer_helper(...);
+   yes_type BOOST_TT_DECL is_pointer_helper(pointer_helper);
+   no_type BOOST_TT_DECL is_pointer_helper(...);
 
-::boost::type_traits::no_type is_function_tester(...);
+::boost::type_traits::no_type BOOST_TT_DECL is_function_tester(...);
 template <class R>
 ::boost::type_traits::yes_type is_function_tester(R (*)(void));
 template <class R, class A0>
@@ -135,53 +130,22 @@ template <class R, class A0, class A1, class A2, class A3, class A4, class A5, c
 ::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28));
 template <class R, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28, class A29>
 ::boost::type_traits::yes_type is_function_tester(R (*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29));
-
-
-   yes_type is_array_helper(const volatile void*, const volatile void*);
-   template <class T>
-   no_type is_array_helper(T*const volatile*, const volatile void*);
-   no_type is_array_helper(...);
 } // namespace detail
-template <typename T> 
-struct is_array
-{ 
-private:
-   static T t;
-public:
-   BOOST_STATIC_CONSTANT(bool, value = 
-      (::boost::type_traits::ice_and<
-         (1 == sizeof(detail::is_array_helper(&t, t))),
-         ::boost::type_traits::ice_not<
-            ::boost::is_reference<T>::value>::value,
-         ::boost::type_traits::ice_not<
-            (1 == sizeof(detail::is_function_tester(t)))>::value
-      >::value));
-};
-template <> 
-struct is_array<void>
-{ 
-   BOOST_STATIC_CONSTANT(bool, value = false);
-};
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-template <> 
-struct is_array<const void>
-{ 
-   BOOST_STATIC_CONSTANT(bool, value = false);
-};
-template <> 
-struct is_array<volatile void>
-{ 
-   BOOST_STATIC_CONSTANT(bool, value = false);
-};
-template <> 
-struct is_array<const volatile void>
-{ 
-   BOOST_STATIC_CONSTANT(bool, value = false);
-};
-#endif
-
 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
+namespace detail
+{
+  // Utility metafunction which returns true if its argument is not an
+  // array and not a reference.
+  template <class T>
+  struct neither_array_nor_reference : ::boost::type_traits::ice_not<
+      ::boost::type_traits::ice_or<
+          ::boost::is_reference<T>::value
+        , ::boost::is_array<T>::value
+      >::value>
+  {};
+}
+
 /**********************************************
  *
  * is_pointer
@@ -203,26 +167,37 @@ template <typename T> struct is_pointer_helper<T*const volatile>
 template <typename T> struct is_pointer
 { BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_and< ::boost::detail::is_pointer_helper<T>::value, ::boost::type_traits::ice_not< ::boost::is_member_pointer<T>::value >::value >::value)); };
 #else
-template <typename T>
-struct is_pointer 
-{ 
-private:
-   static T t;
-public:
-   BOOST_STATIC_CONSTANT(bool, value =
-                (::boost::type_traits::ice_and<
-                  ::boost::type_traits::ice_not<
-                     ::boost::is_reference<T>::value
-                  >::value,
-                  ::boost::type_traits::ice_not<
-                     ::boost::is_array<T>::value
-                  >::value,
+
+namespace detail
+{
+  // is_pointer implementation
+  template <bool maybe = false>
+  struct is_pointer_select : ::boost::type_traits::false_unary_metafunction
+  {
+  };
+
+  template <>
+  struct is_pointer_select<true>
+  {
+      template <class T>
+      struct apply
+      {
+          static T& make_t();
+          BOOST_STATIC_CONSTANT(bool, value =
                   (::boost::type_traits::ice_or<
-                       (1 == sizeof(detail::is_pointer_helper(t))),
-                       (1 == sizeof(detail::is_function_tester(t)))
-                  >::value)
-                >::value ) );
-};
+                       (1 == sizeof(is_pointer_helper(make_t()))),
+                       (1 == sizeof(is_function_tester(make_t())))
+                   >::value));
+      };
+  };
+}
+
+template <typename T>
+struct is_pointer : ::boost::detail::is_pointer_select<
+    ::boost::detail::neither_array_nor_reference<T>::value
+>::template apply<T>
+{};
+
 template <>
 struct is_pointer <void>
 { 
@@ -247,65 +222,6 @@ struct is_pointer <const volatile void>
 #endif
 #endif
 
-/**********************************************
- *
- * is_reference
- *
- **********************************************/
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-template <typename T> struct is_reference 
-{ BOOST_STATIC_CONSTANT(bool, value = false); };
-template <typename T> struct is_reference<T&> 
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-#if defined(__BORLANDC__)
-// these are illegal specialisations; cv-qualifies applied to
-// references have no effect according to [8.3.2p1],
-// C++ Builder requires them though as it treats cv-qualified
-// references as distinct types...
-template <typename T> struct is_reference<T&const> 
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-template <typename T> struct is_reference<T&volatile> 
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-template <typename T> struct is_reference<T&const volatile> 
-{ BOOST_STATIC_CONSTANT(bool, value = true); };
-#endif
-#else
-# ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable: 4181)
-#endif // BOOST_MSVC
-template <typename T> struct is_reference
-{ 
-private:
-   typedef T const volatile cv_t;
-public:
-   BOOST_STATIC_CONSTANT(bool, value = 
-      (::boost::type_traits::ice_or<
-      ::boost::type_traits::ice_not<
-         ::boost::is_const<cv_t>::value
-      >::value, 
-      ::boost::type_traits::ice_not<
-         ::boost::is_volatile<cv_t>::value>::value
-      >::value));
-};
-template <> struct is_reference<void>
-{
-   BOOST_STATIC_CONSTANT(bool, value = false);
-};
-#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-template <> struct is_reference<const void>
-{ BOOST_STATIC_CONSTANT(bool, value = false); };
-template <> struct is_reference<volatile void>
-{ BOOST_STATIC_CONSTANT(bool, value = false); };
-template <> struct is_reference<const volatile void>
-{ BOOST_STATIC_CONSTANT(bool, value = false); };
-#endif
-
-# ifdef BOOST_MSVC
-#  pragma warning(pop)
-# endif // BOOST_MSVC
-#endif
-
 /**********************************************
  *
  * is_union
@@ -324,25 +240,90 @@ public:
  * is_enum
  *
  **********************************************/
-namespace detail{
-struct int_convertible
+namespace detail
 {
-   int_convertible(int);
-};
+  struct int_convertible
+  {
+      int_convertible(int);
+  };
+
+  // Don't evaluate convertibility to int_convertible unless the type
+  // is non-arithmetic. This suppresses warnings with GCC.
+  template <bool is_class_arithmetic_or_reference = true>
+  struct is_enum_helper
+  {
+      template <class T>
+      struct type
+      {
+          BOOST_STATIC_CONSTANT(bool, value = false);
+      };
+  };
+
+  template <>
+  struct is_enum_helper<false>
+  {
+      template <class T> 
+      struct type
+          : ::boost::is_convertible<T,::boost::detail::int_convertible>
+      {
+      };
+  };
 } // namespace detail
-#ifndef __BORLANDC__
+#if !(defined(__BORLANDC__) && (__BORLANDC__ <= 0x551))
 template <typename T> struct is_enum
 {
 private:
-   typedef typename ::boost::add_reference<T>::type r_type;
-public:
-   BOOST_STATIC_CONSTANT(bool, value =
-      (::boost::type_traits::ice_and<
-         ::boost::type_traits::ice_not< ::boost::is_arithmetic<T>::value>::value,
-         ::boost::type_traits::ice_not< ::boost::is_reference<T>::value>::value,
-         ::boost::is_convertible<r_type, detail::int_convertible>::value
+   typedef ::boost::add_reference<T> ar_t;
+   typedef typename ar_t::type r_type;
+       
+# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || BOOST_MSVC > 1301 || defined(BOOST_NO_COMPILER_CONFIG)
+   BOOST_STATIC_CONSTANT(bool, selector =
+      (::boost::type_traits::ice_or<
+           ::boost::is_arithmetic<T>::value
+         , ::boost::is_reference<T>::value
+       // We MUST do this on conforming compilers in order to
+       // correctly deduce that noncopyable types are not enums (dwa
+       // 2002/04/15)...
+         , ::boost::is_class<T>::value
+      >::value));
+# else 
+   BOOST_STATIC_CONSTANT(bool, selector =
+      (::boost::type_traits::ice_or<
+           ::boost::is_arithmetic<T>::value
+         , ::boost::is_reference<T>::value
+       // However, not doing this on non-conforming compilers prevents
+       // a dependency recursion.
       >::value));
+# endif
+#ifdef __BORLANDC__
+    typedef ::boost::detail::is_enum_helper< ::boost::is_enum<T>::selector> se_t;
+#else
+    typedef ::boost::detail::is_enum_helper<selector> se_t;
+#endif
+    typedef typename se_t::template type<r_type> helper;
+public:
+    BOOST_STATIC_CONSTANT(bool, value = helper::value);
+};
+
+// Specializations suppress some nasty warnings with GCC
+template<>
+struct is_enum<float>
+{
+    BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template<>
+struct is_enum<double>
+{
+    BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template<>
+struct is_enum<long double>
+{
+    BOOST_STATIC_CONSTANT(bool, value = false);
 };
+
 #else // __BORLANDC__
 //
 // buggy is_convertible prevents working 
@@ -359,170 +340,642 @@ public:
  * is_member_pointer
  *
  **********************************************/
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
 template <typename T> struct is_member_pointer
-{ BOOST_STATIC_CONSTANT(bool, value = false); };
+{ BOOST_STATIC_CONSTANT(bool, value = ::boost::is_member_function_pointer<T>::value); };
 template <typename T, typename U> struct is_member_pointer<U T::*>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
-#ifdef __GNUC__
-// gcc workaround (JM 02 Oct 2000)
+
+/**********************************************
+ *
+ * is_member_function_pointer
+ *
+ **********************************************/
+template <typename T>
+struct is_member_function_pointer{ BOOST_STATIC_CONSTANT(bool, value = false); };
+
 template <class R, class T>
-struct is_member_pointer<R (T::*)(void)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(void)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0>
-struct is_member_pointer<R (T::*)(A0)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1>
-struct is_member_pointer<R (T::*)(A0, A1)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2>
-struct is_member_pointer<R (T::*)(A0, A1, A2)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
-struct is_member_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
-#endif
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+
+// Metrowerks thinks this creates ambiguities
+# if !defined(__MWERKS__) || __MWERKS__ >= 0x3000
+
+template <class R, class T>
+struct is_member_function_pointer<R (T::*)(void)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0>
+struct is_member_function_pointer<R (T::*)(A0)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1>
+struct is_member_function_pointer<R (T::*)(A0, A1)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)const>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+
+template <class R, class T>
+struct is_member_function_pointer<R (T::*)(void)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0>
+struct is_member_function_pointer<R (T::*)(A0)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1>
+struct is_member_function_pointer<R (T::*)(A0, A1)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+
+template <class R, class T>
+struct is_member_function_pointer<R (T::*)(void)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0>
+struct is_member_function_pointer<R (T::*)(A0)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1>
+struct is_member_function_pointer<R (T::*)(A0, A1)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
+struct is_member_function_pointer<R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28)const volatile>{ BOOST_STATIC_CONSTANT(bool, value = true); };
+
+# endif // __MWERKS__ < 0x3000
 #else
+
 namespace detail{
 template <class R, class T>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(void));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void));
+template <class R, class T, class A0>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0));
+template <class R, class T, class A0, class A1>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1));
+template <class R, class T, class A0, class A1, class A2>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2));
+template <class R, class T, class A0, class A1, class A2, class A3>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28));
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28, class A29>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29));
+
+template <class R, class T>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void) const);
+template <class R, class T, class A0>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0) const);
+template <class R, class T, class A0, class A1>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1) const);
+template <class R, class T, class A0, class A1, class A2>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2) const);
+template <class R, class T, class A0, class A1, class A2, class A3>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28) const);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28, class A29>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) const);
+
+template <class R, class T>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void) volatile);
 template <class R, class T, class A0>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0) volatile);
 template <class R, class T, class A0, class A1>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1) volatile);
 template <class R, class T, class A0, class A1, class A2>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28));
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28) volatile);
 template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28, class A29>
-::boost::type_traits::yes_type is_member_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29));
-   no_type is_member_pointer_helper(...);
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) volatile);
+
+template <class R, class T>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(void) const volatile);
+template <class R, class T, class A0>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0) const volatile);
+template <class R, class T, class A0, class A1>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1) const volatile);
+template <class R, class T, class A0, class A1, class A2>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28) const volatile);
+template <class R, class T, class A0, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11, class A12, class A13, class A14, class A15, class A16, class A17, class A18, class A19, class A20, class A21, class A22, class A23, class A24, class A25, class A26, class A27, class A28, class A29>
+::boost::type_traits::yes_type is_member_function_pointer_helper(R (T::*)(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29) const volatile);
+::boost::type_traits::no_type BOOST_TT_DECL is_member_function_pointer_helper(...);
+
+template <class R, class T>
+::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_helper(R T::*);
+::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_helper(...);
+
 }
-template <typename T> 
-struct is_member_pointer
-{ 
-private:
-   static T t;
-public:
-   BOOST_STATIC_CONSTANT(bool, value = (1 == sizeof(detail::is_member_pointer_helper(t))) );
+
+namespace detail
+{
+  template <bool maybe = false>
+  struct is_member_function_pointer_select
+      : ::boost::type_traits::false_unary_metafunction
+  {
+  };
+
+  template <>
+  struct is_member_function_pointer_select<true>
+  {
+      template <class T>
+      struct apply
+      {
+          static T& make_t();
+
+          BOOST_STATIC_CONSTANT(
+              bool, value = (1 == sizeof(detail::is_member_function_pointer_helper(make_t()))) );
+      };
+  };
+}
+
+template <typename T>
+struct is_member_function_pointer : ::boost::detail::is_member_function_pointer_select<
+    ::boost::detail::neither_array_nor_reference<T>::value
+>::template apply<T>
+{};
+
+template <>
+struct is_member_function_pointer<void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+template <>
+struct is_member_function_pointer<const void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
 };
 template <> 
-struct is_member_pointer<void>
+struct is_member_function_pointer<volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <>
+struct is_member_function_pointer<const volatile void>
 { 
    BOOST_STATIC_CONSTANT(bool, value = false);
 };
+#endif
+#ifdef __BORLANDC__
+template <typename T> struct is_member_pointer
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+template <typename T, typename U> struct is_member_pointer<U T::*>
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+#else
+
+namespace detail
+{
+  template <bool maybe = false>
+  struct is_member_pointer_select
+      : ::boost::type_traits::false_unary_metafunction
+  {
+  };
+
+  template <>
+  struct is_member_pointer_select<true>
+  {
+      template <class T>
+      struct apply
+      {
+          static T& make_t();
+
+          BOOST_STATIC_CONSTANT(
+             bool, value = 
+               (::boost::type_traits::ice_or<
+                  (1 == sizeof(detail::is_member_function_pointer_helper(make_t()))),
+                  (1 == sizeof(detail::is_member_pointer_helper(make_t())))
+                >::value) );
+      };
+  };
+}
+
+template <typename T>
+struct is_member_pointer : ::boost::detail::is_member_pointer_select<
+    ::boost::detail::neither_array_nor_reference<T>::value
+>::template apply<T>
+{};
+
+template <>
+struct is_member_pointer<void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
-template <> 
+template <>
 struct is_member_pointer<const void>
-{ 
+{
    BOOST_STATIC_CONSTANT(bool, value = false);
 };
 template <> 
 struct is_member_pointer<volatile void>
-{ 
+{
    BOOST_STATIC_CONSTANT(bool, value = false);
 };
-template <> 
+template <>
 struct is_member_pointer<const volatile void>
 { 
    BOOST_STATIC_CONSTANT(bool, value = false);
 };
 #endif
+#endif // __BORLANDC__
 
 #endif
 
@@ -530,7 +983,7 @@ struct is_member_pointer<const volatile void>
 } // namespace boost
 
 #endif // BOOST_COMPOSITE_TYPE_TRAITS_HPP
+
 
 
 
index aceeec4c22e725c86fb0b68797c9e44562bd696c..d8c019875607272291946e07ceb937036162d4e8 100644 (file)
@@ -54,8 +54,8 @@ namespace detail{
   struct from_not_void_conversion {
     template <class From, class To>
     struct n_bind {
-      static no_type _m_check(...);
-      static yes_type _m_check(To);
+      static no_type BOOST_TT_DECL _m_check(...);
+      static yes_type BOOST_TT_DECL _m_check(To);
     public:
       void foo(); // avoid warning about all members being private
       static From _m_from;
@@ -83,7 +83,7 @@ template <class From, class To>
 struct is_convertible
 {
  typedef typename detail::conversion_helper<From>::type Selector;
- typedef Selector::template n_bind<From,To> Conversion;
+ typedef typename Selector::template n_bind<From,To> Conversion;
 public:
  enum { value = Conversion::exists };
 };
@@ -95,49 +95,24 @@ public:
 // UDT conversions:
 //
 template <class From, class To>
-struct is_convertible_helper
+struct is_convertible
 {
 private:
+#pragma option push -w-8074
    // This workaround for Borland breaks the EDG C++ frontend,
    // so we only use it for Borland.
    template <class T>
    struct checker
    {
-      static type_traits::no_type _m_check(...);
-      static type_traits::yes_type _m_check(T);
+      static type_traits::no_type BOOST_TT_DECL _m_check(...);
+      static type_traits::yes_type BOOST_TT_DECL _m_check(T);
    };
    static From _m_from;
 public:
    static const bool value = sizeof( checker<To>::_m_check(_m_from) ) == sizeof(type_traits::yes_type);
 
    void foo(); // avoid warning about all members being private
-};
-
-template <class From, class To>
-struct is_convertible
-{
-private:
-   typedef is_convertible_helper<From, To> c_type;
-   enum{ v = c_type::value };
-   char force_it[v ? 1 : 2];
-public:
-   static const bool value = is_convertible_helper<From, To>::value;
-};
-
-template <class From>
-struct is_convertible<From, void>
-{
-   static const bool value = false;
-};
-template <class To>
-struct is_convertible<void, To>
-{
-   static const bool value = false;
-};
-template <>
-struct is_convertible<void, void>
-{
-   static const bool value = true;
+#pragma option pop
 };
 
 #elif defined(__GNUC__)
@@ -170,57 +145,181 @@ public:
    void foo(); // avoid warning about all members being private
 };
 
-template <class From>
-struct is_convertible<From, void>
-{
-   static const bool value = false;
-};
-template <class To>
-struct is_convertible<void, To>
-{
-   static const bool value = false;
-};
-template <>
-struct is_convertible<void, void>
-{
-   static const bool value = true;
-};
+// Declare specializations of is_convertible for all of the floating
+// types to all of the integral types. This suppresses some nasty
+// warnings
+
+# define BOOST_IS_CONVERTIBLE(T1,T2) template<>struct is_convertible<T1,T2>{static const bool value=true;};
+# define BOOST_IS_CONVERTIBLE2(T1,T2)        \
+        BOOST_IS_CONVERTIBLE(T1,signed T2)   \
+        BOOST_IS_CONVERTIBLE(T1,unsigned T2)
+            
+# define BOOST_FLOAT_IS_CONVERTIBLE(F)  \
+   BOOST_IS_CONVERTIBLE(F,char)         \
+   BOOST_IS_CONVERTIBLE2(F,char)        \
+   BOOST_IS_CONVERTIBLE2(F,short)       \
+   BOOST_IS_CONVERTIBLE2(F,int)         \
+   BOOST_IS_CONVERTIBLE2(F,long)        \
+   BOOST_IS_CONVERTIBLE2(F,long long)
 
+BOOST_FLOAT_IS_CONVERTIBLE(float)
+BOOST_FLOAT_IS_CONVERTIBLE(double)
+BOOST_FLOAT_IS_CONVERTIBLE(long double)
+BOOST_FLOAT_IS_CONVERTIBLE(float const)
+BOOST_FLOAT_IS_CONVERTIBLE(double const)
+BOOST_FLOAT_IS_CONVERTIBLE(long double const)
+BOOST_FLOAT_IS_CONVERTIBLE(float volatile)
+BOOST_FLOAT_IS_CONVERTIBLE(double volatile)
+BOOST_FLOAT_IS_CONVERTIBLE(long double volatile)
+BOOST_FLOAT_IS_CONVERTIBLE(float const volatile)
+BOOST_FLOAT_IS_CONVERTIBLE(double const volatile)
+BOOST_FLOAT_IS_CONVERTIBLE(long double const volatile)
+# undef BOOST_FLOAT_IS_CONVERTIBLE
+# undef BOOST_IS_CONVERTIBLE2
+# undef BOOST_IS_CONVERTIBLE
 #else
 
 template <class From, class To>
 struct is_convertible
 {
 private:
-   static type_traits::no_type _m_check(...);
-   static type_traits::yes_type _m_check(To);
+   static type_traits::no_type BOOST_TT_DECL _m_check(...);
+   static type_traits::yes_type BOOST_TT_DECL _m_check(To);
    static From _m_from;
 public:
    BOOST_STATIC_CONSTANT(bool, value = sizeof( _m_check(_m_from) ) == sizeof(type_traits::yes_type));
    void foo(); // avoid warning about all members being private
 };
 
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+//  A definition is required even for integral static constants
+template <class From, class To>
+const bool is_convertible<From, To>::value;
+#endif
+
+
+#endif // is_convertible
+
+//
+// Now add the full and partial specialisations
+// for void types, these are common to all the
+// implementation above:
+//
 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 template <class From>
 struct is_convertible<From, void>
 {
    BOOST_STATIC_CONSTANT(bool, value = false);
 };
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+template <class From>
+struct is_convertible<From, const void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <class From>
+struct is_convertible<From, volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <class From>
+struct is_convertible<From, const volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+#endif // BOOST_NO_CV_VOID_SPECIALIZATIONS
 
 template <class To>
 struct is_convertible<void, To>
 {
    BOOST_STATIC_CONSTANT(bool, value = false);
 };
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+template <class To>
+struct is_convertible<const void, To>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <class To>
+struct is_convertible<volatile void, To>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <class To>
+struct is_convertible<const volatile void, To>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+#endif
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
 template <>
 struct is_convertible<void, void>
 {
    BOOST_STATIC_CONSTANT(bool, value = true);
 };
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-#endif // is_convertible
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+template <>
+struct is_convertible<void, const void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<void, volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<void, const volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<const void, const void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<const void, volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<const void, const volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<volatile void, const void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<volatile void, volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<volatile void, const volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<const volatile void, const void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<const volatile void, volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <>
+struct is_convertible<const volatile void, const volatile void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = true);
+};
+#endif
 
 } // namespace boost
 
index 587882817d04ccd83b6d0643cd7ff8b3798a0400..b10eac689b7450e746e680ee064808453c7f35d8 100644 (file)
@@ -1,8 +1,9 @@
-//  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
-//  Permission to copy, use, modify, sell and
-//  distribute this software is granted provided this copyright notice appears
-//  in all copies. This software is provided "as is" without express or implied
-//  warranty, and with no claim as to its suitability for any purpose.
+//  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+//  Hinnant & John Maddock 2000.  Permission to copy, use, modify,
+//  sell and distribute this software is granted provided this
+//  copyright notice appears in all copies. This software is provided
+//  "as is" without express or implied warranty, and with no claim as
+//  to its suitability for any purpose.
 //
 //  See http://www.boost.org for most recent version including documentation.
 //
 #ifndef BOOST_FWD_TYPE_TRAITS_HPP
 #include <boost/type_traits/fwd.hpp>
 #endif
+#ifndef BOOST_TT_REFERENCE_TRAITS_HPP
+# include <boost/type_traits/reference_traits.hpp>
+#endif
+#ifndef BOOST_TT_ARRAY_TRAITS_HPP
+# include <boost/type_traits/array_traits.hpp>
+#endif
+#ifndef BOOST_TT_UTILITY_HPP
+# include <boost/type_traits/utility.hpp>
+#endif 
 
 namespace boost{
 
@@ -179,13 +189,47 @@ namespace detail{
    no_type is_volatile_helper(const void *);
 }
 
+namespace detail
+{
+  template <bool is_ref = true, bool array>
+  struct is_const_impl
+      : ::boost::type_traits::false_unary_metafunction
+  {};
+
+  template <>
+  struct is_const_impl<false,false>
+  {
+      template <class T>
+      struct apply
+      {
+       private:
+          static T* t;
+       public:
+          BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(t))));
+      };      
+  };
+
+  template <>
+  struct is_const_impl<false,true>
+  {
+      template <class T>
+      struct apply
+      {
+       private:
+          static T t;
+       public:
+          BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(&t))));
+      };      
+  };
+}
+
 template <typename T>
 struct is_const
+    : ::boost::detail::is_const_impl<
+          is_reference<T>::value
+        , is_array<T>::value
+     >::template apply<T>
 { 
-private:
-   static T t;
-public:
-   BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_const_helper(&t))));
 };
 
 template <>
@@ -211,15 +255,50 @@ struct is_const<const volatile void>
 };
 #endif
 
+namespace detail
+{
+  template <bool is_ref = true, bool array>
+  struct is_volatile_impl
+      : ::boost::type_traits::false_unary_metafunction
+  {};
+
+  template <>
+  struct is_volatile_impl<false,false>
+  {
+      template <class T>
+      struct apply
+      {
+       private:
+          static T* t;
+       public:
+          BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(t))));
+      };      
+  };
+
+  template <>
+  struct is_volatile_impl<false,true>
+  {
+      template <class T>
+      struct apply
+      {
+       private:
+          static T t;
+       public:
+          BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(&t))));
+      };      
+  };
+}
+
 template <typename T>
 struct is_volatile
-{
-private:
-   static T t;
-public:
-   BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) == sizeof(detail::is_volatile_helper(&t))));
+    : ::boost::detail::is_volatile_impl<
+          is_reference<T>::value
+        , is_array<T>::value
+     >::template apply<T>
+{ 
 };
 
+
 template <>
 struct is_volatile<void>
 {
@@ -252,7 +331,17 @@ struct is_volatile<const volatile void>
 template <typename T>
 struct add_const
 {
+#if defined(BOOST_MSVC)
+    // This bogus warning will appear when add_const is applied to a
+    // const volatile reference because we can't detect const volatile
+    // references with MSVC6.
+# pragma warning(push)
+# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
+#endif 
    typedef T const type;
+#if defined(BOOST_MSVC)
+# pragma warning(pop)
+#endif 
 };
 // * convert a type T to volatile type - add_volatile<T>
 // this is not required since the result is always
@@ -261,13 +350,44 @@ struct add_const
 template <typename T>
 struct add_volatile
 {
+#if defined(BOOST_MSVC)
+    // This bogus warning will appear when add_volatile is applied to a
+    // const volatile reference because we can't detect const volatile
+    // references with MSVC6.
+# pragma warning(push)
+# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
+#endif 
    typedef T volatile type;
+#if defined(BOOST_MSVC)
+# pragma warning(pop)
+#endif 
+};
+// * convert a type T to a const volatile type - add_cv<T>
+// this is not required since the result is always
+// the same as "T const volatile", but it does suppress warnings
+// from some compilers:
+template <typename T>
+struct add_cv
+{
+#if defined(BOOST_MSVC)
+    // This bogus warning will appear when add_volatile is applied to a
+    // const volatile reference because we can't detect const volatile
+    // references with MSVC6.
+# pragma warning(push)
+# pragma warning(disable:4181) // warning C4181: qualifier applied to reference type ignored
+#endif 
+   typedef T const volatile type;
+#if defined(BOOST_MSVC)
+# pragma warning(pop)
+#endif 
 };
 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 template <class T>
 struct add_const<T&>{ typedef T& type; };
 template <class T>
 struct add_volatile<T&>{ typedef T& type; };
+template <class T>
+struct add_cv<T&>{ typedef T& type; };
 #endif
 
 } // namespace boost
index b336c789ccb1c0b2bde305739514e0190d7e97c0..df098456ee298f8ee8c867b0023de5a205593fda 100644 (file)
 #endif
 //
 // is a type a function?
+// Please note that this implementation is unnecessarily complex:
+// we could just use !is_convertible<T*, const volatile void*>::value,
+// except that some compilers erroneously allow conversions from
+// function pointers to void*.
 //
 namespace boost{
 namespace detail{
@@ -103,6 +107,7 @@ struct is_function_helper
 {
    static T* t;
    BOOST_STATIC_CONSTANT(bool, value = sizeof(is_function_tester(t)) == sizeof(::boost::type_traits::yes_type));
+   //BOOST_STATIC_CONSTANT(bool, value = (!::boost::is_convertible<T*, const volatile void*>::value));
 };
 
 #endif
index 660fdf9e37741560d1b4c0c791e35cfa182f5bf0..c58dd9c484def13e189bd6163d01920638dba2ef 100644 (file)
 // BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy
 // BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
 
-#define BOOST_IS_CLASS(T) false
-#define BOOST_IS_ENUM(T) false
-#define BOOST_IS_UNION(T) false
-#define BOOST_IS_POD(T) false
-#define BOOST_IS_EMPTY(T) false
-#define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
-#define BOOST_HAS_TRIVIAL_COPY(T) false
-#define BOOST_HAS_TRIVIAL_ASSIGN(T) false
-#define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
+#ifdef BOOST_HAS_SGI_TYPE_TRAITS
+#  define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits<T>::is_POD_type, ::__true_type>::value
+#  define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_default_constructor, ::__true_type>::value
+#  define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_copy_constructor, ::__true_type>::value
+#  define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_assignment_operator, ::__true_type>::value
+#  define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_destructor, ::__true_type>::value
+#endif
+
+#ifndef BOOST_IS_CLASS
+#  define BOOST_IS_CLASS(T) false
+#endif
+
+#ifndef BOOST_IS_ENUM
+#  define BOOST_IS_ENUM(T) false
+#endif
+
+#ifndef BOOST_IS_UNION
+#  define BOOST_IS_UNION(T) false
+#endif
+
+#ifndef BOOST_IS_POD
+#  define BOOST_IS_POD(T) false
+#endif
+
+#ifndef BOOST_IS_EMPTY
+#  define BOOST_IS_EMPTY(T) false
+#endif
+
+#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR
+#  define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
+#endif
+
+#ifndef BOOST_HAS_TRIVIAL_COPY
+#  define BOOST_HAS_TRIVIAL_COPY(T) false
+#endif
+
+#ifndef BOOST_HAS_TRIVIAL_ASSIGN
+#  define BOOST_HAS_TRIVIAL_ASSIGN(T) false
+#endif
+
+#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR
+#  define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
+#endif
+
+//
+// whenever we have a conversion function with elipses
+// it needs to be declared __cdecl to suppress compiler
+// warnings from MS and Borland compilers:
+#if defined(BOOST_MSVC) || defined(__BORLANDC__)
+#define BOOST_TT_DECL __cdecl
+#else
+#define BOOST_TT_DECL
+#endif
 
 
 namespace boost{
@@ -79,6 +123,12 @@ template <class T>
 struct remove_volatile;
 template <class T>
 struct remove_cv;
+template <class T>
+struct add_const;
+template <class T>
+struct add_volatile;
+template <class T>
+struct add_cv;
 
 // composite_traits.hpp:
 template <class T>
@@ -90,6 +140,8 @@ struct is_reference;
 template <class T>
 struct is_member_pointer;
 template <class T>
+struct is_member_function_pointer;
+template <class T>
 struct is_enum;
 template <class T>
 struct is_union;
@@ -114,7 +166,15 @@ struct has_trivial_assign;
 template <class T>
 struct has_trivial_destructor;
 template <class T>
+struct has_nothrow_constructor;
+template <class T>
+struct has_nothrow_copy;
+template <class T>
+struct has_nothrow_assign;
+template <class T>
 struct is_empty;
+template <class Base, class Derived>
+struct is_base_and_derived;
 
 // transform_traits.hpp:
 template <class T>
diff --git a/boost/boost/type_traits/is_class.hpp b/boost/boost/type_traits/is_class.hpp
new file mode 100644 (file)
index 0000000..4dceaf2
--- /dev/null
@@ -0,0 +1,49 @@
+//  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
+//  Hinnant & John Maddock 2000-2002.  Permission to copy, use,
+//  modify, sell and distribute this software is granted provided this
+//  copyright notice appears in all copies. This software is provided
+//  "as is" without express or implied warranty, and with no claim as
+//  to its suitability for any purpose.
+//
+//  See http://www.boost.org for most recent version including documentation.
+//
+#ifndef BOOST_TYPE_TRAITS_IS_CLASS_HPP
+# define BOOST_TYPE_TRAITS_IS_CLASS_HPP
+
+# if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || defined(BOOST_MSVC) && _MSC_FULL_VER > 13012108 || defined(BOOST_NO_COMPILER_CONFIG)
+# ifndef BOOST_ICE_TYPE_TRAITS_HPP
+#  include <boost/type_traits/ice.hpp>
+# endif
+
+# define BOOST_TYPE_TRAITS_IS_CLASS_DEFINED
+namespace boost {
+
+template <typename T>
+struct is_class
+{
+    // This is actually the conforming implementation which works with
+    // abstract classes.  However, enough compilers have trouble with
+    // it that most will use the one in
+    // boost/type_traits/object_traits.hpp. This implementation
+    // actually works with VC7.0, but other interactions seem to fail
+    // when we use it.
+
+// is_class<> metafunction due to Paul Mensonides
+// (leavings@attbi.com). For more details:
+// http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
+ private:
+    template <class U> static ::boost::type_traits::yes_type is_class_helper(void(U::*)(void));
+    template <class U> static ::boost::type_traits::no_type is_class_helper(...);
+ public:
+    BOOST_STATIC_CONSTANT(
+        bool, value = sizeof(
+            is_class_helper<T>(0)
+            ) == sizeof(::boost::type_traits::yes_type));
+};
+}
+
+# else // nonconforming compilers will use a different impelementation, in object_traits.hpp
+
+# endif // nonconforming implementations
+
+#endif // BOOST_TYPE_TRAITS_IS_CLASS_HPP
index 36e2ad921e0745df78321902ca28a6735d6b6e71..4386e9cfbd0f92228e76c40c17d79c42fe1c26ae 100644 (file)
 #ifndef BOOST_FUNCTION_TYPE_TRAITS_HPP
 #include <boost/type_traits/function_traits.hpp>
 #endif
+#ifndef BOOST_TYPE_TRAITS_IS_CLASS_HPP
+# include <boost/type_traits/is_class.hpp>
+#endif 
+
+#ifdef BOOST_HAS_SGI_TYPE_TRAITS
+#  include <type_traits.h>
+#  include <boost/type_traits/same_traits.hpp>
+#endif
 
 namespace boost{
 
@@ -74,6 +82,8 @@ struct is_scalar
       >::value));
 };
 
+# ifndef BOOST_TYPE_TRAITS_IS_CLASS_DEFINED
+// conforming compilers use the implementation in <boost/type_traits/is_class.hpp>
 /**********************************************
  *
  * is_class
@@ -82,7 +92,8 @@ struct is_scalar
 template <typename T>
 struct is_class
 {
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#  ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
    BOOST_STATIC_CONSTANT(bool, value =
       (::boost::type_traits::ice_and<
          ::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value,
@@ -92,7 +103,7 @@ struct is_class
          ::boost::type_traits::ice_not< ::boost::is_void<T>::value >::value,
          ::boost::type_traits::ice_not< ::boost::is_function<T>::value >::value
       >::value));
-#else
+#  else
    BOOST_STATIC_CONSTANT(bool, value =
       (::boost::type_traits::ice_and<
          ::boost::type_traits::ice_not< ::boost::is_union<T>::value >::value,
@@ -101,9 +112,9 @@ struct is_class
          ::boost::type_traits::ice_not< ::boost::is_reference<T>::value>::value,
          ::boost::type_traits::ice_not< ::boost::is_void<T>::value >::value
       >::value));
-#endif
+#  endif
 };
-
+# endif // nonconforming implementations
 /**********************************************
  *
  * is_compound
@@ -128,21 +139,98 @@ template <typename T> struct is_compound
  * is_POD
  *
  **********************************************/
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 template <typename T> struct is_POD
 { 
-   BOOST_STATIC_CONSTANT(bool, value =
-      (::boost::type_traits::ice_or<
+    BOOST_STATIC_CONSTANT(
+        bool, value =
+        (::boost::type_traits::ice_or<
          ::boost::is_scalar<T>::value,
          ::boost::is_void<T>::value,
          BOOST_IS_POD(T)
-      >::value));
+         >::value));
 };
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
 template <typename T, std::size_t sz>
 struct is_POD<T[sz]>
 {
    BOOST_STATIC_CONSTANT(bool, value = ::boost::is_POD<T>::value);
 };
+#else
+namespace detail
+{
+  template <bool is_array = false> struct is_POD_helper;
+}
+
+template <typename T> struct is_POD
+{ 
+   BOOST_STATIC_CONSTANT(
+       bool, value = (
+           ::boost::detail::is_POD_helper<
+              ::boost::is_array<T>::value
+           >::template apply<T>::value
+           )
+       );
+};
+
+namespace detail
+{
+  template <bool is_array>
+  struct is_POD_helper
+  {
+      template <typename T> struct apply
+      {
+          BOOST_STATIC_CONSTANT(
+              bool, value =
+              (::boost::type_traits::ice_or<
+               ::boost::is_scalar<T>::value,
+               ::boost::is_void<T>::value,
+               BOOST_IS_POD(T)
+               >::value));
+      };
+  };
+
+  template <bool b>
+  struct bool_to_type
+  {
+      typedef ::boost::type_traits::no_type type;
+  };
+
+  template <>
+  struct bool_to_type<true>
+  {
+      typedef ::boost::type_traits::yes_type type;
+  };
+  
+  template <class ArrayType>
+  struct is_POD_array_helper
+  {
+      typedef
+#if !defined(__BORLANDC__) || __BORLANDC__ > 0x551
+      typename
+#endif 
+      ::boost::detail::bool_to_type<(::boost::is_POD<ArrayType>::value)>::type type;
+      
+      type instance() const;
+  };
+  
+  template <class T>
+  is_POD_array_helper<T> is_POD_array(T*);
+
+  template <>
+  struct is_POD_helper<true>
+  {
+      template <typename T> struct apply
+      {
+          static T& help();
+
+          BOOST_STATIC_CONSTANT(
+              bool, value =
+              sizeof(is_POD_array(help()).instance()) == sizeof(::boost::type_traits::yes_type));
+      };
+  };
+}
 #endif
 
 /**********************************************
@@ -214,31 +302,102 @@ struct has_trivial_destructor
 
 /**********************************************
  *
- * is_empty
+ * has_nothrow_constructor
  *
  **********************************************/
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-namespace detail{
-
 template <typename T>
-struct empty_helper_t1 : public T
+struct has_nothrow_constructor
 {
-#ifdef __MWERKS__
-   empty_helper_t1();  // hh compiler bug workaround
-#endif
-   int i[256];
+   BOOST_STATIC_CONSTANT(bool, value =
+      (::boost::has_trivial_constructor<T>::value));
 };
-struct empty_helper_t2 { int i[256]; };
 
-template <typename T, bool b, bool b2>
-struct empty_helper{ BOOST_STATIC_CONSTANT(bool, value = false); };
+/**********************************************
+ *
+ * has_nothrow_copy
+ *
+ **********************************************/
+template <typename T>
+struct has_nothrow_copy
+{
+   BOOST_STATIC_CONSTANT(bool, value =
+      (::boost::has_trivial_copy<T>::value));
+};
 
+/**********************************************
+ *
+ * has_nothrow_assign
+ *
+ **********************************************/
 template <typename T>
-struct empty_helper<T, true, false>
+struct has_nothrow_assign
 {
    BOOST_STATIC_CONSTANT(bool, value =
-      (sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2)));
+      (::boost::has_trivial_assign<T>::value));
+};
+
+/**********************************************
+ *
+ * is_empty
+ *
+ **********************************************/
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+namespace detail
+{
+  template <typename T>
+  struct empty_helper_t1 : public T
+  {
+//#ifdef __MWERKS__
+      empty_helper_t1();  // hh compiler bug workaround
+//#endif
+      int i[256];
+  };
+  struct empty_helper_t2 { int i[256]; };
+}
+
+# ifndef __BORLANDC__
+namespace detail
+{
+  template <typename T, bool is_a_class = false>
+  struct empty_helper{ BOOST_STATIC_CONSTANT(bool, value = false); };
+
+  template <typename T>
+  struct empty_helper<T, true>
+  {
+      BOOST_STATIC_CONSTANT(
+          bool, value = (sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2)));
+  };
+}
+
+template <typename T>
+struct is_empty
+{
+ private:
+    typedef typename remove_cv<T>::type cvt;
+    
+ public:
+    BOOST_STATIC_CONSTANT(
+        bool, value = (
+            ::boost::type_traits::ice_or<
+              ::boost::detail::empty_helper<T,::boost::is_class<T>::value>::value
+              , BOOST_IS_EMPTY(cvt)
+            >::value
+            ));
 };
+
+# else // __BORLANDC__
+
+namespace detail
+{
+  template <typename T, bool is_a_class, bool convertible_to_int>
+  struct empty_helper{ BOOST_STATIC_CONSTANT(bool, value = false); };
+
+  template <typename T>
+  struct empty_helper<T, true, false>
+  {
+      BOOST_STATIC_CONSTANT(bool, value =
+                            (sizeof(empty_helper_t1<T>) == sizeof(empty_helper_t2)));
+  };
 }
 
 template <typename T>
@@ -248,24 +407,28 @@ private:
    typedef typename remove_cv<T>::type cvt;
    typedef typename add_reference<T>::type r_type;
 public:
-   BOOST_STATIC_CONSTANT(bool, value =
-      (::boost::type_traits::ice_or<
-         ::boost::detail::empty_helper<T,
-            ::boost::is_class<T>::value ,
-            ::boost::is_convertible< r_type,int>::value
-         >::value,
-         BOOST_IS_EMPTY(cvt)
-      >::value));
+   BOOST_STATIC_CONSTANT(
+       bool, value = (
+           ::boost::type_traits::ice_or<
+              ::boost::detail::empty_helper<
+                  T
+                , ::boost::is_class<T>::value
+                , ::boost::is_convertible< r_type,int>::value
+              >::value
+              , BOOST_IS_EMPTY(cvt)
+           >::value));
 };
+# endif // __BORLANDC__
 
 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-#if defined(BOOST_MSVC6_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATES)
+#ifdef BOOST_MSVC6_MEMBER_TEMPLATES
 
 namespace detail{
 
 template <typename T>
 struct empty_helper_t1 : public T
 {
+   empty_helper_t1();
    int i[256];
 };
 struct empty_helper_t2 { int i[256]; };
@@ -335,10 +498,58 @@ public:
 #else
 template <typename T> struct is_empty
 { enum{ value = BOOST_IS_EMPTY(T) }; };
-#endif  // defined(BOOST_MSVC6_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATES)
+#endif  // BOOST_MSVC6_MEMBER_TEMPLATES
 
 #endif  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
+/**********************************************
+ *
+ * is_stateless
+ *
+ **********************************************/
+template <typename T>
+struct is_stateless
+{
+  BOOST_STATIC_CONSTANT(bool, value = 
+    (::boost::type_traits::ice_and<
+       ::boost::has_trivial_constructor<T>::value,
+       ::boost::has_trivial_copy<T>::value,
+       ::boost::has_trivial_destructor<T>::value,
+       ::boost::is_class<T>::value,
+       ::boost::is_empty<T>::value
+     >::value));
+};
+
+template <class Base, class Derived>
+struct is_base_and_derived
+{
+   BOOST_STATIC_CONSTANT(bool, value =
+      (::boost::type_traits::ice_and<
+         ::boost::is_convertible<Derived*,Base*>::value,
+         ::boost::is_class<Derived>::value,
+         ::boost::is_class<Base>::value
+      >::value)
+   );
+};
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <class Base, class Derived>
+struct is_base_and_derived<Base&, Derived>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <class Base, class Derived>
+struct is_base_and_derived<Base, Derived&>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+template <class Base, class Derived>
+struct is_base_and_derived<Base&, Derived&>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+#endif
+
 } // namespace boost
 
 #endif // BOOST_OBJECT_TYPE_TRAITS_HPP
@@ -348,3 +559,4 @@ template <typename T> struct is_empty
 
 
 
+
diff --git a/boost/boost/type_traits/reference_traits.hpp b/boost/boost/type_traits/reference_traits.hpp
new file mode 100644 (file)
index 0000000..b9df72a
--- /dev/null
@@ -0,0 +1,90 @@
+//  (C) Copyright David Abrahams Steve Cleary, Beman Dawes, Howard
+//  Hinnant & John Maddock 2000-2002.  Permission to copy, use,
+//  modify, sell and distribute this software is granted provided this
+//  copyright notice appears in all copies. This software is provided
+//  "as is" without express or implied warranty, and with no claim as
+//  to its suitability for any purpose.
+//
+//  See http://www.boost.org for most recent version including documentation.
+//
+#ifndef BOOST_TT_REFERENCE_TRAITS_HPP
+# define BOOST_TT_REFERENCE_TRAITS_HPP
+
+# ifndef BOOST_TT_UTILITY_HPP
+#  include <boost/type_traits/utility.hpp>
+# endif // BOOST_TT_UTILITY_HPP
+
+namespace boost { 
+
+/**********************************************
+ *
+ * is_reference
+ *
+ **********************************************/
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <typename T> struct is_reference 
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+template <typename T> struct is_reference<T&> 
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+#if defined(__BORLANDC__)
+// these are illegal specialisations; cv-qualifies applied to
+// references have no effect according to [8.3.2p1],
+// C++ Builder requires them though as it treats cv-qualified
+// references as distinct types...
+template <typename T> struct is_reference<T&const> 
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <typename T> struct is_reference<T&volatile> 
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+template <typename T> struct is_reference<T&const volatile> 
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+#endif
+#else
+# ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable: 4181)
+#endif // BOOST_MSVC
+
+namespace detail
+{
+  using ::boost::type_traits::yes_type;
+  using ::boost::type_traits::no_type;
+  using ::boost::type_traits::wrap;
+  
+  template <class T> T&(* is_reference_helper1(wrap<T>) )(wrap<T>);
+  char is_reference_helper1(...);
+
+  template <class T> no_type is_reference_helper2(T&(*)(wrap<T>));
+  yes_type is_reference_helper2(...);
+}
+
+template <typename T>
+struct is_reference
+{
+    BOOST_STATIC_CONSTANT(
+        bool, value = sizeof(
+            ::boost::detail::is_reference_helper2(
+                ::boost::detail::is_reference_helper1(::boost::type_traits::wrap<T>()))) == 1
+        );
+};
+    
+template <> struct is_reference<void>
+{
+   BOOST_STATIC_CONSTANT(bool, value = false);
+};
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+template <> struct is_reference<const void>
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+template <> struct is_reference<volatile void>
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+template <> struct is_reference<const volatile void>
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+#endif
+
+# ifdef BOOST_MSVC
+#  pragma warning(pop)
+# endif // BOOST_MSVC
+#endif
+
+} // namespace boost::type_traits
+
+#endif // BOOST_TT_REFERENCE_TRAITS_HPP
index 5c9fef1dde7ac2c255565e332eb5ccf8b68ecbf4..fc3c555b39e72982645a80852744625b4a15c1f1 100644 (file)
@@ -41,6 +41,15 @@ template <typename T>
 struct is_same<T, T>
 { BOOST_STATIC_CONSTANT(bool, value = true); };
 
+#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
+//  A definition is required even for integral static constants
+template <typename T, typename U>
+const bool is_same<T, U>::value;
+
+template <typename T>
+const bool is_same<T, T>::value;
+#endif
+
 #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
 #ifdef BOOST_MSVC
@@ -68,8 +77,8 @@ struct is_same {
 
 namespace detail{
    template <class T>
-   ::boost::type_traits::yes_type is_same_helper(T*, T*);
-   ::boost::type_traits::no_type is_same_helper(...);
+   ::boost::type_traits::yes_type BOOST_TT_DECL is_same_helper(T*, T*);
+   ::boost::type_traits::no_type BOOST_TT_DECL is_same_helper(...);
 }
 
 template <typename T, typename U>
index 06171d81fdd706437451523291613191060e575b..6cc0536e4e7a4b8778057f0cbe6670703137671d 100644 (file)
@@ -69,7 +69,7 @@ struct add_reference
 template <typename T>
 struct add_reference<T&>
 { typedef T& type; };
-#elif defined(BOOST_MSVC6_MEMBER_TEMPLATES) || !defined(BOOST_NO_MEMBER_TEMPLATES)
+#elif defined(BOOST_MSVC6_MEMBER_TEMPLATES)
 namespace detail{
 
 template <bool x>
@@ -175,9 +175,8 @@ struct add_pointer
 {
 private:
    typedef typename remove_reference<T>::type no_ref_type;
-   typedef typename remove_bounds<no_ref_type>::type no_b_type;
 public:
-   typedef no_b_type* type;
+   typedef no_ref_type* type;
 };
 
 } // namespace boost
index b96feab9eccbcf06162bc591014990084982ecd0..b87d27825723dc9db872b64fc33f187c748a0198 100644 (file)
@@ -11,7 +11,9 @@
 #define BOOST_TYPE_TRAITS_TEST_HPP
 #include <iostream>
 #include <typeinfo>
+#include <boost/config.hpp>
 #include <boost/utility.hpp>
+#include <boost/type_traits/alignment_traits.hpp>
 //
 // define tests here
 unsigned failures = 0;
@@ -34,14 +36,16 @@ int check_result(int argc, char** argv)
       << failures << " failures found, "
       << expected_failures << " failures expected from this compiler." << std::endl;
    if((argc == 2) 
-       && (argv[1][0] == '-')
-       && (argv[1][1] == 'a')
-       && (argv[1][2] == 0))
+      && (argv[1][0] == '-')
+      && (argv[1][1] == 'a')
+      && (argv[1][2] == 0))
    {
       std::cout << "Press any key to continue...";
       std::cin.get();
    }
-   return (failures == expected_failures) ? 0 : failures;
+   return (failures == expected_failures)
+       ? 0
+       : (failures != 0) ? static_cast<int>(failures) : -1;
 }
 
 
@@ -72,28 +76,23 @@ struct checker<false>
    }
 };
 
+template <class T>
+struct typify{};
+
 template <class T, class U>
 struct type_checker
 {
-   static void check(const char* TT, const char* TU, const char* expression)
+   static void check(const char* TT, const char*, const char* expression)
    {
       ++test_count;
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-      if((typeid(T) != typeid(U))
-         || (::boost::is_reference<T>::value != ::boost::is_reference<U>::value)
-         || (::boost::is_const<T>::value != ::boost::is_const<U>::value)
-         || (::boost::is_volatile<T>::value != ::boost::is_volatile<U>::value))
+      if(typeid(typify<T>) != typeid(typify<U>))
       {
-#endif
          ++failures;
          std::cout << "checking type of " << expression << "...failed" << std::endl;
-         std::cout << "   expected type was " << TT << std::endl;
-         std::cout << "   typeid(" << TT << ") was: " << typeid(T).name() << std::endl;
-         std::cout << "   typeid(" << TU << ") was: " << typeid(U).name() << std::endl;
-         std::cout << "   In template class " << typeid(type_checker<T,U>).name() << std::endl;
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+         std::cout << "   evaluating:  type_checker<" << TT << "," << expression << ">" << std::endl;
+         std::cout << "   expected:    type_checker<" << TT << "," << TT << ">" << std::endl;
+         std::cout << "   but got:     " << typeid(type_checker<T,U>).name() << std::endl;
       }
-#endif
    }
 };
 
@@ -115,6 +114,7 @@ struct type_checker<T,T>
 #define value_fail(v, x) \
       ++test_count; \
       ++failures; \
+      ++expected_failures;\
       std::cout << "checking value of " << #x << "...failed" << std::endl; \
       std::cout << "   " #x " does not compile on this compiler" << std::endl;
 
@@ -197,6 +197,29 @@ struct test_align<T&>
 
 #define align_test(T) test_align<T>::do_it()
 
+template<class T>
+struct test_type_with_align 
+{
+  typedef typename boost::type_with_alignment<
+                     (boost::alignment_of<T>::value)>::type 
+    align_t;
+
+  static void do_it()
+  {
+    int align = boost::alignment_of<T>::value;
+    int new_align = boost::alignment_of<align_t>::value;
+    ++test_count;
+    if (new_align % align != 0) {
+      ++failures;
+      std::cerr << "checking for an object with same alignment as " 
+      << typeid(T).name() << "...failed" << std::endl;
+      std::cerr << "\tfound: " << typeid(align_t).name() << std::endl;
+    }
+  }
+};
+
+#define type_with_align_test(T) test_type_with_align<T>::do_it()
+
 //
 // the following code allows us to test that a particular
 // template functions correctly when instanciated inside another template
@@ -267,18 +290,32 @@ typedef int (UDT::*mf2)();
 typedef int (UDT::*mf3)(int);
 typedef int (UDT::*mf4)(int, float);
 typedef int (UDT::*mp);
+typedef int (UDT::*cmf)(int) const;
 
 // cv-qualifiers applied to reference types should have no effect
 // declare these here for later use with is_reference and remove_reference:
 # ifdef BOOST_MSVC
 #  pragma warning(push)
 #  pragma warning(disable: 4181)
-# endif // BOOST_MSVC
+# elif defined(__ICL)
+#  pragma warning(push)
+#  pragma warning(disable: 21)
+# endif
+//
+// This is intentional:
+// r_type and cr_type should be the same type
+// but some compilers wrongly apply cv-qualifiers
+// to reference types (this may generate a warning
+// on some compilers):
+//
 typedef int& r_type;
 typedef const r_type cr_type;
 # ifdef BOOST_MSVC
 #  pragma warning(pop)
-# endif // BOOST_MSVC
+# elif defined(__ICL)
+#  pragma warning(pop)
+#  pragma warning(disable: 985) // identifier truncated in debug information
+# endif
 
 struct POD_UDT { int x; };
 struct empty_UDT
@@ -313,7 +350,7 @@ union empty_POD_union_UDT{};
 
 class Base { };
 
-class Deriverd : public Base { };
+class Derived : public Base { };
 
 class NonDerived { };
 
@@ -363,7 +400,7 @@ struct int_convertible
 // used to verify that is_empty does not emit
 // spurious warnings or errors.
 //
-struct non_empty : boost::noncopyable
+struct non_empty : private boost::noncopyable
 {
    int i;
 };
@@ -381,6 +418,8 @@ struct test_abc2
    virtual void foo2() = 0;
 };
 
+struct incomplete_type;
+
 
 #endif // BOOST_TYPE_TRAITS_TEST_HPP
 
@@ -391,3 +430,5 @@ struct test_abc2
 
 
 
+
+
diff --git a/boost/boost/type_traits/utility.hpp b/boost/boost/type_traits/utility.hpp
new file mode 100644 (file)
index 0000000..a51c2d9
--- /dev/null
@@ -0,0 +1,24 @@
+// Copyright David Abrahams 2002. Permission to copy, use,
+// modify, sell and distribute this software is granted provided this
+// copyright notice appears in all copies. This software is provided
+// "as is" without express or implied warranty, and with no claim as
+// to its suitability for any purpose.
+#ifndef BOOST_TT_UTILITY_HPP
+# define BOOST_TT_UTILITY_HPP
+
+namespace boost { namespace type_traits
+{
+  // Utility metafunction class which always returns false
+  struct false_unary_metafunction
+  {
+      template <class T>
+      struct apply
+      {
+          BOOST_STATIC_CONSTANT(bool, value = false);
+      };
+  };
+
+  template <class T> struct wrap {};
+}} // namespace boost::type_traits
+
+#endif // BOOST_TT_UTILITY_HPP
index fa99b9a14818c2da81ec116992415c36d73bf657..a6c9464bff37d19e076c6c01a0e50dffc92446a1 100644 (file)
 
 //  Classes appear in alphabetical order
 
-//  Revision History
-//  21 May 01  checked_delete() and checked_array_delete() added (Beman Dawes,
-//             suggested by Dave Abrahams, generalizing idea from Vladimir Prus)
-//  21 May 01  made next() and prior() inline (Beman Dawes)  
-//  26 Jan 00  protected noncopyable destructor added (Miki Jovanovic)
-//  10 Dec 99  next() and prior() templates added (Dave Abrahams)
-//  30 Aug 99  moved cast templates to cast.hpp (Beman Dawes)
-//   3 Aug 99  cast templates added
-//  20 Jul 99  name changed to utility.hpp 
-//   9 Jun 99  protected noncopyable default ctor
-//   2 Jun 99  Initial Version. Class noncopyable only contents (Dave Abrahams)
-
 #ifndef BOOST_UTILITY_HPP
 #define BOOST_UTILITY_HPP
 
-#include <boost/config.hpp>        // broken compiler workarounds 
-#include <boost/static_assert.hpp> 
-#include <cstddef>                 // for size_t
-#include <utility>                 // for std::pair
+// certain headers are part of the <utility.hpp> interface
+
+#include <boost/checked_delete.hpp>
+#include <boost/utility/base_from_member.hpp>  
+#include <boost/utility/addressof.hpp>
 
 namespace boost
 {
-//  checked_delete() and checked_array_delete()  -----------------------------//
-
-    // verify that types are complete for increased safety
-
-    template< typename T >
-    inline void checked_delete(T * x)
-    {
-        BOOST_STATIC_ASSERT( sizeof(T) != 0 ); // assert type complete at point
-                                               // of instantiation
-        delete x;
-    }
-
-    template< typename T >
-    inline void checked_array_delete(T  * x)
-    {
-        BOOST_STATIC_ASSERT( sizeof(T) != 0 ); // assert type complete at point
-                                               // of instantiation
-        delete [] x;
-    }
-
 //  next() and prior() template functions  -----------------------------------//
 
     //  Helper functions for classes like bidirectional iterators not supporting
diff --git a/boost/boost/utility/addressof.hpp b/boost/boost/utility/addressof.hpp
new file mode 100644 (file)
index 0000000..a434b8e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2002 Brad King (brad.king@kitware.com) 
+//                    Doug Gregor (gregod@cs.rpi.edu)
+//                    Peter Dimov
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_UTILITY_ADDRESSOF_HPP
+#define BOOST_UTILITY_ADDRESSOF_HPP
+
+namespace boost {
+
+// Do not make addressof() inline. Breaks MSVC 7. (Peter Dimov)
+
+template <typename T> T* addressof(T& v)
+{
+  return reinterpret_cast<T*>(
+       &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
+}
+
+}
+
+#endif // BOOST_UTILITY_ADDRESSOF_HPP
diff --git a/boost/boost/utility/base_from_member.hpp b/boost/boost/utility/base_from_member.hpp
new file mode 100644 (file)
index 0000000..48d1d4a
--- /dev/null
@@ -0,0 +1,59 @@
+//  boost utility/base_from_member.hpp header file  --------------------------//
+
+//  (C) Copyright Daryle Walker 2001.  Permission to copy, use, modify, sell
+//  and distribute this software is granted provided this copyright
+//  notice appears in all copies.  This software is provided "as is" without
+//  express or implied warranty, and with no claim as to its suitability for
+//  any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+#ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
+#define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
+
+#include <boost/utility_fwd.hpp>  // required for parameter defaults
+
+
+namespace boost
+{
+
+//  Base-from-member class template  -----------------------------------------//
+
+// Helper to initialize a base object so a derived class can use this
+// object in the initialization of another base class.  Used by
+// Dietmar Kuehl from ideas by Ron Klatcho to solve the problem of a
+// base class needing to be initialized by a member.
+
+// Contributed by Daryle Walker
+
+template < typename MemberType, int UniqueID >
+class base_from_member
+{
+protected:
+    MemberType  member;
+
+    explicit  base_from_member()
+        : member()
+        {}
+
+    template< typename T1 >
+    explicit base_from_member( T1 x1 )
+        : member( x1 )
+        {}
+
+    template< typename T1, typename T2 >
+    base_from_member( T1 x1, T2 x2 )
+        : member( x1, x2 )
+        {}
+
+    template< typename T1, typename T2, typename T3 >
+    base_from_member( T1 x1, T2 x2, T3 x3 )
+        : member( x1, x2, x3 ) 
+        {}
+
+};  // boost::base_from_member
+
+}  // namespace boost
+
+
+#endif  // BOOST_UTILITY_BASE_FROM_MEMBER_HPP
diff --git a/boost/boost/utility_fwd.hpp b/boost/boost/utility_fwd.hpp
new file mode 100644 (file)
index 0000000..8e2f040
--- /dev/null
@@ -0,0 +1,34 @@
+//  Boost utility_fwd.hpp header file  ---------------------------------------//
+
+//  (C) Copyright boost.org 2001.  Permission to copy, use, modify, sell
+//  and distribute this software is granted provided this copyright
+//  notice appears in all copies.  This software is provided "as is" without
+//  express or implied warranty, and with no claim as to its suitability for
+//  any purpose.
+
+//  See http://www.boost.org for most recent version including documentation.
+
+#ifndef BOOST_UTILITY_FWD_HPP
+#define BOOST_UTILITY_FWD_HPP
+
+
+namespace boost
+{
+
+
+//  From <boost/utility/base_from_member.hpp>  -------------------------------//
+
+template < typename MemberType, int UniqueID = 0 >
+    class base_from_member;
+
+
+//  From <boost/utility.hpp>  ------------------------------------------------//
+
+class noncopyable;
+
+// Also has a few function templates
+
+}  // namespace boost
+
+
+#endif  // BOOST_UTILITY_FWD_HPP
diff --git a/boost/boost/version.hpp b/boost/boost/version.hpp
new file mode 100644 (file)
index 0000000..21199bf
--- /dev/null
@@ -0,0 +1,26 @@
+//  Boost config.hpp configuration header file  ------------------------------//
+
+//  (C) Copyright Boost.org 1999. Permission to copy, use, modify, sell and
+//  distribute this software is granted provided this copyright notice appears
+//  in all copies. This software is provided "as is" without express or implied
+//  warranty, and with no claim as to its suitability for any purpose.
+
+//  See http://www.boost.org for most recent version.
+
+#ifndef BOOST_VERSION_HPP
+#define BOOST_VERSION_HPP
+
+//
+//  Caution, this is the only boost header that is guarenteed
+//  to change with every boost release, including this header
+//  will cause a recompile every time a new boost version is
+//  released.
+//
+//  BOOST_VERSION % 100 is the sub-minor version
+//  BOOST_VERSION / 100 % 1000 is the minor version
+//  BOOST_VERSION / 100000 is the major version
+
+#define BOOST_VERSION 102900
+
+#endif
+
diff --git a/boost/boost/visit_each.hpp b/boost/boost/visit_each.hpp
new file mode 100644 (file)
index 0000000..74daacb
--- /dev/null
@@ -0,0 +1,35 @@
+// Boost.Signals library
+//
+// Copyright (C) 2001 Doug Gregor (gregod@cs.rpi.edu)
+//
+// Permission to copy, use, sell and distribute this software is granted
+// provided this copyright notice appears in all copies.
+// Permission to modify the code and to distribute modified code is granted
+// provided this copyright notice appears in all copies, and a notice
+// that the code was modified is included with the copyright notice.
+//
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_VISIT_EACH_HPP
+#define BOOST_VISIT_EACH_HPP
+
+#include <boost/config.hpp>
+
+namespace boost {
+  template<typename Visitor, typename T>
+  inline void visit_each(Visitor& visitor, const T& t, long)
+  {
+    visitor(t);
+  }
+
+  template<typename Visitor, typename T>
+  inline void visit_each(Visitor& visitor, const T& t)
+  {
+    visit_each(visitor, t, 0);
+  }
+}
+
+#endif // BOOST_VISIT_EACH_HPP
diff --git a/boost/boost/weak_ptr.hpp b/boost/boost/weak_ptr.hpp
new file mode 100644 (file)
index 0000000..e04b4f1
--- /dev/null
@@ -0,0 +1,177 @@
+#ifndef BOOST_WEAK_PTR_HPP_INCLUDED
+#define BOOST_WEAK_PTR_HPP_INCLUDED
+
+//
+//  weak_ptr.hpp
+//
+//  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.
+//
+//  See http://www.boost.org/libs/smart_ptr/weak_ptr.htm for documentation.
+//
+
+#include <boost/shared_ptr.hpp>
+
+#ifdef BOOST_MSVC  // moved here to work around VC++ compiler crash
+# pragma warning(push)
+# pragma warning(disable:4284) // odd return type for operator->
+#endif
+
+namespace boost
+{
+
+template<typename T> class weak_ptr
+{
+private:
+
+    // Borland 5.5.1 specific workarounds
+    typedef weak_ptr<T> this_type;
+
+public:
+
+    typedef T element_type;
+
+    weak_ptr(): px(0), pn()
+    {
+    }
+
+//  generated copy constructor, assignment, destructor are fine
+
+    template<typename Y>
+    weak_ptr(weak_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
+    {
+    }
+
+    template<typename Y>
+    weak_ptr(shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
+    {
+    }
+
+#if !defined(BOOST_MSVC) || (BOOST_MSVC > 1200)
+
+    template<typename Y>
+    weak_ptr & operator=(weak_ptr<Y> const & r) // never throws
+    {
+        px = r.px;
+        pn = r.pn;
+        return *this;
+    }
+
+    template<typename Y>
+    weak_ptr & operator=(shared_ptr<Y> const & r) // never throws
+    {
+        px = r.px;
+        pn = r.pn;
+        return *this;
+    }
+
+#endif
+
+    void reset()
+    {
+        this_type().swap(*this);
+    }
+
+    T * get() const // never throws; unsafe in multithreaded programs!
+    {
+        return pn.use_count() == 0? 0: px;
+    }
+
+    long use_count() const // never throws
+    {
+        return pn.use_count();
+    }
+
+    bool expired() const // never throws
+    {
+        return pn.use_count() == 0;
+    }
+
+    void swap(this_type & other) // never throws
+    {
+        std::swap(px, other.px);
+        pn.swap(other.pn);
+    }
+
+    bool less(this_type const & rhs) const // implementation detail, never throws
+    {
+        return pn < rhs.pn;
+    }
+
+// Tasteless as this may seem, making all members public allows member templates
+// to work in the absence of member template friends. (Matthew Langston)
+
+#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
+
+private:
+
+    template<typename Y> friend class weak_ptr;
+    template<typename Y> friend class shared_ptr;
+
+#endif
+
+    T * px;                     // contained pointer
+    detail::weak_count pn;      // reference counter
+
+};  // weak_ptr
+
+template<class T, class U> inline bool operator==(weak_ptr<T> const & a, weak_ptr<U> const & b)
+{
+    return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(weak_ptr<T> const & a, weak_ptr<U> const & b)
+{
+    return a.get() != b.get();
+}
+
+#if __GNUC__ == 2 && __GNUC_MINOR__ <= 96
+
+// Resolve the ambiguity between our op!= and the one in rel_ops
+
+template<typename T> inline bool operator!=(weak_ptr<T> const & a, weak_ptr<T> const & b)
+{
+    return a.get() != b.get();
+}
+
+#endif
+
+template<class T> inline bool operator<(weak_ptr<T> const & a, weak_ptr<T> const & b)
+{
+    return a.less(b);
+}
+
+template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b)
+{
+    a.swap(b);
+}
+
+template<class T> shared_ptr<T> make_shared(weak_ptr<T> const & r) // never throws
+{
+    // optimization: avoid throw overhead
+    if(r.use_count() == 0)
+    {
+        return shared_ptr<T>();
+    }
+
+    try
+    {
+        return shared_ptr<T>(r);
+    }
+    catch(use_count_is_zero const &)
+    {
+        return shared_ptr<T>();
+    }
+}
+
+} // namespace boost
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif    
+
+#endif  // #ifndef BOOST_WEAK_PTR_HPP_INCLUDED