Commits

alfonse  committed 3eec91d

Boost: Removed vestiages of Regex.
Report system is basically functional. Need XML/Lua writing.

  • Participants
  • Parent commits 02f09dd

Comments (0)

Files changed (25)

File boost_1_51_0/boost/cast.hpp

+//  boost cast.hpp header file  ----------------------------------------------//
+
+//  (C) Copyright Kevlin Henney and Dave Abrahams 1999.
+//  Distributed under the Boost
+//  Software License, Version 1.0. (See accompanying file
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//  See http://www.boost.org/libs/conversion for Documentation.
+
+//  Revision History
+//  23 JUn 05  numeric_cast removed and redirected to the new verion (Fernando Cacciola)
+//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included
+//             <boost/limits.hpp> instead (the workaround did not
+//             actually compile when BOOST_NO_LIMITS was defined in
+//             any case, so we loose nothing). (John Maddock)
+//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
+//             worked with stock GCC; trying to get it to do that broke
+//             vc-stlport.
+//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
+//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
+//             boost::detail::type to boost/type.hpp. Made it compile with
+//             stock gcc again (Dave Abrahams)
+//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
+//             Review (Beman Dawes)
+//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
+//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
+//             (Dave Abrahams)
+//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
+//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
+//  27 Jun 00  More MSVC6 workarounds
+//  15 Jun 00  Add workarounds for MSVC6
+//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
+//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
+//  29 Dec 99  Change using declarations so usages in other namespaces work
+//             correctly (Dave Abrahams)
+//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
+//             as suggested Darin Adler and improved by Valentin Bonnard.
+//   2 Sep 99  Remove controversial asserts, simplify, rename.
+//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
+//             place in nested namespace.
+//   3 Aug 99  Initial version
+
+#ifndef BOOST_CAST_HPP
+#define BOOST_CAST_HPP
+
+# include <boost/config.hpp>
+# include <boost/assert.hpp>
+# include <typeinfo>
+# include <boost/type.hpp>
+# include <boost/limits.hpp>
+# include <boost/detail/select_type.hpp>
+
+//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
+//  time if you use a template function which has template parameters that don't
+//  appear in the function's argument list.
+//
+//  TODO: Add this to config.hpp?
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
+# else
+#  define BOOST_EXPLICIT_DEFAULT_TARGET
+# endif
+
+namespace boost
+{
+//  See the documentation for descriptions of how to choose between
+//  static_cast<>, dynamic_cast<>, polymorphic_cast<> and polymorphic_downcast<>
+
+//  polymorphic_cast  --------------------------------------------------------//
+
+    //  Runtime checked polymorphic downcasts and crosscasts.
+    //  Suggested in The C++ Programming Language, 3rd Ed, Bjarne Stroustrup,
+    //  section 15.8 exercise 1, page 425.
+
+    template <class Target, class Source>
+    inline Target polymorphic_cast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
+    {
+        Target tmp = dynamic_cast<Target>(x);
+        if ( tmp == 0 ) throw std::bad_cast();
+        return tmp;
+    }
+
+//  polymorphic_downcast  ----------------------------------------------------//
+
+    //  BOOST_ASSERT() checked polymorphic downcast.  Crosscasts prohibited.
+
+    //  WARNING: Because this cast uses BOOST_ASSERT(), it violates
+    //  the One Definition Rule if used in multiple translation units
+    //  where BOOST_DISABLE_ASSERTS, BOOST_ENABLE_ASSERT_HANDLER
+    //  NDEBUG are defined inconsistently.
+
+    //  Contributed by Dave Abrahams
+
+    template <class Target, class Source>
+    inline Target polymorphic_downcast(Source* x BOOST_EXPLICIT_DEFAULT_TARGET)
+    {
+        BOOST_ASSERT( dynamic_cast<Target>(x) == x );  // detect logic error
+        return static_cast<Target>(x);
+    }
+
+#  undef BOOST_EXPLICIT_DEFAULT_TARGET
+
+} // namespace boost
+
+# include <boost/numeric/conversion/cast.hpp>
+
+#endif  // BOOST_CAST_HPP

File boost_1_51_0/boost/detail/numeric_traits.hpp

