]> git.lyx.org Git - features.git/commitdiff
boost: update to version 1.40
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 7 Nov 2009 11:55:44 +0000 (11:55 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 7 Nov 2009 11:55:44 +0000 (11:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31888 a592a061-630c-0410-9148-cb99ea01b6c8

134 files changed:
boost/boost/aligned_storage.hpp
boost/boost/array.hpp
boost/boost/bind/protect.hpp
boost/boost/config/compiler/borland.hpp
boost/boost/config/compiler/codegear.hpp
boost/boost/config/compiler/common_edg.hpp
boost/boost/config/compiler/digitalmars.hpp
boost/boost/config/compiler/gcc.hpp
boost/boost/config/compiler/hp_acc.hpp
boost/boost/config/compiler/intel.hpp
boost/boost/config/compiler/kai.hpp
boost/boost/config/compiler/metrowerks.hpp
boost/boost/config/compiler/mpw.hpp
boost/boost/config/compiler/pgi.hpp
boost/boost/config/compiler/sgi_mipspro.hpp
boost/boost/config/compiler/sunpro_cc.hpp
boost/boost/config/compiler/vacpp.hpp
boost/boost/config/compiler/visualc.hpp
boost/boost/config/platform/vxworks.hpp [new file with mode: 0755]
boost/boost/config/select_platform_config.hpp
boost/boost/config/select_stdlib_config.hpp
boost/boost/config/stdlib/dinkumware.hpp
boost/boost/config/stdlib/libcomo.hpp
boost/boost/config/stdlib/libstdcpp3.hpp
boost/boost/config/stdlib/modena.hpp
boost/boost/config/stdlib/msl.hpp
boost/boost/config/stdlib/roguewave.hpp
boost/boost/config/stdlib/sgi.hpp
boost/boost/config/stdlib/stlport.hpp
boost/boost/config/stdlib/vacpp.hpp
boost/boost/config/suffix.hpp
boost/boost/crc.hpp
boost/boost/detail/allocator_utilities.hpp
boost/boost/detail/container_fwd.hpp
boost/boost/detail/is_incrementable.hpp
boost/boost/detail/scoped_enum_emulation.hpp [new file with mode: 0755]
boost/boost/detail/utf8_codecvt_facet.hpp
boost/boost/exception/all.hpp [new file with mode: 0644]
boost/boost/exception/detail/attribute_noreturn.hpp [new file with mode: 0644]
boost/boost/exception/detail/exception_ptr_base.hpp [new file with mode: 0644]
boost/boost/exception/diagnostic_information.hpp
boost/boost/exception/errinfo_api_function.hpp [new file with mode: 0644]
boost/boost/exception/errinfo_at_line.hpp [new file with mode: 0644]
boost/boost/exception/errinfo_errno.hpp [new file with mode: 0644]
boost/boost/exception/errinfo_file_handle.hpp [new file with mode: 0644]
boost/boost/exception/errinfo_file_name.hpp [new file with mode: 0644]
boost/boost/exception/errinfo_file_open_mode.hpp [new file with mode: 0644]
boost/boost/exception/errinfo_type_info_name.hpp [new file with mode: 0644]
boost/boost/exception/exception.hpp
boost/boost/exception/info.hpp
boost/boost/format/format_implementation.hpp
boost/boost/format/parsing.hpp
boost/boost/function/function_base.hpp
boost/boost/function/function_fwd.hpp
boost/boost/function/function_template.hpp
boost/boost/functional/detail/container_fwd.hpp [new file with mode: 0644]
boost/boost/functional/hash.hpp [new file with mode: 0644]
boost/boost/functional/hash/detail/float_functions.hpp [new file with mode: 0644]
boost/boost/functional/hash/detail/hash_float.hpp [new file with mode: 0644]
boost/boost/functional/hash/detail/hash_float_generic.hpp [new file with mode: 0644]
boost/boost/functional/hash/detail/hash_float_x86.hpp [new file with mode: 0644]
boost/boost/functional/hash/detail/limits.hpp [new file with mode: 0644]
boost/boost/functional/hash/extensions.hpp [new file with mode: 0644]
boost/boost/functional/hash/hash.hpp [new file with mode: 0644]
boost/boost/functional/hash/hash_fwd.hpp [new file with mode: 0644]
boost/boost/functional/hash_fwd.hpp [new file with mode: 0644]
boost/boost/integer/static_log2.hpp
boost/boost/mpl/aux_/config/compiler.hpp
boost/boost/mpl/aux_/inserter_algorithm.hpp
boost/boost/mpl/aux_/push_back_impl.hpp
boost/boost/mpl/aux_/push_front_impl.hpp
boost/boost/mpl/char.hpp [new file with mode: 0755]
boost/boost/mpl/char_fwd.hpp [new file with mode: 0755]
boost/boost/mpl/for_each.hpp
boost/boost/mpl/limits/string.hpp [new file with mode: 0644]
boost/boost/mpl/map/aux_/insert_impl.hpp
boost/boost/mpl/string.hpp [new file with mode: 0755]
boost/boost/operators.hpp
boost/boost/property_map.hpp
boost/boost/property_map_iterator.hpp
boost/boost/ref.hpp
boost/boost/regex/concepts.hpp
boost/boost/regex/config.hpp
boost/boost/regex/icu.hpp
boost/boost/regex/v4/basic_regex.hpp
boost/boost/regex/v4/basic_regex_creator.hpp
boost/boost/regex/v4/basic_regex_parser.hpp
boost/boost/regex/v4/cpp_regex_traits.hpp
boost/boost/regex/v4/iterator_category.hpp
boost/boost/regex/v4/match_results.hpp
boost/boost/regex/v4/perl_matcher.hpp
boost/boost/regex/v4/perl_matcher_common.hpp
boost/boost/regex/v4/perl_matcher_non_recursive.hpp
boost/boost/regex/v4/perl_matcher_recursive.hpp
boost/boost/regex/v4/regex_format.hpp
boost/boost/regex/v4/regex_traits_defaults.hpp
boost/boost/regex/v4/regex_workaround.hpp
boost/boost/regex/v4/states.hpp
boost/boost/regex/v4/syntax_type.hpp
boost/boost/regex/v4/w32_regex_traits.hpp
boost/boost/signals/signal1.hpp
boost/boost/signals/signal10.hpp
boost/boost/signals/signal2.hpp
boost/boost/signals/signal3.hpp
boost/boost/signals/signal4.hpp
boost/boost/signals/signal5.hpp
boost/boost/signals/signal6.hpp
boost/boost/signals/signal7.hpp
boost/boost/signals/signal8.hpp
boost/boost/signals/signal9.hpp
boost/boost/smart_ptr/detail/shared_count.hpp
boost/boost/smart_ptr/detail/sp_convertible.hpp
boost/boost/smart_ptr/enable_shared_from_this2.hpp [new file with mode: 0755]
boost/boost/smart_ptr/intrusive_ptr.hpp
boost/boost/smart_ptr/shared_ptr.hpp
boost/boost/smart_ptr/weak_ptr.hpp
boost/boost/swap.hpp [new file with mode: 0644]
boost/boost/throw_exception.hpp
boost/boost/tuple/detail/tuple_basic.hpp
boost/boost/tuple/tuple_io.hpp
boost/boost/type_traits/alignment_of.hpp
boost/boost/utility/addressof.hpp
boost/boost/utility/result_of.hpp
boost/boost/version.hpp
boost/libs/regex/src/CMakeLists.txt [new file with mode: 0755]
boost/libs/regex/src/c_regex_traits.cpp
boost/libs/regex/src/cregex.cpp
boost/libs/regex/src/icu.cpp [new file with mode: 0755]
boost/libs/regex/src/regex_traits_defaults.cpp
boost/libs/regex/src/static_mutex.cpp [new file with mode: 0755]
boost/libs/regex/src/usinstances.cpp [new file with mode: 0755]
boost/libs/regex/src/wc_regex_traits.cpp [new file with mode: 0755]
boost/libs/regex/src/wide_posix_api.cpp
boost/libs/signals/src/CMakeLists.txt [new file with mode: 0755]

index cfaf7877a1551cbf1b804935c123bfc3538bf3ba..ce277ab702ad4db26644b86bebce1b74eab59dec 100644 (file)
@@ -54,6 +54,14 @@ struct aligned_storage_imp
             , type_with_alignment<alignment_>
             >::type align_;
     } data_;
+    void* address() const { return const_cast<aligned_storage_imp*>(this); }
+};
+
+template< std::size_t alignment_ >
+struct aligned_storage_imp<0u,alignment_>
+{
+    /* intentionally empty */
+    void* address() const { return 0; }
 };
 
 }} // namespace detail::aligned_storage
@@ -62,12 +70,15 @@ template <
       std::size_t size_
     , std::size_t alignment_ = std::size_t(-1)
 >
-class aligned_storage
+class aligned_storage : 
+#ifndef __BORLANDC__
+   private 
+#else
+   public
+#endif
+   detail::aligned_storage::aligned_storage_imp<size_, alignment_> 
 {
-private: // representation
-
-   detail::aligned_storage::aligned_storage_imp<size_, alignment_> data_;
-
 public: // constants
 
     typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
@@ -118,14 +129,14 @@ public: // accessors
 
     void* address()
     {
-        return this;
+        return static_cast<type*>(this)->address();
     }
 
 #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
 
     const void* address() const
     {
-        return this;
+        return static_cast<const type*>(this)->address();
     }
 
 #else // MSVC6
index 52218aac51383aed26e8ae622c2c891c79319945..8ef73c42508c1d465bf31d0e40bb6fc68dfad200 100644 (file)
@@ -27,6 +27,7 @@
 #include <cstddef>
 #include <stdexcept>
 #include <boost/assert.hpp>
+#include <boost/swap.hpp>
 
 // Handles broken standard libraries better than <iterator>
 #include <boost/detail/iterator.hpp>
@@ -131,7 +132,8 @@ namespace boost {
 
         // swap (note: linear complexity)
         void swap (array<T,N>& y) {
-            std::swap_ranges(begin(),end(),y.begin());
+            for (size_type i = 0; i < N; ++i)
+                boost::swap(elems[i],y.elems[i]);
         }
 
         // direct access to data (read-only)
@@ -209,19 +211,19 @@ namespace boost {
         }
 
         // operator[]
-        reference operator[](size_type i)
+        reference operator[](size_type /*i*/)
         {
             return failed_rangecheck();
         }
 
-        const_reference operator[](size_type i) const
+        const_reference operator[](size_type /*i*/) const
         {
             return failed_rangecheck();
         }
 
         // at() with range check
-        reference at(size_type i)               {   return failed_rangecheck(); }
-        const_reference at(size_type i) const   {   return failed_rangecheck(); }
+        reference at(size_type /*i*/)               {   return failed_rangecheck(); }
+        const_reference at(size_type /*i*/) const   {   return failed_rangecheck(); }
 
         // front() and back()
         reference front()
@@ -250,7 +252,7 @@ namespace boost {
         static size_type max_size() { return 0; }
         enum { static_size = 0 };
 
-        void swap (array<T,0>& y) {
+        void swap (array<T,0>& /*y*/) {
         }
 
         // direct access to data (read-only)
index b1ff2a2a8e94b14a3c2e243c307faff4b7bae513..749e158c349fe0dd6e11d8c9681d8c45ad9ff14c 100644 (file)
@@ -5,12 +5,16 @@
 //  protect.hpp
 //
 //  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//  Copyright (c) 2009 Steven Watanabe
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
 namespace boost
 {
 
@@ -47,6 +51,22 @@ public:
         return f_(a1);
     }
 
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1> result_type operator()(const A1 & a1)
+    {
+        return f_(a1);
+    }
+
+    template<class A1> result_type operator()(const A1 & a1) const
+    {
+        return f_(a1);
+    }
+
+#endif
+
     template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
     {
         return f_(a1, a2);
@@ -57,6 +77,41 @@ public:
         return f_(a1, a2);
     }
 
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
+    {
+        return f_(a1, a2);
+    }
+
+    template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
+    {
+        return f_(a1, a2);
+    }
+
+#endif
+
     template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
     {
         return f_(a1, a2, a3);
@@ -66,6 +121,21 @@ public:
     {
         return f_(a1, a2, a3);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3)
+    {
+        return f_(a1, a2, a3);
+    }
+
+    template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const
+    {
+        return f_(a1, a2, a3);
+    }
+    
+#endif
 
     template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
     {
@@ -76,6 +146,21 @@ public:
     {
         return f_(a1, a2, a3, a4);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4)
+    {
+        return f_(a1, a2, a3, a4);
+    }
+
+    template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const
+    {
+        return f_(a1, a2, a3, a4);
+    }
+
+#endif
 
     template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
     {
@@ -86,6 +171,21 @@ public:
     {
         return f_(a1, a2, a3, a4, a5);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5)
+    {
+        return f_(a1, a2, a3, a4, a5);
+    }
+
+    template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const
+    {
+        return f_(a1, a2, a3, a4, a5);
+    }
+
+#endif
 
     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)
     {
@@ -96,6 +196,21 @@ public:
     {
         return f_(a1, a2, a3, a4, a5, a6);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & 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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6);
+    }
+
+#endif
 
     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)
     {
@@ -106,6 +221,21 @@ public:
     {
         return f_(a1, a2, a3, a4, a5, a6, a7);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & 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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7);
+    }
+
+#endif
 
     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)
     {
@@ -116,6 +246,21 @@ public:
     {
         return f_(a1, a2, a3, a4, a5, a6, a7, a8);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & 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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+    }
+
+#endif
 
     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)
     {
@@ -126,6 +271,21 @@ public:
     {
         return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
     }
+    
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+    template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & 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 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const
+    {
+        return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    }
+
+#endif
 
 private:
 
index c6413b3a1d7b32b276d50795d81efe1e82b47b8f..16a70687f4bbba701767b88046760998e18f92ba 100644 (file)
 #  define BOOST_NO_TWO_PHASE_NAME_LOOKUP
 #  define BOOST_NO_USING_TEMPLATE
 #  define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
+#  define BOOST_NO_NESTED_FRIENDSHIP
+#  define BOOST_NO_TYPENAME_WITH_CTOR
 #endif
 
 //
 //
 // C++0x Macros:
 //
-#if defined( BOOST_CODEGEAR_0X_SUPPORT ) && (__BORLANDC__ >= 0x610)
+#if !defined( BOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610)
+#  define BOOST_NO_CHAR16_T
+#  define BOOST_NO_CHAR32_T
+#  define BOOST_NO_DECLTYPE
+#  define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
+#  define BOOST_NO_EXTERN_TEMPLATE
+#  define BOOST_NO_RVALUE_REFERENCES 
+#  define BOOST_NO_SCOPED_ENUMS
+#  define BOOST_NO_STATIC_ASSERT
+#else
 #  define BOOST_HAS_ALIGNOF
 #  define BOOST_HAS_CHAR16_T
 #  define BOOST_HAS_CHAR32_T
 #  define BOOST_HAS_REF_QUALIFIER
 #  define BOOST_HAS_RVALUE_REFS
 #  define BOOST_HAS_STATIC_ASSERT
-
-#  define BOOST_NO_EXTERN_TEMPLATE
-#  define BOOST_NO_SCOPED_ENUMS
-#  define BOOST_NO_VARIADIC_TEMPLATES
-#  define BOOST_NO_CONSTEXPR
-#  define BOOST_NO_DEFAULTED_FUNCTIONS
-#  define BOOST_NO_DELETED_FUNCTIONS
-#  define BOOST_NO_RAW_LITERALS
-#  define BOOST_NO_UNICODE_LITERALS       // UTF-8 still not supported
-#else
-#  define BOOST_NO_CHAR16_T
-#  define BOOST_NO_CHAR32_T
-#  define BOOST_NO_DECLTYPE
-#  define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#  define BOOST_NO_EXTERN_TEMPLATE
-#  define BOOST_NO_SCOPED_ENUMS
-#  define BOOST_NO_STATIC_ASSERT
-#  define BOOST_NO_RVALUE_REFERENCES
-#  define BOOST_NO_VARIADIC_TEMPLATES
-#  define BOOST_NO_CONSTEXPR
-#  define BOOST_NO_DEFAULTED_FUNCTIONS
-#  define BOOST_NO_DELETED_FUNCTIONS
-#  define BOOST_NO_RAW_LITERALS
-#  define BOOST_NO_UNICODE_LITERALS
 #endif
 
 #define BOOST_NO_AUTO_DECLARATIONS
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_CONCEPTS
+#define BOOST_NO_CONSTEXPR
+#define BOOST_NO_DEFAULTED_FUNCTIONS
+#define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
+#define BOOST_NO_RAW_LITERALS
+#define BOOST_NO_RVALUE_REFERENCES
+#define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_TEMPLATE_ALIASES
+#define BOOST_NO_UNICODE_LITERALS    // UTF-8 still not supported
+#define BOOST_NO_VARIADIC_TEMPLATES
 
 #if __BORLANDC__ >= 0x590
 #  define BOOST_HAS_TR1_HASH
index f393282a779f77521979110187e5d840c7b46fa0..39a69064369f84e4a0af557896e4ea6265f53168 100644 (file)
 // #define BOOST_HAS_STATIC_ASSERT\r
 #define BOOST_HAS_STD_TYPE_TRAITS\r
 \r
-#define BOOST_NO_EXTERN_TEMPLATE\r
-#define BOOST_NO_SCOPED_ENUMS\r
-#define BOOST_NO_STATIC_ASSERT\r
-#define BOOST_NO_RVALUE_REFERENCES\r
-#define BOOST_NO_VARIADIC_TEMPLATES\r
+#define BOOST_NO_AUTO_DECLARATIONS\r
+#define BOOST_NO_AUTO_MULTIDECLARATIONS\r
+#define BOOST_NO_CONCEPTS\r
 #define BOOST_NO_CONSTEXPR\r
 #define BOOST_NO_DEFAULTED_FUNCTIONS\r
 #define BOOST_NO_DELETED_FUNCTIONS\r
+#define BOOST_NO_EXTERN_TEMPLATE\r
+#define BOOST_NO_INITIALIZER_LISTS\r
+#define BOOST_NO_LAMBDAS\r
+#define BOOST_NO_NULLPTR\r
 #define BOOST_NO_RAW_LITERALS\r
+#define BOOST_NO_RVALUE_REFERENCES\r
+#define BOOST_NO_STATIC_ASSERT\r
+#define BOOST_NO_TEMPLATE_ALIASES\r
 #define BOOST_NO_UNICODE_LITERALS\r
-#define BOOST_NO_AUTO_DECLARATIONS\r
-#define BOOST_NO_AUTO_MULTIDECLARATIONS\r
+#define BOOST_NO_VARIADIC_TEMPLATES\r
 \r
 //\r
 // TR1 macros:\r
index 3e62bb0f592acc299762ccd78ea7b6bd8c81f3d3..75c2f57f1eb3d3a716544a56ac4d83b7f58eb98e 100644 (file)
 #   define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
 #endif 
 
-#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
-// No support for initializer lists
-#  define BOOST_NO_INITIALIZER_LISTS
-#endif
-
 // See also kai.hpp which checks a Kai-specific symbol for EH
 # if !defined(__KCC) && !defined(__EXCEPTIONS)
 #     define BOOST_NO_EXCEPTIONS
 //
 //   See above for BOOST_NO_LONG_LONG
 //
+#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
+// No support for initializer lists
+#  define BOOST_NO_INITIALIZER_LISTS
+#endif
+
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
+
 #ifdef c_plusplus
 // EDG has "long long" in non-strict mode
 // However, some libraries have insufficient "long long" support
index f0c3c88c217ae9cf57870e464bd271c651816d31..c0e770277ab9c23f8e98f1ad7daaf9c07537a9d3 100644 (file)
@@ -26,7 +26,6 @@
 #define BOOST_NO_SFINAE\r
 #define BOOST_NO_USING_TEMPLATE\r
 #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL\r
-#define BOOST_NO_INITIALIZER_LISTS\r
 #endif\r
 \r
 //\r
 //\r
 // C++0x features\r
 //\r
+#define BOOST_NO_AUTO_DECLARATIONS\r
+#define BOOST_NO_AUTO_MULTIDECLARATIONS\r
 #define BOOST_NO_CHAR16_T\r
 #define BOOST_NO_CHAR32_T\r
+#define BOOST_NO_CONCEPTS\r
 #define BOOST_NO_CONSTEXPR\r
 #define BOOST_NO_DECLTYPE\r
 #define BOOST_NO_DEFAULTED_FUNCTIONS\r
 #define BOOST_NO_DELETED_FUNCTIONS\r
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS\r
 #define BOOST_NO_EXTERN_TEMPLATE\r
+#define BOOST_NO_INITIALIZER_LISTS\r
+#define BOOST_NO_LAMBDAS\r
+#define BOOST_NO_NULLPTR\r
 #define BOOST_NO_RAW_LITERALS\r
 #define BOOST_NO_RVALUE_REFERENCES\r
 #define BOOST_NO_SCOPED_ENUMS\r
 #define BOOST_NO_STATIC_ASSERT\r
+#define BOOST_NO_TEMPLATE_ALIASES\r
 #define BOOST_NO_UNICODE_LITERALS\r
 #define BOOST_NO_VARIADIC_TEMPLATES\r
-#define BOOST_NO_AUTO_DECLARATIONS\r
-#define BOOST_NO_AUTO_MULTIDECLARATIONS\r
+\r
 #if __DMC__ < 0x800\r
 #error "Compiler not supported or configured - please reconfigure"\r
 #endif\r
index 62bf45e6c7d51ff755c2d24ab9c9408c58adb54b..94653c89903ce842e412b5610e76b65b29b26e3b 100644 (file)
 #  endif
 #endif
 
+// C++0x features not implemented in any GCC version
 //
-// C++0x features
-//
-
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
 #define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
+// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS until it
+// gets fixed. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
 #define BOOST_NO_SCOPED_ENUMS
-#define BOOST_NO_UNICODE_LITERALS
-// See below for BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_TEMPLATE_ALIASES
 
+// C++0x features in 4.3.n and later
+//
 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) && defined(__GXX_EXPERIMENTAL_CXX0X__)
 // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
 // passed on the command line, which in turn defines
 #  endif
 #endif
 
-#if !defined(__GXX_EXPERIMENTAL_CXX0X__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
-#  define BOOST_NO_INITIALIZER_LISTS
+// C++0x features in 4.4.n and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #  define BOOST_NO_AUTO_DECLARATIONS
+#  define BOOST_NO_AUTO_MULTIDECLARATIONS
+#  define BOOST_NO_CHAR16_T
+#  define BOOST_NO_CHAR32_T
+#  define BOOST_NO_DEFAULTED_FUNCTIONS
+#  define BOOST_NO_DELETED_FUNCTIONS
+#  define BOOST_NO_INITIALIZER_LISTS
+#  define BOOST_NO_SCOPED_ENUMS  
+#  define BOOST_NO_UNICODE_LITERALS
 #endif
 
 // ConceptGCC compiler:
 #ifdef __GXX_CONCEPTS__
 #  define BOOST_HAS_CONCEPTS
 #  define BOOST_COMPILER "ConceptGCC version " __VERSION__
+#else
+#  define BOOST_NO_CONCEPTS
 #endif
 
 #ifndef BOOST_COMPILER
index 0c3cc9af542156211e8208cd14ab3b38f7a45bd8..a24fc16bed820fa7de177a38fa361481a2e287bb 100644 (file)
 //
 //   See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
 //
+#if !defined(__EDG__)
+
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
+#endif
 
 //
 // last known and checked version for HP-UX/ia64 is 61300
index e4d1b07dbb8e196174a5bc471bac9bf13f7ffbba..1ab029ed46f63eeee64956b413a945271397ae73 100644 (file)
@@ -157,28 +157,6 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
 #  define BOOST_NO_TWO_PHASE_NAME_LOOKUP
 #endif
 
-//
-// C++0x features
-//
-//   See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
-//
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-
 //
 // last known and checked version:
 #if (BOOST_INTEL_CXX_VERSION > 1100)
index de16f1a67583ae58c59e1114e7e99379be11583b..ea06f9f4d06741dddbd4d7e5f7e47dcd9b8267c9 100644 (file)
@@ -21,8 +21,6 @@
 #     define BOOST_NO_EXCEPTIONS
 # endif
 
-#define BOOST_COMPILER "Kai C++ version " BOOST_STRINGIZE(__KCC_VERSION)
-
 //
 // last known and checked version is 4001:
 #if (__KCC_VERSION > 4001)
index 5f6e0fe593db8a17267df46bdd7f29bb199f2b5c..e1e9329c46069aa897fc6be3c8e9e86943ae58cc 100644 (file)
 
 // the "|| !defined(BOOST_STRICT_CONFIG)" part should apply to the last
 // tested version *only*:
-#   if(__MWERKS__ <= 0x3206) || !defined(BOOST_STRICT_CONFIG) // 9.5
+#   if(__MWERKS__ <= 0x3207) || !defined(BOOST_STRICT_CONFIG) // 9.6
 #     define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
 #     define BOOST_NO_IS_ABSTRACT
-#     define BOOST_NO_INITIALIZER_LISTS
 #    endif
 
 #if !__option(wchar_type)
@@ -74,6 +73,8 @@
 #     define BOOST_COMPILER_VERSION 9.4
 #   elif __MWERKS__ == 0x3206
 #     define BOOST_COMPILER_VERSION 9.5
+#   elif __MWERKS__ == 0x3207
+#     define BOOST_COMPILER_VERSION 9.6
 #   else
 #     define BOOST_COMPILER_VERSION __MWERKS__
 #   endif
 #else
 #  define BOOST_NO_RVALUE_REFERENCES              
 #endif
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
 
 #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
 
index 1d72406566b8d70418438ee5b4d2af628578e6e3..ac536c00013efd52372b244d83259c9e24e52eae 100644 (file)
@@ -33,7 +33,6 @@
 
 #  define BOOST_NO_STD_ALLOCATOR /* actually a bug with const reference overloading */
 
-#  define BOOST_NO_INITIALIZER_LISTS
 #endif
 
 //
 //
 //   See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
 //
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
 
 //
 // versions check:
index fe5f3d840fa9eeb6e2074f8ec4b9e2bcfbae53eb..bbb7cf97f6dd2818133e09c9d50034dc5e8de8ec 100644 (file)
@@ -21,7 +21,6 @@
 #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL \r
 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP\r
 #define BOOST_NO_SWPRINTF\r
-#define BOOST_NO_INITIALIZER_LISTS\r
 \r
 #else\r
 \r
 //\r
 //   See boost\config\suffix.hpp for BOOST_NO_LONG_LONG\r
 //\r
+#define BOOST_NO_AUTO_DECLARATIONS\r
+#define BOOST_NO_AUTO_MULTIDECLARATIONS\r
 #define BOOST_NO_CHAR16_T\r
 #define BOOST_NO_CHAR32_T\r
+#define BOOST_NO_CONCEPTS\r
 #define BOOST_NO_CONSTEXPR\r
 #define BOOST_NO_DECLTYPE\r
 #define BOOST_NO_DEFAULTED_FUNCTIONS\r
 #define BOOST_NO_DELETED_FUNCTIONS\r
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS\r
 #define BOOST_NO_EXTERN_TEMPLATE\r
+#define BOOST_NO_INITIALIZER_LISTS\r
+#define BOOST_NO_LAMBDAS\r
+#define BOOST_NO_NULLPTR\r
 #define BOOST_NO_RAW_LITERALS\r
 #define BOOST_NO_RVALUE_REFERENCES\r
 #define BOOST_NO_SCOPED_ENUMS\r
 #define BOOST_NO_STATIC_ASSERT\r
+#define BOOST_NO_TEMPLATE_ALIASES\r
 #define BOOST_NO_UNICODE_LITERALS\r
 #define BOOST_NO_VARIADIC_TEMPLATES\r
-#define BOOST_NO_AUTO_DECLARATIONS\r
-#define BOOST_NO_AUTO_MULTIDECLARATIONS\r
 \r
 //\r
 // version check:\r
index f6a86ad50fd8ed2f9d4d9c171def832d2a938ac4..90688314ad5b5ccb88d3487be827730abb5ee61c 100644 (file)
 #undef BOOST_NO_SWPRINTF
 #undef BOOST_DEDUCED_TYPENAME
 
-#define BOOST_NO_INITIALIZER_LISTS
-//
-// C++0x features
-//
-//   See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
-//
-#define BOOST_NO_CHAR16_T
-#define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
-#define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DELETED_FUNCTIONS
-#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
-#define BOOST_NO_EXTERN_TEMPLATE
-#define BOOST_NO_RAW_LITERALS
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_SCOPED_ENUMS
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_UNICODE_LITERALS
-#define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-
 //
 // version check:
 // probably nothing to do here?
index 6553a46502a74a880b2f732c23ff728e4a0344dc..c4407232d07148e1b3f97eb50373432e4d79c3c2 100644 (file)
@@ -74,7 +74,6 @@
 //
 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
 #define BOOST_NO_ADL_BARRIER
-#define BOOST_NO_INITIALIZER_LISTS
 
 //
 // C++0x features
 #  define BOOST_NO_LONG_LONG
 #endif
 
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
 
 //
 // Version
index eb75cdbf8686acb8d66095569fd740d2ed0a61a4..b526a6b0fe9fa26f62d0f571c6e06e77e99d6f41 100644 (file)
@@ -47,7 +47,7 @@
 #endif
 //
 // last known and checked version is 600:
-#if (__IBMCPP__ > 600)
+#if (__IBMCPP__ > 1010)
 #  if defined(BOOST_ASSERT_CONFIG)
 #     error "Unknown compiler version - please run the configure tests and report the results"
 #  endif
 //
 //   See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
 //
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_STATIC_ASSERT
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
 
 
 
index 552e5bb160a70b74dbc90f50f2461d9e961822aa..2c3a2adf00b2489973b768db89298d6d7ddd050d 100644 (file)
 // disable Win32 API's if compiler extentions are
 // turned off:
 //
-#ifndef _MSC_EXTENSIONS
+#if !defined(_MSC_EXTENSIONS) && !defined(BOOST_DISABLE_WIN32)
 #  define BOOST_DISABLE_WIN32
 #endif
-#ifndef _CPPRTTI
+#if !defined(_CPPRTTI) && !defined(BOOST_NO_RTTI)
 #  define BOOST_NO_RTTI
 #endif
 
 // all versions support __declspec:
 //
 #define BOOST_HAS_DECLSPEC
+
 //
 // C++0x features
 //
 //   See above for BOOST_NO_LONG_LONG
+
+// C++ features supported by VC++ 10 (aka 2010)
+//
+#if _MSC_VER < 1600
+#define BOOST_NO_AUTO_DECLARATIONS
+#define BOOST_NO_AUTO_MULTIDECLARATIONS
+#define BOOST_NO_DECLTYPE
+#define BOOST_NO_LAMBDAS
+#define BOOST_NO_RVALUE_REFERENCES
+#define BOOST_NO_STATIC_ASSERT
+#endif // _MSC_VER < 1600
+
+// C++0x features not supported by any versions
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
+#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
-#define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_EXTERN_TEMPLATE
+#define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_SCOPED_ENUMS
+#define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
 
-// MSVC 2010 CTP has some support for C++0x, but we still disable it until the compiler release
-// #if _MSC_VER < 1600
-#define BOOST_NO_RVALUE_REFERENCES
-#define BOOST_NO_STATIC_ASSERT
-#define BOOST_NO_AUTO_DECLARATIONS
-#define BOOST_NO_AUTO_MULTIDECLARATIONS
-// #endif // _MSC_VER < 1600
-
 //
 // prefix and suffix headers:
 //
 #error "Compiler not supported or configured - please reconfigure"
 #endif
 //
-// last known and checked version is 1500 (VC9):
+// last known and checked version is 1600 (VC10, aka 2010):
 #if (_MSC_VER > 1600)
 #  if defined(BOOST_ASSERT_CONFIG)
 #     error "Unknown compiler version - please run the configure tests and report the results"
diff --git a/boost/boost/config/platform/vxworks.hpp b/boost/boost/config/platform/vxworks.hpp
new file mode 100755 (executable)
index 0000000..75b14ca
--- /dev/null
@@ -0,0 +1,31 @@
+//  (C) Copyright Dustin Spicuzza 2009. \r
+//  Use, modification and distribution are subject to the \r
+//  Boost Software License, Version 1.0. (See accompanying file \r
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+//  See http://www.boost.org for most recent version.\r
+\r
+//  vxWorks specific config options:\r
+\r
+#define BOOST_PLATFORM "vxWorks"\r
+\r
+#define BOOST_NO_CWCHAR\r
+#define BOOST_NO_INTRINSIC_WCHAR_T\r
+\r
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)\r
+#define BOOST_NO_INT64_T\r
+#endif\r
+\r
+#define BOOST_HAS_UNISTD_H\r
+\r
+// these allow posix_features to work, since vxWorks doesn't\r
+// define them itself\r
+#define _POSIX_TIMERS 1\r
+#define _POSIX_THREADS 1\r
+\r
+// vxworks doesn't work with asio serial ports\r
+#define BOOST_ASIO_DISABLE_SERIAL_PORT\r
+\r
+// boilerplate code:\r
+#include <boost/config/posix_features.hpp>\r
\r
index 4ce2c01546a1cfccc9c4af45188f412505f2e3b4..615bb064ff8c3baad511f095764d85aed9d05e56 100644 (file)
 // QNX:
 #  define BOOST_PLATFORM_CONFIG "boost/config/platform/qnxnto.hpp"
 
+#elif defined(__VXWORKS__)
+// vxWorks:
+#  define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp"
+
 #else
 
 #  if defined(unix) \
index 13e5e4cef021b7b50d06a804b0945f6df48bd346..2a1430aef4b0749c26b006110e39deee58c184df 100644 (file)
 
 // 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 <boost/config/no_tr1/utility.hpp>
+// First include <cstddef> to determine if some version of STLport is in use as the std lib
+// (do not rely on this header being included since users can short-circuit this header 
+//  if they know whose std lib they are using.)
+#include <cstddef>
 
 #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
 // STLPort library; this _must_ come first, otherwise since
 // can end up detecting that first rather than STLport:
 #  define BOOST_STDLIB_CONFIG "boost/config/stdlib/stlport.hpp"
 
-#elif defined(__LIBCOMO__)
+#else
+
+// If our std lib was not some version of STLport, then include <utility> as it is about 
+// the smallest of the std lib headers that includes real C++ stuff.  (Some std libs do not
+// include their C++-related macros in <cstddef> so this additional include makes sure
+// we get those definitions)
+// (again do not rely on this header being included since users can short-circuit this 
+//  header if they know whose std lib they are using.)
+#include <boost/config/no_tr1/utility.hpp>
+
+#if defined(__LIBCOMO__)
 // Comeau STL:
 #define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcomo.hpp"
 
@@ -64,5 +71,7 @@
 
 #endif
 
+#endif
+
 
 
index ff1aed943852ecb1fe661f48e18e282a5237f5fb..addf3357c8cc049f4d035126a4507067617b9c3c 100644 (file)
 #  define BOOST_NO_STD_ITERATOR_TRAITS
 #endif
 
-//
-// No std::unordered_* containers yet:
-//
-#define BOOST_NO_STD_UNORDERED
-
 #if defined(__ICL) && (__ICL < 800) && defined(_CPPLIB_VER) && (_CPPLIB_VER <= 310)
 // Intel C++ chokes over any non-trivial use of <locale>
 // this may be an overly restrictive define, but regex fails without it:
 #  define BOOST_NO_STD_LOCALE
 #endif
 
+//  C++0x headers implemented in 520 (as shipped by Microsoft)
+//
+#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
+#endif
+
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+
 #ifdef _CPPLIB_VER
 #  define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
 #else
index 3114094ecca01274b0d6ce8d55b9a3a7beef3697..06731e32e7053dfb8910b27e5d6f2687c4fcfa35 100644 (file)
 #  define BOOST_HAS_HASH
 #  define BOOST_HAS_SLIST
 #endif
+
+//  C++0x headers not yet implemented
 //
-// We never have the new C++0x unordered containers:
-//
-#define BOOST_NO_STD_UNORDERED
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
 
 //
 // Intrinsic type_traits support.
index 8e1c811b1aba9834ee6cab1f78f8c9d5ba2c2dab..6a57319ffd267a15ac5f4b4c9814e251aa24937d 100644 (file)
 # endif
 #endif
 
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
-#  define BOOST_NO_STD_UNORDERED
+//  stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
+//  __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
+//  developers. He also commented:
+//
+//       "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
+//       GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
+//       Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
+//       than any release in the 4.2 series."
+//
+//  Another resource for understanding stdlibc++ features is:
+//  http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
+
+//  C++0x headers in GCC 4.3.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED  // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
+#endif
+
+//  C++0x headers in GCC 4.4.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
 #endif
 
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+
+//  --- end ---
index e488d13aab5720c8ddcfd8c24d7c9588b8521972..7bd50cecb7c51986fb8b564e0a91619e792e225c 100644 (file)
 #ifndef MSIPL_WCHART
 #define BOOST_NO_STD_WSTRING
 #endif
+
+//  C++0x headers not yet implemented
 //
-// We never have the new C++0x unordered containers:
-//
-#define BOOST_NO_STD_UNORDERED
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
 
 #define BOOST_STDLIB "Modena C++ standard library"
 
index 746878debe841eb7f25ee8c621c3c976032d1e40..6bcd232a57350e13a802774c3816d675e5d7cd76 100644 (file)
 #  define BOOST_NO_STD_USE_FACET
 #  define BOOST_HAS_TWO_ARG_USE_FACET
 #endif
-//
-// We never have the new C++0x unordered containers:
-//
-#define BOOST_NO_STD_UNORDERED
 
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
 
 #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)
 
index 3e5888245a3070f6ac2272df30e14f3b1d022b71..cba2f54a1a0a2d02f942f460e68ad6da0c3b9027 100644 (file)
 #  endif
 #endif
 
-//
-// We never have the new C++0x unordered containers:
-//
-#define BOOST_NO_STD_UNORDERED
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
 
index b493d49cbd3bd3af1e0bac620687ae204e8c910f..c505008b7d77d5e6603011184db0361506a629b3 100644 (file)
@@ -76,7 +76,6 @@
 //
 #define BOOST_HAS_HASH
 #define BOOST_HAS_SLIST
-#define BOOST_NO_STD_UNORDERED
 
 //
 // If this is GNU libstdc++2, then no <limits> and no std::wstring:
 //
 #define BOOST_HAS_SGI_TYPE_TRAITS
 
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
+
 #define BOOST_STDLIB "SGI standard library"
 
 
index 82e4cff5d295d242f6a170b441c5f27dc839aed4..3dfd529effb940a797959b23cc5a5c035fd87c7b 100644 (file)
 #  endif
 #endif
 
-#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION < 0x500)
+#if defined(_STLPORT_VERSION) && ((_STLPORT_VERSION < 0x500) || (_STLPORT_VERSION >= 0x520))
 #  define BOOST_NO_STD_UNORDERED
 #endif
+
+#if defined(_STLPORT_VERSION) && (_STLPORT_VERSION >= 0x520)
+#  define BOOST_HAS_TR1_UNORDERED_SET
+#  define BOOST_HAS_TR1_UNORDERED_MAP
+#endif
 //
 // Without member template support enabled, their are no template
 // iterate constructors, and no std::allocator:
@@ -195,6 +200,31 @@ namespace std{ using _STLP_VENDOR_CSTD::strcmp; using _STLP_VENDOR_CSTD::strcpy;
 namespace boost { using std::min; using std::max; }
 #endif
 
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
+
 #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)
 
 
index c6c45660fc4daccfc13e00996a278928babab4dd..c8d6d5ad697e66fb353ad18c7377962534deeb6f 100644 (file)
 
 #define BOOST_HAS_MACRO_USE_FACET
 #define BOOST_NO_STD_MESSAGES
-#define BOOST_NO_STD_UNORDERED
+
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED        // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
 
 #define BOOST_STDLIB "Visual Age default standard library"
 
index ca803306720dcd7156fb6e63912a3647f87bd722..fa44986946cb70aa3fc589ea6d829da072ad8a9b 100644 (file)
 #  define BOOST_HASH_MAP_HEADER <hash_map>
 #endif
 
+//
+// Set BOOST_NO_INITIALIZER_LISTS if there is no library support.
+//
+
+#if defined(BOOST_NO_0X_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS)
+#  define BOOST_NO_INITIALIZER_LISTS
+#endif
+
 //  BOOST_HAS_ABI_HEADERS
 //  This macro gets set if we have headers that fix the ABI,
 //  and prevent ODR violations when linking to external libraries:
index e70c8340337ba4d7fa67b3229c3553d514989284..6be5aa1d8b1bef83fd99fe63b0553d1c96189d81 100644 (file)
@@ -464,6 +464,10 @@ namespace detail
         // 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 ];
+#elif defined(__GNUC__)
+        // old versions of GCC (before 4.0.2) choke on using byte_combos
+        // as a constant expression when compiling with -pedantic.
+        typedef value_type                   table_type[1ul << CHAR_BIT];
 #else
         typedef value_type                   table_type[ byte_combos ];
 #endif
index 91b0fa7b396912839e981b9017758935daecd60f..5d6ef48b05b149bded13d98e70a4757e3a2e3ad7 100755 (executable)
@@ -1,4 +1,4 @@
-/* Copyright 2003-2008 Joaquin M Lopez Munoz.
+/* Copyright 2003-2009 Joaquin M Lopez Munoz.
  * Distributed under the Boost Software License, Version 1.0.
  * (See accompanying file LICENSE_1_0.txt or copy at
  * http://www.boost.org/LICENSE_1_0.txt)
@@ -178,12 +178,31 @@ void construct(void* p,const Type& t)
   new (p) Type(t);
 }
 
+#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
+/* MSVC++ issues spurious warnings about unreferencend formal parameters
+ * in destroy<Type> when Type is a class with trivial dtor.
+ */
+
+#pragma warning(push)
+#pragma warning(disable:4100)  
+#endif
+
 template<typename Type>
 void destroy(const Type* p)
 {
+
+#if BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
+  const_cast<Type*>(p)->~Type();
+#else
   p->~Type();
+#endif
+
 }
 
+#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
+#pragma warning(pop)
+#endif
+
 } /* namespace boost::detail::allocator */
 
 } /* namespace boost::detail */
index 67031b9a63aadc565f699795b8158a4c11d9f580..04f2ac51351192be78812f4dd492acf041e5ecab 100644 (file)
 #include <boost/config.hpp>\r
 #include <boost/detail/workaround.hpp>\r
 \r
-#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)\r
-#define BOOST_HASH_CHAR_TRAITS string_char_traits\r
-#else\r
-#define BOOST_HASH_CHAR_TRAITS char_traits\r
-#endif\r
-\r
 #if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \\r
     || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \\r
     || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \\r
@@ -65,7 +59,13 @@ namespace std
 {\r
     template <class T> class allocator;\r
     template <class charT, class traits, class Allocator> class basic_string;\r
-    template <class charT> struct BOOST_HASH_CHAR_TRAITS;\r
+\r
+#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)\r
+    template <class charT> struct string_char_traits;\r
+#else\r
+    template <class charT> struct char_traits;\r
+#endif\r
+\r
     template <class T> class complex;\r
 }\r
 \r
index cb7d7a7b59d8006f63aded3dcef678aa2dd271fe..1c8fd5785b5aedebd3eb04ac4ec2d83386d5c80d 100644 (file)
@@ -63,7 +63,12 @@ namespace is_incrementable_
   tag operator,(tag,int);  
 #  define BOOST_comma(a,b) (a,b)
 # endif 
-  
+
+# if defined(BOOST_MSVC)
+#  pragma warning(push)
+#  pragma warning(disable:4913) // Warning about operator,
+# endif 
+
   // two check overloads help us identify which operator++ was picked
   char (& check(tag) )[2];
   
@@ -92,6 +97,11 @@ namespace is_incrementable_
         , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
       );
   };
+
+# if defined(BOOST_MSVC)
+#  pragma warning(pop)
+# endif 
+
 }
 
 # undef BOOST_comma
diff --git a/boost/boost/detail/scoped_enum_emulation.hpp b/boost/boost/detail/scoped_enum_emulation.hpp
new file mode 100755 (executable)
index 0000000..e5fe984
--- /dev/null
@@ -0,0 +1,56 @@
+//  scoped_enum_emulation.hpp  ---------------------------------------------------------//\r
+\r
+//  Copyright Beman Dawes, 2009\r
+\r
+//  Distributed under the Boost Software License, Version 1.0.\r
+//  See http://www.boost.org/LICENSE_1_0.txt\r
+\r
+//  Generates C++0x scoped enums if the feature is present, otherwise emulates C++0x\r
+//  scoped enums with C++03 namespaces and enums. The Boost.Config BOOST_NO_SCOPED_ENUMS\r
+//  macro is used to detect feature support.\r
+//\r
+//  See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf for a\r
+//  description of the scoped enum feature. Note that the committee changed the name\r
+//  from strongly typed enum to scoped enum.  \r
+//\r
+//  Caution: only the syntax is emulated; the semantics are not emulated and\r
+//  the syntax emulation doesn't include being able to specify the underlying\r
+//  representation type.\r
+//\r
+//  The emulation is via struct rather than namespace to allow use within classes.\r
+//  Thanks to Andrey Semashev for pointing that out.\r
+//\r
+//  Helpful comments and suggestions were also made by Kjell Elster, Phil Endecott,\r
+//  Joel Falcou, Mathias Gaunard, Felipe Magno de Almeida, Matt Calabrese, Vincente\r
+//  Botet, and Daniel James. \r
+//\r
+//  Sample usage:\r
+//\r
+//     BOOST_SCOPED_ENUM_START(algae) { green, red, cyan }; BOOST_SCOPED_ENUM_END\r
+//     ...\r
+//     BOOST_SCOPED_ENUM(algae) sample( algae::red );\r
+//     void foo( BOOST_SCOPED_ENUM(algae) color );\r
+//     ...\r
+//     sample = algae::green;\r
+//     foo( algae::cyan );\r
+\r
+#ifndef BOOST_SCOPED_ENUM_EMULATION_HPP\r
+#define BOOST_SCOPED_ENUM_EMULATION_HPP\r
+\r
+#include <boost/config.hpp>\r
+\r
+#ifdef BOOST_NO_SCOPED_ENUMS\r
+\r
+# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_t\r
+# define BOOST_SCOPED_ENUM_END };\r
+# define BOOST_SCOPED_ENUM(name) name::enum_t\r
+\r
+#else\r
+\r
+# define BOOST_SCOPED_ENUM_START(name) enum class name\r
+# define BOOST_SCOPED_ENUM_END\r
+# define BOOST_SCOPED_ENUM(name) name\r
+\r
+#endif\r
+\r
+#endif  // BOOST_SCOPED_ENUM_EMULATION_HPP\r
index ac7e7bfded2854a61e563f1c14816e2e6bef20eb..b777ff934ebfed8964c89ee0a2dc0b42e8694ccf 100755 (executable)
 // specialized on those types for this to work.
 
 #include <locale>
-// for mbstate_t
-#include <wchar.h>
-// for std::size_t
-#include <cstddef>
+#include <cwchar>   // for mbstate_t
+#include <cstddef>  // for std::size_t
 
 #include <boost/config.hpp>
 #include <boost/detail/workaround.hpp>
 
+#if defined(BOOST_NO_STDC_NAMESPACE)
 namespace std {
-    #if defined(__LIBCOMO__)
-        using ::mbstate_t;
-    #elif defined(BOOST_DINKUMWARE_STDLIB) && !defined(__BORLANDC__)
-        using ::mbstate_t;
-    #elif defined(__SGI_STL_PORT)
-    #elif defined(BOOST_NO_STDC_NAMESPACE)
-        using ::mbstate_t;
-        using ::codecvt;
-    #endif
-} // namespace std
+    using ::mbstate_t;
+    using ::size_t;
+}
+#endif
 
 #if !defined(__MSL_CPP__) && !defined(__LIBCOMO__)
     #define BOOST_CODECVT_DO_LENGTH_CONST const
diff --git a/boost/boost/exception/all.hpp b/boost/boost/exception/all.hpp
new file mode 100644 (file)
index 0000000..13ab3a7
--- /dev/null
@@ -0,0 +1,26 @@
+//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593\r
+#define UUID_316FDA946C0D11DEA9CBAE5255D89593\r
+\r
+#include <boost/exception/diagnostic_information.hpp>\r
+#include <boost/exception/error_info.hpp>\r
+#include <boost/exception/exception.hpp>\r
+#include <boost/exception/get_error_info.hpp>\r
+#include <boost/exception/info.hpp>\r
+#include <boost/exception/info_tuple.hpp>\r
+#include <boost/exception/errinfo_api_function.hpp>\r
+#include <boost/exception/errinfo_at_line.hpp>\r
+#include <boost/exception/errinfo_errno.hpp>\r
+#include <boost/exception/errinfo_file_handle.hpp>\r
+#include <boost/exception/errinfo_file_name.hpp>\r
+#include <boost/exception/errinfo_file_open_mode.hpp>\r
+#include <boost/exception/errinfo_type_info_name.hpp>\r
+#ifndef BOOST_NO_EXCEPTIONS\r
+#include <boost/exception_ptr.hpp>\r
+#endif\r
+\r
+#endif\r
diff --git a/boost/boost/exception/detail/attribute_noreturn.hpp b/boost/boost/exception/detail/attribute_noreturn.hpp
new file mode 100644 (file)
index 0000000..9d2102c
--- /dev/null
@@ -0,0 +1,19 @@
+//Copyright (c) 2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_61531AB0680611DEADD5846855D89593\r
+#define UUID_61531AB0680611DEADD5846855D89593\r
+\r
+#include <boost/config.hpp>\r
+\r
+#if defined(BOOST_MSVC)\r
+#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)\r
+#elif defined(__GNUC__)\r
+#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn))\r
+#else\r
+#define BOOST_ATTRIBUTE_NORETURN\r
+#endif\r
+\r
+#endif\r
diff --git a/boost/boost/exception/detail/exception_ptr_base.hpp b/boost/boost/exception/detail/exception_ptr_base.hpp
new file mode 100644 (file)
index 0000000..a5bcbeb
--- /dev/null
@@ -0,0 +1,26 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_DC4208C6417811DEBF11E1EC55D89593\r
+#define UUID_DC4208C6417811DEBF11E1EC55D89593\r
+\r
+namespace\r
+boost\r
+    {\r
+        namespace\r
+        exception_detail\r
+                {\r
+                class\r
+                exception_ptr_base\r
+                        {\r
+                        public:\r
+\r
+                        virtual void _rethrow() const=0;\r
+                        virtual bool _empty() const=0;\r
+                        };\r
+                }\r
+    }\r
+\r
+#endif\r
index 2c662201989d0e66a8417b8ffc5d641e23114f16..01f7b35823d3b0f2879b2f8222cc26ad6307f938 100755 (executable)
@@ -8,6 +8,7 @@
 
 #include <boost/config.hpp>
 #include <boost/exception/get_error_info.hpp>
+#include <boost/exception/detail/exception_ptr_base.hpp>
 #include <boost/utility/enable_if.hpp>
 #include <exception>
 #include <sstream>
@@ -41,16 +42,6 @@ boost
             enum e { value = !enable_boost_exception_overload<T>::value && sizeof(check((T*)0))==sizeof(yes) };
             };
 
-#ifndef BOOST_NO_RTTI
-        template <class T>
-        inline
-        std::string
-        dynamic_exception_type( T const & x )
-            {
-            return std::string("Dynamic exception type: ") + BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name();
-            }
-#endif
-
         inline
         char const *
         get_diagnostic_information( exception const & x )
@@ -72,43 +63,41 @@ boost
 
         inline
         std::string
-        boost_diagnostic_information( exception const & x )
+        diagnostic_information_impl( boost::exception const * be, std::exception const * se )
             {
-            std::ostringstream tmp;
-            if( char const * const * f=get_error_info<throw_file>(x) )
-                {
-                tmp << *f;
-                if( int const * l=get_error_info<throw_line>(x) )
-                    tmp << '(' << *l << "): ";
-                }
-            tmp << "Throw in function ";
-            if( char const * const * fn=get_error_info<throw_function>(x) )
-                tmp << *fn;
-            else
-                tmp << "(unknown)";
-            tmp << std::endl;
+            BOOST_ASSERT(be||se);
 #ifndef BOOST_NO_RTTI
-            tmp << dynamic_exception_type(x) << std::endl;
-            if( std::exception const * e=dynamic_cast<std::exception const *>(&x) )
-                tmp << "std::exception::what: " << e->what() << std::endl;
+            if( !se )
+                se = dynamic_cast<std::exception const *>(be);
+            if( !be )
+                be = dynamic_cast<boost::exception const *>(se);
 #endif
-            if( char const * s=exception_detail::get_diagnostic_information(x) )
-                if( *s )
-                    tmp << s;
-            return tmp.str();
-            }
-
-        inline
-        std::string
-        std_diagnostic_information( std::exception const & x )
-            {
             std::ostringstream tmp;
+            if( be )
+                {
+                if( char const * const * f=get_error_info<throw_file>(*be) )
+                    {
+                    tmp << *f;
+                    if( int const * l=get_error_info<throw_line>(*be) )
+                        tmp << '(' << *l << "): ";
+                    }
+                tmp << "Throw in function ";
+                if( char const * const * fn=get_error_info<throw_function>(*be) )
+                    tmp << *fn;
+                else
+                    tmp << "(unknown)";
+                tmp << '\n';
+                }
 #ifndef BOOST_NO_RTTI
-            if( exception const * e=dynamic_cast<exception const *>(&x) )
-                return boost_diagnostic_information(*e);
-            tmp << dynamic_exception_type(x) << std::endl;
+            tmp << std::string("Dynamic exception type: ") <<
+                (be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).name() << '\n';
 #endif
-            tmp << "std::exception::what: " << x.what() << std::endl;
+            if( se )
+                tmp << "std::exception::what: " << se->what() << '\n';
+            if( be )
+                if( char const * s=exception_detail::get_diagnostic_information(*be) )
+                    if( *s )
+                        tmp << s;
             return tmp.str();
             }
         }
@@ -118,7 +107,7 @@ boost
     typename enable_if<exception_detail::enable_boost_exception_overload<T>,std::string>::type
     diagnostic_information( T const & e )
         {
-        return exception_detail::boost_diagnostic_information(e);
+        return exception_detail::diagnostic_information_impl(&e,0);
         }
 
     template <class T>
@@ -126,7 +115,7 @@ boost
     typename enable_if<exception_detail::enable_std_exception_overload<T>,std::string>::type
     diagnostic_information( T const & e )
         {
-        return exception_detail::std_diagnostic_information(e);
+        return exception_detail::diagnostic_information_impl(0,&e);
         }
     }
 
@@ -139,14 +128,31 @@ boost
     std::string
     current_exception_diagnostic_information()
         {
-        if( boost::exception const * e=current_exception_cast<boost::exception const>() )
-            return diagnostic_information(*e);
-        else if( std::exception const * e=current_exception_cast<std::exception const>() )
-            return diagnostic_information(*e);
+        boost::exception const * be=current_exception_cast<boost::exception const>();
+        std::exception const * se=current_exception_cast<std::exception const>();
+        if( be || se )
+            return exception_detail::diagnostic_information_impl(be,se);
         else
             return "No diagnostic information available.";
         }
-       }
+
+    inline
+    std::string
+    diagnostic_information( exception_detail::exception_ptr_base const & p )
+        {
+        if( !p._empty() )
+            try
+                {
+                p._rethrow();
+                }
+            catch(
+            ... )
+                {
+                return current_exception_diagnostic_information();
+                }
+        return "<empty>";
+        }
+    }
 #endif
 
 #endif
diff --git a/boost/boost/exception/errinfo_api_function.hpp b/boost/boost/exception/errinfo_api_function.hpp
new file mode 100644 (file)
index 0000000..7b6a9fe
--- /dev/null
@@ -0,0 +1,22 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_DDFBB4546C1211DEA4659E9055D89593\r
+#define UUID_DDFBB4546C1211DEA4659E9055D89593\r
+\r
+#include "boost/exception/error_info.hpp"\r
+\r
+namespace\r
+boost\r
+    {\r
+    //Usage hint:\r
+    //if( api_function(....)!=0 )\r
+    //    BOOST_THROW_EXCEPTION(\r
+    //        failure() <<\r
+    //        errinfo_api_function("api_function") );\r
+    typedef error_info<struct errinfo_api_function_,char const *> errinfo_api_function;\r
+    }\r
+\r
+#endif\r
diff --git a/boost/boost/exception/errinfo_at_line.hpp b/boost/boost/exception/errinfo_at_line.hpp
new file mode 100644 (file)
index 0000000..cc422ce
--- /dev/null
@@ -0,0 +1,18 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_E7255CE26C1211DE85800C9155D89593\r
+#define UUID_E7255CE26C1211DE85800C9155D89593\r
+\r
+namespace\r
+boost\r
+    {\r
+    template <class Tag,class T> class error_info;\r
+\r
+    //Use with parsing errors exceptions, for example in a XML file parser.\r
+    typedef error_info<struct errinfo_at_line_,int> errinfo_at_line;\r
+    }\r
+\r
+#endif\r
diff --git a/boost/boost/exception/errinfo_errno.hpp b/boost/boost/exception/errinfo_errno.hpp
new file mode 100644 (file)
index 0000000..2e781f4
--- /dev/null
@@ -0,0 +1,35 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593\r
+#define UUID_F0EE17BE6C1211DE87FF459155D89593\r
+\r
+#include "boost/exception/info.hpp"\r
+#include <errno.h>\r
+#include <string.h>\r
+\r
+namespace\r
+boost\r
+    {\r
+    typedef error_info<struct errinfo_errno_,int> errinfo_errno;\r
+\r
+    //Usage hint:\r
+    //if( c_function(....)!=0 )\r
+    //    BOOST_THROW_EXCEPTION(\r
+    //        failure() <<\r
+    //        errinfo_errno(errno) <<\r
+    //        errinfo_api_function("c_function") );\r
+    inline\r
+    std::string\r
+    to_string( errinfo_errno const & e )\r
+        {\r
+        std::ostringstream tmp;\r
+        int v=e.value();\r
+        tmp << v << ", \"" << strerror(v) << "\"";\r
+        return tmp.str();\r
+        }\r
+    }\r
+\r
+#endif\r
diff --git a/boost/boost/exception/errinfo_file_handle.hpp b/boost/boost/exception/errinfo_file_handle.hpp
new file mode 100644 (file)
index 0000000..5b9673d
--- /dev/null
@@ -0,0 +1,20 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_F79E6EE26C1211DEB26E929155D89593\r
+#define UUID_F79E6EE26C1211DEB26E929155D89593\r
+\r
+#include <stdio.h>\r
+\r
+namespace\r
+boost\r
+    {\r
+    template <class> class weak_ptr;\r
+    template <class Tag,class T> class error_info;\r
+\r
+    typedef error_info<struct errinfo_file_handle_,weak_ptr<FILE> > errinfo_file_handle;\r
+    }\r
+\r
+#endif\r
diff --git a/boost/boost/exception/errinfo_file_name.hpp b/boost/boost/exception/errinfo_file_name.hpp
new file mode 100644 (file)
index 0000000..c6f1c9e
--- /dev/null
@@ -0,0 +1,26 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_FEE5120A6C1211DE94E8BC9155D89593\r
+#define UUID_FEE5120A6C1211DE94E8BC9155D89593\r
+\r
+#include <string>\r
+\r
+namespace\r
+boost\r
+    {\r
+    template <class Tag,class T> class error_info;\r
+\r
+    //Usage hint:\r
+    //FILE * f=fopen(name,mode);\r
+    //if( !f )\r
+    //    BOOST_THROW_EXCEPTION(\r
+    //        file_open_error() <<\r
+    //        errinfo_file_name(name) <<\r
+    //        errinfo_file_open_mode(mode) );\r
+    typedef error_info<struct errinfo_file_name_,std::string> errinfo_file_name;\r
+    }\r
+\r
+#endif\r
diff --git a/boost/boost/exception/errinfo_file_open_mode.hpp b/boost/boost/exception/errinfo_file_open_mode.hpp
new file mode 100644 (file)
index 0000000..c1bbaa1
--- /dev/null
@@ -0,0 +1,26 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_056F1F266C1311DE8E74299255D89593\r
+#define UUID_056F1F266C1311DE8E74299255D89593\r
+\r
+#include <string>\r
+\r
+namespace\r
+boost\r
+    {\r
+    template <class Tag,class T> class error_info;\r
+\r
+    //Usage hint:\r
+    //FILE * f=fopen(name,mode);\r
+    //if( !f )\r
+    //    BOOST_THROW_EXCEPTION(\r
+    //        file_open_error() <<\r
+    //        errinfo_file_name(name) <<\r
+    //        errinfo_file_open_mode(mode) );\r
+    typedef error_info<struct errinfo_file_open_mode_,std::string> errinfo_file_open_mode;\r
+    }\r
+\r
+#endif\r
diff --git a/boost/boost/exception/errinfo_type_info_name.hpp b/boost/boost/exception/errinfo_type_info_name.hpp
new file mode 100644 (file)
index 0000000..dbd9abf
--- /dev/null
@@ -0,0 +1,23 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.\r
+\r
+//Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef UUID_0E11109E6C1311DEB7EA649255D89593\r
+#define UUID_0E11109E6C1311DEB7EA649255D89593\r
+\r
+#include <string>\r
+\r
+namespace\r
+boost\r
+    {\r
+    template <class Tag,class T> class error_info;\r
+\r
+    //Usage hint:\r
+    //BOOST_THROW_EXCEPTION(\r
+    //    bad_type() <<\r
+    //    errinfo_type_info_name(typeid(x).name()) );\r
+    typedef error_info<struct errinfo_type_info_name_,std::string> errinfo_type_info_name;\r
+    }\r
+\r
+#endif\r
index 6df93aca8bce608915dc9419957e146d1caf38d1..6233f19b3abddb3d808be1c9f55a2dd283306e0b 100755 (executable)
@@ -80,13 +80,13 @@ boost
     template <class Tag,class T>
     class error_info;
 
-    typedef error_info<struct tag_throw_function,char const *> throw_function;
-    typedef error_info<struct tag_throw_file,char const *> throw_file;
-    typedef error_info<struct tag_throw_line,int> throw_line;
+    typedef error_info<struct throw_function_,char const *> throw_function;
+    typedef error_info<struct throw_file_,char const *> throw_file;
+    typedef error_info<struct throw_line_,int> throw_line;
 
     template <>
     class
-    error_info<tag_throw_function,char const *>
+    error_info<throw_function_,char const *>
         {
         public:
         typedef char const * value_type;
@@ -100,7 +100,7 @@ boost
 
     template <>
     class
-    error_info<tag_throw_file,char const *>
+    error_info<throw_file_,char const *>
         {
         public:
         typedef char const * value_type;
@@ -114,7 +114,7 @@ boost
 
     template <>
     class
-    error_info<tag_throw_line,int>
+    error_info<throw_line_,int>
         {
         public:
         typedef int value_type;
index 92a347eb5fcba2ce101bdfc1d76067478caccf91..328563865d7e0b4f8bd1c371a1191dae53005c63 100755 (executable)
@@ -106,7 +106,7 @@ boost
                     for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
                         {
                         shared_ptr<error_info_base const> const & x = i->second;
-                        tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << std::endl;
+                        tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n';
                         }
                     tmp.str().swap(diagnostic_info_str_);
                     }
index 28300e579f1a1e6027220907fef53c1194b0922b..9dd93a5acf3580ccfc38a411f5efdf003ca1cf0b 100644 (file)
@@ -37,7 +37,7 @@ namespace boost {
     template< class Ch, class Tr, class Alloc>
     basic_format<Ch, Tr, Alloc>:: basic_format(const Ch* s, const std::locale & loc)
         : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
-          loc_(loc), exceptions_(io::all_error_bits)
+          exceptions_(io::all_error_bits), loc_(loc)
     {
         if(s) parse( s );
     }
@@ -45,7 +45,7 @@ namespace boost {
     template< class Ch, class Tr, class Alloc>
     basic_format<Ch, Tr, Alloc>:: basic_format(const string_type& s, const std::locale & loc)
         : style_(0), cur_arg_(0), num_args_(0), dumped_(false),
-          loc_(loc), exceptions_(io::all_error_bits)
+          exceptions_(io::all_error_bits), loc_(loc)
     {
         parse(s);  
     }
index c4621ac3726a8008aa05884246d1f38b32748ddd..b14ca82c984699c12fa0dcdb4a8285609aedc85c 100644 (file)
@@ -48,7 +48,7 @@ namespace detail {
 #if ! defined( BOOST_NO_LOCALE_ISDIGIT )
         return fac.is(std::ctype<Ch>::digit, c);
 # else
-        (void) fac;    // remove "unused parameter" warning
+        (void) fac;     // remove "unused parameter" warning
         using namespace std;
         return isdigit(c); 
 #endif 
index 6612fb8415229eae7d98c87dc780c47716f13b3e..c4663c35a873f168995c4cdf79a2f48e48e668aa 100644 (file)
@@ -18,6 +18,9 @@
 #include <typeinfo>
 #include <boost/config.hpp>
 #include <boost/assert.hpp>
+#include <boost/integer.hpp>
+#include <boost/type_traits/has_trivial_copy.hpp>
+#include <boost/type_traits/has_trivial_destructor.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/is_integral.hpp>
 #include <boost/type_traits/is_volatile.hpp>
@@ -42,7 +45,7 @@
 #endif       
 
 // Define BOOST_FUNCTION_STD_NS to the namespace that contains type_info.
-#ifdef BOOST_NO_EXCEPTION_STD_NAMESPACE
+#ifdef BOOST_NO_STD_TYPEINFO
 // Embedded VC++ does not have type_info in namespace std
 #  define BOOST_FUNCTION_STD_NS
 #else
@@ -259,6 +262,12 @@ namespace boost {
           A(a)
         {
         }
+       
+       functor_wrapper(const functor_wrapper& f) :
+          F(static_cast<const F&>(f)),
+          A(static_cast<const A&>(f))
+       {
+       }
       };
 
       /**
@@ -625,7 +634,7 @@ public:
     if (!vtable) return typeid(void);
 
     detail::function::function_buffer type;
-    vtable->manager(functor, type, detail::function::get_functor_type_tag);
+    get_vtable()->manager(functor, type, detail::function::get_functor_type_tag);
     return *type.type.type;
   }
 
@@ -638,7 +647,7 @@ public:
       type_result.type.type = &typeid(Functor);
       type_result.type.const_qualified = is_const<Functor>::value;
       type_result.type.volatile_qualified = is_volatile<Functor>::value;
-      vtable->manager(functor, type_result, 
+      get_vtable()->manager(functor, type_result, 
                       detail::function::check_functor_type_tag);
       return static_cast<Functor*>(type_result.obj_ptr);
     }
@@ -656,7 +665,7 @@ public:
       type_result.type.type = &typeid(Functor);
       type_result.type.const_qualified = true;
       type_result.type.volatile_qualified = is_volatile<Functor>::value;
-      vtable->manager(functor, type_result, 
+      get_vtable()->manager(functor, type_result, 
                       detail::function::check_functor_type_tag);
       // GCC 2.95.3 gets the CV qualifiers wrong here, so we
       // can't do the static_cast that we should do.
@@ -702,6 +711,15 @@ public:
 #endif
 
 public: // should be protected, but GCC 2.95.3 will fail to allow access
+  detail::function::vtable_base* get_vtable() const {
+    return reinterpret_cast<detail::function::vtable_base*>(
+             reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
+  }
+
+  bool has_trivial_copy_and_destroy() const {
+    return reinterpret_cast<std::size_t>(vtable) & 0x01;
+  }
+
   detail::function::vtable_base* vtable;
   mutable detail::function::function_buffer functor;
 };
@@ -877,4 +895,8 @@ namespace detail {
 #undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL
 #undef BOOST_FUNCTION_COMPARE_TYPE_ID
 
+#if defined(BOOST_MSVC)
+#   pragma warning( pop )
+#endif       
+
 #endif // BOOST_FUNCTION_BASE_HEADER
index 08792631993db01731a8ac2ffccf6200b8881745..cc092838124553d5b5a222ae45488454324f3b4c 100644 (file)
@@ -21,7 +21,7 @@ namespace boost { namespace python { namespace objects {
 \r
 #if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)                    \\r
  || defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)                         \\r
- || !(BOOST_STRICT_CONFIG || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)\r
+ || !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)\r
 #  define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX\r
 #endif\r
 \r
index 584abe96ba17a54964a9c2353a140648e60c3586..6a99109ab12737141a0960281afa51bd952ecc5d 100644 (file)
@@ -11,6 +11,7 @@
 // Note: this header is a header template and must NOT have multiple-inclusion
 // protection.
 #include <boost/function/detail/prologue.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
 
 #if defined(BOOST_MSVC)
 #   pragma warning( push )
@@ -624,14 +625,10 @@ namespace boost {
         assign_to(const reference_wrapper<FunctionObj>& f, 
                   function_buffer& functor, function_obj_ref_tag)
         {
-          if (!boost::detail::function::has_empty_target(f.get_pointer())) {
-            functor.obj_ref.obj_ptr = (void *)f.get_pointer();
-            functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
-            functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
-            return true;
-          } else {
-            return false;
-          }
+          functor.obj_ref.obj_ptr = (void *)f.get_pointer();
+          functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
+          functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
+          return true;
         }
         template<typename FunctionObj,typename Allocator>
         bool 
@@ -678,6 +675,11 @@ namespace boost {
               R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
       vtable_type;
 
+    vtable_type* get_vtable() const {
+      return reinterpret_cast<vtable_type*>(
+               reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
+    }
+
     struct clear_type {};
 
   public:
@@ -757,7 +759,7 @@ namespace boost {
       if (this->empty())
         boost::throw_exception(bad_function_call());
 
-      return static_cast<vtable_type*>(vtable)->invoker
+      return get_vtable()->invoker
                (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
     }
 #else
@@ -781,24 +783,26 @@ namespace boost {
     operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
     {
       this->clear();
-      try {
+      BOOST_TRY  {
         this->assign_to(f);
-      } catch (...) {
+      } BOOST_CATCH (...) {
         vtable = 0;
-        throw;
+        BOOST_RETHROW;
       }
+      BOOST_CATCH_END
       return *this;
     }
     template<typename Functor,typename Allocator>
     void assign(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a)
     {
       this->clear();
-      try {
+      BOOST_TRY{
         this->assign_to_a(f,a);
-      } catch (...) {
+      } BOOST_CATCH (...) {
         vtable = 0;
-        throw;
+        BOOST_RETHROW;
       }
+      BOOST_CATCH_END
     }
 
 #ifndef BOOST_NO_SFINAE
@@ -823,12 +827,13 @@ namespace boost {
         return *this;
 
       this->clear();
-      try {
+      BOOST_TRY {
         this->assign_to_own(f);
-      } catch (...) {
+      } BOOST_CATCH (...) {
         vtable = 0;
-        throw;
+        BOOST_RETHROW;
       }
+      BOOST_CATCH_END
       return *this;
     }
 
@@ -847,7 +852,8 @@ namespace boost {
     void clear()
     {
       if (vtable) {
-        reinterpret_cast<vtable_type*>(vtable)->clear(this->functor);
+        if (!this->has_trivial_copy_and_destroy())
+          get_vtable()->clear(this->functor);
         vtable = 0;
       }
     }
@@ -876,8 +882,11 @@ namespace boost {
     {
       if (!f.empty()) {
         this->vtable = f.vtable;
-        f.vtable->manager(f.functor, this->functor,
-                          boost::detail::function::clone_functor_tag);
+        if (this->has_trivial_copy_and_destroy())
+          this->functor = f.functor;
+        else
+          get_vtable()->base.manager(f.functor, this->functor,
+                                     boost::detail::function::clone_functor_tag);
       }
     }
 
@@ -903,8 +912,15 @@ namespace boost {
       static vtable_type stored_vtable = 
         { { &manager_type::manage }, &invoker_type::invoke };
 
-      if (stored_vtable.assign_to(f, functor)) vtable = &stored_vtable.base;
-      else vtable = 0;
+      if (stored_vtable.assign_to(f, functor)) {
+        std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
+        if (boost::has_trivial_copy_constructor<Functor>::value &&
+            boost::has_trivial_destructor<Functor>::value &&
+            detail::function::function_allows_small_object_optimization<Functor>::value)
+          value |= (std::size_t)0x01;
+        vtable = reinterpret_cast<detail::function::vtable_base *>(value);
+      } else 
+        vtable = 0;
     }
 
     template<typename Functor,typename Allocator>
@@ -930,8 +946,15 @@ namespace boost {
       static vtable_type stored_vtable =
         { { &manager_type::manage }, &invoker_type::invoke };
 
-      if (stored_vtable.assign_to_a(f, functor, a)) vtable = &stored_vtable.base;
-      else vtable = 0;
+      if (stored_vtable.assign_to_a(f, functor, a)) { 
+        std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
+        if (boost::has_trivial_copy_constructor<Functor>::value &&
+            boost::has_trivial_destructor<Functor>::value &&
+            detail::function::function_allows_small_object_optimization<Functor>::value)
+          value |= (std::size_t)0x01;
+        vtable = reinterpret_cast<detail::function::vtable_base *>(value);
+      } else 
+        vtable = 0;
     }
 
     // Moves the value from the specified argument to *this. If the argument 
@@ -942,23 +965,23 @@ namespace boost {
       if (&f == this)
         return;
 
-#if !defined(BOOST_NO_EXCEPTIONS)      
-      try {
-#endif
+      BOOST_TRY {
         if (!f.empty()) {
           this->vtable = f.vtable;
-          f.vtable->manager(f.functor, this->functor,
-                            boost::detail::function::move_functor_tag);
-                 f.vtable = 0;
-#if !defined(BOOST_NO_EXCEPTIONS)      
+          if (this->has_trivial_copy_and_destroy())
+            this->functor = f.functor;
+          else
+            get_vtable()->base.manager(f.functor, this->functor,
+                                     boost::detail::function::move_functor_tag);
+          f.vtable = 0;
         } else {
           clear();
         }
-      } catch (...) {
+      } BOOST_CATCH (...) {
         vtable = 0;
-        throw;
+        BOOST_RETHROW;
       }
-#endif
+      BOOST_CATCH_END
     }
   };
 
@@ -979,13 +1002,14 @@ namespace boost {
   template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS>
   typename BOOST_FUNCTION_FUNCTION<
       R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>::result_type
-   BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
+  inline 
+  BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
   ::operator()(BOOST_FUNCTION_PARMS) const
   {
     if (this->empty())
       boost::throw_exception(bad_function_call());
 
-    return reinterpret_cast<const vtable_type*>(vtable)->invoker
+    return get_vtable()->invoker
              (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
   }
 #endif
diff --git a/boost/boost/functional/detail/container_fwd.hpp b/boost/boost/functional/detail/container_fwd.hpp
new file mode 100644 (file)
index 0000000..2388e64
--- /dev/null
@@ -0,0 +1,19 @@
+\r
+// Copyright 2005-2008 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+// Forwarding header for container_fwd.hpp's new location.\r
+// This header is deprecated, I'll be adding a warning in a future release,\r
+// then converting it to an error and finally removing this header completely.\r
+\r
+#if !defined(BOOST_FUNCTIONAL_DETAIL_CONTAINER_FWD_HPP)\r
+#define BOOST_FUNCTIONAL_DETAIL_CONTAINER_FWD_HPP\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+#include <boost/detail/container_fwd.hpp>\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash.hpp b/boost/boost/functional/hash.hpp
new file mode 100644 (file)
index 0000000..80f7fa9
--- /dev/null
@@ -0,0 +1,7 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#include <boost/functional/hash/hash.hpp>\r
+\r
diff --git a/boost/boost/functional/hash/detail/float_functions.hpp b/boost/boost/functional/hash/detail/float_functions.hpp
new file mode 100644 (file)
index 0000000..b46b673
--- /dev/null
@@ -0,0 +1,246 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP)\r
+#define BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP\r
+\r
+#include <boost/config.hpp>\r
+#include <boost/config/no_tr1/cmath.hpp>\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+// The C++ standard requires that the C float functions are overloarded\r
+// for float, double and long double in the std namespace, but some of the older\r
+// library implementations don't support this. On some that don't, the C99\r
+// float functions (frexpf, frexpl, etc.) are available.\r
+//\r
+// The following tries to automatically detect which are available.\r
+\r
+namespace boost {\r
+    namespace hash_detail {\r
+\r
+        // Returned by dummy versions of the float functions.\r
+    \r
+        struct not_found {\r
+            // Implicitly convertible to float and long double in order to avoid\r
+            // a compile error when the dummy float functions are used.\r
+\r
+            inline operator float() const { return 0; }\r
+            inline operator long double() const { return 0; }\r
+        };\r
+          \r
+        // A type for detecting the return type of functions.\r
+\r
+        template <typename T> struct is;\r
+        template <> struct is<float> { char x[10]; };\r
+        template <> struct is<double> { char x[20]; };\r
+        template <> struct is<long double> { char x[30]; };\r
+        template <> struct is<boost::hash_detail::not_found> { char x[40]; };\r
+            \r
+        // Used to convert the return type of a function to a type for sizeof.\r
+\r
+        template <typename T> is<T> float_type(T);\r
+\r
+        // call_ldexp\r
+        //\r
+        // This will get specialized for float and long double\r
+        \r
+        template <typename Float> struct call_ldexp\r
+        {\r
+            typedef double float_type;\r
+            \r
+            inline double operator()(double a, int b) const\r
+            {\r
+                using namespace std;\r
+                return ldexp(a, b);\r
+            }\r
+        };\r
+\r
+        // call_frexp\r
+        //\r
+        // This will get specialized for float and long double\r
+\r
+        template <typename Float> struct call_frexp\r
+        {\r
+            typedef double float_type;\r
+            \r
+            inline double operator()(double a, int* b) const\r
+            {\r
+                using namespace std;\r
+                return frexp(a, b);\r
+            }\r
+        };\r
+    }\r
+}\r
+            \r
+// A namespace for dummy functions to detect when the actual function we want\r
+// isn't available. ldexpl, ldexpf etc. might be added tby the macros below.\r
+//\r
+// AFAICT these have to be outside of the boost namespace, as if they're in\r
+// the boost namespace they'll always be preferable to any other function\r
+// (since the arguments are built in types, ADL can't be used).\r
+\r
+namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS {\r
+    template <class Float> boost::hash_detail::not_found ldexp(Float, int);\r
+    template <class Float> boost::hash_detail::not_found frexp(Float, int*);    \r
+}\r
+\r
+// Macros for generating specializations of call_ldexp and call_frexp.\r
+//\r
+// check_cpp and check_c99 check if the C++ or C99 functions are available.\r
+//\r
+// Then the call_* functions select an appropriate implementation.\r
+//\r
+// I used c99_func in a few places just to get a unique name.\r
+//\r
+// Important: when using 'using namespace' at namespace level, include as\r
+// little as possible in that namespace, as Visual C++ has an odd bug which\r
+// can cause the namespace to be imported at the global level. This seems to\r
+// happen mainly when there's a template in the same namesapce.\r
+\r
+#define BOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2)    \\r
+namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS {                           \\r
+    template <class Float>                                              \\r
+    boost::hash_detail::not_found c99_func(Float, type2);               \\r
+}                                                                       \\r
+                                                                        \\r
+namespace boost {                                                       \\r
+    namespace hash_detail {                                             \\r
+        namespace c99_func##_detect {                                   \\r
+            using namespace std;                                        \\r
+            using namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS;          \\r
+                                                                        \\r
+            struct check {                                              \\r
+                static type1 x;                                         \\r
+                static type2 y;                                         \\r
+                BOOST_STATIC_CONSTANT(bool, cpp =                       \\r
+                    sizeof(float_type(cpp_func(x,y)))                   \\r
+                        == sizeof(is<type1>));                          \\r
+                BOOST_STATIC_CONSTANT(bool, c99 =                       \\r
+                    sizeof(float_type(c99_func(x,y)))                   \\r
+                        == sizeof(is<type1>));                          \\r
+            };                                                          \\r
+        }                                                               \\r
+                                                                        \\r
+        template <bool x>                                               \\r
+        struct call_c99_##c99_func :                                    \\r
+            boost::hash_detail::call_##cpp_func<double> {};             \\r
+                                                                        \\r
+        template <>                                                     \\r
+        struct call_c99_##c99_func<true> {                              \\r
+            typedef type1 float_type;                                   \\r
+                                                                        \\r
+            template <typename T>                                       \\r
+            inline type1 operator()(type1 a, T b)  const                \\r
+            {                                                           \\r
+                using namespace std;                                    \\r
+                return c99_func(a, b);                                  \\r
+            }                                                           \\r
+        };                                                              \\r
+                                                                        \\r
+        template <bool x>                                               \\r
+        struct call_cpp_##c99_func :                                    \\r
+            call_c99_##c99_func<                                        \\r
+                ::boost::hash_detail::c99_func##_detect::check::c99     \\r
+            > {};                                                       \\r
+                                                                        \\r
+        template <>                                                     \\r
+        struct call_cpp_##c99_func<true> {                              \\r
+            typedef type1 float_type;                                   \\r
+                                                                        \\r
+            template <typename T>                                       \\r
+            inline type1 operator()(type1 a, T b)  const                \\r
+            {                                                           \\r
+                using namespace std;                                    \\r
+                return cpp_func(a, b);                                  \\r
+            }                                                           \\r
+        };                                                              \\r
+                                                                        \\r
+        template <>                                                     \\r
+        struct call_##cpp_func<type1> :                                 \\r
+            call_cpp_##c99_func<                                        \\r
+                ::boost::hash_detail::c99_func##_detect::check::cpp     \\r
+            > {};                                                       \\r
+    }                                                                   \\r
+}\r
+\r
+#define BOOST_HASH_CALL_FLOAT_MACRO(cpp_func, c99_func, type1, type2)   \\r
+namespace boost {                                                       \\r
+    namespace hash_detail {                                             \\r
+                                                                        \\r
+        template <>                                                     \\r
+        struct call_##cpp_func<type1> {                                 \\r
+            typedef type1 float_type;                                   \\r
+            inline type1 operator()(type1 x, type2 y) const {           \\r
+                return c99_func(x, y);                                  \\r
+            }                                                           \\r
+        };                                                              \\r
+    }                                                                   \\r
+}\r
+\r
+#if defined(ldexpf)\r
+BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpf, float, int)\r
+#else\r
+BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpf, float, int)\r
+#endif\r
+\r
+#if defined(ldexpl)\r
+BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpl, long double, int)\r
+#else\r
+BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpl, long double, int)\r
+#endif\r
+\r
+#if defined(frexpf)\r
+BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpf, float, int*)\r
+#else\r
+BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpf, float, int*)\r
+#endif\r
+\r
+#if defined(frexpl)\r
+BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpl, long double, int*)\r
+#else\r
+BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpl, long double, int*)\r
+#endif\r
+\r
+#undef BOOST_HASH_CALL_FLOAT_MACRO\r
+#undef BOOST_HASH_CALL_FLOAT_FUNC\r
+\r
+\r
+namespace boost\r
+{\r
+    namespace hash_detail\r
+    {\r
+        template <typename Float1, typename Float2>\r
+        struct select_hash_type_impl {\r
+            typedef double type;\r
+        };\r
+\r
+        template <>\r
+        struct select_hash_type_impl<float, float> {\r
+            typedef float type;\r
+        };\r
+\r
+        template <>\r
+        struct select_hash_type_impl<long double, long double> {\r
+            typedef long double type;\r
+        };\r
+\r
+\r
+        // select_hash_type\r
+        //\r
+        // If there is support for a particular floating point type, use that\r
+        // otherwise use double (there's always support for double).\r
+             \r
+        template <typename Float>\r
+        struct select_hash_type : select_hash_type_impl<\r
+                BOOST_DEDUCED_TYPENAME call_ldexp<Float>::float_type,\r
+                BOOST_DEDUCED_TYPENAME call_frexp<Float>::float_type\r
+            > {};            \r
+    }\r
+}\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash/detail/hash_float.hpp b/boost/boost/functional/hash/detail/hash_float.hpp
new file mode 100644 (file)
index 0000000..8108f46
--- /dev/null
@@ -0,0 +1,101 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER)\r
+#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+#include <boost/config.hpp>\r
+#include <boost/functional/hash/detail/float_functions.hpp>\r
+#include <boost/functional/hash/detail/limits.hpp>\r
+#include <boost/integer/static_log2.hpp>\r
+#include <boost/cstdint.hpp>\r
+#include <boost/assert.hpp>\r
+\r
+// Include hash implementation for the current platform.\r
+\r
+// Cygwn\r
+#if defined(__CYGWIN__)\r
+#  if defined(__i386__) || defined(_M_IX86)\r
+#    include <boost/functional/hash/detail/hash_float_x86.hpp>\r
+#  else\r
+#    include <boost/functional/hash/detail/hash_float_generic.hpp>\r
+#  endif\r
+#else\r
+#  include <boost/functional/hash/detail/hash_float_generic.hpp>\r
+#endif\r
+\r
+// Can we use fpclassify?\r
+\r
+// STLport\r
+#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)\r
+#define BOOST_HASH_USE_FPCLASSIFY 0\r
+\r
+// GNU libstdc++ 3\r
+#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)\r
+#  if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \\r
+      !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))\r
+#    define BOOST_HASH_USE_FPCLASSIFY 1\r
+#  else\r
+#    define BOOST_HASH_USE_FPCLASSIFY 0\r
+#  endif\r
+\r
+// Everything else\r
+#else\r
+#  define BOOST_HASH_USE_FPCLASSIFY 0\r
+#endif\r
+\r
+#if BOOST_HASH_USE_FPCLASSIFY\r
+\r
+#include <boost/config/no_tr1/cmath.hpp>\r
+\r
+namespace boost\r
+{\r
+    namespace hash_detail\r
+    {\r
+        template <class T>\r
+        inline std::size_t float_hash_value(T v)\r
+        {\r
+            using namespace std;\r
+            switch (fpclassify(v)) {\r
+            case FP_ZERO:\r
+                return 0;\r
+            case FP_INFINITE:\r
+                return (std::size_t)(v > 0 ? -1 : -2);\r
+            case FP_NAN:\r
+                return (std::size_t)(-3);\r
+            case FP_NORMAL:\r
+            case FP_SUBNORMAL:\r
+                return float_hash_impl(v);\r
+            default:\r
+                BOOST_ASSERT(0);\r
+                return 0;\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+#else // !BOOST_HASH_USE_FPCLASSIFY\r
+\r
+namespace boost\r
+{\r
+    namespace hash_detail\r
+    {\r
+        template <class T>\r
+        inline std::size_t float_hash_value(T v)\r
+        {\r
+            return v == 0 ? 0 : float_hash_impl(v);\r
+        }\r
+    }\r
+}\r
+\r
+#endif // BOOST_HASH_USE_FPCLASSIFY\r
+\r
+#undef BOOST_HASH_USE_FPCLASSIFY\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash/detail/hash_float_generic.hpp b/boost/boost/functional/hash/detail/hash_float_generic.hpp
new file mode 100644 (file)
index 0000000..abb16a6
--- /dev/null
@@ -0,0 +1,93 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+// A general purpose hash function for non-zero floating point values.\r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_GENERIC_HEADER)\r
+#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_GENERIC_HEADER\r
+\r
+#include <boost/functional/hash/detail/float_functions.hpp>\r
+#include <boost/integer/static_log2.hpp>\r
+#include <boost/functional/hash/detail/limits.hpp>\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+#if defined(BOOST_MSVC)\r
+#pragma warning(push)\r
+#if BOOST_MSVC >= 1400\r
+#pragma warning(disable:6294) // Ill-defined for-loop: initial condition does\r
+                              // not satisfy test. Loop body not executed \r
+#endif\r
+#endif\r
+\r
+namespace boost\r
+{\r
+    namespace hash_detail\r
+    {\r
+        inline void hash_float_combine(std::size_t& seed, std::size_t value)\r
+        {\r
+            seed ^= value + (seed<<6) + (seed>>2);\r
+        }\r
+\r
+        template <class T>\r
+        inline std::size_t float_hash_impl2(T v)\r
+        {\r
+            boost::hash_detail::call_frexp<T> frexp;\r
+            boost::hash_detail::call_ldexp<T> ldexp;\r
+        \r
+            int exp = 0;\r
+\r
+            v = frexp(v, &exp);\r
+\r
+            // A postive value is easier to hash, so combine the\r
+            // sign with the exponent and use the absolute value.\r
+            if(v < 0) {\r
+                v = -v;\r
+                exp += limits<T>::max_exponent -\r
+                    limits<T>::min_exponent;\r
+            }\r
+\r
+            // The result of frexp is always between 0.5 and 1, so its\r
+            // top bit will always be 1. Subtract by 0.5 to remove that.\r
+            v -= T(0.5);\r
+            v = ldexp(v, limits<std::size_t>::digits + 1);\r
+            std::size_t seed = static_cast<std::size_t>(v);\r
+            v -= seed;\r
+\r
+            // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;\r
+            std::size_t const length\r
+                = (limits<T>::digits *\r
+                        boost::static_log2<limits<T>::radix>::value - 1)\r
+                / limits<std::size_t>::digits;\r
+\r
+            for(std::size_t i = 0; i != length; ++i)\r
+            {\r
+                v = ldexp(v, limits<std::size_t>::digits);\r
+                std::size_t part = static_cast<std::size_t>(v);\r
+                v -= part;\r
+                hash_float_combine(seed, part);\r
+            }\r
+\r
+            hash_float_combine(seed, exp);\r
+\r
+            return seed;\r
+        }\r
+\r
+        template <class T>\r
+        inline std::size_t float_hash_impl(T v)\r
+        {\r
+            typedef BOOST_DEDUCED_TYPENAME select_hash_type<T>::type type;\r
+            return float_hash_impl2(static_cast<type>(v));\r
+        }\r
+    }\r
+}\r
+\r
+#if defined(BOOST_MSVC)\r
+#pragma warning(pop)\r
+#endif\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash/detail/hash_float_x86.hpp b/boost/boost/functional/hash/detail/hash_float_x86.hpp
new file mode 100644 (file)
index 0000000..ee8e758
--- /dev/null
@@ -0,0 +1,56 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+// A non-portable hash function form non-zero floats on x86.\r
+//\r
+// Even if you're on an x86 platform, this might not work if their floating\r
+// point isn't set up as this expects. So this should only be used if it's\r
+// absolutely certain that it will work.\r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER)\r
+#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_X86_HEADER\r
+\r
+#include <boost/cstdint.hpp>\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+namespace boost\r
+{\r
+    namespace hash_detail\r
+    {\r
+        inline void hash_float_combine(std::size_t& seed, std::size_t value)\r
+        {\r
+            seed ^= value + (seed<<6) + (seed>>2);\r
+        }\r
+\r
+        inline std::size_t float_hash_impl(float v)\r
+        {\r
+            boost::uint32_t* ptr = (boost::uint32_t*)&v;\r
+            std::size_t seed = *ptr;\r
+            return seed;\r
+        }\r
+\r
+        inline std::size_t float_hash_impl(double v)\r
+        {\r
+            boost::uint32_t* ptr = (boost::uint32_t*)&v;\r
+            std::size_t seed = *ptr++;\r
+            hash_float_combine(seed, *ptr);\r
+            return seed;\r
+        }\r
+\r
+        inline std::size_t float_hash_impl(long double v)\r
+        {\r
+            boost::uint32_t* ptr = (boost::uint32_t*)&v;\r
+            std::size_t seed = *ptr++;\r
+            hash_float_combine(seed, *ptr++);\r
+            hash_float_combine(seed, *(boost::uint16_t*)ptr);\r
+            return seed;\r
+        }\r
+    }\r
+}\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash/detail/limits.hpp b/boost/boost/functional/hash/detail/limits.hpp
new file mode 100644 (file)
index 0000000..e684593
--- /dev/null
@@ -0,0 +1,61 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+//\r
+// On some platforms std::limits gives incorrect values for long double.\r
+// This tries to work around them.\r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER)\r
+#define BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+#include <boost/limits.hpp>\r
+\r
+// On OpenBSD, numeric_limits is not reliable for long doubles, but\r
+// the macros defined in <float.h> are and support long double when STLport\r
+// doesn't.\r
+\r
+#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE)\r
+#include <float.h>\r
+#endif\r
+\r
+namespace boost\r
+{\r
+    namespace hash_detail\r
+    {\r
+        template <class T>\r
+        struct limits : std::numeric_limits<T> {};\r
+\r
+#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE)\r
+        template <>\r
+        struct limits<long double>\r
+             : std::numeric_limits<long double>\r
+        {\r
+            static long double epsilon() {\r
+                return LDBL_EPSILON;\r
+            }\r
+\r
+            static long double (max)() {\r
+                return LDBL_MAX;\r
+            }\r
+\r
+            static long double (min)() {\r
+                return LDBL_MIN;\r
+            }\r
+\r
+            BOOST_STATIC_CONSTANT(int, digits = LDBL_MANT_DIG);\r
+            BOOST_STATIC_CONSTANT(int, max_exponent = LDBL_MAX_EXP);\r
+            BOOST_STATIC_CONSTANT(int, min_exponent = LDBL_MIN_EXP);\r
+#if defined(_STLP_NO_LONG_DOUBLE)\r
+            BOOST_STATIC_CONSTANT(int, radix = FLT_RADIX);\r
+#endif\r
+        };\r
+#endif // __OpenBSD__\r
+    }\r
+}\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash/extensions.hpp b/boost/boost/functional/hash/extensions.hpp
new file mode 100644 (file)
index 0000000..eea32ef
--- /dev/null
@@ -0,0 +1,286 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+//  Based on Peter Dimov's proposal\r
+//  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf\r
+//  issue 6.18. \r
+\r
+// This implements the extensions to the standard.\r
+// It's undocumented, so you shouldn't use it....\r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)\r
+#define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP\r
+\r
+#include <boost/functional/hash/hash.hpp>\r
+#include <boost/detail/container_fwd.hpp>\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)\r
+#include <boost/type_traits/is_array.hpp>\r
+#endif\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
+#include <boost/type_traits/is_const.hpp>\r
+#endif\r
+\r
+namespace boost\r
+{\r
+    template <class A, class B>\r
+    std::size_t hash_value(std::pair<A, B> const&);\r
+    template <class T, class A>\r
+    std::size_t hash_value(std::vector<T, A> const&);\r
+    template <class T, class A>\r
+    std::size_t hash_value(std::list<T, A> const& v);\r
+    template <class T, class A>\r
+    std::size_t hash_value(std::deque<T, A> const& v);\r
+    template <class K, class C, class A>\r
+    std::size_t hash_value(std::set<K, C, A> const& v);\r
+    template <class K, class C, class A>\r
+    std::size_t hash_value(std::multiset<K, C, A> const& v);\r
+    template <class K, class T, class C, class A>\r
+    std::size_t hash_value(std::map<K, T, C, A> const& v);\r
+    template <class K, class T, class C, class A>\r
+    std::size_t hash_value(std::multimap<K, T, C, A> const& v);\r
+\r
+    template <class T>\r
+    std::size_t hash_value(std::complex<T> const&);\r
+\r
+    template <class A, class B>\r
+    std::size_t hash_value(std::pair<A, B> const& v)\r
+    {\r
+        std::size_t seed = 0;\r
+        hash_combine(seed, v.first);\r
+        hash_combine(seed, v.second);\r
+        return seed;\r
+    }\r
+\r
+    template <class T, class A>\r
+    std::size_t hash_value(std::vector<T, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class T, class A>\r
+    std::size_t hash_value(std::list<T, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class T, class A>\r
+    std::size_t hash_value(std::deque<T, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class K, class C, class A>\r
+    std::size_t hash_value(std::set<K, C, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class K, class C, class A>\r
+    std::size_t hash_value(std::multiset<K, C, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class K, class T, class C, class A>\r
+    std::size_t hash_value(std::map<K, T, C, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class K, class T, class C, class A>\r
+    std::size_t hash_value(std::multimap<K, T, C, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    template <class T>\r
+    std::size_t hash_value(std::complex<T> const& v)\r
+    {\r
+        boost::hash<T> hasher;\r
+        std::size_t seed = hasher(v.imag());\r
+        seed ^= hasher(v.real()) + (seed<<6) + (seed>>2);\r
+        return seed;\r
+    }\r
+\r
+    //\r
+    // call_hash_impl\r
+    //\r
+\r
+    // On compilers without function template ordering, this deals with arrays.\r
+\r
+#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)\r
+    namespace hash_detail\r
+    {\r
+        template <bool IsArray>\r
+        struct call_hash_impl\r
+        {\r
+            template <class T>\r
+            struct inner\r
+            {\r
+                static std::size_t call(T const& v)\r
+                {\r
+                    using namespace boost;\r
+                    return hash_value(v);\r
+                }\r
+            };\r
+        };\r
+\r
+        template <>\r
+        struct call_hash_impl<true>\r
+        {\r
+            template <class Array>\r
+            struct inner\r
+            {\r
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
+                static std::size_t call(Array const& v)\r
+#else\r
+                static std::size_t call(Array& v)\r
+#endif\r
+                {\r
+                    const int size = sizeof(v) / sizeof(*v);\r
+                    return boost::hash_range(v, v + size);\r
+                }\r
+            };\r
+        };\r
+\r
+        template <class T>\r
+        struct call_hash\r
+            : public call_hash_impl<boost::is_array<T>::value>\r
+                ::BOOST_NESTED_TEMPLATE inner<T>\r
+        {\r
+        };\r
+    }\r
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING\r
+\r
+    //\r
+    // boost::hash\r
+    //\r
+\r
+\r
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
+\r
+    template <class T> struct hash\r
+        : std::unary_function<T, std::size_t>\r
+    {\r
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)\r
+        std::size_t operator()(T const& val) const\r
+        {\r
+            return hash_value(val);\r
+        }\r
+#else\r
+        std::size_t operator()(T const& val) const\r
+        {\r
+            return hash_detail::call_hash<T>::call(val);\r
+        }\r
+#endif\r
+    };\r
+\r
+#if BOOST_WORKAROUND(__DMC__, <= 0x848)\r
+    template <class T, unsigned int n> struct hash<T[n]>\r
+        : std::unary_function<T[n], std::size_t>\r
+    {\r
+        std::size_t operator()(const T* val) const\r
+        {\r
+            return boost::hash_range(val, val+n);\r
+        }\r
+    };\r
+#endif\r
+\r
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION\r
+\r
+    // On compilers without partial specialization, boost::hash<T>\r
+    // has already been declared to deal with pointers, so just\r
+    // need to supply the non-pointer version of hash_impl.\r
+\r
+    namespace hash_detail\r
+    {\r
+        template <bool IsPointer>\r
+        struct hash_impl;\r
+\r
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
+\r
+        template <>\r
+        struct hash_impl<false>\r
+        {\r
+            template <class T>\r
+            struct inner\r
+                : std::unary_function<T, std::size_t>\r
+            {\r
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)\r
+                std::size_t operator()(T const& val) const\r
+                {\r
+                    return hash_value(val);\r
+                }\r
+#else\r
+                std::size_t operator()(T const& val) const\r
+                {\r
+                    return hash_detail::call_hash<T>::call(val);\r
+                }\r
+#endif\r
+            };\r
+        };\r
+\r
+#else // Visual C++ 6.5\r
+\r
+        // Visual C++ 6.5 has problems with nested member functions and\r
+        // applying const to const types in templates. So we get this:\r
+\r
+        template <bool IsConst>\r
+        struct hash_impl_msvc\r
+        {\r
+            template <class T>\r
+            struct inner\r
+                : public std::unary_function<T, std::size_t>\r
+            {\r
+                std::size_t operator()(T const& val) const\r
+                {\r
+                    return hash_detail::call_hash<T const>::call(val);\r
+                }\r
+\r
+                std::size_t operator()(T& val) const\r
+                {\r
+                    return hash_detail::call_hash<T>::call(val);\r
+                }\r
+            };\r
+        };\r
+\r
+        template <>\r
+        struct hash_impl_msvc<true>\r
+        {\r
+            template <class T>\r
+            struct inner\r
+                : public std::unary_function<T, std::size_t>\r
+            {\r
+                std::size_t operator()(T& val) const\r
+                {\r
+                    return hash_detail::call_hash<T>::call(val);\r
+                }\r
+            };\r
+        };\r
+        \r
+        template <class T>\r
+        struct hash_impl_msvc2\r
+            : public hash_impl_msvc<boost::is_const<T>::value>\r
+                    ::BOOST_NESTED_TEMPLATE inner<T> {};\r
+        \r
+        template <>\r
+        struct hash_impl<false>\r
+        {\r
+            template <class T>\r
+            struct inner : public hash_impl_msvc2<T> {};\r
+        };\r
+\r
+#endif // Visual C++ 6.5\r
+    }\r
+#endif  // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION\r
+}\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash/hash.hpp b/boost/boost/functional/hash/hash.hpp
new file mode 100644 (file)
index 0000000..337a986
--- /dev/null
@@ -0,0 +1,478 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+//  Based on Peter Dimov's proposal\r
+//  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf\r
+//  issue 6.18. \r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_HASH_HPP)\r
+#define BOOST_FUNCTIONAL_HASH_HASH_HPP\r
+\r
+#include <boost/functional/hash/hash_fwd.hpp>\r
+#include <functional>\r
+#include <boost/functional/hash/detail/hash_float.hpp>\r
+#include <string>\r
+#include <boost/limits.hpp>\r
+\r
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
+#include <boost/type_traits/is_pointer.hpp>\r
+#endif\r
+\r
+#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)\r
+#define BOOST_HASH_CHAR_TRAITS string_char_traits\r
+#else\r
+#define BOOST_HASH_CHAR_TRAITS char_traits\r
+#endif\r
+\r
+namespace boost\r
+{\r
+    std::size_t hash_value(bool);\r
+    std::size_t hash_value(char);\r
+    std::size_t hash_value(unsigned char);\r
+    std::size_t hash_value(signed char);\r
+    std::size_t hash_value(short);\r
+    std::size_t hash_value(unsigned short);\r
+    std::size_t hash_value(int);\r
+    std::size_t hash_value(unsigned int);\r
+    std::size_t hash_value(long);\r
+    std::size_t hash_value(unsigned long);\r
+\r
+#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)\r
+    std::size_t hash_value(wchar_t);\r
+#endif\r
+    \r
+#if defined(BOOST_HAS_LONG_LONG)\r
+    std::size_t hash_value(boost::long_long_type);\r
+    std::size_t hash_value(boost::ulong_long_type);\r
+#endif\r
+\r
+#if !BOOST_WORKAROUND(__DMC__, <= 0x848)\r
+    template <class T> std::size_t hash_value(T* const&);\r
+#else\r
+    template <class T> std::size_t hash_value(T*);\r
+#endif\r
+\r
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)\r
+    template< class T, unsigned N >\r
+    std::size_t hash_value(const T (&x)[N]);\r
+\r
+    template< class T, unsigned N >\r
+    std::size_t hash_value(T (&x)[N]);\r
+#endif\r
+\r
+    std::size_t hash_value(float v);\r
+    std::size_t hash_value(double v);\r
+    std::size_t hash_value(long double v);\r
+\r
+    template <class Ch, class A>\r
+    std::size_t hash_value(std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);\r
+\r
+    // Implementation\r
+\r
+    namespace hash_detail\r
+    {\r
+        template <class T>\r
+        inline std::size_t hash_value_signed(T val)\r
+        {\r
+             const int size_t_bits = std::numeric_limits<std::size_t>::digits;\r
+             // ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1\r
+             const int length = (std::numeric_limits<T>::digits - 1)\r
+                 / size_t_bits;\r
+\r
+             std::size_t seed = 0;\r
+             T positive = val < 0 ? -1 - val : val;\r
+\r
+             // Hopefully, this loop can be unrolled.\r
+             for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)\r
+             {\r
+                 seed ^= (std::size_t) (positive >> i) + (seed<<6) + (seed>>2);\r
+             }\r
+             seed ^= (std::size_t) val + (seed<<6) + (seed>>2);\r
+\r
+             return seed;\r
+        }\r
+\r
+        template <class T>\r
+        inline std::size_t hash_value_unsigned(T val)\r
+        {\r
+             const int size_t_bits = std::numeric_limits<std::size_t>::digits;\r
+             // ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1\r
+             const int length = (std::numeric_limits<T>::digits - 1)\r
+                 / size_t_bits;\r
+\r
+             std::size_t seed = 0;\r
+\r
+             // Hopefully, this loop can be unrolled.\r
+             for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)\r
+             {\r
+                 seed ^= (std::size_t) (val >> i) + (seed<<6) + (seed>>2);\r
+             }\r
+             seed ^= (std::size_t) val + (seed<<6) + (seed>>2);\r
+\r
+             return seed;\r
+        }\r
+    }\r
+\r
+    inline std::size_t hash_value(bool v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(char v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(unsigned char v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(signed char v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(short v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(unsigned short v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(int v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(unsigned int v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(long v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(unsigned long v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+\r
+#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)\r
+    inline std::size_t hash_value(wchar_t v)\r
+    {\r
+        return static_cast<std::size_t>(v);\r
+    }\r
+#endif\r
+\r
+#if defined(BOOST_HAS_LONG_LONG)\r
+    inline std::size_t hash_value(boost::long_long_type v)\r
+    {\r
+        return hash_detail::hash_value_signed(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(boost::ulong_long_type v)\r
+    {\r
+        return hash_detail::hash_value_unsigned(v);\r
+    }\r
+#endif\r
+\r
+    // Implementation by Alberto Barbati and Dave Harris.\r
+#if !BOOST_WORKAROUND(__DMC__, <= 0x848)\r
+    template <class T> std::size_t hash_value(T* const& v)\r
+#else\r
+    template <class T> std::size_t hash_value(T* v)\r
+#endif\r
+    {\r
+        std::size_t x = static_cast<std::size_t>(\r
+           reinterpret_cast<std::ptrdiff_t>(v));\r
+\r
+        return x + (x >> 3);\r
+    }\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
+    template <class T>\r
+    inline void hash_combine(std::size_t& seed, T& v)\r
+#else\r
+    template <class T>\r
+    inline void hash_combine(std::size_t& seed, T const& v)\r
+#endif\r
+    {\r
+        boost::hash<T> hasher;\r
+        seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);\r
+    }\r
+\r
+    template <class It>\r
+    inline std::size_t hash_range(It first, It last)\r
+    {\r
+        std::size_t seed = 0;\r
+\r
+        for(; first != last; ++first)\r
+        {\r
+            hash_combine(seed, *first);\r
+        }\r
+\r
+        return seed;\r
+    }\r
+\r
+    template <class It>\r
+    inline void hash_range(std::size_t& seed, It first, It last)\r
+    {\r
+        for(; first != last; ++first)\r
+        {\r
+            hash_combine(seed, *first);\r
+        }\r
+    }\r
+\r
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))\r
+    template <class T>\r
+    inline std::size_t hash_range(T* first, T* last)\r
+    {\r
+        std::size_t seed = 0;\r
+\r
+        for(; first != last; ++first)\r
+        {\r
+            boost::hash<T> hasher;\r
+            seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);\r
+        }\r
+\r
+        return seed;\r
+    }\r
+\r
+    template <class T>\r
+    inline void hash_range(std::size_t& seed, T* first, T* last)\r
+    {\r
+        for(; first != last; ++first)\r
+        {\r
+            boost::hash<T> hasher;\r
+            seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);\r
+        }\r
+    }\r
+#endif\r
+\r
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)\r
+    template< class T, unsigned N >\r
+    inline std::size_t hash_value(const T (&x)[N])\r
+    {\r
+        return hash_range(x, x + N);\r
+    }\r
+\r
+    template< class T, unsigned N >\r
+    inline std::size_t hash_value(T (&x)[N])\r
+    {\r
+        return hash_range(x, x + N);\r
+    }\r
+#endif\r
+\r
+    template <class Ch, class A>\r
+    inline std::size_t hash_value(std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)\r
+    {\r
+        return hash_range(v.begin(), v.end());\r
+    }\r
+\r
+    inline std::size_t hash_value(float v)\r
+    {\r
+        return boost::hash_detail::float_hash_value(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(double v)\r
+    {\r
+        return boost::hash_detail::float_hash_value(v);\r
+    }\r
+\r
+    inline std::size_t hash_value(long double v)\r
+    {\r
+        return boost::hash_detail::float_hash_value(v);\r
+    }\r
+\r
+    //\r
+    // boost::hash\r
+    //\r
+    \r
+    // Define the specializations required by the standard. The general purpose\r
+    // boost::hash is defined later in extensions.hpp if BOOST_HASH_NO_EXTENSIONS\r
+    // is not defined.\r
+    \r
+    // BOOST_HASH_SPECIALIZE - define a specialization for a type which is\r
+    // passed by copy.\r
+    //\r
+    // BOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is\r
+    // passed by copy.\r
+    //\r
+    // These are undefined later.\r
+\r
+#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
+#define BOOST_HASH_SPECIALIZE(type) \\r
+    template <> struct hash<type> \\r
+         : public std::unary_function<type, std::size_t> \\r
+    { \\r
+        std::size_t operator()(type v) const \\r
+        { \\r
+            return boost::hash_value(v); \\r
+        } \\r
+    };\r
+\r
+#define BOOST_HASH_SPECIALIZE_REF(type) \\r
+    template <> struct hash<type> \\r
+         : public std::unary_function<type, std::size_t> \\r
+    { \\r
+        std::size_t operator()(type const& v) const \\r
+        { \\r
+            return boost::hash_value(v); \\r
+        } \\r
+    };\r
+#else\r
+#define BOOST_HASH_SPECIALIZE(type) \\r
+    template <> struct hash<type> \\r
+         : public std::unary_function<type, std::size_t> \\r
+    { \\r
+        std::size_t operator()(type v) const \\r
+        { \\r
+            return boost::hash_value(v); \\r
+        } \\r
+    }; \\r
+    \\r
+    template <> struct hash<const type> \\r
+         : public std::unary_function<const type, std::size_t> \\r
+    { \\r
+        std::size_t operator()(const type v) const \\r
+        { \\r
+            return boost::hash_value(v); \\r
+        } \\r
+    };\r
+\r
+#define BOOST_HASH_SPECIALIZE_REF(type) \\r
+    template <> struct hash<type> \\r
+         : public std::unary_function<type, std::size_t> \\r
+    { \\r
+        std::size_t operator()(type const& v) const \\r
+        { \\r
+            return boost::hash_value(v); \\r
+        } \\r
+    }; \\r
+    \\r
+    template <> struct hash<const type> \\r
+         : public std::unary_function<const type, std::size_t> \\r
+    { \\r
+        std::size_t operator()(type const& v) const \\r
+        { \\r
+            return boost::hash_value(v); \\r
+        } \\r
+    };\r
+#endif\r
+\r
+    BOOST_HASH_SPECIALIZE(bool)\r
+    BOOST_HASH_SPECIALIZE(char)\r
+    BOOST_HASH_SPECIALIZE(signed char)\r
+    BOOST_HASH_SPECIALIZE(unsigned char)\r
+#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)\r
+    BOOST_HASH_SPECIALIZE(wchar_t)\r
+#endif\r
+    BOOST_HASH_SPECIALIZE(short)\r
+    BOOST_HASH_SPECIALIZE(unsigned short)\r
+    BOOST_HASH_SPECIALIZE(int)\r
+    BOOST_HASH_SPECIALIZE(unsigned int)\r
+    BOOST_HASH_SPECIALIZE(long)\r
+    BOOST_HASH_SPECIALIZE(unsigned long)\r
+\r
+    BOOST_HASH_SPECIALIZE(float)\r
+    BOOST_HASH_SPECIALIZE(double)\r
+    BOOST_HASH_SPECIALIZE(long double)\r
+\r
+    BOOST_HASH_SPECIALIZE_REF(std::string)\r
+#if !defined(BOOST_NO_STD_WSTRING)\r
+    BOOST_HASH_SPECIALIZE_REF(std::wstring)\r
+#endif\r
+\r
+#if defined(BOOST_HAS_LONG_LONG)\r
+    BOOST_HASH_SPECIALIZE(boost::long_long_type)\r
+    BOOST_HASH_SPECIALIZE(boost::ulong_long_type)\r
+#endif\r
+\r
+#undef BOOST_HASH_SPECIALIZE\r
+#undef BOOST_HASH_SPECIALIZE_REF\r
+\r
+// Specializing boost::hash for pointers.\r
+\r
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)\r
+\r
+    template <class T>\r
+    struct hash<T*>\r
+        : public std::unary_function<T*, std::size_t>\r
+    {\r
+        std::size_t operator()(T* v) const\r
+        {\r
+#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)\r
+            return boost::hash_value(v);\r
+#else\r
+            std::size_t x = static_cast<std::size_t>(\r
+                reinterpret_cast<std::ptrdiff_t>(v));\r
+\r
+            return x + (x >> 3);\r
+#endif\r
+        }\r
+    };\r
+\r
+#else\r
+\r
+    // For compilers without partial specialization, we define a\r
+    // boost::hash for all remaining types. But hash_impl is only defined\r
+    // for pointers in 'extensions.hpp' - so when BOOST_HASH_NO_EXTENSIONS\r
+    // is defined there will still be a compile error for types not supported\r
+    // in the standard.\r
+\r
+    namespace hash_detail\r
+    {\r
+        template <bool IsPointer>\r
+        struct hash_impl;\r
+\r
+        template <>\r
+        struct hash_impl<true>\r
+        {\r
+            template <class T>\r
+            struct inner\r
+                : public std::unary_function<T, std::size_t>\r
+            {\r
+                std::size_t operator()(T val) const\r
+                {\r
+#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 590)\r
+                    return boost::hash_value(val);\r
+#else\r
+                    std::size_t x = static_cast<std::size_t>(\r
+                        reinterpret_cast<std::ptrdiff_t>(val));\r
+\r
+                    return x + (x >> 3);\r
+#endif\r
+                }\r
+            };\r
+        };\r
+    }\r
+\r
+    template <class T> struct hash\r
+        : public boost::hash_detail::hash_impl<boost::is_pointer<T>::value>\r
+            ::BOOST_NESTED_TEMPLATE inner<T>\r
+    {\r
+    };\r
+\r
+#endif\r
+}\r
+\r
+#undef BOOST_HASH_CHAR_TRAITS\r
+\r
+#endif // BOOST_FUNCTIONAL_HASH_HASH_HPP\r
+\r
+// Include this outside of the include guards in case the file is included\r
+// twice - once with BOOST_HASH_NO_EXTENSIONS defined, and then with it\r
+// undefined.\r
+\r
+#if !defined(BOOST_HASH_NO_EXTENSIONS) \\r
+    && !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)\r
+#include <boost/functional/hash/extensions.hpp>\r
+#endif\r
diff --git a/boost/boost/functional/hash/hash_fwd.hpp b/boost/boost/functional/hash/hash_fwd.hpp
new file mode 100644 (file)
index 0000000..1d0d066
--- /dev/null
@@ -0,0 +1,40 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+//  Based on Peter Dimov's proposal\r
+//  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf\r
+//  issue 6.18. \r
+\r
+#if !defined(BOOST_FUNCTIONAL_HASH_FWD_HPP)\r
+#define BOOST_FUNCTIONAL_HASH_FWD_HPP\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)\r
+# pragma once\r
+#endif\r
+\r
+#include <boost/config.hpp>\r
+#include <cstddef>\r
+#include <boost/detail/workaround.hpp>\r
+\r
+namespace boost\r
+{\r
+    template <class T> struct hash;\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)\r
+    template <class T> void hash_combine(std::size_t& seed, T& v);\r
+#else\r
+    template <class T> void hash_combine(std::size_t& seed, T const& v);\r
+#endif\r
+\r
+    template <class It> std::size_t hash_range(It, It);\r
+    template <class It> void hash_range(std::size_t&, It, It);\r
+\r
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))\r
+    template <class T> inline std::size_t hash_range(T*, T*);\r
+    template <class T> inline void hash_range(std::size_t&, T*, T*);\r
+#endif\r
+}\r
+\r
+#endif\r
diff --git a/boost/boost/functional/hash_fwd.hpp b/boost/boost/functional/hash_fwd.hpp
new file mode 100644 (file)
index 0000000..b8f8c9a
--- /dev/null
@@ -0,0 +1,7 @@
+\r
+// Copyright 2005-2009 Daniel James.\r
+// Distributed under the Boost Software License, Version 1.0. (See accompanying\r
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#include <boost/functional/hash/hash_fwd.hpp>\r
+\r
index 19e048bd032b637690e602909b9c288bbf556c74..219a48e34116ef5b61027afafc634c5ef239630f 100644 (file)
@@ -48,7 +48,7 @@ namespace boost {
      template <result_type n>
      struct choose_initial_n {
 
-         enum { c = (argument_type(1) << n << n) != 0 };
+         BOOST_STATIC_CONSTANT(bool, c = (argument_type(1) << n << n) != 0);
          BOOST_STATIC_CONSTANT(
              result_type,
              value = !c*n + choose_initial_n<2*c*n>::value
@@ -85,7 +85,7 @@ namespace boost {
      template <argument_type x, result_type n = initial_n>
      struct static_log2_impl {
 
-         enum { c = (x >> n) > 0 }; // x >= 2**n ?
+         BOOST_STATIC_CONSTANT(bool, c = (x >> n) > 0); // x >= 2**n ?
          BOOST_STATIC_CONSTANT(
              result_type,
              value = c*n + (static_log2_impl< (x>>c*n), n/2 >::value)
index 01ff8b85e95fc201d43b520af1c82d6defac01b2..3238963c0c78da357607c629e4d36486c3f36ed5 100644 (file)
@@ -10,9 +10,9 @@
 //
 // See http://www.boost.org/libs/mpl for documentation.
 
-// $Id: compiler.hpp 49272 2008-10-11 06:50:46Z agurtovoy $
-// $Date: 2008-10-11 02:50:46 -0400 (Sat, 11 Oct 2008) $
-// $Revision: 49272 $
+// $Id: compiler.hpp 53189 2009-05-22 20:07:55Z hkaiser $
+// $Date: 2009-05-22 16:07:55 -0400 (Fri, 22 May 2009) $
+// $Revision: 53189 $
 
 #if !defined(BOOST_MPL_CFG_COMPILER_DIR)
 
@@ -35,7 +35,7 @@
 #   elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
 #       if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
 #           define BOOST_MPL_CFG_COMPILER_DIR bcc551
-#       elseif BOOST_WORKAROUND(__BORLANDC__, >= 0x590)
+#       elif BOOST_WORKAROUND(__BORLANDC__, >= 0x590)
 #           define BOOST_MPL_CFG_COMPILER_DIR bcc
 #       else
 #           define BOOST_MPL_CFG_COMPILER_DIR bcc_pre590
index 563ecf0d1d699bb4b51c6ec21ed01025cbc19a4c..a6f340c782b7f44a08062371328ac4fe346c4e13 100755 (executable)
@@ -11,9 +11,9 @@
 //
 // See http://www.boost.org/libs/mpl for documentation.
 
-// $Id: inserter_algorithm.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
-// $Revision: 49267 $
+// $Id: inserter_algorithm.hpp 55648 2009-08-18 05:16:53Z agurtovoy $
+// $Date: 2009-08-18 01:16:53 -0400 (Tue, 18 Aug 2009) $
+// $Revision: 55648 $
 
 #include <boost/mpl/back_inserter.hpp>
 #include <boost/mpl/front_inserter.hpp>
@@ -49,7 +49,7 @@ template< \
       BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), typename P) \
     > \
 struct name< BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P),na > \
-    : if_< has_push_back<P1> \
+    : if_< has_push_back< typename clear<P1>::type> \
         , aux::name##_impl< \
               BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(arity), P) \
             , back_inserter< typename clear<P1>::type > \
index 54e945cd313cf8c8de525999df7cfecd866b8574..2f839cb88ac5ea226ac6d8044610133e1c7fcd93 100755 (executable)
@@ -10,9 +10,9 @@
 //
 // See http://www.boost.org/libs/mpl for documentation.
 
-// $Id: push_back_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
-// $Revision: 49267 $
+// $Id: push_back_impl.hpp 55679 2009-08-20 07:50:16Z agurtovoy $
+// $Date: 2009-08-20 03:50:16 -0400 (Thu, 20 Aug 2009) $
+// $Revision: 55679 $
 
 #include <boost/mpl/push_back_fwd.hpp>
 #include <boost/mpl/assert.hpp>
@@ -25,8 +25,7 @@
 
 namespace boost { namespace mpl {
 
-template< typename Tag >
-struct has_push_back_impl;
+struct has_push_back_arg {};
 
 // agurt 05/feb/04: no default implementation; the stub definition is needed 
 // to enable the default 'has_push_back' implementation below
@@ -39,7 +38,7 @@ struct push_back_impl
         // if you've got an assert here, you are requesting a 'push_back' 
         // specialization that doesn't exist.
         BOOST_MPL_ASSERT_MSG(
-              ( boost::is_same< T, has_push_back_impl<T> >::value )
+              ( boost::is_same< T, has_push_back_arg >::value )
             , REQUESTED_PUSH_BACK_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
             , ( Sequence )
             );
@@ -51,13 +50,13 @@ struct has_push_back_impl
 {
     template< typename Seq > struct apply
 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
-        : aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >
+        : aux::has_type< push_back< Seq, has_push_back_arg > >
     {
 #else
     {
-        typedef aux::has_type< push_back< Seq, has_push_back_impl<Tag> > > type;
+        typedef aux::has_type< push_back< Seq, has_push_back_arg > > type;
         BOOST_STATIC_CONSTANT(bool, value = 
-              (aux::has_type< push_back< Seq, has_push_back_impl<Tag> > >::value)
+              (aux::has_type< push_back< Seq, has_push_back_arg > >::value)
             );
 #endif
     };
index dfc126170d1205aaf8169a73d1e383b102bd7b22..6723ea3894bfe3505b019049d6e090a473f4dbbe 100755 (executable)
@@ -10,9 +10,9 @@
 //
 // See http://www.boost.org/libs/mpl for documentation.
 
-// $Id: push_front_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
-// $Revision: 49267 $
+// $Id: push_front_impl.hpp 55679 2009-08-20 07:50:16Z agurtovoy $
+// $Date: 2009-08-20 03:50:16 -0400 (Thu, 20 Aug 2009) $
+// $Revision: 55679 $
 
 #include <boost/mpl/push_front_fwd.hpp>
 #include <boost/mpl/assert.hpp>
@@ -25,8 +25,7 @@
 
 namespace boost { namespace mpl {
 
-template< typename Tag >
-struct has_push_front_impl;
+struct has_push_front_arg {};
 
 // agurt 05/feb/04: no default implementation; the stub definition is needed 
 // to enable the default 'has_push_front' implementation below
@@ -40,7 +39,7 @@ struct push_front_impl
         // if you've got an assert here, you are requesting a 'push_front' 
         // specialization that doesn't exist.
         BOOST_MPL_ASSERT_MSG(
-              ( boost::is_same< T, has_push_front_impl<T> >::value )
+              ( boost::is_same< T, has_push_front_arg >::value )
             , REQUESTED_PUSH_FRONT_SPECIALIZATION_FOR_SEQUENCE_DOES_NOT_EXIST
             , ( Sequence )
             );
@@ -52,13 +51,13 @@ struct has_push_front_impl
 {
     template< typename Seq > struct apply
 #if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
-        : aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >
+        : aux::has_type< push_front< Seq, has_push_front_arg > >
     {
 #else
     {
-        typedef aux::has_type< push_front< Seq, has_push_front_impl<Tag> > > type;
+        typedef aux::has_type< push_front< Seq, has_push_front_arg > > type;
         BOOST_STATIC_CONSTANT(bool, value = 
-              (aux::has_type< push_front< Seq, has_push_front_impl<Tag> > >::value)
+              (aux::has_type< push_front< Seq, has_push_front_arg > >::value)
             );
 #endif
     };
diff --git a/boost/boost/mpl/char.hpp b/boost/boost/mpl/char.hpp
new file mode 100755 (executable)
index 0000000..366ec05
--- /dev/null
@@ -0,0 +1,22 @@
+\r
+#ifndef BOOST_MPL_CHAR_HPP_INCLUDED\r
+#define BOOST_MPL_CHAR_HPP_INCLUDED\r
+\r
+// Copyright Eric Niebler 2008\r
+//\r
+// Distributed under the Boost Software License, Version 1.0. \r
+// (See accompanying file LICENSE_1_0.txt or copy at \r
+// http://www.boost.org/LICENSE_1_0.txt)\r
+//\r
+// See http://www.boost.org/libs/mpl for documentation.\r
+\r
+// $Source$\r
+// $Date: 2008-06-14 08:41:37 -0700 (Sat, 16 Jun 2008) $\r
+// $Revision: 24874 $\r
+\r
+#include <boost/mpl/char_fwd.hpp>\r
+\r
+#define AUX_WRAPPER_VALUE_TYPE char\r
+#include <boost/mpl/aux_/integral_wrapper.hpp>\r
+\r
+#endif // BOOST_MPL_CHAR_HPP_INCLUDED\r
diff --git a/boost/boost/mpl/char_fwd.hpp b/boost/boost/mpl/char_fwd.hpp
new file mode 100755 (executable)
index 0000000..65d741c
--- /dev/null
@@ -0,0 +1,27 @@
+\r
+#ifndef BOOST_MPL_CHAR_FWD_HPP_INCLUDED\r
+#define BOOST_MPL_CHAR_FWD_HPP_INCLUDED\r
+\r
+// Copyright Eric Niebler 2008\r
+//\r
+// Distributed under the Boost Software License, Version 1.0. \r
+// (See accompanying file LICENSE_1_0.txt or copy at \r
+// http://www.boost.org/LICENSE_1_0.txt)\r
+//\r
+// See http://www.boost.org/libs/mpl for documentation.\r
+\r
+// $Source$\r
+// $Date: 2008-06-14 08:41:37 -0700 (Sat, 16 Jun 2008) $\r
+// $Revision: 24874 $\r
+\r
+#include <boost/mpl/aux_/adl_barrier.hpp>\r
+#include <boost/mpl/aux_/nttp_decl.hpp>\r
+\r
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN\r
+\r
+template< BOOST_MPL_AUX_NTTP_DECL(char, N) > struct char_;\r
+\r
+BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE\r
+BOOST_MPL_AUX_ADL_BARRIER_DECL(char_)\r
+\r
+#endif // BOOST_MPL_CHAR_FWD_HPP_INCLUDED\r
index 668ec6aeea0529cc010d3c1aef21364659f7febe..89abc85d5edfd8de7d4bb6a86583f027056c3dc5 100755 (executable)
@@ -10,9 +10,9 @@
 //
 // See http://www.boost.org/libs/mpl for documentation.
 
-// $Id: for_each.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
-// $Revision: 49267 $
+// $Id: for_each.hpp 55648 2009-08-18 05:16:53Z agurtovoy $
+// $Date: 2009-08-18 01:16:53 -0400 (Tue, 18 Aug 2009) $
+// $Revision: 55648 $
 
 #include <boost/mpl/is_sequence.hpp>
 #include <boost/mpl/begin_end.hpp>
@@ -76,7 +76,7 @@ struct for_each_impl<false>
         
         typedef typename mpl::next<Iterator>::type iter;
         for_each_impl<boost::is_same<iter,LastIterator>::value>
-            ::execute((iter*)0, (LastIterator*)0, (TransformFunc*)0, f);
+            ::execute( static_cast<iter*>(0), static_cast<LastIterator*>(0), static_cast<TransformFunc*>(0), f);
     }
 };
 
@@ -98,7 +98,7 @@ void for_each(F f, Sequence* = 0, TransformOp* = 0)
     typedef typename end<Sequence>::type last;
 
     aux::for_each_impl< boost::is_same<first,last>::value >
-        ::execute((first*)0, (last*)0, (TransformOp*)0, f);
+        ::execute(static_cast<first*>(0), static_cast<last*>(0), static_cast<TransformOp*>(0), f);
 }
 
 template<
diff --git a/boost/boost/mpl/limits/string.hpp b/boost/boost/mpl/limits/string.hpp
new file mode 100644 (file)
index 0000000..c51c0ef
--- /dev/null
@@ -0,0 +1,21 @@
+\r
+#ifndef BOOST_MPL_LIMITS_STRING_HPP_INCLUDED\r
+#define BOOST_MPL_LIMITS_STRING_HPP_INCLUDED\r
+\r
+// Copyright Eric Niebler 2009\r
+//\r
+// Distributed under the Boost Software License, Version 1.0. \r
+// (See accompanying file LICENSE_1_0.txt or copy at \r
+// http://www.boost.org/LICENSE_1_0.txt)\r
+//\r
+// See http://www.boost.org/libs/mpl for documentation.\r
+\r
+// $Id: string.hpp 49239 2009-04-01 09:10:26Z eric_niebler $\r
+// $Date: 2009-04-01 02:10:26 -0700 (Wed, 1 Apr 2009) $\r
+// $Revision: 49239 $\r
+\r
+#if !defined(BOOST_MPL_LIMIT_STRING_SIZE)\r
+#   define BOOST_MPL_LIMIT_STRING_SIZE 32\r
+#endif\r
+\r
+#endif // BOOST_MPL_LIMITS_STRING_HPP_INCLUDED\r
index c37c134ceacb5ab228d64689c6ab004de8f9236c..411909f8f2deb8d3e5b419f591bad991816eb5ac 100755 (executable)
@@ -11,9 +11,9 @@
 //
 // See http://www.boost.org/libs/mpl for documentation.
 
-// $Id: insert_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
-// $Revision: 49267 $
+// $Id: insert_impl.hpp 55751 2009-08-24 04:11:00Z agurtovoy $
+// $Date: 2009-08-24 00:11:00 -0400 (Mon, 24 Aug 2009) $
+// $Revision: 55751 $
 
 #include <boost/mpl/insert_fwd.hpp>
 #include <boost/mpl/next_prior.hpp>
@@ -39,7 +39,7 @@ struct map_insert_impl
             >
 #else
         , m_item<
-              next< typename Map::size >::type::value
+              Map::order::value
             , typename Pair::first
             , typename Pair::second
             , Map
diff --git a/boost/boost/mpl/string.hpp b/boost/boost/mpl/string.hpp
new file mode 100755 (executable)
index 0000000..f3b1613
--- /dev/null
@@ -0,0 +1,559 @@
+\r
+#ifndef BOOST_MPL_STRING_HPP_INCLUDED\r
+#define BOOST_MPL_STRING_HPP_INCLUDED\r
+\r
+// Copyright Eric Niebler 2009\r
+//\r
+// Distributed under the Boost Software License, Version 1.0.\r
+// (See accompanying file LICENSE_1_0.txt or copy at\r
+// http://www.boost.org/LICENSE_1_0.txt)\r
+//\r
+// See http://www.boost.org/libs/mpl for documentation.\r
+\r
+// $Id: string.hpp 49239 2009-04-01 09:10:26Z eric_niebler $\r
+// $Date: 2009-04-01 02:10:26 -0700 (Wed, 1 Apr 2009) $\r
+// $Revision: 49239 $\r
+//\r
+// Thanks to:\r
+//   Dmitry Goncharov for porting this to the Sun compiler\r
+\r
+#include <boost/config.hpp>\r
+#include <boost/detail/workaround.hpp>\r
+#include <boost/detail/endian.hpp>\r
+#include <boost/mpl/limits/string.hpp>\r
+#include <boost/mpl/if.hpp>\r
+#include <boost/mpl/char.hpp>\r
+#include <boost/mpl/copy.hpp>\r
+#include <boost/mpl/size.hpp>\r
+#include <boost/mpl/empty.hpp>\r
+#include <boost/mpl/assert.hpp>\r
+#include <boost/mpl/size_t.hpp>\r
+#include <boost/mpl/begin_end.hpp>\r
+#include <boost/mpl/joint_view.hpp>\r
+#include <boost/mpl/insert_range.hpp>\r
+#include <boost/mpl/back_inserter.hpp>\r
+#include <boost/mpl/front_inserter.hpp>\r
+#include <boost/mpl/iterator_range.hpp>\r
+#include <boost/preprocessor/arithmetic/dec.hpp>\r
+#include <boost/preprocessor/arithmetic/add.hpp>\r
+#include <boost/preprocessor/arithmetic/div.hpp>\r
+#include <boost/preprocessor/punctuation/comma_if.hpp>\r
+#include <boost/preprocessor/repetition/repeat.hpp>\r
+#include <boost/preprocessor/repetition/enum_params.hpp>\r
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>\r
+#include <boost/preprocessor/repetition/enum_shifted_params.hpp>\r
+#include <boost/preprocessor/repetition/enum_trailing_params.hpp>\r
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>\r
+\r
+#include <iterator> // for bidirectional_iterator_tag\r
+#include <climits>\r
+\r
+namespace boost { namespace mpl\r
+{\r
+    #define BOOST_MPL_STRING_MAX_PARAMS                                                             \\r
+      BOOST_PP_DIV(BOOST_PP_ADD(BOOST_MPL_LIMIT_STRING_SIZE, 3), 4)\r
+\r
+    // Low-level bit-twiddling is done by macros. Any implementation-defined behavior of\r
+    // multi-character literals should be localized to these macros.\r
+\r
+    #define BOOST_MPL_MULTICHAR_LENGTH(c)                                                           \\r
+      (std::size_t)((c<CHAR_MIN) ? 4 : ((c>0xffffff)+(c>0xffff)+(c>0xff)+1))\r
+\r
+    #if defined(BOOST_LITTLE_ENDIAN) && defined(__SUNPRO_CC)\r
+\r
+        #define BOOST_MPL_MULTICHAR_AT(c,i)                                                         \\r
+          (char)(0xff&((unsigned)(c)>>(8*(std::size_t)(i))))\r
+\r
+        #define BOOST_MPL_MULTICHAR_PUSH_BACK(c,i)                                                  \\r
+          ((((unsigned char)(i))<<(BOOST_MPL_MULTICHAR_LENGTH(c)*8))|(unsigned)(c))\r
+\r
+        #define BOOST_MPL_MULTICHAR_PUSH_FRONT(c,i)                                                 \\r
+          (((unsigned)(c)<<8)|(unsigned char)(i))\r
+\r
+        #define BOOST_MPL_MULTICHAR_POP_BACK(c)                                                     \\r
+          (((1<<((BOOST_MPL_MULTICHAR_LENGTH(c)-1)*8))-1)&(unsigned)(c))\r
+\r
+        #define BOOST_MPL_MULTICHAR_POP_FRONT(c)                                                    \\r
+          ((unsigned)(c)>>8)\r
+\r
+    #else\r
+\r
+        #define BOOST_MPL_MULTICHAR_AT(c,i)                                                         \\r
+          (char)(0xff&((unsigned)(c)>>(8*(BOOST_MPL_MULTICHAR_LENGTH(c)-(std::size_t)(i)-1))))\r
+\r
+        #define BOOST_MPL_MULTICHAR_PUSH_BACK(c,i)                                                  \\r
+          (((unsigned)(c)<<8)|(unsigned char)(i))\r
+\r
+        #define BOOST_MPL_MULTICHAR_PUSH_FRONT(c,i)                                                 \\r
+          ((((unsigned char)(i))<<(BOOST_MPL_MULTICHAR_LENGTH(c)*8))|(unsigned)(c))\r
+\r
+        #define BOOST_MPL_MULTICHAR_POP_BACK(c)                                                     \\r
+          ((unsigned)(c)>>8)\r
+\r
+        #define BOOST_MPL_MULTICHAR_POP_FRONT(c)                                                    \\r
+          (((1<<((BOOST_MPL_MULTICHAR_LENGTH(c)-1)*8))-1)&(unsigned)(c))\r
+\r
+    #endif\r
+\r
+    struct string_tag;\r
+    struct string_iterator_tag;\r
+\r
+    template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_MPL_STRING_MAX_PARAMS, int C, 0)>\r
+    struct string;\r
+\r
+    template<typename Sequence, int I, int J>\r
+    struct string_iterator;\r
+\r
+    template<typename Sequence>\r
+    struct sequence_tag;\r
+\r
+    template<typename Tag>\r
+    struct size_impl;\r
+\r
+    template<>\r
+    struct size_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence>\r
+        struct apply;\r
+\r
+        #define M0(z, n, data)                                                                      \\r
+        + BOOST_MPL_MULTICHAR_LENGTH(BOOST_PP_CAT(C,n))\r
+\r
+        #define M1(z, n, data)                                                                      \\r
+        template<BOOST_PP_ENUM_PARAMS_Z(z, n, int C)>                                               \\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)> >                                 \\r
+          : mpl::size_t<(0 BOOST_PP_REPEAT_ ## z(n, M0, ~))>                                        \\r
+        {};\r
+\r
+        BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_MPL_STRING_MAX_PARAMS), M1, ~)\r
+        #undef M0\r
+        #undef M1\r
+    };\r
+\r
+    template<>\r
+    struct size_impl<mpl::string_tag>::apply<mpl::string<> >\r
+      : mpl::size_t<0>\r
+    {};\r
+\r
+    template<typename Tag>\r
+    struct begin_impl;\r
+\r
+    template<>\r
+    struct begin_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence>\r
+        struct apply\r
+        {\r
+            typedef mpl::string_iterator<Sequence, 0, 0> type;\r
+        };\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct end_impl;\r
+\r
+    template<>\r
+    struct end_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence>\r
+        struct apply;\r
+\r
+        #define M0(z,n,data)                                                                        \\r
+        template<BOOST_PP_ENUM_PARAMS_Z(z, n, int C)>                                               \\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)> >                                 \\r
+        {                                                                                           \\r
+            typedef mpl::string_iterator<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)>, n, 0> type;  \\r
+        };\r
+\r
+        BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_MPL_STRING_MAX_PARAMS), M0, ~)\r
+        #undef M0\r
+    };\r
+\r
+    template<>\r
+    struct end_impl<mpl::string_tag>::apply<mpl::string<> >\r
+    {\r
+        typedef mpl::string_iterator<mpl::string<>, 0, 0> type;\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct push_back_impl;\r
+\r
+    template<>\r
+    struct push_back_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence, typename Value, bool B = (4==BOOST_MPL_MULTICHAR_LENGTH(Sequence::back_))>\r
+        struct apply\r
+        {\r
+            BOOST_MPL_ASSERT_MSG(\r
+                (BOOST_MPL_LIMIT_STRING_SIZE != mpl::size<Sequence>::type::value)\r
+              , PUSH_BACK_FAILED_MPL_STRING_IS_FULL\r
+              , (Sequence)\r
+            );\r
+            // If the above assertion didn't fire, then the string is sparse.\r
+            // Repack the string and retry the push_back\r
+            typedef\r
+                typename mpl::push_back<\r
+                    typename mpl::copy<\r
+                        Sequence\r
+                      , mpl::back_inserter<mpl::string<> >\r
+                    >::type\r
+                  , Value\r
+                >::type\r
+            type;\r
+        };\r
+\r
+        template<typename Value>\r
+        struct apply<mpl::string<>, Value, false>\r
+        {\r
+            typedef mpl::string<(char)Value::value> type;\r
+        };\r
+\r
+        #define M0(z,n,data)                                                                        \\r
+        template<BOOST_PP_ENUM_PARAMS_Z(z, n, int C), typename Value>                               \\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)>, Value, false>                    \\r
+        {                                                                                           \\r
+            typedef                                                                                 \\r
+                mpl::string<                                                                        \\r
+                    BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_DEC(n), C)                                   \\r
+                    BOOST_PP_COMMA_IF(BOOST_PP_DEC(n))                                              \\r
+                    ((unsigned)BOOST_PP_CAT(C,BOOST_PP_DEC(n))>0xffffff)                            \\r
+                    ?BOOST_PP_CAT(C,BOOST_PP_DEC(n))                                                \\r
+                    :BOOST_MPL_MULTICHAR_PUSH_BACK(BOOST_PP_CAT(C,BOOST_PP_DEC(n)), Value::value)   \\r
+                  , ((unsigned)BOOST_PP_CAT(C,BOOST_PP_DEC(n))>0xffffff)                            \\r
+                    ?(char)Value::value                                                             \\r
+                    :0                                                                              \\r
+                >                                                                                   \\r
+            type;                                                                                   \\r
+        };\r
+\r
+        BOOST_PP_REPEAT_FROM_TO(1, BOOST_MPL_STRING_MAX_PARAMS, M0, ~)\r
+        #undef M0\r
+\r
+        template<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, int C), typename Value>\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)>, Value, false>\r
+        {\r
+            typedef\r
+                mpl::string<\r
+                    BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(BOOST_MPL_STRING_MAX_PARAMS), C)\r
+                  , BOOST_MPL_MULTICHAR_PUSH_BACK(BOOST_PP_CAT(C,BOOST_PP_DEC(BOOST_MPL_STRING_MAX_PARAMS)), Value::value)\r
+                >\r
+            type;\r
+        };\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct pop_back_impl;\r
+\r
+    template<>\r
+    struct pop_back_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence>\r
+        struct apply;\r
+\r
+        #define M0(z,n,data)                                                                        \\r
+        template<BOOST_PP_ENUM_PARAMS_Z(z, n, int C)>                                               \\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)> >                                 \\r
+        {                                                                                           \\r
+            BOOST_MPL_ASSERT_MSG((C0 != 0), POP_BACK_FAILED_MPL_STRING_IS_EMPTY, (mpl::string<>));  \\r
+            typedef                                                                                 \\r
+                mpl::string<                                                                        \\r
+                    BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_DEC(n), C)                                   \\r
+                    BOOST_PP_COMMA_IF(BOOST_PP_DEC(n))                                              \\r
+                    BOOST_MPL_MULTICHAR_POP_BACK(BOOST_PP_CAT(C,BOOST_PP_DEC(n)))                   \\r
+                >                                                                                   \\r
+            type;                                                                                   \\r
+        };\r
+\r
+        BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_MPL_STRING_MAX_PARAMS), M0, ~)\r
+        #undef M0\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct push_front_impl;\r
+\r
+    template<>\r
+    struct push_front_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence, typename Value, bool B = (4==BOOST_MPL_MULTICHAR_LENGTH(Sequence::front_))>\r
+        struct apply\r
+        {\r
+            BOOST_MPL_ASSERT_MSG(\r
+                (BOOST_MPL_LIMIT_STRING_SIZE != mpl::size<Sequence>::type::value)\r
+              , PUSH_FRONT_FAILED_MPL_STRING_IS_FULL\r
+              , (Sequence)\r
+            );\r
+            // If the above assertion didn't fire, then the string is sparse.\r
+            // Repack the string and retry the push_front.\r
+            typedef\r
+                typename mpl::push_front<\r
+                    typename mpl::reverse_copy<\r
+                        Sequence\r
+                      , mpl::front_inserter<string<> >\r
+                    >::type\r
+                  , Value\r
+                >::type\r
+            type;\r
+        };\r
+\r
+        #if !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))\r
+        template<typename Value>\r
+        struct apply<mpl::string<>, Value, false>\r
+        {\r
+            typedef mpl::string<(char)Value::value> type;\r
+        };\r
+        #endif\r
+\r
+        #define M0(z,n,data)                                                                        \\r
+        template<BOOST_PP_ENUM_PARAMS_Z(z, n, int C), typename Value>                               \\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)>, Value, true>                     \\r
+        {                                                                                           \\r
+            typedef                                                                                 \\r
+                mpl::string<                                                                        \\r
+                    (char)Value::value                                                              \\r
+                    BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, C)                                        \\r
+                >                                                                                   \\r
+            type;                                                                                   \\r
+        };\r
+\r
+        BOOST_PP_REPEAT_FROM_TO(1, BOOST_MPL_STRING_MAX_PARAMS, M0, ~)\r
+        #undef M0\r
+\r
+        template<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, int C), typename Value>\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)>, Value, false>\r
+        {\r
+            typedef\r
+                mpl::string<\r
+                    BOOST_MPL_MULTICHAR_PUSH_FRONT(C0, Value::value)\r
+                  , BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)\r
+                >\r
+            type0;\r
+\r
+            #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590))\r
+            typedef\r
+                typename mpl::if_<\r
+                    mpl::empty<mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)> >\r
+                  , mpl::string<(char)Value::value>\r
+                  , type0\r
+                >::type\r
+            type;\r
+            #else\r
+            typedef type0 type;\r
+            #endif\r
+        };\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct pop_front_impl;\r
+\r
+    template<>\r
+    struct pop_front_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence, bool B = (1==BOOST_MPL_MULTICHAR_LENGTH(Sequence::front_))>\r
+        struct apply;\r
+\r
+        #define M0(z,n,data)                                                                        \\r
+        template<BOOST_PP_ENUM_PARAMS_Z(z, n, int C)>                                               \\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS_Z(z, n, C)>, true>                            \\r
+        {                                                                                           \\r
+            BOOST_MPL_ASSERT_MSG((C0 != 0), POP_FRONT_FAILED_MPL_STRING_IS_EMPTY, (mpl::string<>)); \\r
+            typedef                                                                                 \\r
+                mpl::string<BOOST_PP_ENUM_SHIFTED_PARAMS_Z(z, n, C)>                                \\r
+            type;                                                                                   \\r
+        };\r
+\r
+        BOOST_PP_REPEAT_FROM_TO(1, BOOST_MPL_STRING_MAX_PARAMS, M0, ~)\r
+        #undef M0\r
+\r
+        template<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, int C)>\r
+        struct apply<mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)>, false>\r
+        {\r
+            typedef\r
+                mpl::string<\r
+                    BOOST_MPL_MULTICHAR_POP_FRONT(C0)\r
+                  , BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)\r
+                >\r
+            type;\r
+        };\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct insert_range_impl;\r
+\r
+    template<>\r
+    struct insert_range_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence, typename Pos, typename Range>\r
+        struct apply\r
+          : mpl::copy<\r
+                mpl::joint_view<\r
+                    mpl::iterator_range<\r
+                        mpl::string_iterator<Sequence, 0, 0>\r
+                      , Pos\r
+                    >\r
+                  , mpl::joint_view<\r
+                        Range\r
+                      , mpl::iterator_range<\r
+                            Pos\r
+                          , typename mpl::end<Sequence>::type\r
+                        >\r
+                    >\r
+                >\r
+              , mpl::back_inserter<mpl::string<> >\r
+            >\r
+        {};\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct insert_impl;\r
+\r
+    template<>\r
+    struct insert_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence, typename Pos, typename Value>\r
+        struct apply\r
+          : mpl::insert_range<Sequence, Pos, mpl::string<(char)Value::value> >\r
+        {};\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct erase_impl;\r
+\r
+    template<>\r
+    struct erase_impl<mpl::string_tag>\r
+    {\r
+        template<typename Sequence, typename First, typename Last>\r
+        struct apply\r
+          : mpl::copy<\r
+                mpl::joint_view<\r
+                    mpl::iterator_range<\r
+                        mpl::string_iterator<Sequence, 0, 0>\r
+                      , First\r
+                    >\r
+                  , mpl::iterator_range<\r
+                        typename mpl::if_na<Last, typename mpl::next<First>::type>::type\r
+                      , typename mpl::end<Sequence>::type\r
+                    >\r
+                >\r
+              , mpl::back_inserter<mpl::string<> >\r
+            >\r
+        {};\r
+    };\r
+\r
+    template<typename Tag>\r
+    struct clear_impl;\r
+\r
+    template<>\r
+    struct clear_impl<mpl::string_tag>\r
+    {\r
+        template<typename>\r
+        struct apply\r
+        {\r
+            typedef mpl::string<> type;\r
+        };\r
+    };\r
+\r
+    #define M0(z, n, data)                                                                            \\r
+    template<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, int C), int J>                         \\r
+    struct string_iterator<mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)>, n, J>   \\r
+    {                                                                                                 \\r
+        enum { eomc_ = (BOOST_MPL_MULTICHAR_LENGTH(BOOST_PP_CAT(C, n)) == J + 1) };                   \\r
+        typedef mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)> string;             \\r
+        typedef std::bidirectional_iterator_tag category;                                             \\r
+        typedef                                                                                       \\r
+            mpl::string_iterator<string, n + eomc_, eomc_ ? 0 : J + 1>                                \\r
+        next;                                                                                         \\r
+        typedef                                                                                       \\r
+            mpl::string_iterator<string, n, J - 1>                                                    \\r
+        prior;                                                                                        \\r
+        typedef mpl::char_<BOOST_MPL_MULTICHAR_AT(BOOST_PP_CAT(C, n), J)> type;                       \\r
+    };                                                                                                \\r
+    template<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, int C)>                                \\r
+    struct string_iterator<mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)>, n, 0>   \\r
+    {                                                                                                 \\r
+        enum { eomc_ = (BOOST_MPL_MULTICHAR_LENGTH(BOOST_PP_CAT(C, n)) == 1) };                       \\r
+        typedef mpl::string<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, C)> string;             \\r
+        typedef std::bidirectional_iterator_tag category;                                             \\r
+        typedef                                                                                       \\r
+            mpl::string_iterator<string, n + eomc_, !eomc_>                                           \\r
+        next;                                                                                         \\r
+        typedef                                                                                       \\r
+            mpl::string_iterator<                                                                     \\r
+                string                                                                                \\r
+              , n - 1                                                                                 \\r
+              , BOOST_MPL_MULTICHAR_LENGTH(BOOST_PP_CAT(C, BOOST_PP_DEC(n))) - 1                      \\r
+            >                                                                                         \\r
+        prior;                                                                                        \\r
+        typedef mpl::char_<BOOST_MPL_MULTICHAR_AT(BOOST_PP_CAT(C, n), 0)> type;                       \\r
+    };\r
+\r
+    BOOST_PP_REPEAT(BOOST_MPL_STRING_MAX_PARAMS, M0, ~)\r
+    #undef M0\r
+\r
+    template<BOOST_PP_ENUM_PARAMS(BOOST_MPL_STRING_MAX_PARAMS, int C)>\r
+    struct string\r
+    {\r
+        /// INTERNAL ONLY\r
+        enum\r
+        {\r
+            front_  = C0\r
+          , back_   = BOOST_PP_CAT(C, BOOST_PP_DEC(BOOST_MPL_STRING_MAX_PARAMS))\r
+        };\r
+\r
+        typedef char        value_type;\r
+        typedef string      type;\r
+        typedef string_tag  tag;\r
+    };\r
+\r
+    namespace aux_\r
+    {\r
+        template<typename It, typename End>\r
+        struct next_unless\r
+          : mpl::next<It>\r
+        {};\r
+\r
+        template<typename End>\r
+        struct next_unless<End, End>\r
+        {\r
+            typedef End type;\r
+        };\r
+\r
+        template<typename It, typename End>\r
+        struct deref_unless\r
+          : mpl::deref<It>\r
+        {};\r
+\r
+        template<typename End>\r
+        struct deref_unless<End, End>\r
+        {\r
+            typedef mpl::char_<'\0'> type;\r
+        };\r
+    }\r
+\r
+    template<typename Sequence>\r
+    struct c_str\r
+    {\r
+        typedef typename mpl::end<Sequence>::type iend;\r
+        typedef typename mpl::begin<Sequence>::type i0;\r
+        #define M0(z, n, data)                                                                      \\r
+        typedef                                                                                     \\r
+            typename mpl::aux_::next_unless<BOOST_PP_CAT(i, n), iend>::type                         \\r
+        BOOST_PP_CAT(i, BOOST_PP_INC(n));\r
+        BOOST_PP_REPEAT(BOOST_MPL_LIMIT_STRING_SIZE, M0, ~)\r
+        #undef M0\r
+\r
+        typedef c_str type;\r
+        static typename Sequence::value_type const value[BOOST_MPL_LIMIT_STRING_SIZE+1];\r
+    };\r
+\r
+    template<typename Sequence>\r
+    typename Sequence::value_type const c_str<Sequence>::value[BOOST_MPL_LIMIT_STRING_SIZE+1] =\r
+    {\r
+        #define M0(z, n, data)                                                                      \\r
+        mpl::aux_::deref_unless<BOOST_PP_CAT(i, n), iend>::type::value,\r
+        BOOST_PP_REPEAT(BOOST_MPL_LIMIT_STRING_SIZE, M0, ~)\r
+        #undef M0\r
+        '\0'\r
+    };\r
+\r
+}} // namespace boost\r
+\r
+#endif // BOOST_MPL_STRING_HPP_INCLUDED\r
index b3b1bd72a4679a817ad911eb2b86e665ca910e2d..4b47ba40c1baa21c6498ec940fc638a56ae99592 100644 (file)
@@ -8,6 +8,9 @@
 //  See http://www.boost.org/libs/utility/operators.htm for documentation.
 
 //  Revision History
+//  07 Aug 08 Added "euclidean" spelling. (Daniel Frey)
+//  03 Apr 08 Make sure "convertible to bool" is sufficient
+//            for T::operator<, etc. (Daniel Frey)
 //  24 May 07 Changed empty_base to depend on T, see
 //            http://svn.boost.org/trac/boost/ticket/979
 //  21 Oct 02 Modified implementation of operators to allow compilers with a
@@ -124,34 +127,34 @@ namespace boost
 template <class T, class U, class B = ::boost::detail::empty_base<T> >
 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 T& x, const U& y) { return !static_cast<bool>(x > y); }
+     friend bool operator>=(const T& x, const U& y) { return !static_cast<bool>(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); }
+     friend bool operator<=(const U& x, const T& y) { return !static_cast<bool>(y < x); }
+     friend bool operator>=(const U& x, const T& y) { return !static_cast<bool>(y > x); }
 };
 
 template <class T, class B = ::boost::detail::empty_base<T> >
 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); }
+     friend bool operator<=(const T& x, const T& y) { return !static_cast<bool>(y < x); }
+     friend bool operator>=(const T& x, const T& y) { return !static_cast<bool>(x < y); }
 };
 
 template <class T, class U, class B = ::boost::detail::empty_base<T> >
 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); }
+     friend bool operator!=(const U& y, const T& x) { return !static_cast<bool>(x == y); }
+     friend bool operator!=(const T& y, const U& x) { return !static_cast<bool>(y == x); }
 };
 
 template <class T, class B = ::boost::detail::empty_base<T> >
 struct equality_comparable1 : B
 {
-     friend bool operator!=(const T& x, const T& y) { return !(x == y); }
+     friend bool operator!=(const T& x, const T& y) { return !static_cast<bool>(x == y); }
 };
 
 // A macro which produces "name_2left" from "name".
@@ -356,7 +359,7 @@ struct equivalent2 : B
 {
   friend bool operator==(const T& x, const U& y)
   {
-    return !(x < y) && !(x > y);
+    return !static_cast<bool>(x < y) && !static_cast<bool>(x > y);
   }
 };
 
@@ -365,7 +368,7 @@ struct equivalent1 : B
 {
   friend bool operator==(const T&x, const T&y)
   {
-    return !(x < y) && !(y < x);
+    return !static_cast<bool>(x < y) && !static_cast<bool>(y < x);
   }
 };
 
@@ -373,17 +376,17 @@ template <class T, class U, class B = ::boost::detail::empty_base<T> >
 struct partially_ordered2 : B
 {
   friend bool operator<=(const T& x, const U& y)
-    { return (x < y) || (x == y); }
+    { return static_cast<bool>(x < y) || static_cast<bool>(x == y); }
   friend bool operator>=(const T& x, const U& y)
-    { return (x > y) || (x == y); }
+    { return static_cast<bool>(x > y) || static_cast<bool>(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); }
+    { return static_cast<bool>(y > x) || static_cast<bool>(y == x); }
   friend bool operator>=(const U& x, const T& y)
-    { return (y < x) || (y == x); }
+    { return static_cast<bool>(y < x) || static_cast<bool>(y == x); }
 };
 
 template <class T, class B = ::boost::detail::empty_base<T> >
@@ -392,9 +395,9 @@ 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); }
+    { return static_cast<bool>(x < y) || static_cast<bool>(x == y); }
   friend bool operator>=(const T& x, const T& y)
-    { return (y < x) || (x == y); }
+    { return static_cast<bool>(y < x) || static_cast<bool>(x == y); }
 };
 
 //  Combined operator classes (contributed by Daryle Walker) ----------------//
@@ -580,7 +583,35 @@ struct ordered_euclidian_ring_operators1
     : totally_ordered1<T
     , euclidian_ring_operators1<T, B
       > > {};
-      
+
+template <class T, class U, class B = ::boost::detail::empty_base<T> >
+struct euclidean_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<T> >
+struct euclidean_ring_operators1
+    : ring_operators1<T
+    , dividable1<T
+    , modable1<T, B
+      > > > {};
+
+template <class T, class U, class B = ::boost::detail::empty_base<T> >
+struct ordered_euclidean_ring_operators2
+    : totally_ordered2<T, U
+    , euclidean_ring_operators2<T, U, B
+      > > {};
+
+template <class T, class B = ::boost::detail::empty_base<T> >
+struct ordered_euclidean_ring_operators1
+    : totally_ordered1<T
+    , euclidean_ring_operators1<T, B
+      > > {};
+
 template <class T, class P, class B = ::boost::detail::empty_base<T> >
 struct input_iteratable
     : equality_comparable1<T
@@ -837,6 +868,8 @@ 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_TEMPLATE(euclidean_ring_operators)
+BOOST_OPERATOR_TEMPLATE(ordered_euclidean_ring_operators)
 BOOST_OPERATOR_TEMPLATE2(input_iteratable)
 BOOST_OPERATOR_TEMPLATE1(output_iteratable)
 BOOST_OPERATOR_TEMPLATE2(forward_iteratable)
index f2875a01c76ab1e6294159285dbccf63cc903c56..3a64e93b87d3f64cce8ef1cb14dc940603072c75 100644 (file)
-//  (C) Copyright Jeremy Siek 1999-2001.
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
+/*=============================================================================
+Copyright (c) 2009 Trustees of Indiana University
 
-//  See http://www.boost.org/libs/property_map for documentation.
+Distributed under the Boost Software License, Version 1.0. (See accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+// Redirect/warning header, adapted from the version in Spirit
 
-#ifndef BOOST_PROPERTY_MAP_HPP
-#define BOOST_PROPERTY_MAP_HPP
+#include <boost/version.hpp>
 
-#include <cassert>
-#include <boost/config.hpp>
-#include <boost/pending/cstddef.hpp>
-#include <boost/detail/iterator.hpp>
-#include <boost/concept_check.hpp>
-#include <boost/concept_archetype.hpp>
-#include <boost/mpl/assert.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/type_traits/is_same.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
-
-#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
-  // 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]; }
-
-#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
-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 typename readable_property_map_archetype<K,V>::key_type&)
-  {
-    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 typename writable_property_map_archetype<K,V>::key_type&, 
-           const typename writable_property_map_archetype<K,V>::value_type&) { }
-
-
-  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 property_traits<PMap>::value_type value_type;
-      BOOST_MPL_ASSERT((boost::mpl::or_<
-                          boost::is_same<const value_type&, reference>,
-                          boost::is_same<value_type&, reference> >));
-
-      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 property_traits<PMap>::value_type value_type;
-      BOOST_MPL_ASSERT((boost::is_same<value_type&, reference>));
-
-      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);
-  }
+#if BOOST_VERSION >= 103800
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+#  pragma message ("Warning: This header is deprecated. Please use: boost/property_map/property_map.hpp")
+#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
+#  warning "This header is deprecated. Please use: boost/property_map/property_map.hpp"
 #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, 
-      std::size_t n_ = 0, 
-      const IndexMap& _id = IndexMap() ) 
-      : iter(first), n(n_), index(_id) { }
-    inline safe_iterator_property_map() { }
-    inline R operator[](key_type v) const {
-      assert(get(index, v) < n);
-      return *(iter + get(index, v)) ;
-    }
-    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 boost::detail::iterator_traits<RAIter>::value_type,
-    typename boost::detail::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 boost::detail::iterator_traits<RAIter>::value_type,
-      typename boost::detail::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->find(k)->second;
-    }
-  private:
-    C const* 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 always returns a reference to the same object.
-  //
-template <typename KeyType, typename ValueType>
-class ref_property_map :
-  public
-    boost::put_get_helper<ValueType&,ref_property_map<KeyType,ValueType> >
-{ 
-  ValueType* value;
-public:
-  typedef KeyType key_type;
-  typedef ValueType value_type;
-  typedef ValueType& reference;
-  typedef lvalue_property_map_tag category;
-  ref_property_map(ValueType& v) : value(&v) {}
-  ValueType& operator[](key_type const&) const { return *value; }
-
-};
-
-
-  //=========================================================================
-  // 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 */
 
+#include <boost/property_map/property_map.hpp>
index 9874cbf4adbe1c8170f59cd2c3dffa6889b358e8..30799712fa7bad0686ffbbc4dfe54e0528a66d62 100644 (file)
-// (C) Copyright Jeremy Siek, 2001.
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
+/*=============================================================================
+Copyright (c) 2009 Trustees of Indiana University
 
-//  See http://www.boost.org/libs/property_map for documentation.
+Distributed under the Boost Software License, Version 1.0. (See accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+// Redirect/warning header, adapted from the version in Spirit
 
-#ifndef BOOST_PROPERTY_MAP_ITERATOR_HPP
-#define BOOST_PROPERTY_MAP_ITERATOR_HPP
+#include <boost/version.hpp>
 
-#include <boost/property_map.hpp>
-#include <boost/iterator/iterator_adaptor.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-namespace boost {
-
-  //======================================================================
-  // property iterator, generalized from ideas by François Faure
-
-  namespace detail {
-
-    template <class Iterator, class LvaluePropertyMap>
-    class lvalue_pmap_iter
-      : public iterator_adaptor< lvalue_pmap_iter< Iterator, LvaluePropertyMap >,
-                                 Iterator,
-                                 typename property_traits<LvaluePropertyMap>::value_type,
-                                 use_default,
-                                 typename property_traits<LvaluePropertyMap>::reference>
-    {
-      friend class boost::iterator_core_access;
-
-      typedef iterator_adaptor< lvalue_pmap_iter< Iterator, LvaluePropertyMap >,
-                                Iterator,
-                                typename property_traits<LvaluePropertyMap>::value_type,
-                                use_default,
-                                typename property_traits<LvaluePropertyMap>::reference> super_t;
-
-    public:
-      lvalue_pmap_iter() { }
-      lvalue_pmap_iter(Iterator const&     it,
-                       LvaluePropertyMap m)
-        : super_t(it),
-          m_map(m) {}
-
-    private:
-      typename super_t::reference
-      dereference() const
-      {
-        return m_map[*(this->base_reference())];
-      }
-
-      LvaluePropertyMap m_map;
-    };
-
-    template <class Iterator, class ReadablePropertyMap>
-    class readable_pmap_iter :
-      public iterator_adaptor< readable_pmap_iter< Iterator, ReadablePropertyMap >,
-                               Iterator,
-                               typename property_traits<ReadablePropertyMap>::value_type,
-                               use_default,
-                               typename property_traits<ReadablePropertyMap>::value_type>
-
-
-    {
-      friend class boost::iterator_core_access;
-
-      typedef iterator_adaptor< readable_pmap_iter< Iterator, ReadablePropertyMap >,
-                                Iterator,
-                                typename property_traits<ReadablePropertyMap>::value_type,
-                                use_default,
-                                typename property_traits<ReadablePropertyMap>::value_type> super_t;
-
-    public:
-      readable_pmap_iter() { }
-      readable_pmap_iter(Iterator const&     it,
-                         ReadablePropertyMap m)
-        : super_t(it),
-          m_map(m) {}
-
-    private:
-      typename super_t::reference
-      dereference() const
-      {
-        return get(m_map, *(this->base_reference()));
-      }
-
-      ReadablePropertyMap m_map;
-    };
-
-
-  } // namespace detail
-
-  template <class PropertyMap, class Iterator>
-  struct property_map_iterator_generator :
-    mpl::if_< is_same< typename property_traits<PropertyMap>::category, lvalue_property_map_tag>,
-              detail::lvalue_pmap_iter<Iterator, PropertyMap>,
-              detail::readable_pmap_iter<Iterator, PropertyMap> >
-  {};
-
-  template <class PropertyMap, class Iterator>
-  typename property_map_iterator_generator<PropertyMap, Iterator>::type
-  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
+#if BOOST_VERSION >= 103800
+#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
+#  pragma message ("Warning: This header is deprecated. Please use: boost/property_map/property_map_iterator.hpp")
+#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
+#  warning "This header is deprecated. Please use: boost/property_map/property_map_iterator.hpp"
+#endif
+#endif
 
+#include <boost/property_map/property_map_iterator.hpp>
index 0d747bd1b60cc5ab2febed6739a308f43ca0246d..6058d6983197a72ab040bbfeb7e0b04006cc3ece 100644 (file)
@@ -173,6 +173,12 @@ class unwrap_reference
 
 # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
+template <class T> inline typename unwrap_reference<T>::type&
+unwrap_ref(T& t)
+{
+    return t;
+}
+
 template<class T> inline T* get_pointer( reference_wrapper<T> const & r )
 {
     return r.get_pointer();
index d30dae5f5a10942bfe827f7053dcfc90623f9b0e..00a38ab3f11bf570f5323967a22ee795487c9a40 100644 (file)
@@ -844,6 +844,42 @@ struct BoostRegexConcept
       m_string = m_char + m_sub;\r
       ignore_unused_variable_warning(m_string);\r
 \r
+      // Named sub-expressions:\r
+      m_sub = m_cresults[&m_char];\r
+      ignore_unused_variable_warning(m_sub);\r
+      m_sub = m_cresults[m_string];\r
+      ignore_unused_variable_warning(m_sub);\r
+      m_sub = m_cresults[""];\r
+      ignore_unused_variable_warning(m_sub);\r
+      m_sub = m_cresults[std::string("")];\r
+      ignore_unused_variable_warning(m_sub);\r
+      m_string = m_cresults.str(&m_char);\r
+      ignore_unused_variable_warning(m_string);\r
+      m_string = m_cresults.str(m_string);\r
+      ignore_unused_variable_warning(m_string);\r
+      m_string = m_cresults.str("");\r
+      ignore_unused_variable_warning(m_string);\r
+      m_string = m_cresults.str(std::string(""));\r
+      ignore_unused_variable_warning(m_string);\r
+\r
+      typename match_results_type::difference_type diff;\r
+      diff = m_cresults.length(&m_char);\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.length(m_string);\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.length("");\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.length(std::string(""));\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.position(&m_char);\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.position(m_string);\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.position("");\r
+      ignore_unused_variable_warning(diff);\r
+      diff = m_cresults.position(std::string(""));\r
+      ignore_unused_variable_warning(diff);\r
+\r
 #ifndef BOOST_NO_STD_LOCALE\r
       m_stream << m_sub;\r
       m_stream << m_cresults;\r
index 8c8f5248fb374cb111c97016d60970970c66020f..8306f3ff9ab4d0c2c29510b022aac7aef4b309a0 100644 (file)
 #     pragma warning(push)
 #     pragma warning(disable : 4251 4231 4660)
 #  endif
-#  ifdef _DLL
+#  if defined(_DLL) && defined(BOOST_MSVC) && (BOOST_MSVC < 1600)
 #     include <string>
       extern template class __declspec(dllimport) std::basic_string<unsigned short>;
 #  endif
index 601d03e168b63d8de9b18d98cb5437ad39f17c2d..622ddc2275bc4086b307e8fd38e548469cf4e102 100644 (file)
@@ -184,7 +184,9 @@ private:
       offset_underscore = U_CHAR_CATEGORY_COUNT+3,\r
       offset_unicode = U_CHAR_CATEGORY_COUNT+4,\r
       offset_any = U_CHAR_CATEGORY_COUNT+5,\r
-      offset_ascii = U_CHAR_CATEGORY_COUNT+6\r
+      offset_ascii = U_CHAR_CATEGORY_COUNT+6,\r
+      offset_horizontal = U_CHAR_CATEGORY_COUNT+7,\r
+      offset_vertical = U_CHAR_CATEGORY_COUNT+8\r
    };\r
 \r
    //\r
@@ -197,6 +199,8 @@ private:
    static const char_class_type mask_unicode;\r
    static const char_class_type mask_any;\r
    static const char_class_type mask_ascii;\r
+   static const char_class_type mask_horizontal;\r
+   static const char_class_type mask_vertical;\r
 \r
    static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2);\r
 \r
@@ -311,12 +315,12 @@ inline u32regex do_make_u32regex(InputIterator i,
                               boost::regex_constants::syntax_option_type opt, \r
                               const boost::mpl::int_<4>*)\r
 {\r
-   typedef std::vector<UCHAR32> vector_type;\r
+   typedef std::vector<UChar32> vector_type;\r
    vector_type v;\r
    while(i != j)\r
    {\r
-      v.push_back((UCHAR32)(*i));\r
-      ++a;\r
+      v.push_back((UChar32)(*i));\r
+      ++i;\r
    }\r
    if(v.size())\r
       return u32regex(&*v.begin(), v.size(), opt);\r
index cb9ff3c51c6f73753f769294c428f867ea7c9daa..09b0467b4022ffe65434dea4a8f07c6080dcc0c8 100644 (file)
@@ -19,6 +19,9 @@
 #ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP
 #define BOOST_REGEX_V4_BASIC_REGEX_HPP
 
+#include <boost/type_traits/is_same.hpp>
+#include <boost/functional/hash.hpp>
+
 #ifdef BOOST_MSVC
 #pragma warning(push)
 #pragma warning(disable: 4103)
@@ -44,12 +47,160 @@ namespace re_detail{
 template <class charT, class traits>
 class basic_regex_parser;
 
+template <class I>
+void bubble_down_one(I first, I last)
+{
+   if(first != last)
+   {
+      I next = last - 1;
+      while((next != first) && !(*(next-1) < *next))
+      {
+         (next-1)->swap(*next);
+         --next;
+      }
+   }
+}
+
+//
+// Class named_subexpressions
+// Contains information about named subexpressions within the regex.
+//
+template <class charT>
+class named_subexpressions_base
+{
+public:
+   virtual int get_id(const charT* i, const charT* j)const = 0;
+   virtual int get_id(std::size_t hash)const = 0;
+#ifdef __GNUC__
+   // warning supression:
+   virtual ~named_subexpressions_base(){}
+#endif
+};
+
+template <class Iterator>
+inline std::size_t hash_value_from_capture_name(Iterator i, Iterator j)
+{
+   std::size_t r = boost::hash_range(i, j);
+   r %= ((std::numeric_limits<int>::max)() - 10001);
+   r += 10000;
+   return r;
+}
+
+template <class charT>
+class named_subexpressions : public named_subexpressions_base<charT>
+{
+   struct name
+   {
+      name(const charT* i, const charT* j, int idx)
+         : /*n(i, j), */ index(idx) 
+      { 
+         hash = hash_value_from_capture_name(i, j); 
+      }
+      name(std::size_t h, int idx)
+         : index(idx), hash(h)
+      { 
+      }
+      //std::vector<charT> n;
+      int index;
+      std::size_t hash;
+      bool operator < (const name& other)const
+      {
+         return hash < other.hash; //std::lexicographical_compare(n.begin(), n.end(), other.n.begin(), other.n.end());
+      }
+      bool operator == (const name& other)const
+      {
+         return hash == other.hash; //n == other.n;
+      }
+      void swap(name& other)
+      {
+         //n.swap(other.n);
+         std::swap(index, other.index);
+         std::swap(hash, other.hash);
+      }
+   };
+public:
+   named_subexpressions(){}
+   void set_name(const charT* i, const charT* j, int index)
+   {
+      m_sub_names.push_back(name(i, j, index));
+      bubble_down_one(m_sub_names.begin(), m_sub_names.end());
+   }
+   int get_id(const charT* i, const charT* j)const
+   {
+      name t(i, j, 0);
+      typename std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t);
+      if((pos != m_sub_names.end()) && (*pos == t))
+      {
+         return pos->index;
+      }
+      return -1;
+   }
+   int get_id(std::size_t h)const
+   {
+      name t(h, 0);
+      typename std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t);
+      if((pos != m_sub_names.end()) && (*pos == t))
+      {
+         return pos->index;
+      }
+      return -1;
+   }
+private:
+   std::vector<name> m_sub_names;
+};
+
+template <class charT, class Other>
+class named_subexpressions_converter : public named_subexpressions_base<charT>
+{
+   boost::shared_ptr<named_subexpressions<Other> > m_converter;
+public:
+   named_subexpressions_converter(boost::shared_ptr<named_subexpressions<Other> > s)
+      : m_converter(s) {}
+   int get_id(const charT* i, const charT* j)const
+   {
+      if(i == j)
+         return -1;
+      std::vector<Other> v;
+      while(i != j)
+      {
+         v.push_back(*i);
+         ++i;
+      }
+      return m_converter->get_id(&v[0], &v[0] + v.size());
+   }
+   int get_id(std::size_t h)const
+   {
+      return m_converter->get_id(h);
+   }
+};
+
+template <class To>
+inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs_imp(
+   boost::shared_ptr<named_subexpressions<To> > s, 
+   boost::integral_constant<bool,true> const&)
+{
+   return s;
+}
+template <class To, class From>
+inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs_imp(
+   boost::shared_ptr<named_subexpressions<From> > s, 
+   boost::integral_constant<bool,false> const&)
+{
+   return boost::shared_ptr<named_subexpressions_converter<To, From> >(new named_subexpressions_converter<To, From>(s));
+}
+template <class To, class From>
+inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs(
+   boost::shared_ptr<named_subexpressions<From> > s)
+{
+   typedef typename boost::is_same<To, From>::type tag_type;
+   return convert_to_named_subs_imp<To>(s, tag_type());
+}
 //
 // class regex_data:
 // represents the data we wish to expose to the matching algorithms.
 //
 template <class charT, class traits>
-struct regex_data
+struct regex_data : public named_subexpressions<charT>
 {
    typedef regex_constants::syntax_option_type   flag_type;
    typedef std::size_t                           size_type;  
@@ -77,6 +228,7 @@ struct regex_data
    std::vector<
       std::pair<
       std::size_t, std::size_t> > m_subs;                 // Position of sub-expressions within the *string*.
+   bool                        m_has_recursions;          // whether we have recursive expressions;
 };
 //
 // class basic_regex_implementation
@@ -520,6 +672,10 @@ public:
       BOOST_ASSERT(0 != m_pimpl.get());
       return m_pimpl->get_data();
    }
+   boost::shared_ptr<re_detail::named_subexpressions<charT> > get_named_subs()const
+   {
+      return m_pimpl;
+   }
 
 private:
    shared_ptr<re_detail::basic_regex_implementation<charT, traits> > m_pimpl;
index 9f2cbeec92ccb6fb17e7da0b7d8db14616eb874d..6f0050542dccb7c9bad5b9f69c1d53ae02e01989 100644 (file)
@@ -240,6 +240,7 @@ protected:
    bool                          m_has_backrefs;       // true if there are actually any backrefs
    unsigned                      m_backrefs;           // bitmask of permitted backrefs
    boost::uintmax_t              m_bad_repeats;        // bitmask of repeats we can't deduce a startmap for;
+   bool                          m_has_recursions;     // set when we have recursive expresisons to fixup
    typename traits::char_class_type m_word_mask;       // mask used to determine if a character is a word character
    typename traits::char_class_type m_mask_space;      // mask used to determine if a character is a word character
    typename traits::char_class_type m_lower_mask;       // mask used to determine if a character is a lowercase character
@@ -250,6 +251,7 @@ private:
    basic_regex_creator(const basic_regex_creator&);
 
    void fixup_pointers(re_syntax_base* state);
+   void fixup_recursions(re_syntax_base* state);
    void create_startmaps(re_syntax_base* state);
    int calculate_backstep(re_syntax_base* state);
    void create_startmap(re_syntax_base* state, unsigned char* l_map, unsigned int* pnull, unsigned char mask);
@@ -263,7 +265,7 @@ private:
 
 template <class charT, class traits>
 basic_regex_creator<charT, traits>::basic_regex_creator(regex_data<charT, traits>* data)
-   : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0)
+   : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0), m_has_recursions(false)
 {
    m_pdata->m_data.clear();
    m_pdata->m_status = ::boost::regex_constants::error_ok;
@@ -692,6 +694,13 @@ void basic_regex_creator<charT, traits>::finalize(const charT* p1, const charT*
    m_pdata->m_first_state = static_cast<re_syntax_base*>(m_pdata->m_data.data());
    // fixup pointers in the machine:
    fixup_pointers(m_pdata->m_first_state);
+   if(m_has_recursions)
+   {
+      m_pdata->m_has_recursions = true;
+      fixup_recursions(m_pdata->m_first_state);
+   }
+   else
+      m_pdata->m_has_recursions = false;
    // create nested startmaps:
    create_startmaps(m_pdata->m_first_state);
    // create main startmap:
@@ -713,6 +722,13 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state)
    {
       switch(state->type)
       {
+      case syntax_element_recurse:
+         m_has_recursions = true;
+         if(state->next.i)
+            state->next.p = getaddress(state->next.i, state);
+         else
+            state->next.p = 0;
+         break;
       case syntax_element_rep:
       case syntax_element_dot_rep:
       case syntax_element_char_rep:
@@ -738,6 +754,93 @@ void basic_regex_creator<charT, traits>::fixup_pointers(re_syntax_base* state)
    }
 }
 
+template <class charT, class traits>
+void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
+{
+   re_syntax_base* base = state;
+   while(state)
+   {
+      switch(state->type)
+      {
+      case syntax_element_assert_backref:
+         {
+            // just check that the index is valid:
+            int id = static_cast<const re_brace*>(state)->index;
+            if(id < 0)
+            {
+               id = -id-1;
+               if(id >= 10000)
+               {
+                  id = m_pdata->get_id(id);
+                  if(id <= 0)
+                  {
+                     // check of sub-expression that doesn't exist:
+                     if(0 == this->m_pdata->m_status) // update the error code if not already set
+                        this->m_pdata->m_status = boost::regex_constants::error_bad_pattern;
+                     //
+                     // clear the expression, we should be empty:
+                     //
+                     this->m_pdata->m_expression = 0;
+                     this->m_pdata->m_expression_len = 0;
+                     //
+                     // and throw if required:
+                     //
+                     if(0 == (this->flags() & regex_constants::no_except))
+                     {
+                        std::string message = this->m_pdata->m_ptraits->error_string(boost::regex_constants::error_bad_pattern);
+                        boost::regex_error e(message, boost::regex_constants::error_bad_pattern, 0);
+                        e.raise();
+                     }
+                  }
+               }
+            }
+         }
+         break;
+      case syntax_element_recurse:
+         {
+            bool ok = false;
+            re_syntax_base* p = base;
+            int id = static_cast<re_jump*>(state)->alt.i;
+            if(id > 10000)
+               id = m_pdata->get_id(id);
+            while(p)
+            {
+               if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == id))
+               {
+                  static_cast<re_jump*>(state)->alt.p = p;
+                  ok = true;
+                  break;
+               }
+               p = p->next.p;
+            }
+            if(!ok)
+            {
+               // recursion to sub-expression that doesn't exist:
+               if(0 == this->m_pdata->m_status) // update the error code if not already set
+                  this->m_pdata->m_status = boost::regex_constants::error_bad_pattern;
+               //
+               // clear the expression, we should be empty:
+               //
+               this->m_pdata->m_expression = 0;
+               this->m_pdata->m_expression_len = 0;
+               //
+               // and throw if required:
+               //
+               if(0 == (this->flags() & regex_constants::no_except))
+               {
+                  std::string message = this->m_pdata->m_ptraits->error_string(boost::regex_constants::error_bad_pattern);
+                  boost::regex_error e(message, boost::regex_constants::error_bad_pattern, 0);
+                  e.raise();
+               }
+            }
+         }
+      default:
+         break;
+      }
+      state = state->next.p;
+   }
+}
+
 template <class charT, class traits>
 void basic_regex_creator<charT, traits>::create_startmaps(re_syntax_base* state)
 {
@@ -953,6 +1056,7 @@ void basic_regex_creator<charT, traits>::create_startmap(re_syntax_base* state,
             create_startmap(state->next.p, 0, pnull, mask);
          return;
       }
+      case syntax_element_recurse:
       case syntax_element_backref:
          // can be null, and any character can match:
          if(pnull)
index b8bc99630d9bb0033c7807775b91ce2c99fcafd1..7d2f5543e2943c8e16e6c6140144ddddf7fab64c 100644 (file)
@@ -78,6 +78,8 @@ private:
    const charT*               m_end;            // the end of the string being parsed
    const charT*               m_position;       // our current parser position
    unsigned                   m_mark_count;     // how many sub-expressions we have
+   int                        m_mark_reset;     // used to indicate that we're inside a (?|...) block.
+   unsigned                   m_max_mark;       // largest mark count seen inside a (?|...) block.
    std::ptrdiff_t             m_paren_start;    // where the last seen ')' began (where repeats are inserted).
    std::ptrdiff_t             m_alt_insert_point; // where to insert the next alternative
    bool                       m_has_case_change; // true if somewhere in the current block the case has changed
@@ -96,7 +98,7 @@ private:
 
 template <class charT, class traits>
 basic_regex_parser<charT, traits>::basic_regex_parser(regex_data<charT, traits>* data)
-   : basic_regex_creator<charT, traits>(data), m_mark_count(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false)
+   : basic_regex_creator<charT, traits>(data), m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false)
 {
 }
 
@@ -123,8 +125,16 @@ void basic_regex_parser<charT, traits>::parse(const charT* p1, const charT* p2,
    switch(l_flags & regbase::main_option_type)
    {
    case regbase::perl_syntax_group:
-      m_parser_proc = &basic_regex_parser<charT, traits>::parse_extended;
-      break;
+      {
+         m_parser_proc = &basic_regex_parser<charT, traits>::parse_extended;
+         //
+         // Add a leading paren with index zero to give recursions a target:
+         //
+         re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace)));
+         br->index = 0;
+         br->icase = this->flags() & regbase::icase;
+         break;
+      }
    case regbase::basic_syntax_group:
       m_parser_proc = &basic_regex_parser<charT, traits>::parse_basic;
       break;
@@ -375,11 +385,17 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
    if(0 == (this->flags() & regbase::nosubs))
    {
       markid = ++m_mark_count;
+#ifndef BOOST_NO_STD_DISTANCE
       if(this->flags() & regbase::save_subexpression_location)
          this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>(std::distance(m_base, m_position) - 1, 0));
+#else
+      if(this->flags() & regbase::save_subexpression_location)
+         this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>((m_position - m_base) - 1, 0));
+#endif
    }
    re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace)));
    pb->index = markid;
+   pb->icase = this->flags() & regbase::icase;
    std::ptrdiff_t last_paren_start = this->getoffset(pb);
    // back up insertion point for alternations, and set new point:
    std::ptrdiff_t last_alt_point = m_alt_insert_point;
@@ -392,6 +408,11 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
    bool old_case_change = m_has_case_change;
    m_has_case_change = false; // no changes to this scope as yet...
    //
+   // Back up branch reset data in case we have a nested (?|...)
+   //
+   int mark_reset = m_mark_reset;
+   m_mark_reset = -1;
+   //
    // now recursively add more states, this will terminate when we get to a
    // matching ')' :
    //
@@ -416,6 +437,10 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
    this->flags(opts);
    m_has_case_change = old_case_change;
    //
+   // restore branch reset:
+   //
+   m_mark_reset = mark_reset;
+   //
    // we either have a ')' or we have run out of characters prematurely:
    //
    if(m_position == m_end)
@@ -424,14 +449,20 @@ bool basic_regex_parser<charT, traits>::parse_open_paren()
       return false;
    }
    BOOST_ASSERT(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_close_mark);
+#ifndef BOOST_NO_STD_DISTANCE
    if(markid && (this->flags() & regbase::save_subexpression_location))
       this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position);
+#else
+   if(markid && (this->flags() & regbase::save_subexpression_location))
+      this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base);
+#endif
    ++m_position;
    //
    // append closing parenthesis state:
    //
    pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace)));
    pb->index = markid;
+   pb->icase = this->flags() & regbase::icase;
    this->m_paren_start = last_paren_start;
    //
    // restore the alternate insertion point:
@@ -600,6 +631,7 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
       // fall through:
    case regex_constants::escape_type_class:
       {
+escape_type_class_jump:
          typedef typename traits::char_class_type mask_type;
          mask_type m = this->m_traits.lookup_classname(m_position, m_position+1);
          if(m != 0)
@@ -709,7 +741,104 @@ bool basic_regex_parser<charT, traits>::parse_extended_escape()
             return true;
          }
          fail(regex_constants::error_ctype, m_position - m_base);
+         return false;
+      }
+   case regex_constants::escape_type_reset_start_mark:
+      if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex)))
+      {
+         re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace)));
+         pb->index = -5;
+         pb->icase = this->flags() & regbase::icase;
+         this->m_pdata->m_data.align();
+         ++m_position;
+         return true;
+      }
+      goto escape_type_class_jump;
+   case regex_constants::escape_type_line_ending:
+      if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex)))
+      {
+         const charT* e = get_escape_R_string<charT>();
+         const charT* old_position = m_position;
+         const charT* old_end = m_end;
+         const charT* old_base = m_base;
+         m_position = e;
+         m_base = e;
+         m_end = e + traits::length(e);
+         bool r = parse_all();
+         m_position = ++old_position;
+         m_end = old_end;
+         m_base = old_base;
+         return r;
+      }
+      goto escape_type_class_jump;
+   case regex_constants::escape_type_extended_backref:
+      if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex)))
+      {
+         bool have_brace = false;
+         bool negative = false;
+         if(++m_position == m_end)
+         {
+            fail(regex_constants::error_escape, m_position - m_base);
+            return false;
+         }
+         // maybe have \g{ddd}
+         if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_open_brace)
+         {
+            if(++m_position == m_end)
+            {
+               fail(regex_constants::error_escape, m_position - m_base);
+               return false;
+            }
+            have_brace = true;
+         }
+         negative = (*m_position == static_cast<charT>('-'));
+         if((negative) && (++m_position == m_end))
+         {
+            fail(regex_constants::error_escape, m_position - m_base);
+            return false;
+         }
+         const charT* pc = m_position;
+         int i = this->m_traits.toi(pc, m_end, 10);
+         if(i < 0)
+         {
+            // Check for a named capture:
+            const charT* base = m_position;
+            while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace))
+               ++m_position;
+            i = this->m_pdata->get_id(base, m_position);
+            pc = m_position;
+         }
+         if(negative)
+            i = 1 + m_mark_count - i;
+         if((i > 0) && (this->m_backrefs & (1u << (i-1))))
+         {
+            m_position = pc;
+            re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace)));
+            pb->index = i;
+            pb->icase = this->flags() & regbase::icase;
+         }
+         else
+         {
+            fail(regex_constants::error_backref, m_position - m_end);
+            return false;
+         }
+         m_position = pc;
+         if(have_brace)
+         {
+            if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace))
+            {
+               fail(regex_constants::error_escape, m_position - m_base);
+               return false;
+            }
+            ++m_position;
+         }
+         return true;
       }
+      goto escape_type_class_jump;
+   case regex_constants::escape_type_control_v:
+      if(0 == (this->flags() & (regbase::main_option_type | regbase::no_perl_ex)))
+         goto escape_type_class_jump;
+      // fallthrough:
    default:
       this->append_literal(unescape_character());
       break;
@@ -737,6 +866,7 @@ template <class charT, class traits>
 bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_t high)
 {
    bool greedy = true;
+   bool pocessive = false;
    std::size_t insert_point;
    // 
    // when we get to here we may have a non-greedy ? mark still to come:
@@ -748,12 +878,19 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
          )
       )
    {
-      // OK we have a perl regex, check for a '?':
+      // OK we have a perl or emacs regex, check for a '?':
       if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_question)
       {
          greedy = false;
          ++m_position;
       }
+      // for perl regexes only check for pocessive ++ repeats.
+      if((0 == (this->flags() & regbase::main_option_type)) 
+         && (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus))
+      {
+         pocessive = true;
+         ++m_position;
+      }
    }
    if(0 == this->m_last_state)
    {
@@ -822,6 +959,22 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
    // now fill in the alt jump for the repeat:
    rep = static_cast<re_repeat*>(this->getaddress(rep_off));
    rep->alt.i = this->m_pdata->m_data.size() - rep_off;
+   //
+   // If the repeat is pocessive then bracket the repeat with a (?>...)
+   // independent sub-expression construct:
+   //
+   if(pocessive)
+   {
+      re_brace* pb = static_cast<re_brace*>(this->insert_state(insert_point, syntax_element_startmark, sizeof(re_brace)));
+      pb->index = -3;
+      pb->icase = this->flags() & regbase::icase;
+      re_jump* jmp = static_cast<re_jump*>(this->insert_state(insert_point + sizeof(re_brace), syntax_element_jump, sizeof(re_jump)));
+      this->m_pdata->m_data.align();
+      jmp->alt.i = this->m_pdata->m_data.size() - this->getoffset(jmp);
+      pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace)));
+      pb->index = -3;
+      pb->icase = this->flags() & regbase::icase;
+   }
    return true;
 }
 
@@ -944,6 +1097,14 @@ bool basic_regex_parser<charT, traits>::parse_alt()
       fail(regex_constants::error_empty, this->m_position - this->m_base);
       return false;
    }
+   //
+   // Reset mark count if required:
+   //
+   if(m_max_mark < m_mark_count)
+      m_max_mark = m_mark_count;
+   if(m_mark_reset >= 0)
+      m_mark_count = m_mark_reset;
+
    ++m_position;
    //
    // we need to append a trailing jump: 
@@ -1462,7 +1623,7 @@ charT basic_regex_parser<charT, traits>::unescape_character()
          int i = this->m_traits.toi(m_position, m_end, 16);
          if((m_position == m_end)
             || (i < 0)
-            || ((std::numeric_limits<charT>::is_specialized) && (charT(i) > (std::numeric_limits<charT>::max)()))
+            || ((std::numeric_limits<charT>::is_specialized) && (i > (int)(std::numeric_limits<charT>::max)()))
             || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace))
          {
             fail(regex_constants::error_badbrace, m_position - m_base);
@@ -1568,6 +1729,7 @@ bool basic_regex_parser<charT, traits>::parse_backref()
       m_position = pc;
       re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace)));
       pb->index = i;
+      pb->icase = this->flags() & regbase::icase;
    }
    else
    {
@@ -1655,6 +1817,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
    int markid = 0;
    std::ptrdiff_t jump_offset = 0;
    re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_startmark, sizeof(re_brace)));
+   pb->icase = this->flags() & regbase::icase;
    std::ptrdiff_t last_paren_start = this->getoffset(pb);
    // back up insertion point for alternations, and set new point:
    std::ptrdiff_t last_alt_point = m_alt_insert_point;
@@ -1665,11 +1828,18 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
    regex_constants::syntax_option_type old_flags = this->flags();
    bool old_case_change = m_has_case_change;
    m_has_case_change = false;
+   charT name_delim;
+   int mark_reset = m_mark_reset;
+   m_mark_reset = -1;
+   int v;
    //
    // select the actual extension used:
    //
    switch(this->m_traits.syntax_type(*m_position))
    {
+   case regex_constants::syntax_or:
+      m_mark_reset = m_mark_count;
+      // fall through:
    case regex_constants::syntax_colon:
       //
       // a non-capturing mark:
@@ -1677,6 +1847,57 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
       pb->index = markid = 0;
       ++m_position;
       break;
+   case regex_constants::syntax_digit:
+      {
+      //
+      // a recursive subexpression:
+      //
+      v = this->m_traits.toi(m_position, m_end, 10);
+      if((v < 0) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+      {
+         fail(regex_constants::error_backref, m_position - m_base);
+         return false;
+      }
+insert_recursion:
+      pb->index = markid = 0;
+      static_cast<re_jump*>(this->append_state(syntax_element_recurse, sizeof(re_jump)))->alt.i = v;
+      static_cast<re_case*>(
+            this->append_state(syntax_element_toggle_case, sizeof(re_case))
+            )->icase = this->flags() & regbase::icase;
+      break;
+      }
+   case regex_constants::syntax_plus:
+      //
+      // A forward-relative recursive subexpression:
+      //
+      ++m_position;
+      v = this->m_traits.toi(m_position, m_end, 10);
+      if((v <= 0) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+      {
+         fail(regex_constants::error_backref, m_position - m_base);
+         return false;
+      }
+      v += m_mark_count;
+      goto insert_recursion;
+   case regex_constants::syntax_dash:
+      //
+      // Possibly a backward-relative recursive subexpression:
+      //
+      ++m_position;
+      v = this->m_traits.toi(m_position, m_end, 10);
+      if(v <= 0)
+      {
+         --m_position;
+         // Oops not a relative recursion at all, but a (?-imsx) group:
+         goto option_group_jump;
+      }
+      v = m_mark_count + 1 - v;
+      if(v <= 0)
+      {
+         fail(regex_constants::error_backref, m_position - m_base);
+         return false;
+      }
+      goto insert_recursion;
    case regex_constants::syntax_equal:
       pb->index = markid = -1;
       ++m_position;
@@ -1706,8 +1927,10 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
             pb->index = markid = -1;
          else
          {
-            fail(regex_constants::error_badrepeat, m_position - m_base);
-            return false;
+            // Probably a named capture which also starts (?< :
+            name_delim = '>';
+            --m_position;
+            goto named_capture_jump;
          }
          ++m_position;
          jump_offset = this->getoffset(this->append_state(syntax_element_jump, sizeof(re_jump)));
@@ -1736,7 +1959,95 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
          return false;
       }
       int v = this->m_traits.toi(m_position, m_end, 10);
-      if(v > 0)
+      if(*m_position == charT('R'))
+      {
+         if(++m_position == m_end)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         if(*m_position == charT('&'))
+         {
+            const charT* base = ++m_position;
+            while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+               ++m_position;
+            if(m_position == m_end)
+            {
+               fail(regex_constants::error_badrepeat, m_position - m_base);
+               return false;
+            }
+            v = -static_cast<int>(hash_value_from_capture_name(base, m_position));
+         }
+         else
+         {
+            v = -this->m_traits.toi(m_position, m_end, 10);
+         }
+         re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace)));
+         br->index = v < 0 ? (v - 1) : 0;
+         if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         if(++m_position == m_end)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+      }
+      else if((*m_position == charT('\'')) || (*m_position == charT('<')))
+      {
+         const charT* base = ++m_position;
+         while((m_position != m_end) && (*m_position != charT('>')) && (*m_position != charT('\'')))
+            ++m_position;
+         if(m_position == m_end)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         v = static_cast<int>(hash_value_from_capture_name(base, m_position));
+         re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace)));
+         br->index = v;
+         if((*m_position != charT('>')) && (*m_position != charT('\'')) || (++m_position == m_end))
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         if(++m_position == m_end)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+      }
+      else if(*m_position == charT('D'))
+      {
+         const char* def = "DEFINE";
+         while(*def && (m_position != m_end) && (*m_position == charT(*def)))
+            ++m_position, ++def;
+         if((m_position == m_end) || *def)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace)));
+         br->index = 9999; // special magic value!
+         if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+         if(++m_position == m_end)
+         {
+            fail(regex_constants::error_badrepeat, m_position - m_base);
+            return false;
+         }
+      }
+      else if(v > 0)
       {
          re_brace* br = static_cast<re_brace*>(this->append_state(syntax_element_assert_backref, sizeof(re_brace)));
          br->index = v;
@@ -1784,7 +2095,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
             if((this->m_traits.syntax_type(*m_position) != regex_constants::syntax_equal)
                && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_not))
             {
-               fail(regex_constants::error_badrepeat, m_position - m_base);
+               fail(regex_constants::error_paren, m_position - m_base);
                return false;
             }
             m_position -= 2;
@@ -1795,10 +2106,93 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
    case regex_constants::syntax_close_mark:
       fail(regex_constants::error_badrepeat, m_position - m_base);
       return false;
+   case regex_constants::escape_type_end_buffer:
+      {
+      name_delim = *m_position;
+named_capture_jump:
+      markid = 0;
+      if(0 == (this->flags() & regbase::nosubs))
+      {
+         markid = ++m_mark_count;
+   #ifndef BOOST_NO_STD_DISTANCE
+         if(this->flags() & regbase::save_subexpression_location)
+            this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>(std::distance(m_base, m_position) - 2, 0));
+   #else
+         if(this->flags() & regbase::save_subexpression_location)
+            this->m_pdata->m_subs.push_back(std::pair<std::size_t, std::size_t>((m_position - m_base) - 2, 0));
+   #endif
+      }
+      pb->index = markid;
+      const charT* base = ++m_position;
+      if(m_position == m_end)
+      {
+         fail(regex_constants::error_paren, m_position - m_base);
+         return false;
+      }
+      while((m_position != m_end) && (*m_position != name_delim))
+         ++m_position;
+      if(m_position == m_end)
+      {
+         fail(regex_constants::error_paren, m_position - m_base);
+         return false;
+      }
+      this->m_pdata->set_name(base, m_position, markid);
+      ++m_position;
+      break;
+      }
    default:
+      if(*m_position == charT('R'))
+      {
+         ++m_position;
+         v = 0;
+         if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark)
+         {
+            fail(regex_constants::error_backref, m_position - m_base);
+            return false;
+         }
+         goto insert_recursion;
+      }
+      if(*m_position == charT('&'))
+      {
+         ++m_position;
+         const charT* base = m_position;
+         while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+            ++m_position;
+         if(m_position == m_end)
+         {
+            fail(regex_constants::error_backref, m_position - m_base);
+            return false;
+         }
+         v = static_cast<int>(hash_value_from_capture_name(base, m_position));
+         goto insert_recursion;
+      }
+      if(*m_position == charT('P'))
+      {
+         ++m_position;
+         if(m_position == m_end)
+         {
+            fail(regex_constants::error_backref, m_position - m_base);
+            return false;
+         }
+         if(*m_position == charT('>'))
+         {
+            ++m_position;
+            const charT* base = m_position;
+            while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark))
+               ++m_position;
+            if(m_position == m_end)
+            {
+               fail(regex_constants::error_backref, m_position - m_base);
+               return false;
+            }
+            v = static_cast<int>(hash_value_from_capture_name(base, m_position));
+            goto insert_recursion;
+         }
+      }
       //
       // lets assume that we have a (?imsx) group and try and parse it:
       //
+option_group_jump:
       regex_constants::syntax_option_type opts = parse_options();
       if(m_position == m_end)
          return false;
@@ -1897,9 +2291,20 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
       }
       else if(this->getaddress(static_cast<re_alt*>(b)->alt.i, b)->type == syntax_element_alt)
       {
+         // Can't have seen more than one alternative:
          fail(regex_constants::error_bad_pattern, m_position - m_base);
          return false;
       }
+      else
+      {
+         // We must *not* have seen an alternative inside a (DEFINE) block:
+         b = this->getaddress(b->next.i, b);
+         if((b->type == syntax_element_assert_backref) && (static_cast<re_brace*>(b)->index == 9999))
+         {
+            fail(regex_constants::error_bad_pattern, m_position - m_base);
+            return false;
+         }
+      }
       // check for invalid repetition of next state:
       b = this->getaddress(expected_alt_point);
       b = this->getaddress(static_cast<re_alt*>(b)->next.i, b);
@@ -1915,6 +2320,7 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
    //
    pb = static_cast<re_brace*>(this->append_state(syntax_element_endmark, sizeof(re_brace)));
    pb->index = markid;
+   pb->icase = this->flags() & regbase::icase;
    this->m_paren_start = last_paren_start;
    //
    // restore the alternate insertion point:
@@ -1924,6 +2330,31 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
    // and the case change data:
    //
    m_has_case_change = old_case_change;
+   //
+   // And the mark_reset data:
+   //
+   if(m_max_mark > m_mark_count)
+   {
+      m_mark_count = m_max_mark;
+   }
+   m_mark_reset = mark_reset;
+
+
+   if(markid > 0)
+   {
+#ifndef BOOST_NO_STD_DISTANCE
+      if(this->flags() & regbase::save_subexpression_location)
+         this->m_pdata->m_subs.at(markid - 1).second = std::distance(m_base, m_position) - 1;
+#else
+      if(this->flags() & regbase::save_subexpression_location)
+         this->m_pdata->m_subs.at(markid - 1).second = (m_position - m_base) - 1;
+#endif
+      //
+      // allow backrefs to this mark:
+      //
+      if((markid > 0) && (markid < (int)(sizeof(unsigned) * CHAR_BIT)))
+         this->m_backrefs |= 1u << (markid - 1);
+   }
    return true;
 }
 
index 89fe49d82454a97859aa38a48214ffad2e0885e1..7ce3ed300eba55bf0104719f48f679fdaf8ea323 100644 (file)
@@ -394,7 +394,9 @@ enum
    char_class_graph=char_class_alnum|char_class_punct,
    char_class_blank=1<<9,
    char_class_word=1<<10,
-   char_class_unicode=1<<11
+   char_class_unicode=1<<11,
+   char_class_horizontal_space=1<<12,
+   char_class_vertical_space=1<<13
 };
 
 #endif
@@ -413,6 +415,8 @@ public:
    BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 24);
    BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 25);
    BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 1u << 26);
+   BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 1u << 27);
+   BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 1u << 28);
 #endif
 
    typedef std::basic_string<charT> string_type;
@@ -477,6 +481,10 @@ template <class charT>
 typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_word;
 template <class charT>
 typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_unicode;
+template <class charT>
+typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_vertical;
+template <class charT>
+typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_horizontal;
 
 #endif
 #endif
@@ -688,18 +696,20 @@ void cpp_regex_traits_implementation<charT>::init()
       // Custom class names:
       //
 #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
-      static const char_class_type masks[14] = 
+      static const char_class_type masks[16] = 
       {
          std::ctype<charT>::alnum,
          std::ctype<charT>::alpha,
          std::ctype<charT>::cntrl,
          std::ctype<charT>::digit,
          std::ctype<charT>::graph,
+         cpp_regex_traits_implementation<charT>::mask_horizontal,
          std::ctype<charT>::lower,
          std::ctype<charT>::print,
          std::ctype<charT>::punct,
          std::ctype<charT>::space,
          std::ctype<charT>::upper,
+         cpp_regex_traits_implementation<charT>::mask_vertical,
          std::ctype<charT>::xdigit,
          cpp_regex_traits_implementation<charT>::mask_blank,
          cpp_regex_traits_implementation<charT>::mask_word,
@@ -713,11 +723,13 @@ void cpp_regex_traits_implementation<charT>::init()
          ::boost::re_detail::char_class_cntrl,
          ::boost::re_detail::char_class_digit,
          ::boost::re_detail::char_class_graph,
+         ::boost::re_detail::char_class_horizontal_space,
          ::boost::re_detail::char_class_lower,
          ::boost::re_detail::char_class_print,
          ::boost::re_detail::char_class_punct,
          ::boost::re_detail::char_class_space,
          ::boost::re_detail::char_class_upper,
+         ::boost::re_detail::char_class_vertical_space,
          ::boost::re_detail::char_class_xdigit,
          ::boost::re_detail::char_class_blank,
          ::boost::re_detail::char_class_word,
@@ -744,7 +756,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
    cpp_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
 {
 #ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
-   static const char_class_type masks[20] = 
+   static const char_class_type masks[22] = 
    {
       0,
       std::ctype<char>::alnum, 
@@ -754,6 +766,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
       std::ctype<char>::digit,
       std::ctype<char>::digit,
       std::ctype<char>::graph,
+      cpp_regex_traits_implementation<charT>::mask_horizontal,
       std::ctype<char>::lower,
       std::ctype<char>::lower,
       std::ctype<char>::print,
@@ -763,12 +776,13 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
       std::ctype<char>::upper,
       cpp_regex_traits_implementation<charT>::mask_unicode,
       std::ctype<char>::upper,
+      cpp_regex_traits_implementation<charT>::mask_vertical,
       std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word, 
       std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word, 
       std::ctype<char>::xdigit,
    };
 #else
-   static const char_class_type masks[20] = 
+   static const char_class_type masks[22] = 
    {
       0,
       ::boost::re_detail::char_class_alnum, 
@@ -778,6 +792,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
       ::boost::re_detail::char_class_digit,
       ::boost::re_detail::char_class_digit,
       ::boost::re_detail::char_class_graph,
+      ::boost::re_detail::char_class_horizontal_space,
       ::boost::re_detail::char_class_lower,
       ::boost::re_detail::char_class_lower,
       ::boost::re_detail::char_class_print,
@@ -787,6 +802,7 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
       ::boost::re_detail::char_class_upper,
       ::boost::re_detail::char_class_unicode,
       ::boost::re_detail::char_class_upper,
+      ::boost::re_detail::char_class_vertical_space,
       ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, 
       ::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word, 
       ::boost::re_detail::char_class_xdigit,
@@ -820,7 +836,9 @@ bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_t
       || ((mask & ::boost::re_detail::char_class_xdigit) && (m_pctype->is(std::ctype<charT>::xdigit, c)))
       || ((mask & ::boost::re_detail::char_class_blank) && (m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
       || ((mask & ::boost::re_detail::char_class_word) && (c == '_'))
-      || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c));
+      || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c))
+      || ((mask & ::boost::re_detail::char_class_vertical) && (is_separator(c) || (c == '\v')))
+      || ((mask & ::boost::re_detail::char_class_horizontal) && m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
 }
 #endif
 
@@ -930,6 +948,12 @@ public:
          && m_pimpl->m_pctype->is(std::ctype<charT>::space, c)
          && !re_detail::is_separator(c))
          return true;
+      else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_vertical) 
+         && (::boost::re_detail::is_separator(c) || (c == '\v')))
+         return true;
+      else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_horizontal) 
+         && this->isctype(c, std::ctype<charT>::space) && !this->isctype(c, re_detail::cpp_regex_traits_implementation<charT>::mask_vertical))
+         return true;
       return false;
 #else
       return m_pimpl->isctype(c, f);
index 20870a0ced8513f1c82d946087fa404f09c82cf7..9e4014237804b676cdb8d796d694cfd9c3cebf0e 100644 (file)
@@ -31,10 +31,14 @@ namespace detail{
 template <class I>
 struct is_random_imp
 {
+#ifndef BOOST_NO_STD_ITERATOR_TRAITS
 private:
    typedef typename std::iterator_traits<I>::iterator_category cat;
 public:
    BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible<cat*, std::random_access_iterator_tag*>::value));
+#else
+   BOOST_STATIC_CONSTANT(bool, value = false);
+#endif
 };
 
 template <class I>
index acf509fa7fa270a96db70d150c29b7a8c835f2ea..09dd31f009ccb286055a1712748d34793d49cb4a 100644 (file)
@@ -36,6 +36,13 @@ namespace boost{
 #pragma warning(disable : 4251 4231 4660)
 #endif
 
+namespace re_detail{
+
+template <class charT>
+class named_subexpressions;
+
+}
+
 template <class BidiIterator, class Allocator>
 class match_results
 { 
@@ -62,13 +69,14 @@ public:
    typedef typename re_detail::regex_iterator_traits<
                                     BidiIterator>::value_type               char_type;
    typedef          std::basic_string<char_type>                            string_type;
+   typedef          re_detail::named_subexpressions_base<char_type>         named_sub_type;
 
    // construct/copy/destroy:
    explicit match_results(const Allocator& a = Allocator())
 #ifndef BOOST_NO_STD_ALLOCATOR
-      : m_subs(a), m_base() {}
+      : m_subs(a), m_base(), m_last_closed_paren(0) {}
 #else
-      : m_subs(), m_base() { (void)a; }
+      : m_subs(), m_base(), m_last_closed_paren(0) { (void)a; }
 #endif
    match_results(const match_results& m)
       : m_subs(m.m_subs), m_base(m.m_base) {}
@@ -95,6 +103,24 @@ public:
          return m_subs[sub].length();
       return 0;
    }
+   difference_type length(const char_type* sub) const
+   {
+      const char_type* end = sub;
+      while(*end) ++end;
+      return length(named_subexpression_index(sub, end));
+   }
+   template <class charT>
+   difference_type length(const charT* sub) const
+   {
+      const charT* end = sub;
+      while(*end) ++end;
+      return length(named_subexpression_index(sub, end));
+   }
+   template <class charT, class Traits, class A>
+   difference_type length(const std::basic_string<charT, Traits, A>& sub) const
+   {
+      return length(sub.c_str());
+   }
    difference_type position(size_type sub = 0) const
    {
       sub += 2;
@@ -108,6 +134,24 @@ public:
       }
       return ~static_cast<difference_type>(0);
    }
+   difference_type position(const char_type* sub) const
+   {
+      const char_type* end = sub;
+      while(*end) ++end;
+      return position(named_subexpression_index(sub, end));
+   }
+   template <class charT>
+   difference_type position(const charT* sub) const
+   {
+      const charT* end = sub;
+      while(*end) ++end;
+      return position(named_subexpression_index(sub, end));
+   }
+   template <class charT, class Traits, class A>
+   difference_type position(const std::basic_string<charT, Traits, A>& sub) const
+   {
+      return position(sub.c_str());
+   }
    string_type str(int sub = 0) const
    {
       sub += 2;
@@ -122,6 +166,25 @@ public:
       }
       return result;
    }
+   string_type str(const char_type* sub) const
+   {
+      return (*this)[sub].str();
+   }
+   template <class Traits, class A>
+   string_type str(const std::basic_string<char_type, Traits, A>& sub) const
+   {
+      return (*this)[sub].str();
+   }
+   template <class charT>
+   string_type str(const charT* sub) const
+   {
+      return (*this)[sub].str();
+   }
+   template <class charT, class Traits, class A>
+   string_type str(const std::basic_string<charT, Traits, A>& sub) const
+   {
+      return (*this)[sub].str();
+   }
    const_reference operator[](int sub) const
    {
       sub += 2;
@@ -131,6 +194,75 @@ public:
       }
       return m_null;
    }
+   //
+   // Named sub-expressions:
+   //
+   const_reference named_subexpression(const char_type* i, const char_type* j) const
+   {
+      int index = m_named_subs->get_id(i, j);
+      return index > 0 ? (*this)[index] : m_null;
+   }
+   template <class charT>
+   const_reference named_subexpression(const charT* i, const charT* j) const
+   {
+      BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
+      if(i == j)
+         return m_null;
+      std::vector<char_type> s;
+      while(i != j)
+         s.insert(s.end(), *i++);
+      return named_subexpression(&*s.begin(), &*s.begin() + s.size());
+   }
+   int named_subexpression_index(const char_type* i, const char_type* j) const
+   {
+      int index = m_named_subs->get_id(i, j);
+      return index > 0 ? index : -20;
+   }
+   template <class charT>
+   int named_subexpression_index(const charT* i, const charT* j) const
+   {
+      BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
+      if(i == j)
+         return -20;
+      std::vector<char_type> s;
+      while(i != j)
+         s.insert(s.end(), *i++);
+      return named_subexpression_index(&*s.begin(), &*s.begin() + s.size());
+   }
+   template <class Traits, class A>
+   const_reference operator[](const std::basic_string<char_type, Traits, A>& s) const
+   {
+      return named_subexpression(s.c_str(), s.c_str() + s.size());
+   }
+   const_reference operator[](const char_type* p) const
+   {
+      const char_type* e = p;
+      while(*e) ++e;
+      return named_subexpression(p, e);
+   }
+
+   template <class charT>
+   const_reference operator[](const charT* p) const
+   {
+      BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
+      if(*p == 0)
+         return m_null;
+      std::vector<char_type> s;
+      while(*p)
+         s.insert(s.end(), *p++);
+      return named_subexpression(&*s.begin(), &*s.begin() + s.size());
+   }
+   template <class charT, class Traits, class A>
+   const_reference operator[](const std::basic_string<charT, Traits, A>& ns) const
+   {
+      BOOST_STATIC_ASSERT(sizeof(charT) <= sizeof(char_type));
+      if(ns.empty())
+         return m_null;
+      std::vector<char_type> s;
+      for(unsigned i = 0; i < ns.size(); ++i)
+         s.insert(s.end(), ns[i]);
+      return named_subexpression(&*s.begin(), &*s.begin() + s.size());
+   }
 
    const_reference prefix() const
    {
@@ -186,6 +318,10 @@ public:
       ::boost::re_detail::regex_format_imp(i, *this, fmt.data(), fmt.data() + fmt.size(), flags, re.get_traits());
       return result;
    }
+   const_reference get_last_closed_paren()const
+   {
+      return m_last_closed_paren == 0 ? m_null : (*this)[m_last_closed_paren];
+   }
 
    allocator_type get_allocator() const
    {
@@ -230,13 +366,15 @@ public:
       m_null.matched = false;
    }
 
-   void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true)
+   void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true, bool escape_k = false)
    {
+      if(pos)
+         m_last_closed_paren = pos;
       pos += 2;
       BOOST_ASSERT(m_subs.size() > pos);
       m_subs[pos].second = i;
       m_subs[pos].matched = m;
-      if(pos == 2)
+      if((pos == 2) && !escape_k)
       {
          m_subs[0].first = i;
          m_subs[0].matched = (m_subs[0].first != m_subs[0].second);
@@ -261,6 +399,7 @@ public:
             m_subs.insert(m_subs.end(), n+2-len, v);
       }
       m_subs[1].first = i;
+      m_last_closed_paren = 0;
    }
    void BOOST_REGEX_CALL set_base(BidiIterator pos)
    {
@@ -284,21 +423,34 @@ public:
          m_subs[n].matched = false;
       }
    }
-   void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos)
+   void BOOST_REGEX_CALL set_first(BidiIterator i, size_type pos, bool escape_k = false)
    {
       BOOST_ASSERT(pos+2 < m_subs.size());
-      if(pos)
+      if(pos || escape_k)
+      {
          m_subs[pos+2].first = i;
+         if(escape_k)
+         {
+            m_subs[1].second = i;
+            m_subs[1].matched = (m_subs[1].first != m_subs[1].second);
+         }
+      }
       else
          set_first(i);
    }
    void BOOST_REGEX_CALL maybe_assign(const match_results<BidiIterator, Allocator>& m);
 
+   void BOOST_REGEX_CALL set_named_subs(boost::shared_ptr<named_sub_type> subs)
+   {
+      m_named_subs = subs;
+   }
 
 private:
    vector_type            m_subs; // subexpressions
    BidiIterator   m_base; // where the search started from
    sub_match<BidiIterator> m_null; // a null match
+   boost::shared_ptr<named_sub_type> m_named_subs;
+   int m_last_closed_paren;
 };
 
 template <class BidiIterator, class Allocator>
index 33afe6e9a096d4fbbb18c9dab8e06c71b44bf400..726c2881e5b17f705910c0ee805ab317ff12858a 100644 (file)
@@ -285,7 +285,8 @@ public:
    }
    ~repeater_count()
    {
-      *stack = next;
+      if(next)
+         *stack = next;
    }
    std::size_t get_count() { return count; }
    int get_id() { return state_id; }
@@ -325,6 +326,17 @@ enum saved_state_type
    saved_state_count = 14
 };
 
+template <class Results>
+struct recursion_info
+{
+   typedef typename Results::value_type value_type;
+   typedef typename value_type::iterator iterator;
+   int id;
+   const re_syntax_base* preturn_address;
+   Results results;
+   repeater_count<iterator>* repeater_stack;
+};
+
 #ifdef BOOST_MSVC
 #pragma warning(push)
 #pragma warning(disable : 4251 4231 4660)
@@ -340,6 +352,7 @@ public:
    typedef std::size_t traits_size_type;
    typedef typename is_byte<char_type>::width_type width_type;
    typedef typename regex_iterator_traits<BidiIterator>::difference_type difference_type;
+   typedef match_results<BidiIterator, Allocator> results_type;
 
    perl_matcher(BidiIterator first, BidiIterator end, 
       match_results<BidiIterator, Allocator>& what, 
@@ -348,7 +361,7 @@ public:
       BidiIterator l_base)
       :  m_result(what), base(first), last(end), 
          position(first), backstop(l_base), re(e), traits_inst(e.get_traits()), 
-         m_independent(false), next_count(&rep_obj), rep_obj(&next_count)
+         m_independent(false), next_count(&rep_obj), rep_obj(&next_count), recursion_stack_position(0)
    {
       construct_init(e, f);
    }
@@ -403,12 +416,17 @@ private:
    bool match_char_repeat();
    bool match_dot_repeat_fast();
    bool match_dot_repeat_slow();
+   bool match_dot_repeat_dispatch()
+   {
+      return ::boost::is_random_access_iterator<BidiIterator>::value ? match_dot_repeat_fast() : match_dot_repeat_slow();
+   }
    bool match_backstep();
    bool match_assert_backref();
    bool match_toggle_case();
 #ifdef BOOST_REGEX_RECURSIVE
    bool backtrack_till_match(std::size_t count);
 #endif
+   bool match_recursion();
 
    // find procs stored in s_find_vtable:
    bool find_restart_any();
@@ -464,6 +482,9 @@ private:
    typename traits::char_class_type m_word_mask;
    // the bitmask to use when determining whether a match_any matches a newline or not:
    unsigned char match_any_mask;
+   // recursion information:
+   recursion_info<results_type> recursion_stack[50];
+   unsigned recursion_stack_position;
 
 #ifdef BOOST_REGEX_NON_RECURSIVE
    //
@@ -487,6 +508,8 @@ private:
    bool unwind_short_set_repeat(bool);
    bool unwind_long_set_repeat(bool);
    bool unwind_non_greedy_repeat(bool);
+   bool unwind_recursion(bool);
+   bool unwind_recursion_pop(bool);
    void destroy_single_repeat();
    void push_matched_paren(int index, const sub_match<BidiIterator>& sub);
    void push_recursion_stopper();
@@ -495,7 +518,8 @@ private:
    void push_repeater_count(int i, repeater_count<BidiIterator>** s);
    void push_single_repeat(std::size_t c, const re_repeat* r, BidiIterator last_position, int state_id);
    void push_non_greedy_repeat(const re_syntax_base* ps);
-
+   void push_recursion(int id, const re_syntax_base* p, results_type* presults);
+   void push_recursion_pop();
 
    // pointer to base of stack:
    saved_state* m_stack_base;
index 399caa3bc942c9fa4090c9f5acf9c0ffe39ff4c5..fd439f84b62bbb71b93e7c27142834046c8263b2 100644 (file)
@@ -200,12 +200,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_imp()
    m_match_flags |= regex_constants::match_all;
    m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
    m_presult->set_base(base);
+   m_presult->set_named_subs(re_detail::convert_to_named_subs<typename match_results<BidiIterator>::char_type>(this->re.get_named_subs()));
    if(m_match_flags & match_posix)
       m_result = *m_presult;
    verify_options(re.flags(), m_match_flags);
    if(0 == match_prefix())
       return false;
-   return m_result[0].second == last;
+   return (m_result[0].second == last) && (m_result[0].first == base);
 
 #if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_NO_EXCEPTIONS)
    }
@@ -261,6 +262,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp()
       pstate = re.get_first_state();
       m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last);
       m_presult->set_base(base);
+      m_presult->set_named_subs(re_detail::convert_to_named_subs<typename match_results<BidiIterator>::char_type>(this->re.get_named_subs()));
       m_match_flags |= regex_constants::match_init;
    }
    else
@@ -343,25 +345,6 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_prefix()
    return m_has_found_match;
 }
 
-template <class BidiIterator, class Allocator, class traits>
-bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
-{
-   int index = static_cast<const re_brace*>(pstate)->index;
-   if(index > 0)
-   {
-      if((m_match_flags & match_nosubs) == 0)
-         m_presult->set_second(position, index);
-   }
-   else if((index < 0) && (index != -4))
-   {
-      // matched forward lookahead:
-      pstate = 0;
-      return true;
-   }
-   pstate = pstate->next.p;
-   return true;
-}
-
 template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::match_literal()
 {
@@ -462,35 +445,6 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_wild()
    return true;
 }
 
-template <class BidiIterator, class Allocator, class traits>
-bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
-{
-   if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first))
-      return false;
-   if((m_match_flags & match_all) && (position != last))
-      return false;
-   if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base))
-      return false;
-   m_presult->set_second(position);
-   pstate = 0;
-   m_has_found_match = true;
-   if((m_match_flags & match_posix) == match_posix)
-   {
-      m_result.maybe_assign(*m_presult);
-      if((m_match_flags & match_any) == 0)
-         return false;
-   }
-#ifdef BOOST_REGEX_MATCH_EXTRA
-   if(match_extra & m_match_flags)
-   {
-      for(unsigned i = 0; i < m_presult->size(); ++i)
-         if((*m_presult)[i].matched)
-            ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]);
-   }
-#endif
-   return true;
-}
-
 template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::match_word_boundary()
 {
@@ -758,8 +712,32 @@ template <class BidiIterator, class Allocator, class traits>
 inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref()
 {
    // return true if marked sub-expression N has been matched:
-   bool result = (*m_presult)[static_cast<const re_brace*>(pstate)->index].matched;
-   pstate = pstate->next.p;
+   int index = static_cast<const re_brace*>(pstate)->index;
+   bool result;
+   if(index == 9999)
+   {
+      // Magic value for a (DEFINE) block:
+      return false;
+   }
+   else if(index > 0)
+   {
+      // Check if index is a hash value:
+      if(index >= 10000)
+         index = re.get_data().get_id(index);
+      // Have we matched subexpression "index"?
+      result = (*m_presult)[index].matched;
+      pstate = pstate->next.p;
+   }
+   else
+   {
+      // Have we recursed into subexpression "index"?
+      // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1.
+      int id = -index-1;
+      if(id >= 10000)
+         id = re.get_data().get_id(id);
+      result = recursion_stack_position && ((recursion_stack[recursion_stack_position-1].id == id) || (index == 0));
+      pstate = pstate->next.p;
+   }
    return result;
 }
 
index 10e03477269c74b8e4725a73a0d68817d0c1cf94..2ce7ebe03439846767988a46551ed5431c879e9a 100644 (file)
@@ -127,10 +127,21 @@ struct saved_single_repeat : public saved_state
       : saved_state(arg_id), count(c), rep(r), last_position(lp){}
 };
 
+template <class Results>
+struct saved_recursion : public saved_state
+{
+   saved_recursion(int id, const re_syntax_base* p, Results* pr) 
+      : saved_state(14), recursion_id(id), preturn_address(p), results(*pr)
+   {}
+   int recursion_id;
+   const re_syntax_base* preturn_address;
+   Results results;
+};
+
 template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
 {
-   static matcher_proc_type const s_match_vtable[29] = 
+   static matcher_proc_type const s_match_vtable[30] = 
    {
       (&perl_matcher<BidiIterator, Allocator, traits>::match_startmark),
       &perl_matcher<BidiIterator, Allocator, traits>::match_endmark,
@@ -154,13 +165,18 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
       &perl_matcher<BidiIterator, Allocator, traits>::match_combining,
       &perl_matcher<BidiIterator, Allocator, traits>::match_soft_buffer_end,
       &perl_matcher<BidiIterator, Allocator, traits>::match_restart_continue,
-      (::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow),
+      // Although this next line *should* be evaluated at compile time, in practice
+      // some compilers (VC++) emit run-time initialisation which breaks thread
+      // safety, so use a dispatch function instead:
+      //(::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow),
+      &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_dispatch,
       &perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::match_backstep,
       &perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref,
       &perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case,
+      &perl_matcher<BidiIterator, Allocator, traits>::match_recursion,
    };
 
    push_recursion_stopper();
@@ -209,7 +225,7 @@ void perl_matcher<BidiIterator, Allocator, traits>::extend_stack()
 template <class BidiIterator, class Allocator, class traits>
 inline void perl_matcher<BidiIterator, Allocator, traits>::push_matched_paren(int index, const sub_match<BidiIterator>& sub)
 {
-   BOOST_ASSERT(index);
+   //BOOST_ASSERT(index);
    saved_matched_paren<BidiIterator>* pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
    --pmp;
    if(pmp < m_stack_base)
@@ -312,10 +328,26 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_single_repeat(st
    m_backup_state = pmp;
 }
 
+template <class BidiIterator, class Allocator, class traits>
+inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int id, const re_syntax_base* p, results_type* presults)
+{
+   saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
+   --pmp;
+   if(pmp < m_stack_base)
+   {
+      extend_stack();
+      pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
+      --pmp;
+   }
+   (void) new (pmp)saved_recursion<results_type>(id, p, presults);
+   m_backup_state = pmp;
+}
+
 template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
 {
    int index = static_cast<const re_brace*>(pstate)->index;
+   icase = static_cast<const re_brace*>(pstate)->icase;
    switch(index)
    {
    case 0:
@@ -400,6 +432,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
          break;
       }
       }
+   case -5:
+      {
+         push_matched_paren(0, (*m_presult)[0]);
+         m_presult->set_first(position, 0, true);
+         pstate = pstate->next.p;
+         break;
+      }
    default:
    {
       BOOST_ASSERT(index > 0);
@@ -848,6 +887,100 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat()
 #endif
 }
 
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
+{
+   BOOST_ASSERT(pstate->type == syntax_element_recurse);
+   //
+   // Backup call stack:
+   //
+   push_recursion_pop();
+   //
+   // Set new call stack:
+   //
+   if(recursion_stack_position >= static_cast<int>(sizeof(recursion_stack)/sizeof(recursion_stack[0])))
+   {
+      return false;
+   }
+   recursion_stack[recursion_stack_position].preturn_address = pstate->next.p;
+   recursion_stack[recursion_stack_position].results = *m_presult;
+   pstate = static_cast<const re_jump*>(pstate)->alt.p;
+   recursion_stack[recursion_stack_position].id = static_cast<const re_brace*>(pstate)->index;
+   ++recursion_stack_position;
+   //BOOST_ASSERT(recursion_stack[recursion_stack_position-1].id);
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
+{
+   int index = static_cast<const re_brace*>(pstate)->index;
+   icase = static_cast<const re_brace*>(pstate)->icase;
+   if(index > 0)
+   {
+      if((m_match_flags & match_nosubs) == 0)
+      {
+         m_presult->set_second(position, index);
+      }
+      if(recursion_stack_position)
+      {
+         if(index == recursion_stack[recursion_stack_position-1].id)
+         {
+            --recursion_stack_position;
+            pstate = recursion_stack[recursion_stack_position].preturn_address;
+            *m_presult = recursion_stack[recursion_stack_position].results;
+            push_recursion(recursion_stack[recursion_stack_position].id, recursion_stack[recursion_stack_position].preturn_address, &recursion_stack[recursion_stack_position].results);
+         }
+      }
+   }
+   else if((index < 0) && (index != -4))
+   {
+      // matched forward lookahead:
+      pstate = 0;
+      return true;
+   }
+   pstate = pstate->next.p;
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
+{
+   if(recursion_stack_position)
+   {
+      BOOST_ASSERT(0 == recursion_stack[recursion_stack_position-1].id);
+      --recursion_stack_position;
+      pstate = recursion_stack[recursion_stack_position].preturn_address;
+      *m_presult = recursion_stack[recursion_stack_position].results;
+      push_recursion(recursion_stack[recursion_stack_position].id, recursion_stack[recursion_stack_position].preturn_address, &recursion_stack[recursion_stack_position].results);
+      return true;
+   }
+   if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first))
+      return false;
+   if((m_match_flags & match_all) && (position != last))
+      return false;
+   if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base))
+      return false;
+   m_presult->set_second(position);
+   pstate = 0;
+   m_has_found_match = true;
+   if((m_match_flags & match_posix) == match_posix)
+   {
+      m_result.maybe_assign(*m_presult);
+      if((m_match_flags & match_any) == 0)
+         return false;
+   }
+#ifdef BOOST_REGEX_MATCH_EXTRA
+   if(match_extra & m_match_flags)
+   {
+      for(unsigned i = 0; i < m_presult->size(); ++i)
+         if((*m_presult)[i].matched)
+            ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]);
+   }
+#endif
+   return true;
+}
+
 /****************************************************************************
 
 Unwind and associated proceedures follow, these perform what normal stack
@@ -858,7 +991,7 @@ unwinding does in the recursive implementation.
 template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match)
 {
-   static unwind_proc_type const s_unwind_table[14] = 
+   static unwind_proc_type const s_unwind_table[18] = 
    {
       &perl_matcher<BidiIterator, Allocator, traits>::unwind_end,
       &perl_matcher<BidiIterator, Allocator, traits>::unwind_paren,
@@ -874,6 +1007,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind(bool have_match)
       &perl_matcher<BidiIterator, Allocator, traits>::unwind_short_set_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat,
+      &perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion,
+      &perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop,
    };
 
    m_recursive_result = have_match;
@@ -907,8 +1042,8 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_paren(bool have_match
    // restore previous values if no match was found:
    if(have_match == false)
    {
-      m_presult->set_first(pmp->sub.first, pmp->index);
-      m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched);
+      m_presult->set_first(pmp->sub.first, pmp->index, pmp->index == 0);
+      m_presult->set_second(pmp->sub.second, pmp->index, pmp->sub.matched, pmp->index == 0);
    }
 #ifdef BOOST_REGEX_MATCH_EXTRA
    //
@@ -1377,6 +1512,106 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_non_greedy_repeat(boo
    return r;
 }
 
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion(bool r)
+{
+   saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
+   if(!r)
+   {
+      recursion_stack[recursion_stack_position].id = pmp->recursion_id;
+      recursion_stack[recursion_stack_position].preturn_address = pmp->preturn_address;
+      recursion_stack[recursion_stack_position].results = pmp->results;
+      ++recursion_stack_position;
+   }
+   boost::re_detail::inplace_destroy(pmp++);
+   m_backup_state = pmp;
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop(bool r)
+{
+   saved_state* pmp = static_cast<saved_state*>(m_backup_state);
+   if(!r)
+   {
+      --recursion_stack_position;
+   }
+   boost::re_detail::inplace_destroy(pmp++);
+   m_backup_state = pmp;
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+void perl_matcher<BidiIterator, Allocator, traits>::push_recursion_pop()
+{
+   saved_state* pmp = static_cast<saved_state*>(m_backup_state);
+   --pmp;
+   if(pmp < m_stack_base)
+   {
+      extend_stack();
+      pmp = static_cast<saved_state*>(m_backup_state);
+      --pmp;
+   }
+   (void) new (pmp)saved_state(15);
+   m_backup_state = pmp;
+}
+/*
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_pop(bool r)
+{
+   saved_state* pmp = static_cast<saved_state*>(m_backup_state);
+   if(!r)
+   {
+      --parenthesis_stack_position;
+   }
+   boost::re_detail::inplace_destroy(pmp++);
+   m_backup_state = pmp;
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_pop()
+{
+   saved_state* pmp = static_cast<saved_state*>(m_backup_state);
+   --pmp;
+   if(pmp < m_stack_base)
+   {
+      extend_stack();
+      pmp = static_cast<saved_state*>(m_backup_state);
+      --pmp;
+   }
+   (void) new (pmp)saved_state(16);
+   m_backup_state = pmp;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::unwind_parenthesis_push(bool r)
+{
+   saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+   if(!r)
+   {
+      parenthesis_stack[parenthesis_stack_position++] = pmp->position;
+   }
+   boost::re_detail::inplace_destroy(pmp++);
+   m_backup_state = pmp;
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+inline void perl_matcher<BidiIterator, Allocator, traits>::push_parenthesis_push(BidiIterator p)
+{
+   saved_position<BidiIterator>* pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+   --pmp;
+   if(pmp < m_stack_base)
+   {
+      extend_stack();
+      pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
+      --pmp;
+   }
+   (void) new (pmp)saved_position<BidiIterator>(0, p, 17);
+   m_backup_state = pmp;
+}
+*/
 } // namespace re_detail
 } // namespace boost
 
index 68e1aac9b4cc1bf1a25612bb51dea7f8f2ed86c9..48f08b7b8dea3f1776930494303495615a9d118b 100644 (file)
@@ -51,8 +51,8 @@ public:
    template <class A>
    void restore(match_results<BidiIterator, A>& w)
    {
-      w.set_first(sub.first, index);
-      w.set_second(sub.second, index, sub.matched);
+      w.set_first(sub.first, index, index == 0);
+      w.set_second(sub.second, index, sub.matched, index == 0);
    }
    const sub_match<BidiIterator>& get() { return sub; }
 };
@@ -60,7 +60,7 @@ public:
 template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
 {
-   static matcher_proc_type const s_match_vtable[29] = 
+   static matcher_proc_type const s_match_vtable[30] = 
    {
       (&perl_matcher<BidiIterator, Allocator, traits>::match_startmark),
       &perl_matcher<BidiIterator, Allocator, traits>::match_endmark,
@@ -84,13 +84,18 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_all_states()
       &perl_matcher<BidiIterator, Allocator, traits>::match_combining,
       &perl_matcher<BidiIterator, Allocator, traits>::match_soft_buffer_end,
       &perl_matcher<BidiIterator, Allocator, traits>::match_restart_continue,
-      (::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow),
+      // Although this next line *should* be evaluated at compile time, in practice
+      // some compilers (VC++) emit run-time initialisation which breaks thread
+      // safety, so use a dispatch function instead:
+      //(::boost::is_random_access_iterator<BidiIterator>::value ? &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_fast : &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_slow),
+      &perl_matcher<BidiIterator, Allocator, traits>::match_dot_repeat_dispatch,
       &perl_matcher<BidiIterator, Allocator, traits>::match_char_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::match_set_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::match_long_set_repeat,
       &perl_matcher<BidiIterator, Allocator, traits>::match_backstep,
       &perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref,
       &perl_matcher<BidiIterator, Allocator, traits>::match_toggle_case,
+      &perl_matcher<BidiIterator, Allocator, traits>::match_recursion,
    };
 
    if(state_count > max_state_count)
@@ -113,6 +118,7 @@ template <class BidiIterator, class Allocator, class traits>
 bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
 {
    int index = static_cast<const re_brace*>(pstate)->index;
+   icase = static_cast<const re_brace*>(pstate)->icase;
    bool r = true;
    switch(index)
    {
@@ -205,6 +211,17 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
          break;
       }
       }
+   case -5:
+      {
+         // Reset start of $0, since we have a \K escape
+         backup_subex<BidiIterator> sub(*m_presult, 0);
+         m_presult->set_first(position, 0, true);
+         pstate = pstate->next.p;
+         r = match_all_states();
+         if(r == false)
+            sub.restore(*m_presult);
+         break;
+      }
    default:
    {
       BOOST_ASSERT(index > 0);
@@ -833,6 +850,127 @@ bool perl_matcher<BidiIterator, Allocator, traits>::backtrack_till_match(std::si
 #endif
 }
 
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
+{
+   BOOST_ASSERT(pstate->type == syntax_element_recurse);
+   //
+   // Set new call stack:
+   //
+   if(recursion_stack_position >= static_cast<int>(sizeof(recursion_stack)/sizeof(recursion_stack[0])))
+   {
+      return false;
+   }
+   recursion_stack[recursion_stack_position].preturn_address = pstate->next.p;
+   recursion_stack[recursion_stack_position].results = *m_presult;
+   recursion_stack[recursion_stack_position].repeater_stack = next_count;
+   pstate = static_cast<const re_jump*>(pstate)->alt.p;
+   recursion_stack[recursion_stack_position].id = static_cast<const re_brace*>(pstate)->index;
+   ++recursion_stack_position;
+
+   repeater_count<BidiIterator>* saved = next_count;
+   repeater_count<BidiIterator> r(&next_count); // resets all repeat counts since we're recursing and starting fresh on those
+   next_count = &r;
+   bool result = match_all_states();
+   next_count = saved;
+
+   if(!result)
+   {
+      --recursion_stack_position;
+      next_count = recursion_stack[recursion_stack_position].repeater_stack;
+      *m_presult = recursion_stack[recursion_stack_position].results;
+      return false;
+   }
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
+{
+   int index = static_cast<const re_brace*>(pstate)->index;
+   icase = static_cast<const re_brace*>(pstate)->icase;
+   if(index > 0)
+   {
+      if((m_match_flags & match_nosubs) == 0)
+      {
+         m_presult->set_second(position, index);
+      }
+      if(recursion_stack_position)
+      {
+         if(index == recursion_stack[recursion_stack_position-1].id)
+         {
+            --recursion_stack_position;
+            recursion_info<results_type> saved = recursion_stack[recursion_stack_position];
+            const re_syntax_base* saved_state = pstate = saved.preturn_address;
+            repeater_count<BidiIterator>* saved_count = next_count;
+            next_count = saved.repeater_stack;
+            *m_presult = saved.results;
+            if(!match_all_states())
+            {
+               recursion_stack[recursion_stack_position] = saved;
+               ++recursion_stack_position;
+               next_count = saved_count;
+               return false;
+            }
+         }
+      }
+   }
+   else if((index < 0) && (index != -4))
+   {
+      // matched forward lookahead:
+      pstate = 0;
+      return true;
+   }
+   pstate = pstate ? pstate->next.p : 0;
+   return true;
+}
+
+template <class BidiIterator, class Allocator, class traits>
+bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
+{
+   if(recursion_stack_position)
+   {
+      BOOST_ASSERT(0 == recursion_stack[recursion_stack_position-1].id);
+      --recursion_stack_position;
+      const re_syntax_base* saved_state = pstate = recursion_stack[recursion_stack_position].preturn_address;
+      *m_presult = recursion_stack[recursion_stack_position].results;
+      if(!match_all_states())
+      {
+         recursion_stack[recursion_stack_position].preturn_address = saved_state;
+         recursion_stack[recursion_stack_position].results = *m_presult;
+         ++recursion_stack_position;
+         return false;
+      }
+      return true;
+   }
+   if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first))
+      return false;
+   if((m_match_flags & match_all) && (position != last))
+      return false;
+   if((m_match_flags & regex_constants::match_not_initial_null) && (position == search_base))
+      return false;
+   m_presult->set_second(position);
+   pstate = 0;
+   m_has_found_match = true;
+   if((m_match_flags & match_posix) == match_posix)
+   {
+      m_result.maybe_assign(*m_presult);
+      if((m_match_flags & match_any) == 0)
+         return false;
+   }
+#ifdef BOOST_REGEX_MATCH_EXTRA
+   if(match_extra & m_match_flags)
+   {
+      for(unsigned i = 0; i < m_presult->size(); ++i)
+         if((*m_presult)[i].matched)
+            ((*m_presult)[i]).get_captures().push_back((*m_presult)[i]);
+   }
+#endif
+   return true;
+}
+
+
+
 } // namespace re_detail
 } // namespace boost
 #ifdef BOOST_MSVC
index d114c2ed29e4dcc44cb41a409248954ac813cd91..4e95112f908b97747ed8b359d12b56d2850da3df 100644 (file)
@@ -107,6 +107,7 @@ private:
    void format_escape();
    void format_conditional();
    void format_until_scope_end();
+   bool handle_perl_verb(bool have_brace);
 
    const traits& m_traits;       // the traits class for localised formatting operations
    const Results& m_results;     // the match_results being used.
@@ -250,6 +251,25 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl()
    case '$':
       put(*m_position++);
       break;
+   case '+':
+      if((++m_position != m_end) && (*m_position == '{'))
+      {
+         const char_type* base = ++m_position;
+         while((m_position != m_end) && (*m_position != '}')) ++m_position;
+         if(m_position != m_end)
+         {
+            // Named sub-expression:
+            put(this->m_results.named_subexpression(base, m_position));
+            ++m_position;
+            break;
+         }
+         else
+         {
+            m_position = --base;
+         }
+      }
+      put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]);
+      break;
    case '{':
       have_brace = true;
       ++m_position;
@@ -258,14 +278,18 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl()
       // see if we have a number:
       {
          std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
-         len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
+         //len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
          int v = m_traits.toi(m_position, m_position + len, 10);
          if((v < 0) || (have_brace && ((m_position == m_end) || (*m_position != '}'))))
          {
-            // leave the $ as is, and carry on:
-            m_position = --save_position;
-            put(*m_position);
-            ++m_position;
+            // Look for a Perl-5.10 verb:
+            if(!handle_perl_verb(have_brace))
+            {
+               // leave the $ as is, and carry on:
+               m_position = --save_position;
+               put(*m_position);
+               ++m_position;
+            }
             break;
          }
          // otherwise output sub v:
@@ -276,6 +300,123 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_perl()
    }
 }
 
+template <class OutputIterator, class Results, class traits>
+bool basic_regex_formatter<OutputIterator, Results, traits>::handle_perl_verb(bool have_brace)
+{
+   // 
+   // We may have a capitalised string containing a Perl action:
+   //
+   static const char_type MATCH[] = { 'M', 'A', 'T', 'C', 'H' };
+   static const char_type PREMATCH[] = { 'P', 'R', 'E', 'M', 'A', 'T', 'C', 'H' };
+   static const char_type POSTMATCH[] = { 'P', 'O', 'S', 'T', 'M', 'A', 'T', 'C', 'H' };
+   static const char_type LAST_PAREN_MATCH[] = { 'L', 'A', 'S', 'T', '_', 'P', 'A', 'R', 'E', 'N', '_', 'M', 'A', 'T', 'C', 'H' };
+   static const char_type LAST_SUBMATCH_RESULT[] = { 'L', 'A', 'S', 'T', '_', 'S', 'U', 'B', 'M', 'A', 'T', 'C', 'H', '_', 'R', 'E', 'S', 'U', 'L', 'T' };
+   static const char_type LAST_SUBMATCH_RESULT_ALT[] = { '^', 'N' };
+
+   if(have_brace && (*m_position == '^'))
+      ++m_position;
+
+   int max_len = m_end - m_position;
+
+   if((max_len >= 5) && std::equal(m_position, m_position + 5, MATCH))
+   {
+      m_position += 5;
+      if(have_brace)
+      {
+         if(*m_position == '}')
+            ++m_position;
+         else
+         {
+            m_position -= 5;
+            return false;
+         }
+      }
+      put(this->m_results[0]);
+      return true;
+   }
+   if((max_len >= 8) && std::equal(m_position, m_position + 8, PREMATCH))
+   {
+      m_position += 8;
+      if(have_brace)
+      {
+         if(*m_position == '}')
+            ++m_position;
+         else
+         {
+            m_position -= 8;
+            return false;
+         }
+      }
+      put(this->m_results.prefix());
+      return true;
+   }
+   if((max_len >= 9) && std::equal(m_position, m_position + 9, POSTMATCH))
+   {
+      m_position += 9;
+      if(have_brace)
+      {
+         if(*m_position == '}')
+            ++m_position;
+         else
+         {
+            m_position -= 9;
+            return false;
+         }
+      }
+      put(this->m_results.suffix());
+      return true;
+   }
+   if((max_len >= 16) && std::equal(m_position, m_position + 16, LAST_PAREN_MATCH))
+   {
+      m_position += 16;
+      if(have_brace)
+      {
+         if(*m_position == '}')
+            ++m_position;
+         else
+         {
+            m_position -= 16;
+            return false;
+         }
+      }
+      put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]);
+      return true;
+   }
+   if((max_len >= 20) && std::equal(m_position, m_position + 20, LAST_SUBMATCH_RESULT))
+   {
+      m_position += 20;
+      if(have_brace)
+      {
+         if(*m_position == '}')
+            ++m_position;
+         else
+         {
+            m_position -= 20;
+            return false;
+         }
+      }
+      put(this->m_results.get_last_closed_paren());
+      return true;
+   }
+   if((max_len >= 2) && std::equal(m_position, m_position + 2, LAST_SUBMATCH_RESULT_ALT))
+   {
+      m_position += 2;
+      if(have_brace)
+      {
+         if(*m_position == '}')
+            ++m_position;
+         else
+         {
+            m_position -= 2;
+            return false;
+         }
+      }
+      put(this->m_results.get_last_closed_paren());
+      return true;
+   }
+   return false;
+}
+
 template <class OutputIterator, class Results, class traits>
 void basic_regex_formatter<OutputIterator, Results, traits>::format_escape()
 {
@@ -440,9 +581,35 @@ void basic_regex_formatter<OutputIterator, Results, traits>::format_conditional(
       put(static_cast<char_type>('?'));
       return;
    }
-   std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
-   len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
-   int v = m_traits.toi(m_position, m_position + len, 10);
+   int v;
+   if(*m_position == '{')
+   {
+      const char_type* base = m_position;
+      ++m_position;
+      v = m_traits.toi(m_position, m_end, 10);
+      if(v < 0)
+      {
+         // Try a named subexpression:
+         while((m_position != m_end) && (*m_position != '}'))
+            ++m_position;
+         v = m_results.named_subexpression_index(base + 1, m_position);
+      }
+      if((v < 0) || (*m_position != '}'))
+      {
+         m_position = base;
+         // oops trailing '?':
+         put(static_cast<char_type>('?'));
+         return;
+      }
+      // Skip trailing '}':
+      ++m_position;
+   }
+   else
+   {
+      std::ptrdiff_t len = ::boost::re_detail::distance(m_position, m_end);
+      len = (std::min)(static_cast<std::ptrdiff_t>(2), len);
+      v = m_traits.toi(m_position, m_position + len, 10);
+   }
    if(v < 0)
    {
       // oops not a number:
index 42428dd8a6ef8379dea663399e6c4a36cdcfdee6..5b2c6bc338c4a516c4bc87d681d1ccbbe8585b26 100644 (file)
@@ -159,7 +159,7 @@ struct character_pointer_range
 template <class charT>
 int get_default_class_id(const charT* p1, const charT* p2)
 {
-   static const charT data[72] = {
+   static const charT data[73] = {
       'a', 'l', 'n', 'u', 'm',
       'a', 'l', 'p', 'h', 'a',
       'b', 'l', 'a', 'n', 'k',
@@ -172,11 +172,12 @@ int get_default_class_id(const charT* p1, const charT* p2)
       's', 'p', 'a', 'c', 'e',
       'u', 'n', 'i', 'c', 'o', 'd', 'e',
       'u', 'p', 'p', 'e', 'r',
+      'v',
       'w', 'o', 'r', 'd',
       'x', 'd', 'i', 'g', 'i', 't',
    };
 
-   static const character_pointer_range<charT> ranges[19] = 
+   static const character_pointer_range<charT> ranges[21] = 
    {
       {data+0, data+5,}, // alnum
       {data+5, data+10,}, // alpha
@@ -185,6 +186,7 @@ int get_default_class_id(const charT* p1, const charT* p2)
       {data+20, data+21,}, // d
       {data+20, data+25,}, // digit
       {data+25, data+30,}, // graph
+      {data+29, data+30,}, // h
       {data+30, data+31,}, // l
       {data+30, data+35,}, // lower
       {data+35, data+40,}, // print
@@ -194,9 +196,10 @@ int get_default_class_id(const charT* p1, const charT* p2)
       {data+57, data+58,}, // u
       {data+50, data+57,}, // unicode
       {data+57, data+62,}, // upper
-      {data+62, data+63,}, // w
-      {data+62, data+66,}, // word
-      {data+66, data+72,}, // xdigit
+      {data+62, data+63,}, // v
+      {data+63, data+64,}, // w
+      {data+63, data+67,}, // word
+      {data+67, data+73,}, // xdigit
    };
    static const character_pointer_range<charT>* ranges_begin = ranges;
    static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
@@ -314,6 +317,43 @@ int global_toi(const charT*& p1, const charT* p2, int radix, const traits& t)
    return result;
 }
 
+template <class charT>
+inline const charT* get_escape_R_string()
+{
+#ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable:4309)
+#endif
+   static const charT e1[] = { '(', '?', '>', '\x0D', '\x0A', '?', 
+      '|', '[', '\x0A', '\x0B', '\x0C', '\x85', '\\', 'x', '{', '2', '0', '2', '8', '}', 
+                '\\', 'x', '{', '2', '0', '2', '9', '}', ']', ')', '\0' };
+   static const charT e2[] = { '(', '?', '>', '\x0D', '\x0A', '?', 
+      '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
+
+   charT c = static_cast<charT>(0x2029u);
+   bool b = (static_cast<unsigned>(c) == 0x2029u);
+   
+   return (b ? e1 : e2);
+#ifdef BOOST_MSVC
+#  pragma warning(pop)
+#endif
+}
+
+template <>
+inline const char* get_escape_R_string<char>()
+{
+#ifdef BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable:4309)
+#endif
+   static const char e2[] = { '(', '?', '>', '\x0D', '\x0A', '?', 
+      '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', '\0' };
+   return e2;
+#ifdef BOOST_MSVC
+#  pragma warning(pop)
+#endif
+}
+
 } // re_detail
 } // boost
 
index fc3c212319f1f01c7ce0c63bef4f88326370918b..06527f1a1f9675ae7da9ed9070427ec659631998 100644 (file)
@@ -124,7 +124,7 @@ inline void pointer_construct(T* p, const T& t)
 
 #ifdef __cplusplus
 namespace boost{ namespace re_detail{
-#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
+#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && BOOST_WORKAROUND(BOOST_MSVC, <1600) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
    //
    // MSVC 8 will either emit warnings or else refuse to compile
    // code that makes perfectly legitimate use of std::copy, when
index 44dd2b4ad92a6dd6717b817383351a80d4753c4d..efdebbe59f7dc8e54aee436f3af5e5e8e1d724a7 100644 (file)
@@ -118,7 +118,9 @@ enum syntax_element_type
    syntax_element_backstep = syntax_element_long_set_rep + 1,
    // an assertion that a mark was matched:
    syntax_element_assert_backref = syntax_element_backstep + 1,
-   syntax_element_toggle_case = syntax_element_assert_backref + 1
+   syntax_element_toggle_case = syntax_element_assert_backref + 1,
+   // a recursive expression:
+   syntax_element_recurse = syntax_element_toggle_case + 1
 };
 
 #ifdef BOOST_REGEX_DEBUG
@@ -156,6 +158,7 @@ struct re_brace : public re_syntax_base
    // The index to match, can be zero (don't mark the sub-expression)
    // or negative (for perl style (?...) extentions):
    int index;
+   bool icase;
 };
 
 /*** struct re_dot **************************************************
index 92c00d4c5520b16b891df127ddaf2a8e00fb1cb1..3efdf0b0f9327f375ec9db5691dfd80f7657ed3b 100644 (file)
@@ -92,8 +92,11 @@ static const escape_syntax_type escape_type_G = 52;                            /
 static const escape_syntax_type escape_type_property = 54;                     // for \p
 static const escape_syntax_type escape_type_not_property = 55;                 // for \P
 static const escape_syntax_type escape_type_named_char = 56;                   // for \N
+static const escape_syntax_type escape_type_extended_backref = 57;             // for \g
+static const escape_syntax_type escape_type_reset_start_mark = 58;             // for \K
+static const escape_syntax_type escape_type_line_ending = 59;                  // for \R
 
-static const escape_syntax_type syntax_max = 57;
+static const escape_syntax_type syntax_max = 60;
 
 }
 }
index 21a9694aa90f3c139a1a33e8c879f9c39a6073e2..d55620726d11c74898432a37f3c857a1ec4f90e1 100644 (file)
@@ -294,6 +294,8 @@ public:
    typedef typename w32_regex_traits<charT>::char_class_type char_class_type;
    BOOST_STATIC_CONSTANT(char_class_type, mask_word = 0x0400); // must be C1_DEFINED << 1
    BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 0x0800); // must be C1_DEFINED << 2
+   BOOST_STATIC_CONSTANT(char_class_type, mask_horizontal = 0x1000); // must be C1_DEFINED << 3
+   BOOST_STATIC_CONSTANT(char_class_type, mask_vertical = 0x2000); // must be C1_DEFINED << 4
    BOOST_STATIC_CONSTANT(char_class_type, mask_base = 0x3ff);  // all the masks used by the CT_CTYPE1 group
 
    typedef std::basic_string<charT> string_type;
@@ -510,7 +512,7 @@ template <class charT>
 typename w32_regex_traits_implementation<charT>::char_class_type 
    w32_regex_traits_implementation<charT>::lookup_classname_imp(const charT* p1, const charT* p2) const
 {
-   static const char_class_type masks[20] = 
+   static const char_class_type masks[22] = 
    {
       0,
       0x0104u, // C1_ALPHA | C1_DIGIT
@@ -520,6 +522,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
       0x0004u, // C1_DIGIT
       0x0004u, // C1_DIGIT
       (~(0x0020u|0x0008u|0x0040) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE or C1_BLANK
+      w32_regex_traits_implementation<charT>::mask_horizontal, 
       0x0002u, // C1_LOWER
       0x0002u, // C1_LOWER
       (~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL
@@ -529,6 +532,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
       0x0001u, // C1_UPPER
       w32_regex_traits_implementation<charT>::mask_unicode,
       0x0001u, // C1_UPPER
+      w32_regex_traits_implementation<charT>::mask_vertical, 
       0x0104u | w32_regex_traits_implementation<charT>::mask_word, 
       0x0104u | w32_regex_traits_implementation<charT>::mask_word, 
       0x0080u, // C1_XDIGIT
@@ -628,6 +632,12 @@ public:
          return true;
       else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
          return true;
+      else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_vertical)
+         && (::boost::re_detail::is_separator(c) || (c == '\v')))
+         return true;
+      else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_horizontal) 
+         && this->isctype(c, 0x0008u) && !this->isctype(c, re_detail::w32_regex_traits_implementation<charT>::mask_vertical))
+         return true;
       return false;
    }
    int toi(const charT*& p1, const charT* p2, int radix)const
index 8363494bd84e802a296febe2d63490f141148759..645f7ab2348c69bdcf7a0870da6439a72376dcbd 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type;
 
 #include <boost/signals/signal_template.hpp>
 
index 07185495d695df1a5c999660559c78031e882a3a..e04356315194d74082b0a991161785c4052ffb9c 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;T10 a10;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9, T10 ia10
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9), a10(ia10)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type; typedef T10 arg11_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; typedef T9 arg9_type; typedef T10 arg10_type;
 
 #include <boost/signals/signal_template.hpp>
 
index 361014eabf67603627e6d4930a14c49ae71361d0..e75f5e7d795b940ca717d3c98ba57b3b2233b0c4 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type;
 
 #include <boost/signals/signal_template.hpp>
 
index 542a56eac6d250de8642dcb4dcfbd99bb7ff9884..0a695c5b843e6c43b68f9f19b20b913ff740ab6e 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type;
 
 #include <boost/signals/signal_template.hpp>
 
index 695f70f9c9c47fd35af6daaa3808da3bee13ac57..56ba36071982446aacdd39e7a3586b12c4ec3a2c 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type;
 
 #include <boost/signals/signal_template.hpp>
 
index ba2f3c2a4ad4510f482bfdc9bf587f33bf49f2d3..027cda9aa257da977b9eabaa5e8dd6150332838a 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type;
 
 #include <boost/signals/signal_template.hpp>
 
index b46afce874f56666a537075decc78d2bd62e6801..39553189acf38181b994331d55d6cd149d79abf4 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type;
 
 #include <boost/signals/signal_template.hpp>
 
index 86f11427dabed080d20924f21ae4d9ab56fabee1..d4530eca6d9a75070ca440d0013f646dc56c2afb 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type;
 
 #include <boost/signals/signal_template.hpp>
 
index e2b86ce68b69e9db0e061f2fddbb17b0d8ee4d1f..094cd9776c78b6c2d179acbe73d61a09cd88d7a9 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type;
 
 #include <boost/signals/signal_template.hpp>
 
index bb6a57afa7d2b41016dab376c37a9efc5c2278f6..a551c16bed5173a57cc68f62a44c788eb9b908e3 100644 (file)
@@ -19,7 +19,7 @@
 #define BOOST_SIGNALS_ARGS_AS_MEMBERS T1 a1;T2 a2;T3 a3;T4 a4;T5 a5;T6 a6;T7 a7;T8 a8;T9 a9;
 #define BOOST_SIGNALS_COPY_PARMS T1 ia1, T2 ia2, T3 ia3, T4 ia4, T5 ia5, T6 ia6, T7 ia7, T8 ia8, T9 ia9
 #define BOOST_SIGNALS_INIT_ARGS :a1(ia1), a2(ia2), a3(ia3), a4(ia4), a5(ia5), a6(ia6), a7(ia7), a8(ia8), a9(ia9)
-#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg2_type; typedef T2 arg3_type; typedef T3 arg4_type; typedef T4 arg5_type; typedef T5 arg6_type; typedef T6 arg7_type; typedef T7 arg8_type; typedef T8 arg9_type; typedef T9 arg10_type;
+#define BOOST_SIGNALS_ARG_TYPES typedef T1 arg1_type; typedef T2 arg2_type; typedef T3 arg3_type; typedef T4 arg4_type; typedef T5 arg5_type; typedef T6 arg6_type; typedef T7 arg7_type; typedef T8 arg8_type; typedef T9 arg9_type;
 
 #include <boost/signals/signal_template.hpp>
 
index eb43d9998b5146059c86a2d85750a89cbcd10599..ce1beb0c98a677a564e3de1196b84218a6a6421d 100644 (file)
@@ -333,6 +333,20 @@ public:
         if(pi_ != 0) pi_->weak_add_ref();\r
     }\r
 \r
+// Move support\r
+\r
+#if defined( BOOST_HAS_RVALUE_REFS )\r
+\r
+    weak_count(weak_count && r): pi_(r.pi_) // nothrow\r
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)\r
+        , id_(weak_count_id)\r
+#endif\r
+    {\r
+        r.pi_ = 0;\r
+    }\r
+\r
+#endif\r
+\r
     ~weak_count() // nothrow\r
     {\r
         if(pi_ != 0) pi_->weak_release();\r
index 693bfa6e41286d347f898cc8198304c90eb2c1e8..b446f203d43c15682de666524fd3fe0ee03b5c56 100644 (file)
@@ -45,7 +45,7 @@ template< class Y, class T > struct sp_convertible
     static yes f( T* );\r
     static no  f( ... );\r
 \r
-    enum _vt { value = sizeof( f( (Y*)0 ) ) == sizeof(yes) };\r
+    enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };\r
 };\r
 \r
 struct sp_empty\r
diff --git a/boost/boost/smart_ptr/enable_shared_from_this2.hpp b/boost/boost/smart_ptr/enable_shared_from_this2.hpp
new file mode 100755 (executable)
index 0000000..fcbce06
--- /dev/null
@@ -0,0 +1,132 @@
+#ifndef BOOST_ENABLE_SHARED_FROM_THIS2_HPP_INCLUDED\r
+#define BOOST_ENABLE_SHARED_FROM_THIS2_HPP_INCLUDED\r
+\r
+//\r
+//  enable_shared_from_this2.hpp\r
+//\r
+//  Copyright 2002, 2009 Peter Dimov\r
+//  Copyright 2008 Frank Mori Hess\r
+//\r
+//  Distributed under the Boost Software License, Version 1.0.\r
+//  See accompanying file LICENSE_1_0.txt or copy at\r
+//  http://www.boost.org/LICENSE_1_0.txt\r
+//\r
+\r
+#include <boost/config.hpp>\r
+#include <boost/shared_ptr.hpp>\r
+#include <boost/assert.hpp>\r
+#include <boost/detail/workaround.hpp>\r
+\r
+namespace boost\r
+{\r
+\r
+namespace detail\r
+{\r
+\r
+class esft2_deleter_wrapper\r
+{\r
+private:\r
+\r
+    shared_ptr<void> deleter_;\r
+\r
+public:\r
+\r
+    esft2_deleter_wrapper()\r
+    {\r
+    }\r
+\r
+    template< class T > void set_deleter( shared_ptr<T> const & deleter )\r
+    {\r
+        deleter_ = deleter;\r
+    }\r
+\r
+    template< class T> void operator()( T* )\r
+    {\r
+        BOOST_ASSERT( deleter_.use_count() <= 1 );\r
+        deleter_.reset();\r
+    }\r
+};\r
+\r
+} // namespace detail\r
+\r
+template< class T > class enable_shared_from_this2\r
+{\r
+protected:\r
+\r
+    enable_shared_from_this2()\r
+    {\r
+    }\r
+\r
+    enable_shared_from_this2( enable_shared_from_this2 const & )\r
+    {\r
+    }\r
+\r
+    enable_shared_from_this2 & operator=( enable_shared_from_this2 const & )\r
+    {\r
+        return *this;\r
+    }\r
+\r
+    ~enable_shared_from_this2()\r
+    {\r
+        BOOST_ASSERT( shared_this_.use_count() <= 1 ); // make sure no dangling shared_ptr objects exist\r
+    }\r
+\r
+private:\r
+\r
+    mutable weak_ptr<T> weak_this_;\r
+    mutable shared_ptr<T> shared_this_;\r
+\r
+public:\r
+\r
+    shared_ptr<T> shared_from_this()\r
+    {\r
+        init_weak_once();\r
+        return shared_ptr<T>( weak_this_ );\r
+    }\r
+\r
+    shared_ptr<T const> shared_from_this() const\r
+    {\r
+        init_weak_once();\r
+        return shared_ptr<T>( weak_this_ );\r
+    }\r
+\r
+private:\r
+\r
+    void init_weak_once() const\r
+    {\r
+        if( weak_this_._empty() )\r
+        {\r
+            shared_this_.reset( static_cast< T* >( 0 ), detail::esft2_deleter_wrapper() );\r
+            weak_this_ = shared_this_;\r
+        }\r
+    }\r
+\r
+public: // actually private, but avoids compiler template friendship issues\r
+\r
+    // Note: invoked automatically by shared_ptr; do not call\r
+    template<class X, class Y> void _internal_accept_owner( shared_ptr<X> * ppx, Y * py ) const\r
+    {\r
+        BOOST_ASSERT( ppx != 0 );\r
+\r
+        if( weak_this_.use_count() == 0 )\r
+        {\r
+            weak_this_ = shared_ptr<T>( *ppx, py );\r
+        }\r
+        else if( shared_this_.use_count() != 0 )\r
+        {\r
+            BOOST_ASSERT( ppx->unique() ); // no weak_ptrs should exist either, but there's no way to check that\r
+\r
+            detail::esft2_deleter_wrapper * pd = boost::get_deleter<detail::esft2_deleter_wrapper>( shared_this_ );\r
+            BOOST_ASSERT( pd != 0 );\r
+\r
+            pd->set_deleter( *ppx );\r
+\r
+            ppx->reset( shared_this_, ppx->get() );\r
+            shared_this_.reset();\r
+        }\r
+    }\r
+};\r
+\r
+} // namespace boost\r
+\r
+#endif  // #ifndef BOOST_ENABLE_SHARED_FROM_THIS2_HPP_INCLUDED\r
index 0bd17308320db145bcae9b46ea498feed173f974..84558983e7f2df639409c40f91667590530983b8 100644 (file)
@@ -109,6 +109,23 @@ public:
         return *this;\r
     }\r
 \r
+#endif\r
+\r
+// Move support\r
+\r
+#if defined( BOOST_HAS_RVALUE_REFS )\r
+\r
+    intrusive_ptr(intrusive_ptr && rhs): px( rhs.px )\r
+    {\r
+        rhs.px = 0;\r
+    }\r
+\r
+    intrusive_ptr & operator=(intrusive_ptr && rhs)\r
+    {\r
+        this_type(std::move(rhs)).swap(*this);\r
+        return *this;\r
+    }\r
+\r
 #endif\r
 \r
     intrusive_ptr & operator=(intrusive_ptr const & rhs)\r
index 6d1d7ccc046a40694918ed146af6a0da60c5222e..3a89fc7e4a7223d753173dedeccbfd589fc6e550 100644 (file)
@@ -61,6 +61,7 @@ namespace boost
 template<class T> class shared_ptr;\r
 template<class T> class weak_ptr;\r
 template<class T> class enable_shared_from_this;\r
+template<class T> class enable_shared_from_this2;\r
 \r
 namespace detail\r
 {\r
@@ -109,6 +110,14 @@ template< class X, class Y, class T > inline void sp_enable_shared_from_this( bo
     }\r
 }\r
 \r
+template< class X, class Y, class T > inline void sp_enable_shared_from_this( boost::shared_ptr<X> * ppx, Y const * py, boost::enable_shared_from_this2< T > const * pe )\r
+{\r
+    if( pe != 0 )\r
+    {\r
+        pe->_internal_accept_owner( ppx, const_cast< Y* >( py ) );\r
+    }\r
+}\r
+\r
 #ifdef _MANAGED\r
 \r
 // Avoid C4793, ... causes native code generation\r
@@ -359,14 +368,14 @@ public:
 \r
     shared_ptr & operator=( shared_ptr && r ) // never throws\r
     {\r
-        this_type( static_cast< shared_ptr && >( r ) ).swap( *this );\r
+        this_type( std::move( r ) ).swap( *this );\r
         return *this;\r
     }\r
 \r
     template<class Y>\r
     shared_ptr & operator=( shared_ptr<Y> && r ) // never throws\r
     {\r
-        this_type( static_cast< shared_ptr<Y> && >( r ) ).swap( *this );\r
+        this_type( std::move( r ) ).swap( *this );\r
         return *this;\r
     }\r
 \r
index a0c83f15b74b675201e698fd8691eb19ef77b03f..317ea44350751072590e0b8ad65cba33caa6b7e3 100644 (file)
@@ -70,11 +70,43 @@ public:
     weak_ptr( weak_ptr<Y> const & r )\r
 \r
 #endif\r
-    : pn(r.pn) // never throws\r
+    : px(r.lock().get()), pn(r.pn) // never throws\r
     {\r
-        px = r.lock().get();\r
     }\r
 \r
+#if defined( BOOST_HAS_RVALUE_REFS )\r
+\r
+    template<class Y>\r
+#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )\r
+\r
+    weak_ptr( weak_ptr<Y> && r, typename detail::sp_enable_if_convertible<Y,T>::type = detail::sp_empty() )\r
+\r
+#else\r
+\r
+    weak_ptr( weak_ptr<Y> && r )\r
+\r
+#endif\r
+    : px(r.lock().get()), pn(std::move(r.pn)) // never throws\r
+    {\r
+        r.px = 0;\r
+    }\r
+\r
+    // for better efficiency in the T == Y case\r
+    weak_ptr( weak_ptr && r ): px( r.px ), pn(std::move(r.pn)) // never throws\r
+    {\r
+        r.px = 0;\r
+    }\r
+\r
+    // for better efficiency in the T == Y case\r
+    weak_ptr & operator=( weak_ptr && r ) // never throws\r
+    {\r
+        this_type( std::move( r ) ).swap( *this );\r
+        return *this;\r
+    }\r
+\r
+\r
+#endif\r
+\r
     template<class Y>\r
 #if !defined( BOOST_SP_NO_SP_CONVERTIBLE )\r
 \r
@@ -99,6 +131,17 @@ public:
         return *this;\r
     }\r
 \r
+#if defined( BOOST_HAS_RVALUE_REFS )\r
+\r
+    template<class Y>\r
+    weak_ptr & operator=(weak_ptr<Y> && r)\r
+    {\r
+        this_type( std::move( r ) ).swap( *this );\r
+        return *this;\r
+    }\r
+\r
+#endif\r
+\r
     template<class Y>\r
     weak_ptr & operator=(shared_ptr<Y> const & r) // never throws\r
     {\r
@@ -124,6 +167,11 @@ public:
         return pn.use_count() == 0;\r
     }\r
 \r
+    bool _empty() const // extension, not in std::weak_ptr\r
+    {\r
+        return pn.empty();\r
+    }\r
+\r
     void reset() // never throws in 1.30+\r
     {\r
         this_type().swap(*this);\r
diff --git a/boost/boost/swap.hpp b/boost/boost/swap.hpp
new file mode 100644 (file)
index 0000000..f16f7b2
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright (C) 2007 Joseph Gauterin\r
+//\r
+// Distributed under the Boost Software License, Version 1.0. (See\r
+// accompanying file LICENSE_1_0.txt or copy at\r
+// http://www.boost.org/LICENSE_1_0.txt)\r
+\r
+#ifndef BOOST_SWAP_HPP\r
+#define BOOST_SWAP_HPP\r
+\r
+#include "boost/utility/swap.hpp"\r
+\r
+#endif\r
index da143393dbab06382570ecb7f84638be7a98164e..2250befb9072e8c877ad8ee95ecb70c7384d9297 100644 (file)
@@ -20,7 +20,7 @@
 //  http://www.boost.org/libs/utility/throw_exception.html
 //
 
-#include <boost/config.hpp>
+#include <boost/exception/detail/attribute_noreturn.hpp>
 #include <boost/detail/workaround.hpp>
 #include <exception>
 
@@ -54,7 +54,7 @@ void throw_exception( std::exception const & e ); // user defined
 
 inline void throw_exception_assert_compatibility( std::exception const & ) { }
 
-template<class E> inline void throw_exception( E const & e )
+template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const & e )
 {
     //All boost exceptions are required to derive std::exception,
     //to ensure compatibility with BOOST_NO_EXCEPTIONS.
index ba59441f274e45834a74e38fd5b0753c7dc1837b..348fd80894edd5d05ea602a0a9aa0e9f09f89920 100644 (file)
@@ -213,7 +213,7 @@ struct element_impl<0, T, true /* IsConst */>
 
 
 template<int N, class T>
-struct element: 
+struct element:
   public detail::element_impl<N, T, ::boost::is_const<T>::value>
 {
 };
@@ -488,11 +488,20 @@ struct length<tuple<> > {
   BOOST_STATIC_CONSTANT(int, value = 0);
 };
 
+template<>
+struct length<tuple<> const> {
+  BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
 template<>
 struct length<null_type> {
   BOOST_STATIC_CONSTANT(int, value = 0);
 };
 
+template<>
+struct length<null_type const> {
+  BOOST_STATIC_CONSTANT(int, value = 0);
+};
 
 namespace detail {
 
index b355e56dc06a00f4c3f3b6ba269d60b57ad66f65..10cdb1cc26394b020c11121f5f85e72322800dfb 100644 (file)
@@ -285,6 +285,21 @@ print(std::basic_ostream<CharType, CharTrait>& o, const cons<T1, T2>& t) {
 } // namespace detail
 
 #if defined (BOOST_NO_TEMPLATED_STREAMS)
+
+inline std::ostream& operator<<(std::ostream& o, const null_type& t) {
+  if (!o.good() ) return o;
+  const char l = 
+    detail::format_info::get_manipulator(o, detail::format_info::open);
+  const char r = 
+    detail::format_info::get_manipulator(o, detail::format_info::close);
+   
+  o << l;
+  o << r;
+
+  return o;
+}
+
 template<class T1, class T2>
 inline std::ostream& operator<<(std::ostream& o, const cons<T1, T2>& t) {
   if (!o.good() ) return o;
@@ -305,6 +320,23 @@ inline std::ostream& operator<<(std::ostream& o, const cons<T1, T2>& t) {
 
 #else
 
+template<class CharType, class CharTrait>
+inline std::basic_ostream<CharType, CharTrait>& 
+operator<<(std::basic_ostream<CharType, CharTrait>& o, 
+           const null_type& t) {
+  if (!o.good() ) return o;
+  const CharType l = 
+    detail::format_info::get_manipulator(o, detail::format_info::open);
+  const CharType r = 
+    detail::format_info::get_manipulator(o, detail::format_info::close);
+   
+  o << l;
+  o << r;
+
+  return o;
+}
+
 template<class CharType, class CharTrait, class T1, class T2>
 inline std::basic_ostream<CharType, CharTrait>& 
 operator<<(std::basic_ostream<CharType, CharTrait>& o, 
index 564d3bba00e6091da7058b81c29c164ee8d6e8ed..51357ce5608211e1d43d1e5c4e385ec530302a86 100644 (file)
@@ -57,11 +57,11 @@ template< typename T >
 struct alignment_of_impl
 {
 #if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
-       //
-       // With MSVC both the native __alignof operator
-       // and our own logic gets things wrong from time to time :-(
-       // Using a combination of the two seems to make the most of a bad job:
-       //
+    //
+    // With MSVC both the native __alignof operator
+    // and our own logic gets things wrong from time to time :-(
+    // Using a combination of the two seems to make the most of a bad job:
+    //
     BOOST_STATIC_CONSTANT(std::size_t, value =
         (::boost::detail::alignment_logic<
             sizeof(::boost::detail::alignment_of_hack<T>) - sizeof(T),
index ac42a5173825a02204bbc6807d6adc908c9b9370..95cd92fca9bb940ae0f9a289268a0fe4a9305b68 100644 (file)
@@ -27,6 +27,9 @@ template<class T> struct addr_impl_ref
 
     inline addr_impl_ref( T & v ): v_( v ) {}
     inline operator T& () const { return v_; }
+
+private:
+    addr_impl_ref & operator=(const addr_impl_ref &);
 };
 
 template<class T> struct addressof_impl
index dc4203020fe35e41a0b2983ffe6012d17c10edb3..26cab6f9f36a0bd69902c2e3dfe3aab2a6a3c2cf 100644 (file)
@@ -70,8 +70,8 @@ struct result_of_nested_result : F::template result<FArgs>
 template<typename F, typename FArgs>\r
 struct result_of_impl<F, FArgs, false>\r
   : mpl::if_<is_function_with_no_args<FArgs>,\r
-            result_of_void_impl<F>,\r
-            result_of_nested_result<F, FArgs> >::type\r
+             result_of_void_impl<F>,\r
+             result_of_nested_result<F, FArgs> >::type\r
 {};\r
 \r
 } // end namespace detail\r
index 8269beb2804ac43a3ff3dcc670b5cb256da813e0..49cfe766fbd79a13f455d0268545f75752828db7 100644 (file)
@@ -19,7 +19,7 @@
 //  BOOST_VERSION / 100 % 1000 is the minor version
 //  BOOST_VERSION / 100000 is the major version
 
-#define BOOST_VERSION 103900
+#define BOOST_VERSION 104000
 
 //
 //  BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
@@ -27,7 +27,7 @@
 //  number, y is the minor version number, and z is the patch level if not 0.
 //  This is used by <config/auto_link.hpp> to select which library version to link to.
 
-#define BOOST_LIB_VERSION "1_39"
+#define BOOST_LIB_VERSION "1_40"
 
 #endif
 
diff --git a/boost/libs/regex/src/CMakeLists.txt b/boost/libs/regex/src/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..bbd03f9
--- /dev/null
@@ -0,0 +1,40 @@
+#\r
+# Copyright Troy D. Straszheim\r
+#\r
+# Distributed under the Boost Software License, Version 1.0.\r
+# See http://www.boost.org/LICENSE_1_0.txt\r
+#\r
+# Look for the ICU library. If we find it, we'll compile in support for ICU\r
+include(FindICU)\r
+set(BOOST_REGEX_LIBRARIES)\r
+if (ICU_FOUND AND ICU_I18N_FOUND)\r
+  add_definitions(-DBOOST_HAS_ICU=1)\r
+  include_directories(${ICU_INCLUDE_DIRS})\r
+  set(BOOST_REGEX_LIBRARIES ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})\r
+endif (ICU_FOUND AND ICU_I18N_FOUND)\r
\r
+boost_add_library(boost_regex\r
+   c_regex_traits.cpp\r
+   cpp_regex_traits.cpp\r
+   cregex.cpp\r
+   fileiter.cpp\r
+   icu.cpp\r
+   instances.cpp\r
+   posix_api.cpp\r
+   regex.cpp\r
+   regex_debug.cpp\r
+   regex_raw_buffer.cpp\r
+   regex_traits_defaults.cpp\r
+   static_mutex.cpp\r
+   w32_regex_traits.cpp\r
+   wc_regex_traits.cpp\r
+   wide_posix_api.cpp\r
+   winstances.cpp \r
+   usinstances.cpp \r
+   LINK_LIBS ${BOOST_REGEX_LIBRARIES}\r
+   SHARED_COMPILE_FLAGS -DBOOST_REGEX_DYN_LINK=1)\r
+\r
+\r
+\r
+\r
+\r
index da960eb0c535e1f3191eb0bde8de646d8d62bb9f..6466bc422eb4d20f8ee1c7ed690025de83e399ca 100644 (file)
@@ -122,7 +122,9 @@ enum
    char_class_graph=char_class_alnum|char_class_punct,
    char_class_blank=1<<9,
    char_class_word=1<<10,
-   char_class_unicode=1<<11
+   char_class_unicode=1<<11,
+   char_class_horizontal=1<<12,
+   char_class_vertical=1<<13
 };
 
 c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_classname(const char* p1, const char* p2)
@@ -137,6 +139,7 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo
       char_class_digit,
       char_class_digit,
       char_class_graph,
+      char_class_horizontal,
       char_class_lower,
       char_class_lower,
       char_class_print,
@@ -146,6 +149,7 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo
       char_class_upper,
       char_class_unicode,
       char_class_upper,
+      char_class_vertical,
       char_class_alnum | char_class_word, 
       char_class_alnum | char_class_word, 
       char_class_xdigit,
@@ -176,7 +180,9 @@ bool BOOST_REGEX_CALL c_regex_traits<char>::isctype(char c, char_class_type mask
       || ((mask & char_class_punct) && (std::ispunct)(static_cast<unsigned char>(c)))
       || ((mask & char_class_xdigit) && (std::isxdigit)(static_cast<unsigned char>(c)))
       || ((mask & char_class_blank) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c))
-      || ((mask & char_class_word) && (c == '_'));
+      || ((mask & char_class_word) && (c == '_'))
+      || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v')))
+      || ((mask & char_class_horizontal) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c) && (c != '\v'));
 }
 
 c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_collatename(const char* p1, const char* p2)
index 234f0467f9c32b38ace7a8ff6ed4831991a9adcf..fb12373a2f5841763657faa933b2a328d0756914 100644 (file)
 typedef boost::match_flag_type match_flag_type;
 #include <cstdio>
 
+#ifdef BOOST_MSVC
+#pragma warning(disable:4309)
+#endif
+
 namespace boost{
 
 #ifdef __BORLANDC__
@@ -559,7 +563,7 @@ std::string RegEx::What(int i)const
    return result;
 }
 
-#if defined(BOOST_HAS_LONG_LONG) && !defined(_MSC_VER)
+#ifdef BOOST_HAS_LONG_LONG
 const std::size_t RegEx::npos = static_cast<std::size_t>(~0ULL);
 #else
 const std::size_t RegEx::npos = static_cast<std::size_t>(~0UL);
@@ -641,3 +645,4 @@ basic_string<wchar_t>::replace<const wchar_t*>(wchar_t* f1, wchar_t* f2, const w
 
 
 
+
diff --git a/boost/libs/regex/src/icu.cpp b/boost/libs/regex/src/icu.cpp
new file mode 100755 (executable)
index 0000000..c5eb538
--- /dev/null
@@ -0,0 +1,503 @@
+/*\r
+ *\r
+ * Copyright (c) 2004\r
+ * John Maddock\r
+ *\r
+ * Use, modification and distribution are subject to the \r
+ * Boost Software License, Version 1.0. (See accompanying file \r
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+ *\r
+ */\r
+\r
+ /*\r
+  *   LOCATION:    see http://www.boost.org for most recent version.\r
+  *   FILE         icu.cpp\r
+  *   VERSION      see <boost/version.hpp>\r
+  *   DESCRIPTION: Unicode regular expressions on top of the ICU Library.\r
+  */\r
+#define BOOST_REGEX_SOURCE\r
+\r
+#include <boost/regex/config.hpp>\r
+#ifdef BOOST_HAS_ICU\r
+#define BOOST_REGEX_ICU_INSTANTIATE\r
+#include <boost/regex/icu.hpp>\r
+\r
+namespace boost{\r
+\r
+namespace re_detail{\r
+\r
+icu_regex_traits_implementation::string_type icu_regex_traits_implementation::do_transform(const char_type* p1, const char_type* p2, const U_NAMESPACE_QUALIFIER Collator* pcoll) const\r
+{\r
+   // TODO make thread safe!!!! :\r
+   typedef u32_to_u16_iterator<const char_type*, ::UChar> itt;\r
+   itt i(p1), j(p2);\r
+#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS\r
+   std::vector< ::UChar> t(i, j);\r
+#else\r
+   std::vector< ::UChar> t;\r
+   while(i != j)\r
+      t.push_back(*i++);\r
+#endif\r
+   ::uint8_t result[100];\r
+   ::int32_t len;\r
+   if(t.size())\r
+      len = pcoll->getSortKey(&*t.begin(), static_cast< ::int32_t>(t.size()), result, sizeof(result));\r
+   else\r
+      len = pcoll->getSortKey(static_cast<UChar const*>(0), static_cast< ::int32_t>(0), result, sizeof(result));\r
+   if(std::size_t(len) > sizeof(result))\r
+   {\r
+      scoped_array< ::uint8_t> presult(new ::uint8_t[len+1]);\r
+      if(t.size())\r
+         len = pcoll->getSortKey(&*t.begin(), static_cast< ::int32_t>(t.size()), presult.get(), len+1);\r
+      else\r
+         len = pcoll->getSortKey(static_cast<UChar const*>(0), static_cast< ::int32_t>(0), presult.get(), len+1);\r
+      if((0 == presult[len-1]) && (len > 1))\r
+         --len;\r
+#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS\r
+      return string_type(presult.get(), presult.get()+len);\r
+#else\r
+      string_type sresult;\r
+      ::uint8_t const* ia = presult.get();\r
+      ::uint8_t const* ib = presult.get()+len;\r
+      while(ia != ib)\r
+         sresult.push_back(*ia++);\r
+      return sresult;\r
+#endif\r
+   }\r
+   if((0 == result[len-1]) && (len > 1))\r
+      --len;\r
+#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS\r
+   return string_type(result, result+len);\r
+#else\r
+   string_type sresult;\r
+   ::uint8_t const* ia = result;\r
+   ::uint8_t const* ib = result+len;\r
+   while(ia != ib)\r
+      sresult.push_back(*ia++);\r
+   return sresult;\r
+#endif\r
+}\r
+\r
+}\r
+\r
+icu_regex_traits::size_type icu_regex_traits::length(const char_type* p)\r
+{\r
+   size_type result = 0;\r
+   while(*p)\r
+   {\r
+      ++p;\r
+      ++result;\r
+   }\r
+   return result;\r
+}\r
+\r
+//\r
+// define our bitmasks:\r
+//\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_blank = icu_regex_traits::char_class_type(1) << offset_blank;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_space = icu_regex_traits::char_class_type(1) << offset_space;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_xdigit = icu_regex_traits::char_class_type(1) << offset_xdigit;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_underscore = icu_regex_traits::char_class_type(1) << offset_underscore;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_unicode = icu_regex_traits::char_class_type(1) << offset_unicode;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_any = icu_regex_traits::char_class_type(1) << offset_any;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_ascii = icu_regex_traits::char_class_type(1) << offset_ascii;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_horizontal = icu_regex_traits::char_class_type(1) << offset_horizontal;\r
+const icu_regex_traits::char_class_type icu_regex_traits::mask_vertical = icu_regex_traits::char_class_type(1) << offset_vertical;\r
+\r
+icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2)\r
+{\r
+   static const ::UChar32 prop_name_table[] = {\r
+      /* any */  'a', 'n', 'y', \r
+      /* ascii */  'a', 's', 'c', 'i', 'i', \r
+      /* assigned */  'a', 's', 's', 'i', 'g', 'n', 'e', 'd', \r
+      /* c* */  'c', '*', \r
+      /* cc */  'c', 'c', \r
+      /* cf */  'c', 'f', \r
+      /* closepunctuation */  'c', 'l', 'o', 's', 'e', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* cn */  'c', 'n', \r
+      /* co */  'c', 'o', \r
+      /* connectorpunctuation */  'c', 'o', 'n', 'n', 'e', 'c', 't', 'o', 'r', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* control */  'c', 'o', 'n', 't', 'r', 'o', 'l', \r
+      /* cs */  'c', 's', \r
+      /* currencysymbol */  'c', 'u', 'r', 'r', 'e', 'n', 'c', 'y', 's', 'y', 'm', 'b', 'o', 'l', \r
+      /* dashpunctuation */  'd', 'a', 's', 'h', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* decimaldigitnumber */  'd', 'e', 'c', 'i', 'm', 'a', 'l', 'd', 'i', 'g', 'i', 't', 'n', 'u', 'm', 'b', 'e', 'r', \r
+      /* enclosingmark */  'e', 'n', 'c', 'l', 'o', 's', 'i', 'n', 'g', 'm', 'a', 'r', 'k', \r
+      /* finalpunctuation */  'f', 'i', 'n', 'a', 'l', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* format */  'f', 'o', 'r', 'm', 'a', 't', \r
+      /* initialpunctuation */  'i', 'n', 'i', 't', 'i', 'a', 'l', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* l* */  'l', '*', \r
+      /* letter */  'l', 'e', 't', 't', 'e', 'r', \r
+      /* letternumber */  'l', 'e', 't', 't', 'e', 'r', 'n', 'u', 'm', 'b', 'e', 'r', \r
+      /* lineseparator */  'l', 'i', 'n', 'e', 's', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', \r
+      /* ll */  'l', 'l', \r
+      /* lm */  'l', 'm', \r
+      /* lo */  'l', 'o', \r
+      /* lowercaseletter */  'l', 'o', 'w', 'e', 'r', 'c', 'a', 's', 'e', 'l', 'e', 't', 't', 'e', 'r', \r
+      /* lt */  'l', 't', \r
+      /* lu */  'l', 'u', \r
+      /* m* */  'm', '*', \r
+      /* mark */  'm', 'a', 'r', 'k', \r
+      /* mathsymbol */  'm', 'a', 't', 'h', 's', 'y', 'm', 'b', 'o', 'l', \r
+      /* mc */  'm', 'c', \r
+      /* me */  'm', 'e', \r
+      /* mn */  'm', 'n', \r
+      /* modifierletter */  'm', 'o', 'd', 'i', 'f', 'i', 'e', 'r', 'l', 'e', 't', 't', 'e', 'r', \r
+      /* modifiersymbol */  'm', 'o', 'd', 'i', 'f', 'i', 'e', 'r', 's', 'y', 'm', 'b', 'o', 'l', \r
+      /* n* */  'n', '*', \r
+      /* nd */  'n', 'd', \r
+      /* nl */  'n', 'l', \r
+      /* no */  'n', 'o', \r
+      /* nonspacingmark */  'n', 'o', 'n', 's', 'p', 'a', 'c', 'i', 'n', 'g', 'm', 'a', 'r', 'k', \r
+      /* notassigned */  'n', 'o', 't', 'a', 's', 's', 'i', 'g', 'n', 'e', 'd', \r
+      /* number */  'n', 'u', 'm', 'b', 'e', 'r', \r
+      /* openpunctuation */  'o', 'p', 'e', 'n', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* other */  'o', 't', 'h', 'e', 'r', \r
+      /* otherletter */  'o', 't', 'h', 'e', 'r', 'l', 'e', 't', 't', 'e', 'r', \r
+      /* othernumber */  'o', 't', 'h', 'e', 'r', 'n', 'u', 'm', 'b', 'e', 'r', \r
+      /* otherpunctuation */  'o', 't', 'h', 'e', 'r', 'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* othersymbol */  'o', 't', 'h', 'e', 'r', 's', 'y', 'm', 'b', 'o', 'l', \r
+      /* p* */  'p', '*', \r
+      /* paragraphseparator */  'p', 'a', 'r', 'a', 'g', 'r', 'a', 'p', 'h', 's', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', \r
+      /* pc */  'p', 'c', \r
+      /* pd */  'p', 'd', \r
+      /* pe */  'p', 'e', \r
+      /* pf */  'p', 'f', \r
+      /* pi */  'p', 'i', \r
+      /* po */  'p', 'o', \r
+      /* privateuse */  'p', 'r', 'i', 'v', 'a', 't', 'e', 'u', 's', 'e', \r
+      /* ps */  'p', 's', \r
+      /* punctuation */  'p', 'u', 'n', 'c', 't', 'u', 'a', 't', 'i', 'o', 'n', \r
+      /* s* */  's', '*', \r
+      /* sc */  's', 'c', \r
+      /* separator */  's', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', \r
+      /* sk */  's', 'k', \r
+      /* sm */  's', 'm', \r
+      /* so */  's', 'o', \r
+      /* spaceseparator */  's', 'p', 'a', 'c', 'e', 's', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r', \r
+      /* spacingcombiningmark */  's', 'p', 'a', 'c', 'i', 'n', 'g', 'c', 'o', 'm', 'b', 'i', 'n', 'i', 'n', 'g', 'm', 'a', 'r', 'k', \r
+      /* surrogate */  's', 'u', 'r', 'r', 'o', 'g', 'a', 't', 'e', \r
+      /* symbol */  's', 'y', 'm', 'b', 'o', 'l', \r
+      /* titlecase */  't', 'i', 't', 'l', 'e', 'c', 'a', 's', 'e', \r
+      /* titlecaseletter */  't', 'i', 't', 'l', 'e', 'c', 'a', 's', 'e', 'l', 'e', 't', 't', 'e', 'r', \r
+      /* uppercaseletter */  'u', 'p', 'p', 'e', 'r', 'c', 'a', 's', 'e', 'l', 'e', 't', 't', 'e', 'r', \r
+      /* z* */  'z', '*', \r
+      /* zl */  'z', 'l', \r
+      /* zp */  'z', 'p', \r
+      /* zs */  'z', 's', \r
+   };\r
+\r
+   static const re_detail::character_pointer_range< ::UChar32> range_data[] = {\r
+      { prop_name_table+0, prop_name_table+3, }, // any\r
+      { prop_name_table+3, prop_name_table+8, }, // ascii\r
+      { prop_name_table+8, prop_name_table+16, }, // assigned\r
+      { prop_name_table+16, prop_name_table+18, }, // c*\r
+      { prop_name_table+18, prop_name_table+20, }, // cc\r
+      { prop_name_table+20, prop_name_table+22, }, // cf\r
+      { prop_name_table+22, prop_name_table+38, }, // closepunctuation\r
+      { prop_name_table+38, prop_name_table+40, }, // cn\r
+      { prop_name_table+40, prop_name_table+42, }, // co\r
+      { prop_name_table+42, prop_name_table+62, }, // connectorpunctuation\r
+      { prop_name_table+62, prop_name_table+69, }, // control\r
+      { prop_name_table+69, prop_name_table+71, }, // cs\r
+      { prop_name_table+71, prop_name_table+85, }, // currencysymbol\r
+      { prop_name_table+85, prop_name_table+100, }, // dashpunctuation\r
+      { prop_name_table+100, prop_name_table+118, }, // decimaldigitnumber\r
+      { prop_name_table+118, prop_name_table+131, }, // enclosingmark\r
+      { prop_name_table+131, prop_name_table+147, }, // finalpunctuation\r
+      { prop_name_table+147, prop_name_table+153, }, // format\r
+      { prop_name_table+153, prop_name_table+171, }, // initialpunctuation\r
+      { prop_name_table+171, prop_name_table+173, }, // l*\r
+      { prop_name_table+173, prop_name_table+179, }, // letter\r
+      { prop_name_table+179, prop_name_table+191, }, // letternumber\r
+      { prop_name_table+191, prop_name_table+204, }, // lineseparator\r
+      { prop_name_table+204, prop_name_table+206, }, // ll\r
+      { prop_name_table+206, prop_name_table+208, }, // lm\r
+      { prop_name_table+208, prop_name_table+210, }, // lo\r
+      { prop_name_table+210, prop_name_table+225, }, // lowercaseletter\r
+      { prop_name_table+225, prop_name_table+227, }, // lt\r
+      { prop_name_table+227, prop_name_table+229, }, // lu\r
+      { prop_name_table+229, prop_name_table+231, }, // m*\r
+      { prop_name_table+231, prop_name_table+235, }, // mark\r
+      { prop_name_table+235, prop_name_table+245, }, // mathsymbol\r
+      { prop_name_table+245, prop_name_table+247, }, // mc\r
+      { prop_name_table+247, prop_name_table+249, }, // me\r
+      { prop_name_table+249, prop_name_table+251, }, // mn\r
+      { prop_name_table+251, prop_name_table+265, }, // modifierletter\r
+      { prop_name_table+265, prop_name_table+279, }, // modifiersymbol\r
+      { prop_name_table+279, prop_name_table+281, }, // n*\r
+      { prop_name_table+281, prop_name_table+283, }, // nd\r
+      { prop_name_table+283, prop_name_table+285, }, // nl\r
+      { prop_name_table+285, prop_name_table+287, }, // no\r
+      { prop_name_table+287, prop_name_table+301, }, // nonspacingmark\r
+      { prop_name_table+301, prop_name_table+312, }, // notassigned\r
+      { prop_name_table+312, prop_name_table+318, }, // number\r
+      { prop_name_table+318, prop_name_table+333, }, // openpunctuation\r
+      { prop_name_table+333, prop_name_table+338, }, // other\r
+      { prop_name_table+338, prop_name_table+349, }, // otherletter\r
+      { prop_name_table+349, prop_name_table+360, }, // othernumber\r
+      { prop_name_table+360, prop_name_table+376, }, // otherpunctuation\r
+      { prop_name_table+376, prop_name_table+387, }, // othersymbol\r
+      { prop_name_table+387, prop_name_table+389, }, // p*\r
+      { prop_name_table+389, prop_name_table+407, }, // paragraphseparator\r
+      { prop_name_table+407, prop_name_table+409, }, // pc\r
+      { prop_name_table+409, prop_name_table+411, }, // pd\r
+      { prop_name_table+411, prop_name_table+413, }, // pe\r
+      { prop_name_table+413, prop_name_table+415, }, // pf\r
+      { prop_name_table+415, prop_name_table+417, }, // pi\r
+      { prop_name_table+417, prop_name_table+419, }, // po\r
+      { prop_name_table+419, prop_name_table+429, }, // privateuse\r
+      { prop_name_table+429, prop_name_table+431, }, // ps\r
+      { prop_name_table+431, prop_name_table+442, }, // punctuation\r
+      { prop_name_table+442, prop_name_table+444, }, // s*\r
+      { prop_name_table+444, prop_name_table+446, }, // sc\r
+      { prop_name_table+446, prop_name_table+455, }, // separator\r
+      { prop_name_table+455, prop_name_table+457, }, // sk\r
+      { prop_name_table+457, prop_name_table+459, }, // sm\r
+      { prop_name_table+459, prop_name_table+461, }, // so\r
+      { prop_name_table+461, prop_name_table+475, }, // spaceseparator\r
+      { prop_name_table+475, prop_name_table+495, }, // spacingcombiningmark\r
+      { prop_name_table+495, prop_name_table+504, }, // surrogate\r
+      { prop_name_table+504, prop_name_table+510, }, // symbol\r
+      { prop_name_table+510, prop_name_table+519, }, // titlecase\r
+      { prop_name_table+519, prop_name_table+534, }, // titlecaseletter\r
+      { prop_name_table+534, prop_name_table+549, }, // uppercaseletter\r
+      { prop_name_table+549, prop_name_table+551, }, // z*\r
+      { prop_name_table+551, prop_name_table+553, }, // zl\r
+      { prop_name_table+553, prop_name_table+555, }, // zp\r
+      { prop_name_table+555, prop_name_table+557, }, // zs\r
+   };\r
+\r
+   static const icu_regex_traits::char_class_type icu_class_map[] = {\r
+      icu_regex_traits::mask_any, // any\r
+      icu_regex_traits::mask_ascii, // ascii\r
+      (0x3FFFFFFFu) & ~(U_GC_CN_MASK), // assigned\r
+      U_GC_C_MASK, // c*\r
+      U_GC_CC_MASK, // cc\r
+      U_GC_CF_MASK, // cf\r
+      U_GC_PE_MASK, // closepunctuation\r
+      U_GC_CN_MASK, // cn\r
+      U_GC_CO_MASK, // co\r
+      U_GC_PC_MASK, // connectorpunctuation\r
+      U_GC_CC_MASK, // control\r
+      U_GC_CS_MASK, // cs\r
+      U_GC_SC_MASK, // currencysymbol\r
+      U_GC_PD_MASK, // dashpunctuation\r
+      U_GC_ND_MASK, // decimaldigitnumber\r
+      U_GC_ME_MASK, // enclosingmark\r
+      U_GC_PF_MASK, // finalpunctuation\r
+      U_GC_CF_MASK, // format\r
+      U_GC_PI_MASK, // initialpunctuation\r
+      U_GC_L_MASK, // l*\r
+      U_GC_L_MASK, // letter\r
+      U_GC_NL_MASK, // letternumber\r
+      U_GC_ZL_MASK, // lineseparator\r
+      U_GC_LL_MASK, // ll\r
+      U_GC_LM_MASK, // lm\r
+      U_GC_LO_MASK, // lo\r
+      U_GC_LL_MASK, // lowercaseletter\r
+      U_GC_LT_MASK, // lt\r
+      U_GC_LU_MASK, // lu\r
+      U_GC_M_MASK, // m*\r
+      U_GC_M_MASK, // mark\r
+      U_GC_SM_MASK, // mathsymbol\r
+      U_GC_MC_MASK, // mc\r
+      U_GC_ME_MASK, // me\r
+      U_GC_MN_MASK, // mn\r
+      U_GC_LM_MASK, // modifierletter\r
+      U_GC_SK_MASK, // modifiersymbol\r
+      U_GC_N_MASK, // n*\r
+      U_GC_ND_MASK, // nd\r
+      U_GC_NL_MASK, // nl\r
+      U_GC_NO_MASK, // no\r
+      U_GC_MN_MASK, // nonspacingmark\r
+      U_GC_CN_MASK, // notassigned\r
+      U_GC_N_MASK, // number\r
+      U_GC_PS_MASK, // openpunctuation\r
+      U_GC_C_MASK, // other\r
+      U_GC_LO_MASK, // otherletter\r
+      U_GC_NO_MASK, // othernumber\r
+      U_GC_PO_MASK, // otherpunctuation\r
+      U_GC_SO_MASK, // othersymbol\r
+      U_GC_P_MASK, // p*\r
+      U_GC_ZP_MASK, // paragraphseparator\r
+      U_GC_PC_MASK, // pc\r
+      U_GC_PD_MASK, // pd\r
+      U_GC_PE_MASK, // pe\r
+      U_GC_PF_MASK, // pf\r
+      U_GC_PI_MASK, // pi\r
+      U_GC_PO_MASK, // po\r
+      U_GC_CO_MASK, // privateuse\r
+      U_GC_PS_MASK, // ps\r
+      U_GC_P_MASK, // punctuation\r
+      U_GC_S_MASK, // s*\r
+      U_GC_SC_MASK, // sc\r
+      U_GC_Z_MASK, // separator\r
+      U_GC_SK_MASK, // sk\r
+      U_GC_SM_MASK, // sm\r
+      U_GC_SO_MASK, // so\r
+      U_GC_ZS_MASK, // spaceseparator\r
+      U_GC_MC_MASK, // spacingcombiningmark\r
+      U_GC_CS_MASK, // surrogate\r
+      U_GC_S_MASK, // symbol\r
+      U_GC_LT_MASK, // titlecase\r
+      U_GC_LT_MASK, // titlecaseletter\r
+      U_GC_LU_MASK, // uppercaseletter\r
+      U_GC_Z_MASK, // z*\r
+      U_GC_ZL_MASK, // zl\r
+      U_GC_ZP_MASK, // zp\r
+      U_GC_ZS_MASK, // zs\r
+   };\r
+\r
+\r
+   static const re_detail::character_pointer_range< ::UChar32>* ranges_begin = range_data;\r
+   static const re_detail::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));\r
+   \r
+   re_detail::character_pointer_range< ::UChar32> t = { p1, p2, };\r
+   const re_detail::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);\r
+   if((p != ranges_end) && (t == *p))\r
+      return icu_class_map[p - ranges_begin];\r
+   return 0;\r
+}\r
+\r
+icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_type* p1, const char_type* p2) const\r
+{\r
+   static const char_class_type masks[] = \r
+   {\r
+      0,\r
+      U_GC_L_MASK | U_GC_ND_MASK, \r
+      U_GC_L_MASK,\r
+      mask_blank,\r
+      U_GC_CC_MASK | U_GC_CF_MASK | U_GC_ZL_MASK | U_GC_ZP_MASK,\r
+      U_GC_ND_MASK,\r
+      U_GC_ND_MASK,\r
+      (0x3FFFFFFFu) & ~(U_GC_CC_MASK | U_GC_CF_MASK | U_GC_CS_MASK | U_GC_CN_MASK | U_GC_Z_MASK),\r
+      mask_horizontal,\r
+      U_GC_LL_MASK,\r
+      U_GC_LL_MASK,\r
+      ~(U_GC_C_MASK),\r
+      U_GC_P_MASK,\r
+      char_class_type(U_GC_Z_MASK) | mask_space,\r
+      char_class_type(U_GC_Z_MASK) | mask_space,\r
+      U_GC_LU_MASK,\r
+      mask_unicode,\r
+      U_GC_LU_MASK,\r
+      mask_vertical,\r
+      char_class_type(U_GC_L_MASK | U_GC_ND_MASK | U_GC_MN_MASK) | mask_underscore, \r
+      char_class_type(U_GC_L_MASK | U_GC_ND_MASK | U_GC_MN_MASK) | mask_underscore, \r
+      char_class_type(U_GC_ND_MASK) | mask_xdigit,\r
+   };\r
+\r
+   int id = ::boost::re_detail::get_default_class_id(p1, p2);\r
+   if(id >= 0)\r
+      return masks[id+1];\r
+   char_class_type result = lookup_icu_mask(p1, p2);\r
+   if(result != 0)\r
+      return result;\r
+\r
+   if(id < 0)\r
+   {\r
+      string_type s(p1, p2);\r
+      string_type::size_type i = 0;\r
+      while(i < s.size())\r
+      {\r
+         s[i] = static_cast<char>((::u_tolower)(s[i]));\r
+         if(::u_isspace(s[i]) || (s[i] == '-') || (s[i] == '_'))\r
+            s.erase(s.begin()+i, s.begin()+i+1);\r
+         else\r
+         {\r
+            s[i] = static_cast<char>((::u_tolower)(s[i]));\r
+            ++i;\r
+         }\r
+      }\r
+      if(s.size())\r
+         id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());\r
+      if(id >= 0)\r
+         return masks[id+1];\r
+      if(s.size())\r
+         result = lookup_icu_mask(&*s.begin(), &*s.begin() + s.size());\r
+      if(result != 0)\r
+         return result;\r
+   }\r
+   BOOST_ASSERT(std::size_t(id+1) < sizeof(masks) / sizeof(masks[0]));\r
+   return masks[id+1];\r
+}\r
+\r
+icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_type* p1, const char_type* p2) const\r
+{\r
+   string_type result;\r
+   if(std::find_if(p1, p2, std::bind2nd(std::greater< ::UChar32>(), 0x7f)) == p2)\r
+   {\r
+#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS\r
+      std::string s(p1, p2);\r
+#else\r
+      std::string s;\r
+      const char_type* p3 = p1;\r
+      while(p3 != p2)\r
+         s.append(1, *p3++);\r
+#endif\r
+      // Try Unicode name:\r
+      UErrorCode err = U_ZERO_ERROR;\r
+      UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, s.c_str(), &err);\r
+      if(U_SUCCESS(err))\r
+      {\r
+         result.push_back(c);\r
+         return result;\r
+      }\r
+      // Try Unicode-extended name:\r
+      err = U_ZERO_ERROR;\r
+      c = ::u_charFromName(U_EXTENDED_CHAR_NAME, s.c_str(), &err);\r
+      if(U_SUCCESS(err))\r
+      {\r
+         result.push_back(c);\r
+         return result;\r
+      }\r
+      // try POSIX name:\r
+      s = ::boost::re_detail::lookup_default_collate_name(s);\r
+#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS\r
+      result.assign(s.begin(), s.end());\r
+#else\r
+      result.clear();\r
+      std::string::const_iterator si, sj;\r
+      si = s.begin();\r
+      sj = s.end();\r
+      while(si != sj)\r
+         result.push_back(*si++);\r
+#endif\r
+   }\r
+   if(result.empty() && (p2-p1 == 1))\r
+      result.push_back(*p1);\r
+   return result;\r
+}\r
+\r
+bool icu_regex_traits::isctype(char_type c, char_class_type f) const\r
+{\r
+   // check for standard catagories first:\r
+   char_class_type m = char_class_type(1u << u_charType(c));\r
+   if((m & f) != 0) \r
+      return true;\r
+   // now check for special cases:\r
+   if(((f & mask_blank) != 0) && u_isblank(c))\r
+      return true;\r
+   if(((f & mask_space) != 0) && u_isspace(c))\r
+      return true;\r
+   if(((f & mask_xdigit) != 0) && (u_digit(c, 16) >= 0))\r
+      return true;\r
+   if(((f & mask_unicode) != 0) && (c >= 0x100))\r
+      return true;\r
+   if(((f & mask_underscore) != 0) && (c == '_'))\r
+      return true;\r
+   if(((f & mask_any) != 0) && (c <= 0x10FFFF))\r
+      return true;\r
+   if(((f & mask_ascii) != 0) && (c <= 0x7F))\r
+      return true;\r
+   if(((f & mask_vertical) != 0) && (::boost::re_detail::is_separator(c) || (c == static_cast<char_type>('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK)))\r
+      return true;\r
+   if(((f & mask_horizontal) != 0) && !::boost::re_detail::is_separator(c) && u_isspace(c) && (c != static_cast<char_type>('\v')))\r
+      return true;\r
+   return false;\r
+}\r
+\r
+}\r
+\r
+#endif // BOOST_HAS_ICU\r
index 8f76c09e4fe4db998e21ec7e68fbaf8f83fbf33c..c9596a3daf62f770677c1f8b4f07574b034501c0 100644 (file)
@@ -100,6 +100,9 @@ BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants
          "p",
          "P",
          "N",
+         "g",
+         "K",
+         "R",
    };
 
    return ((n >= (sizeof(messages) / sizeof(messages[1]))) ? "" : messages[n]);
@@ -375,14 +378,14 @@ BOOST_REGEX_DECL regex_constants::escape_syntax_type BOOST_REGEX_CALL get_defaul
       regex_constants::escape_type_not_class,        /*H*/
       regex_constants::escape_type_not_class,        /*I*/
       regex_constants::escape_type_not_class,        /*J*/
-      regex_constants::escape_type_not_class,        /*K*/
+      regex_constants::escape_type_reset_start_mark, /*K*/
       regex_constants::escape_type_not_class,        /*L*/
       regex_constants::escape_type_not_class,        /*M*/
       regex_constants::escape_type_named_char,       /*N*/
       regex_constants::escape_type_not_class,        /*O*/
       regex_constants::escape_type_not_property,     /*P*/
       regex_constants::escape_type_Q,                /*Q*/
-      regex_constants::escape_type_not_class,        /*R*/
+      regex_constants::escape_type_line_ending,      /*R*/
       regex_constants::escape_type_not_class,        /*S*/
       regex_constants::escape_type_not_class,        /*T*/
       regex_constants::escape_type_not_class,        /*U*/
@@ -403,11 +406,11 @@ BOOST_REGEX_DECL regex_constants::escape_syntax_type BOOST_REGEX_CALL get_defaul
       regex_constants::escape_type_class,        /*d*/
       regex_constants::escape_type_e,        /*e*/
       regex_constants::escape_type_control_f,       /*f*/
-      regex_constants::escape_type_class,        /*g*/
+      regex_constants::escape_type_extended_backref,  /*g*/
       regex_constants::escape_type_class,        /*h*/
       regex_constants::escape_type_class,        /*i*/
       regex_constants::escape_type_class,        /*j*/
-      regex_constants::escape_type_class,        /*k*/
+      regex_constants::escape_type_extended_backref, /*k*/
       regex_constants::escape_type_class,        /*l*/
       regex_constants::escape_type_class,        /*m*/
       regex_constants::escape_type_control_n,       /*n*/
@@ -534,7 +537,7 @@ BOOST_REGEX_DECL regex_constants::syntax_type BOOST_REGEX_CALL get_default_synta
       regex_constants::syntax_dollar,        /*$*/
       regex_constants::syntax_char,        /*%*/
       regex_constants::syntax_char,        /*&*/
-      regex_constants::syntax_char,        /*'*/
+      regex_constants::escape_type_end_buffer,  /*'*/
       regex_constants::syntax_open_mark,        /*(*/
       regex_constants::syntax_close_mark,        /*)*/
       regex_constants::syntax_star,        /***/
diff --git a/boost/libs/regex/src/static_mutex.cpp b/boost/libs/regex/src/static_mutex.cpp
new file mode 100755 (executable)
index 0000000..b200f29
--- /dev/null
@@ -0,0 +1,179 @@
+/*\r
+ *\r
+ * Copyright (c) 2004\r
+ * John Maddock\r
+ *\r
+ * Use, modification and distribution are subject to the \r
+ * Boost Software License, Version 1.0. (See accompanying file \r
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+ *\r
+ */\r
\r
+ /*\r
+  *   LOCATION:    see http://www.boost.org for most recent version.\r
+  *   FILE         static_mutex.cpp\r
+  *   VERSION      see <boost/version.hpp>\r
+  *   DESCRIPTION: Declares static_mutex lock type.\r
+  */\r
+\r
+#define BOOST_REGEX_SOURCE\r
+#include <boost/config.hpp>\r
+\r
+#ifdef BOOST_HAS_THREADS\r
+\r
+#include <boost/regex/pending/static_mutex.hpp>\r
+\r
+#if defined(BOOST_HAS_WINTHREADS)\r
+#ifndef NOMINMAX\r
+#  define NOMINMAX\r
+#endif\r
+#define WIN32_LEAN_AND_MEAN\r
+#include <windows.h>\r
+#include <boost/static_assert.hpp>\r
+#endif\r
+\r
+\r
+namespace boost{\r
+\r
+#if defined(BOOST_HAS_PTHREADS) && defined(PTHREAD_MUTEX_INITIALIZER)\r
+\r
+scoped_static_mutex_lock::scoped_static_mutex_lock(static_mutex& m, bool lk)\r
+: m_mutex(m), m_have_lock(false)\r
+{\r
+   if(lk)\r
+      lock();\r
+}\r
+\r
+scoped_static_mutex_lock::~scoped_static_mutex_lock()\r
+{\r
+   if(m_have_lock)\r
+      unlock();\r
+}\r
+\r
+void scoped_static_mutex_lock::lock()\r
+{\r
+   if(0 == m_have_lock)\r
+   {\r
+      pthread_mutex_lock(&(m_mutex.m_mutex));\r
+      m_have_lock = true;\r
+   }\r
+}\r
+\r
+void scoped_static_mutex_lock::unlock()\r
+{\r
+   if(m_have_lock)\r
+   {\r
+      pthread_mutex_unlock(&(m_mutex.m_mutex));\r
+      m_have_lock = false;\r
+   }\r
+}\r
+\r
+#elif defined(BOOST_HAS_WINTHREADS)\r
+\r
+BOOST_STATIC_ASSERT(sizeof(LONG) == sizeof(boost::int32_t));\r
+\r
+scoped_static_mutex_lock::scoped_static_mutex_lock(static_mutex& m, bool lk)\r
+: m_mutex(m), m_have_lock(false)\r
+{\r
+   if(lk)\r
+      lock();\r
+}\r
+\r
+scoped_static_mutex_lock::~scoped_static_mutex_lock()\r
+{\r
+   if(m_have_lock)\r
+      unlock();\r
+}\r
+\r
+void scoped_static_mutex_lock::lock()\r
+{\r
+   if(0 == m_have_lock)\r
+   {\r
+#if !defined(InterlockedCompareExchangePointer)\r
+      while(0 != InterlockedCompareExchange(reinterpret_cast<void**>((boost::uint_least16_t*)&(m_mutex.m_mutex)), (void*)1, 0))\r
+#else\r
+      while(0 != InterlockedCompareExchange(reinterpret_cast<LONG*>(&(m_mutex.m_mutex)), 1, 0))\r
+#endif\r
+      {\r
+         Sleep(0);\r
+      }\r
+      m_have_lock = true;\r
+   }\r
+}\r
+\r
+void scoped_static_mutex_lock::unlock()\r
+{\r
+   if(m_have_lock)\r
+   {\r
+#if !defined(InterlockedCompareExchangePointer)\r
+      InterlockedExchange((LONG*)&(m_mutex.m_mutex), 0);\r
+#else\r
+      InterlockedExchange(reinterpret_cast<LONG*>(&(m_mutex.m_mutex)), 0);\r
+#endif\r
+      m_have_lock = false;\r
+   }\r
+}\r
+\r
+#else\r
+//\r
+// Portable version of a static mutex based on Boost.Thread library:\r
+//\r
+#include <stdlib.h>\r
+#include <boost/assert.hpp>\r
+\r
+boost::recursive_mutex* static_mutex::m_pmutex = 0;\r
+boost::once_flag static_mutex::m_once = BOOST_ONCE_INIT;\r
+\r
+extern "C" BOOST_REGEX_DECL void free_static_mutex()\r
+{\r
+   delete static_mutex::m_pmutex;\r
+   static_mutex::m_pmutex = 0;\r
+}\r
+\r
+void static_mutex::init()\r
+{\r
+   m_pmutex = new boost::recursive_mutex();\r
+   int r = atexit(free_static_mutex);\r
+   BOOST_ASSERT(0 == r);\r
+}\r
+\r
+scoped_static_mutex_lock::scoped_static_mutex_lock(static_mutex& , bool lk)\r
+: m_plock(0), m_have_lock(false)\r
+{\r
+   if(lk)\r
+      lock();\r
+}\r
+\r
+scoped_static_mutex_lock::~scoped_static_mutex_lock()\r
+{\r
+   if(m_have_lock)\r
+      unlock();\r
+   delete m_plock;\r
+}\r
+\r
+void scoped_static_mutex_lock::lock()\r
+{\r
+   if(0 == m_have_lock)\r
+   {\r
+       boost::call_once(static_mutex::m_once,&static_mutex::init);\r
+      if(0 == m_plock)\r
+         m_plock = new boost::recursive_mutex::scoped_lock(*static_mutex::m_pmutex, false);\r
+      m_plock->lock();\r
+      m_have_lock = true;\r
+   }\r
+}\r
+\r
+void scoped_static_mutex_lock::unlock()\r
+{\r
+   if(m_have_lock)\r
+   {\r
+      m_plock->unlock();\r
+      m_have_lock = false;\r
+   }\r
+}\r
+\r
+#endif\r
+\r
+}\r
+\r
+#endif // BOOST_HAS_THREADS\r
diff --git a/boost/libs/regex/src/usinstances.cpp b/boost/libs/regex/src/usinstances.cpp
new file mode 100755 (executable)
index 0000000..8d6352e
--- /dev/null
@@ -0,0 +1,78 @@
+/*\r
+ *\r
+ * Copyright (c) 1998-2002\r
+ * John Maddock\r
+ *\r
+ * Use, modification and distribution are subject to the \r
+ * Boost Software License, Version 1.0. (See accompanying file \r
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+ *\r
+ */\r
+\r
+ /*\r
+  *   LOCATION:    see http://www.boost.org for most recent version.\r
+  *   FILE:        winstances.cpp\r
+  *   VERSION:     see <boost/version.hpp>\r
+  *   DESCRIPTION: regex unsigned short template instances (MSVC only).\r
+  */\r
+\r
+#define BOOST_REGEX_SOURCE\r
+\r
+#include <boost/detail/workaround.hpp>\r
+#include <memory>\r
+#include <string>\r
+\r
+#if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \\r
+   && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\\r
+   && BOOST_WORKAROUND(BOOST_MSVC, <1600)\r
+//\r
+// This is a horrible workaround, but without declaring these symbols extern we get\r
+// duplicate symbol errors when linking if the application is built without\r
+// /Zc:wchar_t\r
+//\r
+#ifdef _CRTIMP2_PURE\r
+#  define BOOST_REGEX_STDLIB_DECL _CRTIMP2_PURE\r
+#else\r
+#  define BOOST_REGEX_STDLIB_DECL _CRTIMP2\r
+#endif\r
+\r
+namespace std{\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)\r
+template class BOOST_REGEX_STDLIB_DECL allocator<unsigned short>;\r
+template class BOOST_REGEX_STDLIB_DECL _String_val<unsigned short, allocator<unsigned short> >;\r
+template class BOOST_REGEX_STDLIB_DECL basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >;\r
+#endif\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))\r
+template<> BOOST_REGEX_STDLIB_DECL std::size_t __cdecl char_traits<unsigned short>::length(unsigned short const*);\r
+#endif\r
+\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(\r
+   const unsigned short *,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const unsigned short *);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator<(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+}\r
+#endif\r
+\r
+#include <boost/regex/config.hpp>\r
+\r
+#if !defined(BOOST_NO_WREGEX) && defined(BOOST_REGEX_HAS_OTHER_WCHAR_T) && !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES)\r
+#define BOOST_REGEX_US_INSTANTIATE\r
+\r
+#include <boost/regex.hpp>\r
+\r
+#endif\r
+\r
+\r
diff --git a/boost/libs/regex/src/wc_regex_traits.cpp b/boost/libs/regex/src/wc_regex_traits.cpp
new file mode 100755 (executable)
index 0000000..52132fe
--- /dev/null
@@ -0,0 +1,320 @@
+/*\r
+ *\r
+ * Copyright (c) 2004\r
+ * John Maddock\r
+ *\r
+ * Use, modification and distribution are subject to the \r
+ * Boost Software License, Version 1.0. (See accompanying file \r
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\r
+ *\r
+ */\r
+\r
+ /*\r
+  *   LOCATION:    see http://www.boost.org for most recent version.\r
+  *   FILE:        wc_regex_traits.cpp\r
+  *   VERSION:     see <boost/version.hpp>\r
+  *   DESCRIPTION: Implements out of line members for c_regex_traits<wchar_t>\r
+  */\r
+\r
+\r
+#define BOOST_REGEX_SOURCE\r
+\r
+#include <boost/detail/workaround.hpp>\r
+#include <memory>\r
+#include <string>\r
+\r
+#if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \\r
+   && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\\r
+   && BOOST_WORKAROUND(BOOST_MSVC, <1600)\r
+//\r
+// This is a horrible workaround, but without declaring these symbols extern we get\r
+// duplicate symbol errors when linking if the application is built without\r
+// /Zc:wchar_t\r
+//\r
+#ifdef _CRTIMP2_PURE\r
+#  define BOOST_REGEX_STDLIB_DECL _CRTIMP2_PURE\r
+#else\r
+#  define BOOST_REGEX_STDLIB_DECL _CRTIMP2\r
+#endif\r
+\r
+namespace std{\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)\r
+template class BOOST_REGEX_STDLIB_DECL allocator<unsigned short>;\r
+template class BOOST_REGEX_STDLIB_DECL _String_val<unsigned short, allocator<unsigned short> >;\r
+template class BOOST_REGEX_STDLIB_DECL basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >;\r
+#endif\r
+\r
+#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))\r
+template<> BOOST_REGEX_STDLIB_DECL std::size_t __cdecl char_traits<unsigned short>::length(unsigned short const*);\r
+#endif\r
+\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(\r
+   const unsigned short *,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const unsigned short *);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator<(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>(\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,\r
+   const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);\r
+}\r
+#endif\r
+\r
+#include <boost/regex/config.hpp>\r
+#include <boost/detail/workaround.hpp>\r
+\r
+#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560)\r
+\r
+#include <boost/regex/v4/c_regex_traits.hpp>\r
+#ifndef BOOST_NO_WREGEX\r
+#include <boost/regex/v4/primary_transform.hpp>\r
+#include <boost/regex/v4/regex_traits_defaults.hpp>\r
+\r
+#if defined(BOOST_NO_STDC_NAMESPACE)\r
+namespace std{\r
+   using ::wcstol;\r
+}\r
+#endif\r
+\r
+namespace boost{\r
+\r
+c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::transform(const wchar_t* p1, const wchar_t* p2) \r
+{ \r
+   std::size_t r;\r
+   std::size_t s = 10;\r
+   std::wstring src(p1, p2);\r
+   std::wstring result(s, L' ');\r
+   while(s < (r = std::wcsxfrm(&*result.begin(), src.c_str(), s)))\r
+   {\r
+      result.append(r - s + 3, L' ');\r
+      s = result.size();\r
+   }\r
+   result.erase(r);\r
+   return result; \r
+}\r
+\r
+c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::transform_primary(const wchar_t* p1, const wchar_t* p2) \r
+{\r
+   static wchar_t s_delim;\r
+   static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast<const c_regex_traits<wchar_t>*>(0), &s_delim);\r
+   std::wstring result;\r
+   //\r
+   // What we do here depends upon the format of the sort key returned by\r
+   // sort key returned by this->transform:\r
+   //\r
+   switch(s_collate_type)\r
+   {\r
+   case ::boost::re_detail::sort_C:\r
+   case ::boost::re_detail::sort_unknown:\r
+      // the best we can do is translate to lower case, then get a regular sort key:\r
+      {\r
+         result.assign(p1, p2);\r
+         for(std::wstring::size_type i = 0; i < result.size(); ++i)\r
+            result[i] = (std::towlower)(result[i]);\r
+         result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());\r
+         break;\r
+      }\r
+   case ::boost::re_detail::sort_fixed:\r
+      {\r
+         // get a regular sort key, and then truncate it:\r
+         result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());\r
+         result.erase(s_delim);\r
+         break;\r
+      }\r
+   case ::boost::re_detail::sort_delim:\r
+         // get a regular sort key, and then truncate everything after the delim:\r
+         result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());\r
+         if(result.size() && (result[0] == s_delim))\r
+            break;\r
+         std::size_t i;\r
+         for(i = 0; i < result.size(); ++i)\r
+         {\r
+            if(result[i] == s_delim)\r
+               break;\r
+         }\r
+         result.erase(i);\r
+         break;\r
+   }\r
+   if(result.empty())\r
+      result = std::wstring(1, char(0));\r
+   return result;\r
+}\r
+\r
+enum\r
+{\r
+   char_class_space=1<<0, \r
+   char_class_print=1<<1, \r
+   char_class_cntrl=1<<2, \r
+   char_class_upper=1<<3, \r
+   char_class_lower=1<<4,\r
+   char_class_alpha=1<<5, \r
+   char_class_digit=1<<6, \r
+   char_class_punct=1<<7, \r
+   char_class_xdigit=1<<8,\r
+   char_class_alnum=char_class_alpha|char_class_digit, \r
+   char_class_graph=char_class_alnum|char_class_punct,\r
+   char_class_blank=1<<9,\r
+   char_class_word=1<<10,\r
+   char_class_unicode=1<<11,\r
+   char_class_horizontal=1<<12,\r
+   char_class_vertical=1<<13\r
+};\r
+\r
+c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_classname(const wchar_t* p1, const wchar_t* p2) \r
+{\r
+   static const char_class_type masks[] = \r
+   {\r
+      0,\r
+      char_class_alnum, \r
+      char_class_alpha,\r
+      char_class_blank,\r
+      char_class_cntrl,\r
+      char_class_digit,\r
+      char_class_digit,\r
+      char_class_graph,\r
+      char_class_horizontal,\r
+      char_class_lower,\r
+      char_class_lower,\r
+      char_class_print,\r
+      char_class_punct,\r
+      char_class_space,\r
+      char_class_space,\r
+      char_class_upper,\r
+      char_class_unicode,\r
+      char_class_upper,\r
+      char_class_vertical,\r
+      char_class_alnum | char_class_word, \r
+      char_class_alnum | char_class_word, \r
+      char_class_xdigit,\r
+   };\r
+\r
+   int id = ::boost::re_detail::get_default_class_id(p1, p2);\r
+   if(id < 0)\r
+   {\r
+      std::wstring s(p1, p2);\r
+      for(std::wstring::size_type i = 0; i < s.size(); ++i)\r
+         s[i] = (std::towlower)(s[i]);\r
+      id = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());\r
+   }\r
+   BOOST_ASSERT(id+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));\r
+   return masks[id+1];\r
+}\r
+\r
+bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::isctype(wchar_t c, char_class_type mask) \r
+{\r
+   return\r
+      ((mask & char_class_space) && (std::iswspace)(c))\r
+      || ((mask & char_class_print) && (std::iswprint)(c))\r
+      || ((mask & char_class_cntrl) && (std::iswcntrl)(c))\r
+      || ((mask & char_class_upper) && (std::iswupper)(c))\r
+      || ((mask & char_class_lower) && (std::iswlower)(c))\r
+      || ((mask & char_class_alpha) && (std::iswalpha)(c))\r
+      || ((mask & char_class_digit) && (std::iswdigit)(c))\r
+      || ((mask & char_class_punct) && (std::iswpunct)(c))\r
+      || ((mask & char_class_xdigit) && (std::iswxdigit)(c))\r
+      || ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c))\r
+      || ((mask & char_class_word) && (c == '_'))\r
+      || ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff)))\r
+      || ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == L'\v')))\r
+      || ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c) && (c != L'\v'));\r
+}\r
+\r
+c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(const wchar_t* p1, const wchar_t* p2) \r
+{\r
+#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\\r
+               && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\\r
+               && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\r
+   std::string name(p1, p2);\r
+#else\r
+   std::string name;\r
+   const wchar_t* p0 = p1;\r
+   while(p0 != p2)\r
+      name.append(1, char(*p0++));\r
+#endif\r
+   name = ::boost::re_detail::lookup_default_collate_name(name);\r
+#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\\r
+               && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\\r
+               && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\r
+   if(name.size())\r
+      return string_type(name.begin(), name.end());\r
+#else\r
+   if(name.size())\r
+   {\r
+      string_type result;\r
+      typedef std::string::const_iterator iter;\r
+      iter b = name.begin();\r
+      iter e = name.end();\r
+      while(b != e)\r
+         result.append(1, wchar_t(*b++));\r
+      return result;\r
+   }\r
+#endif\r
+   if(p2 - p1 == 1)\r
+      return string_type(1, *p1);\r
+   return string_type();\r
+}\r
+\r
+int BOOST_REGEX_CALL c_regex_traits<wchar_t>::value(wchar_t c, int radix) \r
+{\r
+#ifdef __BORLANDC__\r
+   // workaround for broken wcstol:\r
+   if((std::iswxdigit)(c) == 0)\r
+      return -1;\r
+#endif\r
+   wchar_t b[2] = { c, '\0', };\r
+   wchar_t* ep;\r
+   int result = std::wcstol(b, &ep, radix);\r
+   if(ep == b)\r
+      return -1;\r
+   return result;\r
+}\r
+\r
+#ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T\r
+c_regex_traits<unsigned short>::string_type BOOST_REGEX_CALL c_regex_traits<unsigned short>::transform(const unsigned short* p1, const unsigned short* p2)\r
+{\r
+   std::wstring result = c_regex_traits<wchar_t>::transform((const wchar_t*)p1, (const wchar_t*)p2);\r
+   return string_type(result.begin(), result.end());\r
+}\r
+\r
+c_regex_traits<unsigned short>::string_type BOOST_REGEX_CALL c_regex_traits<unsigned short>::transform_primary(const unsigned short* p1, const unsigned short* p2)\r
+{\r
+   std::wstring result = c_regex_traits<wchar_t>::transform_primary((const wchar_t*)p1, (const wchar_t*)p2);\r
+   return string_type(result.begin(), result.end());\r
+}\r
+\r
+c_regex_traits<unsigned short>::char_class_type BOOST_REGEX_CALL c_regex_traits<unsigned short>::lookup_classname(const unsigned short* p1, const unsigned short* p2)\r
+{\r
+   return c_regex_traits<wchar_t>::lookup_classname((const wchar_t*)p1, (const wchar_t*)p2);\r
+}\r
+\r
+c_regex_traits<unsigned short>::string_type BOOST_REGEX_CALL c_regex_traits<unsigned short>::lookup_collatename(const unsigned short* p1, const unsigned short* p2)\r
+{\r
+   std::wstring result = c_regex_traits<wchar_t>::lookup_collatename((const wchar_t*)p1, (const wchar_t*)p2);\r
+   return string_type(result.begin(), result.end());\r
+}\r
+\r
+bool BOOST_REGEX_CALL c_regex_traits<unsigned short>::isctype(unsigned short c, char_class_type m)\r
+{\r
+   return c_regex_traits<wchar_t>::isctype(c, m);\r
+}\r
+\r
+int BOOST_REGEX_CALL c_regex_traits<unsigned short>::value(unsigned short c, int radix)\r
+{\r
+   return c_regex_traits<wchar_t>::value(c, radix);\r
+}\r
+\r
+#endif\r
+\r
+}\r
+\r
+#endif // BOOST_NO_WREGEX\r
+\r
+#endif // __BORLANDC__\r
+\r
index 83d651b88481c893a969000c771938a489ddc1f6..c8a919027ba5ebb0cbe0edbfb5c8c25a52522e31 100644 (file)
@@ -29,7 +29,7 @@
 #include <cstring>
 #include <cstdio>
 
-#if defined(BOOST_NO_STDC_NAMESPACE)
+#if defined(BOOST_NO_STDC_NAMESPACE) || defined(__NetBSD__)
 namespace std{
 #  ifndef BOOST_NO_SWPRINTF
       using ::swprintf;
diff --git a/boost/libs/signals/src/CMakeLists.txt b/boost/libs/signals/src/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..462ad71
--- /dev/null
@@ -0,0 +1,13 @@
+#\r
+# Copyright Troy D. Straszheim\r
+#\r
+# Distributed under the Boost Software License, Version 1.0.\r
+# See http://www.boost.org/LICENSE_1_0.txt\r
+#\r
+add_definitions(-DBOOST_SIGNALS_NO_LIB=1)\r
+\r
+boost_add_library(\r
+  boost_signals \r
+  trackable.cpp connection.cpp named_slot_map.cpp signal_base.cpp slot.cpp\r
+  SHARED_COMPILE_FLAGS "-DBOOST_SIGNALS_DYN_LINK=1"\r
+  )\r