]> git.lyx.org Git - features.git/commitdiff
update to boost 1.34
authorPeter Kümmel <syntheticpp@gmx.net>
Fri, 25 May 2007 15:15:20 +0000 (15:15 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Fri, 25 May 2007 15:15:20 +0000 (15:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18510 a592a061-630c-0410-9148-cb99ea01b6c8

boost/boost/iostreams/detail/streambuf/indirect_streambuf.hpp
boost/boost/mpl/aux_/lambda_spec.hpp
boost/boost/none.hpp [new file with mode: 0755]
boost/boost/none_t.hpp [deleted file]
boost/boost/optional/optional.hpp
boost/boost/preprocessor/config/config.hpp
boost/boost/regex/v4/cpp_regex_traits.hpp
boost/boost/regex/v4/regex_traits.hpp
boost/boost/spirit/utility/loops.hpp
boost/boost/type_traits/is_convertible.hpp

index f2b866a233443bc82f6953024836bee64d3d1c39..1514fa3a26eee3b7a26a4035001f2749b840a40b 100644 (file)
@@ -58,7 +58,7 @@ public:
     indirect_streambuf();
 
     void open(const T& t BOOST_IOSTREAMS_PUSH_PARAMS());
-    bool is_open();
+    bool is_open() const;
     void close();
     bool auto_close() const;
     void set_auto_close(bool close);
@@ -189,7 +189,7 @@ void indirect_streambuf<T, Tr, Alloc, Mode>::open
 }
 
 template<typename T, typename Tr, typename Alloc, typename Mode>
-inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open()
+inline bool indirect_streambuf<T, Tr, Alloc, Mode>::is_open() const
 { return (flags_ & f_open) != 0; }
 
 template<typename T, typename Tr, typename Alloc, typename Mode>
index fe53da324d5f17ec453fce945280809ff5c3da27..acbefafcf5322c424c433bc3414d0ca091309e2d 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef BOOST_MPL_AUX_LAMBDA_SPEC_HPP_INCLUDED
 #define BOOST_MPL_AUX_LAMBDA_SPEC_HPP_INCLUDED
 
-// Copyright Aleksey Gurtovoy 2001-2004
+// Copyright Aleksey Gurtovoy 2001-2007
 //
 // Distributed under the Boost Software License, Version 1.0. 
 // (See accompanying file LICENSE_1_0.txt or copy at 
@@ -11,8 +11,8 @@
 // See http://www.boost.org/libs/mpl for documentation.
 
 // $Source: /cvsroot/boost/boost/boost/mpl/aux_/lambda_spec.hpp,v $
-// $Date: 2004/09/02 15:40:43 $
-// $Revision: 1.8 $
+// $Date: 2007/01/29 07:28:45 $
+// $Revision: 1.8.14.1 $
 
 #include <boost/mpl/void.hpp>
 #include <boost/mpl/lambda_fwd.hpp>
@@ -35,7 +35,8 @@ struct lambda< \
     > \
 { \
     typedef false_ is_le; \
-    typedef name< BOOST_MPL_PP_PARAMS(i, T) > type; \
+    typedef name< BOOST_MPL_PP_PARAMS(i, T) > result_; \
+    typedef result_ type; \
 }; \
 /**/
 
diff --git a/boost/boost/none.hpp b/boost/boost/none.hpp
new file mode 100755 (executable)
index 0000000..0f5e31c
--- /dev/null
@@ -0,0 +1,43 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.\r
+// Copyright (C) 2007, Anthony Williams\r
+// Copyright (C) 2007, Steven Watanabe, Richard Smith\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/lib/optional/ for documentation.\r
+//\r
+// You are welcome to contact the author at:\r
+// fernando.cacciola@gmail.com\r
+//\r
+#ifndef BOOST_NONE_17SEP2003_HPP\r
+#define BOOST_NONE_17SEP2003_HPP\r
+\r
+namespace boost\r
+{\r
+  namespace detail\r
+  {\r
+    class none_helper;\r
+  }\r
+\r
+  inline void none(detail::none_helper);\r
+\r
+  namespace detail\r
+  {\r
+    class none_helper\r
+    {\r
+    private:\r
+      \r
+      none_helper( none_helper const& ) {}\r
+      \r
+      friend void boost::none(none_helper);\r
+    };\r
+  }\r
+\r
+  typedef void (*none_t)(detail::none_helper);\r
+\r
+  inline void none(detail::none_helper) {}\r
+}\r
+\r
+#endif\r
diff --git a/boost/boost/none_t.hpp b/boost/boost/none_t.hpp
deleted file mode 100644 (file)
index 4b97e20..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
-//
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/lib/optional for documentation.
-//
-// You are welcome to contact the author at:
-//  fernando_cacciola@hotmail.com
-//
-#ifndef BOOST_NONE_T_17SEP2003_HPP
-#define BOOST_NONE_T_17SEP2003_HPP
-
-namespace boost {
-
-namespace detail { struct none_helper{}; }
-
-typedef int detail::none_helper::*none_t ;
-
-} // namespace boost
-
-#endif
-
index 4421f4aa63ea86f792e1477cf5239dad9bd760fc..42277ba61e5fd462cd18e55ae772c2e03215655c 100644 (file)
@@ -26,7 +26,7 @@
 #include "boost/mpl/bool.hpp"
 #include "boost/mpl/not.hpp"
 #include "boost/detail/reference_content.hpp"
-#include "boost/none_t.hpp"
+#include "boost/none.hpp"
 #include "boost/utility/compare_pointees.hpp"
 
 #include "boost/optional/optional_fwd.hpp"
 #define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
 #endif
 
+// Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<>
+// member template of a factory as used in the optional<> implementation.
+// He proposed this simple fix which is to move the call to apply<> outside
+// namespace boost.
+namespace boost_optional_detail
+{
+  template <class T, class Factory>
+  void construct(Factory const& factory, void* address)
+  {
+    factory.BOOST_NESTED_TEMPLATE apply<T>(address);
+  }
+}
+
 
 namespace boost {
 
@@ -173,7 +186,7 @@ class optional_base : public optional_tag
 
     // Creates an optional<T> uninitialized.
     // No-throw
-    optional_base ( none_t const& )
+    optional_base ( none_t )
       :
       m_initialized(false) {}
 
@@ -185,6 +198,16 @@ class optional_base : public optional_tag
     {
       construct(val);
     }
+    
+    // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialzed optional<T>.
+    // Can throw if T::T(T const&) does
+    optional_base ( bool cond, argument_type val )
+      :
+      m_initialized(false)
+    {
+      if ( cond )
+        construct(val);
+    }
 
     // Creates a deep copy of another optional<T>
     // Can throw if T::T(T const&) does
@@ -256,7 +279,7 @@ class optional_base : public optional_tag
 
     // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED
     // No-throw (assuming T::~T() doesn't)
-    void assign ( none_t const& ) { destroy(); }
+    void assign ( none_t ) { destroy(); }
 
 #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
     template<class Expr>
@@ -299,7 +322,7 @@ class optional_base : public optional_tag
     void construct ( Expr const& factory, in_place_factory_base const* )
      {
        BOOST_STATIC_ASSERT ( ::boost::mpl::not_<is_reference_predicate>::value ) ;
-       factory.BOOST_NESTED_TEMPLATE apply<value_type>(m_storage.address()) ;
+       boost_optional_detail::construct<value_type>(factory, m_storage.address());
        m_initialized = true ;
      }
 
@@ -418,6 +441,8 @@ class optional_base : public optional_tag
     // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.
     pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; }
     pointer_type       cast_ptr( internal_type *      p, is_not_reference_tag )       { return p ; }
+    pointer_const_type cast_ptr( internal_type const* p, is_reference_tag     ) const { return &p->get() ; }
+    pointer_type       cast_ptr( internal_type *      p, is_reference_tag     )       { return &p->get() ; }
 
     bool m_initialized ;
     storage_type m_storage ;
@@ -449,12 +474,15 @@ class optional : public optional_detail::optional_base<T>
 
     // Creates an optional<T> uninitialized.
     // No-throw
-    optional( none_t const& none_ ) : base(none_) {}
+    optional( none_t none_ ) : base(none_) {}
 
     // Creates an optional<T> initialized with 'val'.
     // Can throw if T::T(T const&) does
     optional ( argument_type val ) : base(val) {}
 
+    // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional.
+    // Can throw if T::T(T const&) does
+    optional ( bool cond, argument_type val ) : base(cond,val) {}
 
 #ifndef BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
     // NOTE: MSVC needs templated versions first
@@ -537,7 +565,7 @@ class optional : public optional_detail::optional_base<T>
     // Assigns from a "none"
     // Which destroys the current value, if any, leaving this UNINITIALIZED
     // No-throw (assuming T::~T() doesn't)
-    optional& operator= ( none_t const& none_ )
+    optional& operator= ( none_t none_ )
       {
         this->assign( none_ ) ;
         return *this ;
@@ -549,6 +577,10 @@ class optional : public optional_detail::optional_base<T>
     reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
     reference_type       get()       { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
 
+    // Returns a copy of the value if this is initialized, 'v' otherwise
+    reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; }
+    reference_type       get_value_or ( reference_type       v )       { return this->is_initialized() ? get() : v ; }
+    
     // Returns a pointer to the value if this is initialized, otherwise,
     // the behaviour is UNDEFINED
     // No-throw
@@ -570,6 +602,22 @@ class optional : public optional_detail::optional_base<T>
        bool operator!() const { return !this->is_initialized() ; }
 } ;
 
+// Returns optional<T>(v)
+template<class T> 
+inline 
+optional<T> make_optional ( T const& v  )
+{
+  return optional<T>(v);
+}
+
+// Returns optional<T>(cond,v)
+template<class T> 
+inline 
+optional<T> make_optional ( bool cond, T const& v )
+{
+  return optional<T>(cond,v);
+}
+
 // Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
 // No-throw
 template<class T>
@@ -606,6 +654,24 @@ get ( optional<T>* opt )
   return opt->get_ptr() ;
 }
 
+// Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type
+get_optional_value_or ( optional<T> const& opt, BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type v )
+{
+  return opt.get_value_or(v) ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_type
+get_optional_value_or ( optional<T>& opt, BOOST_DEDUCED_TYPENAME optional<T>::reference_type v )
+{
+  return opt.get_value_or(v) ;
+}
+
 // Returns a pointer to the value if this is initialized, otherwise, returns NULL.
 // No-throw
 template<class T>
@@ -627,6 +693,11 @@ get_pointer ( optional<T>& opt )
 // optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
 // WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
 
+
+//
+// optional<T> vs optional<T> cases
+//
+
 template<class T>
 inline
 bool operator == ( optional<T> const& x, optional<T> const& y )
@@ -657,64 +728,141 @@ inline
 bool operator >= ( optional<T> const& x, optional<T> const& y )
 { return !( x < y ) ; }
 
+
+//
+// optional<T> vs T cases
+//
+template<class T>
+inline
+bool operator == ( optional<T> const& x, T const& y )
+{ return equal_pointees(x, optional<T>(y)); }
+
+template<class T>
+inline
+bool operator < ( optional<T> const& x, T const& y )
+{ return less_pointees(x, optional<T>(y)); }
+
+template<class T>
+inline
+bool operator != ( optional<T> const& x, T const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( optional<T> const& x, T const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( optional<T> const& x, T const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( optional<T> const& x, T const& y )
+{ return !( x < y ) ; }
+
+//
+// T vs optional<T> cases
+//
+
+template<class T>
+inline
+bool operator == ( T const& x, optional<T> const& y )
+{ return equal_pointees( optional<T>(x), y ); }
+
+template<class T>
+inline
+bool operator < ( T const& x, optional<T> const& y )
+{ return less_pointees( optional<T>(x), y ); }
+
+template<class T>
+inline
+bool operator != ( T const& x, optional<T> const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( T const& x, optional<T> const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( T const& x, optional<T> const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( T const& x, optional<T> const& y )
+{ return !( x < y ) ; }
+
+
+//
+// optional<T> vs none cases
+//
+
 template<class T>
 inline
-bool operator == ( optional<T> const& x, none_t const& )
+bool operator == ( optional<T> const& x, none_t )
 { return equal_pointees(x, optional<T>() ); }
 
 template<class T>
 inline
-bool operator < ( optional<T> const& x, none_t const& )
+bool operator < ( optional<T> const& x, none_t )
 { return less_pointees(x,optional<T>() ); }
 
 template<class T>
 inline
-bool operator != ( optional<T> const& x, none_t const& y )
+bool operator != ( optional<T> const& x, none_t y )
 { return !( x == y ) ; }
 
 template<class T>
 inline
-bool operator > ( optional<T> const& x, none_t const& y )
+bool operator > ( optional<T> const& x, none_t y )
 { return y < x ; }
 
 template<class T>
 inline
-bool operator <= ( optional<T> const& x, none_t const& y )
+bool operator <= ( optional<T> const& x, none_t y )
 { return !( y < x ) ; }
 
 template<class T>
 inline
-bool operator >= ( optional<T> const& x, none_t const& y )
+bool operator >= ( optional<T> const& x, none_t y )
 { return !( x < y ) ; }
 
+//
+// none vs optional<T> cases
+//
+
 template<class T>
 inline
-bool operator == ( none_t const& x, optional<T> const& y )
+bool operator == ( none_t x, optional<T> const& y )
 { return equal_pointees(optional<T>() ,y); }
 
 template<class T>
 inline
-bool operator < ( none_t const& x, optional<T> const& y )
+bool operator < ( none_t x, optional<T> const& y )
 { return less_pointees(optional<T>() ,y); }
 
 template<class T>
 inline
-bool operator != ( none_t const& x, optional<T> const& y )
+bool operator != ( none_t x, optional<T> const& y )
 { return !( x == y ) ; }
 
 template<class T>
 inline
-bool operator > ( none_t const& x, optional<T> const& y )
+bool operator > ( none_t x, optional<T> const& y )
 { return y < x ; }
 
 template<class T>
 inline
-bool operator <= ( none_t const& x, optional<T> const& y )
+bool operator <= ( none_t x, optional<T> const& y )
 { return !( y < x ) ; }
 
 template<class T>
 inline
-bool operator >= ( none_t const& x, optional<T> const& y )
+bool operator >= ( none_t x, optional<T> const& y )
 { return !( x < y ) ; }
 
 //
@@ -767,10 +915,6 @@ template<class T> inline void swap ( optional<T>& x, optional<T>& y )
   optional_detail::optional_swap(x,y);
 }
 
-template<class T> inline optional<T> make_optional ( T const& v )
-{
-  return optional<T>(v);
-}
 
 } // namespace boost
 
index ab1f6384a1545dda3d3192e1818d1b5dffa4456f..dd0f7138d03473d846fe70e78c14959da5973d51 100644 (file)
 #    elif defined(__MWERKS__) && __MWERKS__ >= 0x3200
 #        define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
 #    elif defined(__EDG__) || defined(__EDG_VERSION__)
-#        define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
+#        if defined(_MSC_VER) && __EDG_VERSION__ >= 308
+#            define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
+#        else
+#            define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
+#        endif
 #    elif defined(__MWERKS__)
 #        define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MWCC())
 #    elif defined(__DMC__)
index 6ba599a41a3a3f40e01e15e013047284edd1eccc..bbe5c5085ef47c208364e1d519b5879e30301d31 100644 (file)
@@ -562,7 +562,7 @@ typename cpp_regex_traits_implementation<charT>::string_type
       // std::collate<wchar_t>::transform returns a different string!
       // So as a workaround, we'll truncate the string at the first NULL
       // which _seems_ to work....
-#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x580)
       result.erase(result.find(charT(0)));
 #else
       //
index 93ee9caa25a81426d6c2b015a1c75433f0ab3f64..9f2b3700a9ca4701fbae2dbb8d6acf567a8ee23c 100644 (file)
@@ -76,7 +76,7 @@ struct regex_traits : public implementationT
 // required "standard" ones:
 //
 namespace re_detail{
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(55500))
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, < 60000)
 BOOST_MPL_HAS_XXX_TRAIT_DEF(boost_extensions_tag)
 #else
 template<class T>
@@ -129,7 +129,7 @@ struct compute_wrapper_base
 {
    typedef BaseT type;
 };
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(55500))
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__HP_aCC, < 60000)
 template <class BaseT>
 struct compute_wrapper_base<BaseT, false>
 {
index 65cc4a306516df309653ce95b134dcdb71858b71..f42776a029f0f9a71c647692357a44caac4d9dcb 100644 (file)
@@ -208,7 +208,7 @@ namespace boost { namespace spirit {
             result_t hit = scan.empty_match();
             std::size_t n = m_min;
 
-            for (std::size_t i = 0;; ++i)
+            for (std::size_t i = 0; ; ++i)
             {
                 typename ScannerT::iterator_t save = scan.first;
                 result_t next = this->subject().parse(scan);
index f817f66f5c0e2a08a79ea64d3923663ceeba6536..54a11a14afc75ac849684812d4eb5680e96c5f71 100644 (file)
@@ -340,7 +340,7 @@ struct is_convertible_impl_select<true, false, true>
 template <typename From, typename To>
 struct is_convertible_impl_dispatch_base
 {
-#ifndef __HP_aCC
+#if !BOOST_WORKAROUND(__HP_aCC, < 60700)
    typedef is_convertible_impl_select< 
       ::boost::is_arithmetic<From>::value, 
       ::boost::is_arithmetic<To>::value,
@@ -413,3 +413,4 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF2(is_convertible,From,To,(::boost::detail::is_convert
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
 
 #endif // BOOST_TT_IS_CONVERTIBLE_HPP_INCLUDED
+