+// (C) Copyright David Abrahams 2001, Howard Hinnant 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)
+//
+// Template class numeric_traits<Number> --
+//
+//    Supplies:
+//
+//      typedef difference_type -- a type used to represent the difference
+//      between any two values of Number.
+//
+//    Support:
+//      1. Not all specializations are supplied
+//
+//      2. Use of specializations that are not supplied will cause a
+//      compile-time error
+//
+//      3. Users are free to specialize numeric_traits for any type.
+//
+//      4. Right now, specializations are only supplied for integer types.
+//
+//      5. On implementations which do not supply compile-time constants in
+//      std::numeric_limits<>, only specializations for built-in integer types
+//      are supplied.
+//
+//      6. Handling of numbers whose range of representation is at least as
+//      great as boost::intmax_t can cause some differences to be
+//      unrepresentable in difference_type:
+//
+//        Number    difference_type
+//        ------    ---------------
+//        signed    Number
+//        unsigned  intmax_t
+//
+// template <class Number> typename numeric_traits<Number>::difference_type
+// numeric_distance(Number x, Number y)
+//    computes (y - x), attempting to avoid overflows.
+//
+
+// See http://www.boost.org for most recent version including documentation.
+
+// Revision History
+// 11 Feb 2001 - Use BOOST_STATIC_CONSTANT (David Abrahams)
+// 11 Feb 2001 - Rolled back ineffective Borland-specific code
+//               (David Abrahams)
+// 10 Feb 2001 - Rolled in supposed Borland fixes from John Maddock, but
+//               not seeing any improvement yet (David Abrahams)
+// 06 Feb 2001 - Factored if_true out into boost/detail/select_type.hpp
+//               (David Abrahams)
+// 23 Jan 2001 - Fixed logic of difference_type selection, which was
+//               completely wack. In the process, added digit_traits<>
+//               to compute the number of digits in intmax_t even when
+//               not supplied by numeric_limits<>. (David Abrahams)
+// 21 Jan 2001 - Created (David Abrahams)
+
+#ifndef BOOST_NUMERIC_TRAITS_HPP_DWA20001901
+# define BOOST_NUMERIC_TRAITS_HPP_DWA20001901
+
+# include <boost/config.hpp>
+# include <boost/cstdint.hpp>
+# include <boost/static_assert.hpp>
+# include <boost/type_traits.hpp>
+# include <boost/detail/select_type.hpp>
+# include <boost/limits.hpp>
+
+namespace boost { namespace detail {
+
+  // Template class is_signed -- determine whether a numeric type is signed
+  // Requires that T is constructable from the literals -1 and 0.  Compile-time
+  // error results if that requirement is not met (and thus signedness is not
+  // likely to have meaning for that type).
+  template <class Number>
+  struct is_signed
+  {
+#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_MSVC) && BOOST_MSVC <= 1300
+    BOOST_STATIC_CONSTANT(bool, value = (Number(-1) < Number(0)));
+#else
+    BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<Number>::is_signed);
+#endif
+  };
+
+# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+  // digit_traits - compute the number of digits in a built-in integer
+  // type. Needed for implementations on which numeric_limits is not specialized
+  // for intmax_t (e.g. VC6).
+  template <bool is_specialized> struct digit_traits_select;
+
+  // numeric_limits is specialized; just select that version of digits
+  template <> struct digit_traits_select<true>
+  {
+      template <class T> struct traits
+      {
+          BOOST_STATIC_CONSTANT(int, digits = std::numeric_limits<T>::digits);
+      };
+  };
+
+  // numeric_limits is not specialized; compute digits from sizeof(T)
+  template <> struct digit_traits_select<false>
+  {
+      template <class T> struct traits
+      {
+          BOOST_STATIC_CONSTANT(int, digits = (
+              sizeof(T) * std::numeric_limits<unsigned char>::digits
+              - (is_signed<T>::value ? 1 : 0))
+              );
+      };
+  };
+
+  // here's the "usable" template
+  template <class T> struct digit_traits
+  {
+      typedef digit_traits_select<
+                ::std::numeric_limits<T>::is_specialized> selector;
+      typedef typename selector::template traits<T> traits;
+      BOOST_STATIC_CONSTANT(int, digits = traits::digits);
+  };
+#endif
+
+  // Template class integer_traits<Integer> -- traits of various integer types
+  // This should probably be rolled into boost::integer_traits one day, but I
+  // need it to work without <limits>
+  template <class Integer>
+  struct integer_traits
+  {
+# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+   private:
+      typedef Integer integer_type;
+      typedef std::numeric_limits<integer_type> x;
+#   if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
+      // for some reason, MSVC asserts when it shouldn't unless we make these
+      // local definitions
+      BOOST_STATIC_CONSTANT(bool, is_integer = x::is_integer);
+      BOOST_STATIC_CONSTANT(bool, is_specialized = x::is_specialized);
+      
+      BOOST_STATIC_ASSERT(is_integer);
+      BOOST_STATIC_ASSERT(is_specialized);
+#   endif
+   public:
+      typedef typename
+      if_true<(int(x::is_signed)
+              && (!int(x::is_bounded)
+                 // digits is the number of no-sign bits
+                  || (int(x::digits) + 1 >= digit_traits<boost::intmax_t>::digits)))>::template then<
+        Integer,
+          
+      typename if_true<(int(x::digits) + 1 < digit_traits<signed int>::digits)>::template then<
+        signed int,
+
+      typename if_true<(int(x::digits) + 1 < digit_traits<signed long>::digits)>::template then<
+        signed long,
+
+   // else
+        intmax_t
+      >::type>::type>::type difference_type;
+#else
+      BOOST_STATIC_ASSERT(boost::is_integral<Integer>::value);
+
+      typedef typename
+      if_true<(sizeof(Integer) >= sizeof(intmax_t))>::template then<
+               
+        typename if_true<(is_signed<Integer>::value)>::template then<
+          Integer,
+          intmax_t
+        >::type,
+
+        typename if_true<(sizeof(Integer) < sizeof(std::ptrdiff_t))>::template then<
+          std::ptrdiff_t,
+          intmax_t
+        >::type
+      >::type difference_type;
+# endif
+  };
+
+  // Right now, only supports integers, but should be expanded.
+  template <class Number>
+  struct numeric_traits
+  {
+      typedef typename integer_traits<Number>::difference_type difference_type;
+  };
+
+  template <class Number>
+  typename numeric_traits<Number>::difference_type numeric_distance(Number x, Number y)
+  {
+      typedef typename numeric_traits<Number>::difference_type difference_type;
+      return difference_type(y) - difference_type(x);
+  }
+}}
+
+#endif // BOOST_NUMERIC_TRAITS_HPP_DWA20001901

File boost_1_51_0/boost/exception/detail/attribute_noreturn.hpp

+//Copyright (c) 2009 Emil Dotchevski and Reverge Studios, Inc.
+
+//Distributed under the Boost Software License, Version 1.0. (See accompanying
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef UUID_61531AB0680611DEADD5846855D89593
+#define UUID_61531AB0680611DEADD5846855D89593
+
+#if defined(_MSC_VER)
+#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
+#elif defined(__GNUC__)
+#define BOOST_ATTRIBUTE_NORETURN __attribute__((__noreturn__))
+#else
+#define BOOST_ATTRIBUTE_NORETURN
+#endif
+
+#endif

File boost_1_51_0/boost/exception/exception.hpp

+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
+
+//Distributed under the Boost Software License, Version 1.0. (See accompanying
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
+#define UUID_274DA366004E11DCB1DDFE2E56D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
+
+namespace
+boost
+    {
+    namespace
+    exception_detail
+        {
+        template <class T>
+        class
+        refcount_ptr
+            {
+            public:
+
+            refcount_ptr():
+                px_(0)
+                {
+                }
+
+            ~refcount_ptr()
+                {
+                release();
+                }
+
+            refcount_ptr( refcount_ptr const & x ):
+                px_(x.px_)
+                {
+                add_ref();
+                }
+
+            refcount_ptr &
+            operator=( refcount_ptr const & x )
+                {
+                adopt(x.px_);
+                return *this;
+                }
+
+            void
+            adopt( T * px )
+                {
+                release();
+                px_=px;
+                add_ref();
+                }
+
+            T *
+            get() const
+                {
+                return px_;
+                }
+
+            private:
+
+            T * px_;
+
+            void
+            add_ref()
+                {
+                if( px_ )
+                    px_->add_ref();
+                }
+
+            void
+            release()
+                {
+                if( px_ && px_->release() )
+                    px_=0;
+                }
+            };
+        }
+
+    ////////////////////////////////////////////////////////////////////////
+
+    template <class Tag,class T>
+    class error_info;
+
+    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<throw_function_,char const *>
+        {
+        public:
+        typedef char const * value_type;
+        value_type v_;
+        explicit
+        error_info( value_type v ):
+            v_(v)
+            {
+            }
+        };
+
+    template <>
+    class
+    error_info<throw_file_,char const *>
+        {
+        public:
+        typedef char const * value_type;
+        value_type v_;
+        explicit
+        error_info( value_type v ):
+            v_(v)
+            {
+            }
+        };
+
+    template <>
+    class
+    error_info<throw_line_,int>
+        {
+        public:
+        typedef int value_type;
+        value_type v_;
+        explicit
+        error_info( value_type v ):
+            v_(v)
+            {
+            }
+        };
+
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
+    class exception;
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
+
+    template <class T>
+    class shared_ptr;
+
+    namespace
+    exception_detail
+        {
+        class error_info_base;
+        struct type_info_;
+
+        struct
+        error_info_container
+            {
+            virtual char const * diagnostic_information( char const * ) const = 0;
+            virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
+            virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
+            virtual void add_ref() const = 0;
+            virtual bool release() const = 0;
+            virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
+
+            protected:
+
+            ~error_info_container() throw()
+                {
+                }
+            };
+
+        template <class>
+        struct get_info;
+
+        template <>
+        struct get_info<throw_function>;
+
+        template <>
+        struct get_info<throw_file>;
+
+        template <>
+        struct get_info<throw_line>;
+
+        char const * get_diagnostic_information( exception const &, char const * );
+
+        void copy_boost_exception( exception *, exception const * );
+
+        template <class E,class Tag,class T>
+        E const & set_info( E const &, error_info<Tag,T> const & );
+
+        template <class E>
+        E const & set_info( E const &, throw_function const & );
+
+        template <class E>
+        E const & set_info( E const &, throw_file const & );
+
+        template <class E>
+        E const & set_info( E const &, throw_line const & );
+        }
+
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
+    class
+    exception
+        {
+        protected:
+
+        exception():
+            throw_function_(0),
+            throw_file_(0),
+            throw_line_(-1)
+            {
+            }
+
+#ifdef __HP_aCC
+        //On HP aCC, this protected copy constructor prevents throwing boost::exception.
+        //On all other platforms, the same effect is achieved by the pure virtual destructor.
+        exception( exception const & x ) throw():
+            data_(x.data_),
+            throw_function_(x.throw_function_),
+            throw_file_(x.throw_file_),
+            throw_line_(x.throw_line_)
+            {
+            }
+#endif
+
+        virtual ~exception() throw()
+#ifndef __HP_aCC
+            = 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
+#endif
+            ;
+
+#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310)
+        public:
+#else
+        private:
+
+        template <class E>
+        friend E const & exception_detail::set_info( E const &, throw_function const & );
+
+        template <class E>
+        friend E const & exception_detail::set_info( E const &, throw_file const & );
+
+        template <class E>
+        friend E const & exception_detail::set_info( E const &, throw_line const & );
+
+        template <class E,class Tag,class T>
+        friend E const & exception_detail::set_info( E const &, error_info<Tag,T> const & );
+
+        friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
+
+        template <class>
+        friend struct exception_detail::get_info;
+        friend struct exception_detail::get_info<throw_function>;
+        friend struct exception_detail::get_info<throw_file>;
+        friend struct exception_detail::get_info<throw_line>;
+        friend void exception_detail::copy_boost_exception( exception *, exception const * );
+#endif
+        mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
+        mutable char const * throw_function_;
+        mutable char const * throw_file_;
+        mutable int throw_line_;
+        };
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
+
+    inline
+    exception::
+    ~exception() throw()
+        {
+        }
+
+    namespace
+    exception_detail
+        {
+        template <class E>
+        E const &
+        set_info( E const & x, throw_function const & y )
+            {
+            x.throw_function_=y.v_;
+            return x;
+            }
+
+        template <class E>
+        E const &
+        set_info( E const & x, throw_file const & y )
+            {
+            x.throw_file_=y.v_;
+            return x;
+            }
+
+        template <class E>
+        E const &
+        set_info( E const & x, throw_line const & y )
+            {
+            x.throw_line_=y.v_;
+            return x;
+            }
+        }
+
+    ////////////////////////////////////////////////////////////////////////
+
+    namespace
+    exception_detail
+        {
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
+        template <class T>
+        struct
+        error_info_injector:
+            public T,
+            public exception
+            {
+            explicit
+            error_info_injector( T const & x ):
+                T(x)
+                {
+                }
+
+            ~error_info_injector() throw()
+                {
+                }
+            };
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
+
+        struct large_size { char c[256]; };
+        large_size dispatch_boost_exception( exception const * );
+
+        struct small_size { };
+        small_size dispatch_boost_exception( void const * );
+
+        template <class,int>
+        struct enable_error_info_helper;
+
+        template <class T>
+        struct
+        enable_error_info_helper<T,sizeof(large_size)>
+            {
+            typedef T type;
+            };
+
+        template <class T>
+        struct
+        enable_error_info_helper<T,sizeof(small_size)>
+            {
+            typedef error_info_injector<T> type;
+            };
+
+        template <class T>
+        struct
+        enable_error_info_return_type
+            {
+            typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception(static_cast<T *>(0)))>::type type;
+            };
+        }
+
+    template <class T>
+    inline
+    typename
+    exception_detail::enable_error_info_return_type<T>::type
+    enable_error_info( T const & x )
+        {
+        typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
+        return rt(x);
+        }
+
+    ////////////////////////////////////////////////////////////////////////
+
+    namespace
+    exception_detail
+        {
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
+        class
+        clone_base
+            {
+            public:
+
+            virtual clone_base const * clone() const = 0;
+            virtual void rethrow() const = 0;
+
+            virtual
+            ~clone_base() throw()
+                {
+                }
+            };
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
+
+        inline
+        void
+        copy_boost_exception( exception * a, exception const * b )
+            {
+            refcount_ptr<error_info_container> data;
+            if( error_info_container * d=b->data_.get() )
+                data = d->clone();
+            a->throw_file_ = b->throw_file_;
+            a->throw_line_ = b->throw_line_;
+            a->throw_function_ = b->throw_function_;
+            a->data_ = data;
+            }
+
+        inline
+        void
+        copy_boost_exception( void *, void const * )
+            {
+            }
+
+        template <class T>
+        class
+        clone_impl:
+            public T,
+            public virtual clone_base
+            {
+            struct clone_tag { };
+            clone_impl( clone_impl const & x, clone_tag ):
+                T(x)
+                {
+                copy_boost_exception(this,&x);
+                }
+
+            public:
+
+            explicit
+            clone_impl( T const & x ):
+                T(x)
+                {
+                copy_boost_exception(this,&x);
+                }
+
+            ~clone_impl() throw()
+                {
+                }
+
+            private:
+
+            clone_base const *
+            clone() const
+                {
+                return new clone_impl(*this,clone_tag());
+                }
+
+            void
+            rethrow() const
+                {
+                throw*this;
+                }
+            };
+        }
+
+    template <class T>
+    inline
+    exception_detail::clone_impl<T>
+    enable_current_exception( T const & x )
+        {
+        return exception_detail::clone_impl<T>(x);
+        }
+    }
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif

File boost_1_51_0/boost/iterator/counting_iterator.hpp

+// Copyright David Abrahams 2003.
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+#ifndef COUNTING_ITERATOR_DWA200348_HPP
+# define COUNTING_ITERATOR_DWA200348_HPP
+
+# include <boost/iterator/iterator_adaptor.hpp>
+# include <boost/detail/numeric_traits.hpp>
+# include <boost/mpl/bool.hpp>
+# include <boost/mpl/if.hpp>
+# include <boost/mpl/identity.hpp>
+# include <boost/mpl/eval_if.hpp>
+
+namespace boost {
+
+template <
+    class Incrementable
+  , class CategoryOrTraversal
+  , class Difference
+>
+class counting_iterator;
+
+namespace detail
+{
+  // Try to detect numeric types at compile time in ways compatible
+  // with the limitations of the compiler and library.
+  template <class T>
+  struct is_numeric_impl
+  {
+      // For a while, this wasn't true, but we rely on it below. This is a regression assert.
+      BOOST_STATIC_ASSERT(::boost::is_integral<char>::value);
+      
+# ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+      
+      BOOST_STATIC_CONSTANT(bool, value = std::numeric_limits<T>::is_specialized);
+      
+# else
+      
+#  if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+      BOOST_STATIC_CONSTANT(
+          bool, value = (
+              boost::is_convertible<int,T>::value
+           && boost::is_convertible<T,int>::value
+      ));
+#  else
+    BOOST_STATIC_CONSTANT(bool, value = ::boost::is_arithmetic<T>::value);
+#  endif
+      
+# endif
+  };
+
+  template <class T>
+  struct is_numeric
+    : mpl::bool_<(::boost::detail::is_numeric_impl<T>::value)>
+  {};
+
+#  if defined(BOOST_HAS_LONG_LONG)
+  template <>
+  struct is_numeric< ::boost::long_long_type>
+    : mpl::true_ {};
+  
+  template <>
+  struct is_numeric< ::boost::ulong_long_type>
+    : mpl::true_ {};
+#  endif
+
+  // Some compilers fail to have a numeric_limits specialization
+  template <>
+  struct is_numeric<wchar_t>
+    : mpl::true_ {};
+  
+  template <class T>
+  struct numeric_difference
+  {
+      typedef typename boost::detail::numeric_traits<T>::difference_type type;
+  };
+
+  BOOST_STATIC_ASSERT(is_numeric<int>::value);
+  
+  template <class Incrementable, class CategoryOrTraversal, class Difference>
+  struct counting_iterator_base
+  {
+      typedef typename detail::ia_dflt_help<
+          CategoryOrTraversal
+        , mpl::eval_if<
+              is_numeric<Incrementable>
+            , mpl::identity<random_access_traversal_tag>
+            , iterator_traversal<Incrementable>
+          >
+      >::type traversal;
+      
+      typedef typename detail::ia_dflt_help<
+          Difference
+        , mpl::eval_if<
+              is_numeric<Incrementable>
+            , numeric_difference<Incrementable>
+            , iterator_difference<Incrementable>
+          >
+      >::type difference;
+      
+      typedef iterator_adaptor<
+          counting_iterator<Incrementable, CategoryOrTraversal, Difference> // self
+        , Incrementable                                           // Base
+        , Incrementable                                           // Value
+# ifndef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+          const  // MSVC won't strip this.  Instead we enable Thomas'
+                 // criterion (see boost/iterator/detail/facade_iterator_category.hpp)
+# endif 
+        , traversal
+        , Incrementable const&                                    // reference
+        , difference
+      > type;
+  };
+
+  // Template class distance_policy_select -- choose a policy for computing the
+  // distance between counting_iterators at compile-time based on whether or not
+  // the iterator wraps an integer or an iterator, using "poor man's partial
+  // specialization".
+
+  template <bool is_integer> struct distance_policy_select;
+
+  // A policy for wrapped iterators
+  template <class Difference, class Incrementable1, class Incrementable2>
+  struct iterator_distance
+  {
+      static Difference distance(Incrementable1 x, Incrementable2 y)
+      {
+          return y - x;
+      }
+  };
+
+  // A policy for wrapped numbers
+  template <class Difference, class Incrementable1, class Incrementable2>
+  struct number_distance
+  {
+      static Difference distance(Incrementable1 x, Incrementable2 y)
+      {
+          return numeric_distance(x, y);
+      }
+  };
+}
+
+template <
+    class Incrementable
+  , class CategoryOrTraversal = use_default
+  , class Difference = use_default
+>
+class counting_iterator
+  : public detail::counting_iterator_base<
+        Incrementable, CategoryOrTraversal, Difference
+    >::type
+{
+    typedef typename detail::counting_iterator_base<
+        Incrementable, CategoryOrTraversal, Difference
+    >::type super_t;
+    
+    friend class iterator_core_access;
+
+ public:
+    typedef typename super_t::difference_type difference_type;
+
+    counting_iterator() { }
+    
+    counting_iterator(counting_iterator const& rhs) : super_t(rhs.base()) {}
+
+    counting_iterator(Incrementable x)
+      : super_t(x)
+    {
+    }
+
+# if 0
+    template<class OtherIncrementable>
+    counting_iterator(
+        counting_iterator<OtherIncrementable, CategoryOrTraversal, Difference> const& t
+      , typename enable_if_convertible<OtherIncrementable, Incrementable>::type* = 0
+    )
+      : super_t(t.base())
+    {}
+# endif 
+
+ private:
+    
+    typename super_t::reference dereference() const
+    {
+        return this->base_reference();
+    }
+
+    template <class OtherIncrementable>
+    difference_type
+    distance_to(counting_iterator<OtherIncrementable, CategoryOrTraversal, Difference> const& y) const
+    {
+      typedef typename mpl::if_<
+          detail::is_numeric<Incrementable>
+        , detail::number_distance<difference_type, Incrementable, OtherIncrementable>
+        , detail::iterator_distance<difference_type, Incrementable, OtherIncrementable>
+      >::type d;
+
+      return d::distance(this->base(), y.base());
+    }
+};
+
+// Manufacture a counting iterator for an arbitrary incrementable type
+template <class Incrementable>
+inline counting_iterator<Incrementable>
+make_counting_iterator(Incrementable x)
+{
+  typedef counting_iterator<Incrementable> result_t;
+  return result_t(x);
+}
+
+
+} // namespace boost::iterator
+
+#endif // COUNTING_ITERATOR_DWA200348_HPP

File boost_1_51_0/boost/range/adaptor/tokenized.hpp

-// Boost.Range library
-//
-//  Copyright Thorsten Ottosen, Neil Groves 2006. Use, modification and
-//  distribution is subject to the Boost Software License, Version
-//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
-//  http://www.boost.org/LICENSE_1_0.txt)
-//
-// For more information, see http://www.boost.org/libs/range/
-//
-
-#ifndef BOOST_RANGE_ADAPTOR_TOKENIZED_HPP
-#define BOOST_RANGE_ADAPTOR_TOKENIZED_HPP
-
-#include <boost/regex.hpp>
-#include <boost/range/iterator_range.hpp>
-
-namespace boost
-{
-    namespace range_detail
-    {
-
-        template< class R >
-        struct tokenized_range : 
-            public boost::iterator_range< 
-                      boost::regex_token_iterator< 
-                          BOOST_DEDUCED_TYPENAME range_iterator<R>::type 
-                                              >
-                                         >
-        {
-        private:
-            typedef           
-                boost::regex_token_iterator< 
-                          BOOST_DEDUCED_TYPENAME range_iterator<R>::type 
-                                            >
-                regex_iter;
-            
-            typedef BOOST_DEDUCED_TYPENAME regex_iter::regex_type 
-                regex_type;
-        
-            typedef boost::iterator_range<regex_iter> 
-                base;
-
-        public:
-            template< class Regex, class Submatch, class Flag >
-            tokenized_range( R& r, const Regex& re, const Submatch& sub, Flag f )
-              : base( regex_iter( boost::begin(r), boost::end(r), 
-                                  regex_type(re), sub, f ),
-                      regex_iter() )
-            { }
-        };
-
-        template< class T, class U, class V >
-        struct regex_holder
-        {
-            const T&  re;
-            const U&  sub;
-            V         f;
-
-            regex_holder( const T& rex, const U& subm, V flag ) :
-                re(rex), sub(subm), f(flag)
-            { }
-        private:
-            // Not assignable
-            void operator=(const regex_holder&);
-        };
-
-        struct regex_forwarder
-        {           
-            template< class Regex >
-            regex_holder<Regex,int,regex_constants::match_flag_type>
-            operator()( const Regex& re, 
-                        int submatch = 0,    
-                        regex_constants::match_flag_type f = 
-                            regex_constants::match_default ) const
-            {
-                return regex_holder<Regex,int,
-                           regex_constants::match_flag_type>( re, submatch, f );
-            }
-             
-            template< class Regex, class Submatch >
-            regex_holder<Regex,Submatch,regex_constants::match_flag_type> 
-            operator()( const Regex& re, 
-                        const Submatch& sub, 
-                        regex_constants::match_flag_type f = 
-                            regex_constants::match_default ) const
-            {
-                return regex_holder<Regex,Submatch,
-                           regex_constants::match_flag_type>( re, sub, f ); 
-            }
-        };
-        
-        template< class BidirectionalRng, class R, class S, class F >
-        inline tokenized_range<BidirectionalRng> 
-        operator|( BidirectionalRng& r, 
-                   const regex_holder<R,S,F>& f )
-        {
-            return tokenized_range<BidirectionalRng>( r, f.re, f.sub, f.f );   
-        }
-
-        template< class BidirectionalRng, class R, class S, class F  >
-        inline tokenized_range<const BidirectionalRng> 
-        operator|( const BidirectionalRng& r, 
-                   const regex_holder<R,S,F>& f )
-        {
-            return tokenized_range<const BidirectionalRng>( r, f.re, f.sub, f.f );
-        }
-        
-    } // 'range_detail'
-
-    using range_detail::tokenized_range;
-
-    namespace adaptors
-    { 
-        namespace
-        {
-            const range_detail::regex_forwarder tokenized = 
-                    range_detail::regex_forwarder();
-        }
-        
-        template<class BidirectionalRange, class Regex, class Submatch, class Flag>
-        inline tokenized_range<BidirectionalRange>
-        tokenize(BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f)
-        {
-            return tokenized_range<BidirectionalRange>(rng, reg, sub, f);
-        }
-        
-        template<class BidirectionalRange, class Regex, class Submatch, class Flag>
-        inline tokenized_range<const BidirectionalRange>
-        tokenize(const BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f)
-        {
-            return tokenized_range<const BidirectionalRange>(rng, reg, sub, f);
-        }
-    } // 'adaptors'
-    
-}
-
-#endif

File boost_1_51_0/boost/range/adaptors.hpp

 #include <boost/range/adaptor/reversed.hpp>
 #include <boost/range/adaptor/sliced.hpp>
 #include <boost/range/adaptor/strided.hpp>
-#include <boost/range/adaptor/tokenized.hpp>
+//#include <boost/range/adaptor/tokenized.hpp>
 #include <boost/range/adaptor/transformed.hpp>
 #include <boost/range/adaptor/uniqued.hpp>
 

File boost_1_51_0/boost/range/any_range.hpp

+//  Copyright Neil Groves 2010. Use, modification and
+//  distribution is subject to the Boost Software License, Version
+//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_ANY_RANGE_HPP_INCLUDED
+#define BOOST_RANGE_ANY_RANGE_HPP_INCLUDED
+
+#include <boost/config.hpp>
+#include <boost/iterator/iterator_categories.hpp>
+#include <boost/iterator/iterator_traits.hpp>
+#include <boost/iterator/iterator_facade.hpp>
+#include <boost/iterator/iterator_adaptor.hpp>
+#include <boost/range/detail/any_iterator.hpp>
+#include <boost/range/concepts.hpp>
+#include <boost/range/reference.hpp>
+#include <boost/range/value_type.hpp>
+#include <boost/range/iterator_range_core.hpp>
+#include <boost/cast.hpp>
+
+namespace boost
+{
+    namespace range_detail
+    {
+        // If T is use_default, return the result of Default, otherwise
+        // return T.
+        //
+        // This is an implementation artifact used to pick intelligent default
+        // values when the user specified boost::use_default as a template
+        // parameter.
+        template<
+            class T,
+            class Default
+        >
+        struct any_range_default_help
+            : mpl::eval_if<
+                is_same<T, use_default>
+              , Default
+              , mpl::identity<T>
+            >
+        {
+        };
+
+        template<
+            class WrappedRange
+          , class Value
+          , class Reference
+        >
+        struct any_range_value_type
+        {
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+            typedef typename any_range_default_help<
+                    Value
+                  , mpl::eval_if<
+                        is_same<Reference, use_default>
+                      , range_value<
+                            typename remove_const<WrappedRange>
+                        ::type>
+                      , remove_reference<Reference>
+                    >
+                >::type type;
+# else
+            typedef typename any_range_default_help<
+                Value
+              , range_value<
+                    typename remove_const<WrappedRange>
+                ::type>
+            >::type type;
+# endif
+        };
+
+        template<
+            class Value
+          , class Traversal
+          , class Reference
+          , class Difference
+          , class Buffer = use_default
+        >
+        class any_range
+            : public iterator_range<
+                        any_iterator<
+                            Value
+                          , Traversal
+                          , Reference
+                          , Difference
+                          , typename any_range_default_help<
+                                Buffer
+                              , mpl::identity<any_iterator_default_buffer>
+                            >::type
+                        >
+                    >
+        {
+            typedef iterator_range<
+                        any_iterator<
+                            Value
+                          , Traversal
+                          , Reference
+                          , Difference
+                          , typename any_range_default_help<
+                                Buffer
+                              , mpl::identity<any_iterator_default_buffer>
+                            >::type
+                        >
+                    > base_type;
+
+            struct enabler {};
+            struct disabler {};
+        public:
+            any_range()
+            {
+            }
+
+            any_range(const any_range& other)
+                : base_type(other)
+            {
+            }
+
+            template<class WrappedRange>
+            any_range(WrappedRange& wrapped_range)
+            : base_type(boost::begin(wrapped_range),
+                        boost::end(wrapped_range))
+            {
+            }
+
+            template<class WrappedRange>
+            any_range(const WrappedRange& wrapped_range)
+            : base_type(boost::begin(wrapped_range),
+                        boost::end(wrapped_range))
+            {
+            }
+
+            template<
+                class OtherValue
+              , class OtherTraversal
+              , class OtherReference
+              , class OtherDifference
+            >
+            any_range(const any_range<
+                                OtherValue
+                              , OtherTraversal
+                              , OtherReference
+                              , OtherDifference
+                              , Buffer
+                            >& other)
+            : base_type(boost::begin(other), boost::end(other))
+            {
+            }
+
+            template<class Iterator>
+            any_range(Iterator first, Iterator last)
+                : base_type(first, last)
+            {
+            }
+        };
+
+        template<
+            class WrappedRange
+          , class Value = use_default
+          , class Traversal = use_default
+          , class Reference = use_default
+          , class Difference = use_default
+          , class Buffer = use_default
+        >
+        struct any_range_type_generator
+        {
+            BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<WrappedRange> ));
+            typedef any_range<
+                typename any_range_value_type<
+                    WrappedRange
+                  , Value
+                  , typename any_range_default_help<
+                        Reference
+                      , range_reference<WrappedRange>
+                    >::type
+                >::type
+              , typename any_range_default_help<
+                            Traversal
+                          , iterator_traversal<
+                                typename range_iterator<WrappedRange>::type
+                            >
+                        >::type
+              , typename any_range_default_help<
+                    Reference
+                  , range_reference<WrappedRange>
+                >::type
+              , typename any_range_default_help<
+                    Difference
+                  , range_difference<WrappedRange>
+                >::type
+              , typename any_range_default_help<
+                    Buffer
+                  , mpl::identity<any_iterator_default_buffer>
+                >::type
+            > type;
+        };
+    } // namespace range_detail
+
+    using range_detail::any_range;
+    using range_detail::any_range_type_generator;
+} // namespace boost
+
+#endif // include guard

File boost_1_51_0/boost/range/counting_range.hpp

+//  Copyright Neil Groves 2010. Use, modification and
+//  distribution is subject to the Boost Software License, Version
+//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_COUNTING_RANGE_HPP_INCLUDED
+#define BOOST_RANGE_COUNTING_RANGE_HPP_INCLUDED
+
+#include <boost/config.hpp>
+#if BOOST_MSVC >= 1400
+#pragma warning(push)
+#pragma warning(disable : 4244)
+#endif
+
+#include <boost/range/iterator_range_core.hpp>
+#include <boost/range/value_type.hpp>
+#include <boost/iterator/counting_iterator.hpp>
+
+namespace boost
+{
+
+    template<class Value>
+    inline iterator_range<counting_iterator<Value> >
+    counting_range(Value first, Value last)
+    {
+        typedef counting_iterator<Value> counting_iterator_t;
+        typedef iterator_range<counting_iterator_t> result_t;
+        return result_t(counting_iterator_t(first),
+                        counting_iterator_t(last));
+    }
+
+    template<class Range>
+    inline iterator_range<counting_iterator<BOOST_DEDUCED_TYPENAME range_value<const Range>::type> >
+    counting_range(const Range& rng)
+    {
+        typedef counting_iterator<BOOST_DEDUCED_TYPENAME range_value<const Range>::type> counting_iterator_t;
+        typedef iterator_range<counting_iterator_t> result_t;
+        return boost::empty(rng)
+            ? result_t()
+            : result_t(
+                counting_iterator_t(*boost::begin(rng)),
+                counting_iterator_t(*boost::prior(boost::end(rng))));
+    }
+
+    template<class Range>
+    inline iterator_range<counting_iterator<BOOST_DEDUCED_TYPENAME range_value<Range>::type> >
+    counting_range(Range& rng)
+    {
+        typedef counting_iterator<BOOST_DEDUCED_TYPENAME range_value<Range>::type> counting_iterator_t;
+        typedef iterator_range<counting_iterator_t> result_t;
+        return boost::empty(rng)
+            ? result_t()
+            : result_t(
+                counting_iterator_t(*boost::begin(rng)),
+                counting_iterator_t(*boost::prior(boost::end(rng))));
+    }
+} // namespace boost
+
+#if BOOST_MSVC >= 1400
+#pragma warning(pop)
+#endif
+
+#endif // include guard

File boost_1_51_0/boost/range/detail/any_iterator.hpp

+// Boost.Range library
+//
+//  Copyright Neil Groves 2010. Use, modification and
+//  distribution is subject to the Boost Software License, Version
+//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
+#define BOOST_RANGE_DETAIL_ANY_ITERATOR_HPP_INCLUDED
+
+#include <boost/cast.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/or.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/range/detail/any_iterator_buffer.hpp>
+#include <boost/range/detail/any_iterator_interface.hpp>
+#include <boost/range/detail/any_iterator_wrapper.hpp>
+
+namespace boost
+{
+    namespace range_detail
+    {
+        // metafunction to determine if T is a const reference
+        template<class T>
+        struct is_const_reference
+        {
+            typedef typename mpl::and_<
+                typename is_reference<T>::type,
+                typename is_const<
+                    typename remove_reference<T>::type
+                >::type
+            >::type type;
+        };
+
+        // metafunction to determine if T is a mutable reference
+        template<class T>
+        struct is_mutable_reference
+        {
+            typedef typename mpl::and_<
+                typename is_reference<T>::type,
+                typename mpl::not_<
+                    typename is_const<
+                        typename remove_reference<T>::type
+                    >::type
+                >::type
+            >::type type;
+        };
+
+        // metafunction to evaluate if a source 'reference' can be
+        // converted to a target 'reference' as a value.
+        //
+        // This is true, when the target reference type is actually
+        // not a reference, and the source reference is convertible
+        // to the target type.
+        template<class SourceReference, class TargetReference>
+        struct is_convertible_to_value_as_reference
+        {
+            typedef typename mpl::and_<
+                typename mpl::not_<
+                    typename is_reference<TargetReference>::type
+                >::type
+              , typename is_convertible<
+                    SourceReference
+                  , TargetReference
+                >::type
+            >::type type;
+        };
+
+        template<
+            class Value
+          , class Traversal
+          , class Reference
+          , class Difference
+          , class Buffer = any_iterator_default_buffer
+        >
+        class any_iterator;
+
+        // metafunction to determine if SomeIterator is an
+        // any_iterator.
+        //
+        // This is the general implementation which evaluates to false.
+        template<class SomeIterator>
+        struct is_any_iterator
+            : mpl::bool_<false>
+        {
+        };
+
+        // specialization of is_any_iterator to return true for
+        // any_iterator classes regardless of template parameters.
+        template<
+            class Value
+          , class Traversal
+          , class Reference
+          , class Difference
+          , class Buffer
+        >
+        struct is_any_iterator<
+            any_iterator<
+                Value
+              , Traversal
+              , Reference
+              , Difference
+              , Buffer
+            >
+        >
+            : mpl::bool_<true>
+        {
+        };
+    } // namespace range_detail
+
+    namespace detail
+    {
+        // Rationale:
+        // These are specialized since the iterator_facade versions lack
+        // the requisite typedefs to allow wrapping to determine the types
+        // if a user copy constructs from a postfix increment.
+
+        template<
+            class Value
+          , class Traversal
+          , class Reference
+          , class Difference
+          , class Buffer
+        >
+        class postfix_increment_proxy<
+                    range_detail::any_iterator<
+                        Value
+                      , Traversal
+                      , Reference
+                      , Difference
+                      , Buffer
+                    >
+                >
+        {
+            typedef range_detail::any_iterator<
+                Value
+              , Traversal
+              , Reference
+              , Difference
+              , Buffer
+            > any_iterator_type;
+
+        public:
+            typedef Value value_type;
+            typedef typename std::iterator_traits<any_iterator_type>::iterator_category iterator_category;
+            typedef Difference difference_type;
+            typedef typename iterator_pointer<any_iterator_type>::type pointer;
+            typedef Reference reference;
+
+            explicit postfix_increment_proxy(any_iterator_type const& x)
+                : stored_value(*x)
+            {}
+
+            value_type&
+            operator*() const
+            {
+                return this->stored_value;
+            }
+        private:
+            mutable value_type stored_value;
+        };
+
+        template<
+            class Value
+          , class Traversal
+          , class Reference
+          , class Difference
+          , class Buffer
+        >
+        class writable_postfix_increment_proxy<
+                    range_detail::any_iterator<
+                        Value
+                      , Traversal
+                      , Reference
+                      , Difference
+                      , Buffer
+                    >
+                >
+        {
+            typedef range_detail::any_iterator<
+                        Value
+                      , Traversal
+                      , Reference
+                      , Difference
+                      , Buffer
+                    > any_iterator_type;
+         public:
+            typedef Value value_type;
+            typedef typename std::iterator_traits<any_iterator_type>::iterator_category iterator_category;
+            typedef Difference difference_type;
+            typedef typename iterator_pointer<any_iterator_type>::type pointer;
+            typedef Reference reference;
+
+            explicit writable_postfix_increment_proxy(any_iterator_type const& x)
+              : stored_value(*x)
+              , stored_iterator(x)
+            {}
+
+            // Dereferencing must return a proxy so that both *r++ = o and
+            // value_type(*r++) can work.  In this case, *r is the same as
+            // *r++, and the conversion operator below is used to ensure
+            // readability.
+            writable_postfix_increment_proxy const&
+            operator*() const
+            {
+                return *this;
+            }
+
+            // Provides readability of *r++
+            operator value_type&() const
+            {
+                return stored_value;
+            }
+
+            // Provides writability of *r++
+            template <class T>
+            T const& operator=(T const& x) const
+            {
+                *this->stored_iterator = x;
+                return x;
+            }
+
+            // This overload just in case only non-const objects are writable
+            template <class T>
+            T& operator=(T& x) const
+            {
+                *this->stored_iterator = x;
+                return x;
+            }
+
+            // Provides X(r++)
+            operator any_iterator_type const&() const
+            {
+                return stored_iterator;
+            }
+
+         private:
+            mutable value_type stored_value;
+            any_iterator_type stored_iterator;
+        };
+
+
+    }
+
+    namespace range_detail
+    {
+        template<
+            class Value
+          , class Traversal
+          , class Reference
+          , class Difference
+          , class Buffer
+        >
+        class any_iterator
+            : public iterator_facade<
+                        any_iterator<
+                            Value
+                          , Traversal
+                          , Reference
+                          , Difference
+                          , Buffer
+                        >
+                    , Value
+                    , Traversal
+                    , Reference
+                    , Difference
+                >
+        {
+            template<
+                class OtherValue
+              , class OtherTraversal
+              , class OtherReference
+              , class OtherDifference
+              , class OtherBuffer
+            >
+            friend class any_iterator;
+
+            struct enabler {};
+            struct disabler {};
+
+            typedef typename any_iterator_interface_type_generator<
+                Traversal
+              , Reference
+              , Difference
+              , Buffer
+            >::type abstract_base_type;
+
+            typedef iterator_facade<
+                        any_iterator<
+                            Value
+                          , Traversal
+                          , Reference
+                          , Difference
+                          , Buffer
+                        >
+                      , Value
+                      , Traversal
+                      , Reference
+                      , Difference
+                  > base_type;
+
+            typedef Buffer buffer_type;
+
+        public:
+            typedef typename base_type::value_type value_type;
+            typedef typename base_type::reference reference;
+            typedef typename base_type::difference_type difference_type;
+
+            // Default constructor
+            any_iterator()
+                : m_impl(0) {}
+
+            // Simple copy construction without conversion
+            any_iterator(const any_iterator& other)
+                : base_type(other)
+                , m_impl(other.m_impl
+                            ? other.m_impl->clone(m_buffer)
+                            : 0)
+            {
+            }
+
+            // Simple assignment operator without conversion
+            any_iterator& operator=(const any_iterator& other)
+            {
+                if (this != &other)
+                {
+                    if (m_impl)
+                        m_impl->~abstract_base_type();
+                    m_buffer.deallocate();
+                    m_impl = 0;
+                    if (other.m_impl)
+                        m_impl = other.m_impl->clone(m_buffer);
+                }
+                return *this;
+            }
+
+            // Implicit conversion from another any_iterator where the
+            // conversion is from a non-const reference to a const reference
+            template<
+                class OtherValue
+              , class OtherTraversal
+              , class OtherReference
+              , class OtherDifference
+            >
+            any_iterator(const any_iterator<
+                                OtherValue,
+                                OtherTraversal,
+                                OtherReference,
+                                OtherDifference,
+                                Buffer
+                            >& other,
+                         typename enable_if<
+                            typename mpl::and_<
+                                typename is_mutable_reference<OtherReference>::type,
+                                typename is_const_reference<Reference>::type
+                            >::type,
+                            enabler
+                        >::type* = 0
+                    )
+                : m_impl(other.m_impl
+                            ? other.m_impl->clone_const_ref(m_buffer)
+                         : 0
+                        )
+            {
+            }
+
+            // Implicit conversion from another any_iterator where the
+            // reference types of the source and the target are references
+            // that are either both const, or both non-const.
+            template<
+                class OtherValue
+              , class OtherTraversal
+              , class OtherReference
+              , class OtherDifference
+            >
+            any_iterator(const any_iterator<
+                                OtherValue
+                              , OtherTraversal
+                              , OtherReference
+                              , OtherDifference
+                              , Buffer
+                            >& other,
+                         typename enable_if<
+                            typename mpl::or_<
+                                typename mpl::and_<
+                                    typename is_mutable_reference<OtherReference>::type,
+                                    typename is_mutable_reference<Reference>::type
+                                >::type,
+                                typename mpl::and_<
+                                    typename is_const_reference<OtherReference>::type,
+                                    typename is_const_reference<Reference>::type
+                                >::type
+                            >::type,
+                            enabler
+                        >::type* = 0
+                        )
+                : m_impl(other.m_impl
+                            ? other.m_impl->clone(m_buffer)
+                         : 0
+                        )
+            {
+            }
+
+            // Implicit conversion to an any_iterator that uses a value for
+            // the reference type.
+            template<
+                class OtherValue
+              , class OtherTraversal
+              , class OtherReference
+              , class OtherDifference
+            >
+            any_iterator(const any_iterator<
+                                OtherValue
+                              , OtherTraversal
+                              , OtherReference
+                              , OtherDifference
+                              , Buffer
+                            >& other,
+                        typename enable_if<
+                            typename is_convertible_to_value_as_reference<
+                                        OtherReference
+                                      , Reference
+                                    >::type,
+                            enabler
+                        >::type* = 0
+                        )
+                : m_impl(other.m_impl
+                            ? other.m_impl->clone_reference_as_value(m_buffer)
+                            : 0
+                            )
+            {
+            }
+
+            any_iterator clone() const
+            {
+                any_iterator result;
+                if (m_impl)
+                    result.m_impl = m_impl->clone(result.m_buffer);
+                return result;
+            }
+
+            any_iterator<
+                Value
+              , Traversal
+              , typename abstract_base_type::const_reference
+              , Difference
+              , Buffer
+            >
+            clone_const_ref() const
+            {
+                typedef any_iterator<
+                    Value
+                  , Traversal
+                  , typename abstract_base_type::const_reference
+                  , Difference
+                  , Buffer
+                > result_type;
+
+                result_type result;
+
+                if (m_impl)
+                    result.m_impl = m_impl->clone_const_ref(result.m_buffer);
+
+                return result;
+            }
+
+            // implicit conversion and construction from type-erasure-compatible
+            // iterators
+            template<class WrappedIterator>
+            explicit any_iterator(
+                const WrappedIterator& wrapped_iterator,
+                typename disable_if<
+                    typename is_any_iterator<WrappedIterator>::type
+                  , disabler
+                >::type* = 0
+                )
+            {