]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/optional/optional.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / optional / optional.hpp
index 74ef49c5496315a09e5c489ce01dac0178322f99..90acd40a1728b316d749d777a5b361e5a8fd2a58 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
-// Copyright (C) 2014 - 2017 Andrzej Krzemienski.
+// Copyright (C) 2014 - 2018 Andrzej Krzemienski.
 //
 // Use, modification, and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 #include <boost/move/utility.hpp>
 #include <boost/none.hpp>
 #include <boost/utility/compare_pointees.hpp>
+#include <boost/utility/result_of.hpp>
 
 #include <boost/optional/optional_fwd.hpp>
 #include <boost/optional/detail/optional_config.hpp>
 #include <boost/optional/detail/optional_factory_support.hpp>
 #include <boost/optional/detail/optional_aligned_storage.hpp>
 
+namespace boost { namespace optional_detail {
+
+template <typename T>
+struct optional_value_type
+{
+};
+
+template <typename T>
+struct optional_value_type< ::boost::optional<T> >
+{
+  typedef T type;
+};
+
+}} // namespace boost::optional_detail
+
 #ifdef BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
 #include <boost/optional/detail/old_optional_implementation.hpp>
 #else
 namespace boost {
-  
+
 namespace optional_ns {
-  
+
 // a tag for in-place initialization of contained value
 struct in_place_init_t
 {
   struct init_tag{};
   explicit in_place_init_t(init_tag){}
-};            
+};
 const in_place_init_t in_place_init ((in_place_init_t::init_tag()));
 
 // a tag for conditional in-place initialization of contained value
@@ -81,7 +97,7 @@ struct in_place_init_if_t
   explicit in_place_init_if_t(init_tag){}
 };
 const in_place_init_if_t in_place_init_if ((in_place_init_if_t::init_tag()));
-  
+
 } // namespace optional_ns
 
 using optional_ns::in_place_init_t;
@@ -91,7 +107,9 @@ using optional_ns::in_place_init_if;
 
 namespace optional_detail {
 
-struct optional_tag {} ;
+struct init_value_tag {};
+
+struct optional_tag {};
 
 
 template<class T>
@@ -131,7 +149,7 @@ class optional_base : public optional_tag
 
     // Creates an optional<T> initialized with 'val'.
     // Can throw if T::T(T const&) does
-    optional_base ( argument_type val )
+    optional_base ( init_value_tag, argument_type val )
       :
       m_initialized(false)
     {
@@ -141,7 +159,7 @@ class optional_base : public optional_tag
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // move-construct an optional<T> initialized from an rvalue-ref to 'val'.
     // Can throw if T::T(T&&) does
-    optional_base ( rval_reference_type val )
+    optional_base ( init_value_tag, rval_reference_type val )
       :
       m_initialized(false)
     {
@@ -251,7 +269,7 @@ class optional_base : public optional_tag
           construct(rhs.get_impl());
       }
     }
-    
+
 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // Assigns from another optional<T> (deep-moves the rhs value)
     void assign ( optional_base&& rhs )
@@ -268,7 +286,7 @@ class optional_base : public optional_tag
           construct(boost::move(rhs.get_impl()));
       }
     }
-#endif 
+#endif
 
     // Assigns from another _convertible_ optional<U> (deep-copies the rhs value)
     template<class U>
@@ -282,7 +300,7 @@ class optional_base : public optional_tag
 #else
           assign_value( static_cast<value_type>(rhs.get()) );
 #endif
-          
+
         else destroy();
       }
       else
@@ -315,7 +333,7 @@ class optional_base : public optional_tag
       }
     }
 #endif
-    
+
     // Assigns from a T (deep-copies the rhs value)
     void assign ( argument_type val )
     {
@@ -323,7 +341,7 @@ class optional_base : public optional_tag
            assign_value(val);
       else construct(val);
     }
-    
+
 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // Assigns from a T (deep-moves the rhs value)
     void assign ( rval_reference_type val )
@@ -362,7 +380,7 @@ class optional_base : public optional_tag
 
   public :
 
-    // **DEPPRECATED** Destroys the current value, if any, leaving this UNINITIALIZED
+    // Destroys the current value, if any, leaving this UNINITIALIZED
     // No-throw (assuming T::~T() doesn't)
     void reset() BOOST_NOEXCEPT { destroy(); }
 
@@ -375,7 +393,7 @@ class optional_base : public optional_tag
     pointer_const_type get_ptr() const { return m_initialized ? get_ptr_impl() : 0 ; }
     pointer_type       get_ptr()       { return m_initialized ? get_ptr_impl() : 0 ; }
 
-    bool is_initialized() const { return m_initialized ; }
+    bool is_initialized() const BOOST_NOEXCEPT { return m_initialized ; }
 
   protected :
 
@@ -384,7 +402,7 @@ class optional_base : public optional_tag
        ::new (m_storage.address()) value_type(val) ;
        m_initialized = true ;
      }
-     
+
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     void construct ( rval_reference_type val )
      {
@@ -410,7 +428,7 @@ class optional_base : public optional_tag
       destroy();
       construct(in_place_init, boost::forward<Args>(args)...);
     }
-     
+
     template<class... Args>
     explicit optional_base ( in_place_init_t, Args&&... args )
       :
@@ -418,7 +436,7 @@ class optional_base : public optional_tag
     {
       construct(in_place_init, boost::forward<Args>(args)...);
     }
-    
+
     template<class... Args>
     explicit optional_base ( in_place_init_if_t, bool cond, Args&&... args )
       :
@@ -434,26 +452,26 @@ class optional_base : public optional_tag
        ::new (m_storage.address()) value_type( boost::forward<Arg>(arg) );
        m_initialized = true ;
      }
-     
+
     void construct ( in_place_init_t )
      {
        ::new (m_storage.address()) value_type();
        m_initialized = true ;
      }
-     
+
     template<class Arg>
     void emplace_assign ( Arg&& arg )
      {
        destroy();
        construct(in_place_init, boost::forward<Arg>(arg)) ;
      }
-     
+
     void emplace_assign ()
      {
        destroy();
        construct(in_place_init) ;
      }
-     
+
     template<class Arg>
     explicit optional_base ( in_place_init_t, Arg&& arg )
       :
@@ -461,14 +479,14 @@ class optional_base : public optional_tag
     {
       construct(in_place_init, boost::forward<Arg>(arg));
     }
-    
+
     explicit optional_base ( in_place_init_t )
       :
       m_initialized(false)
     {
       construct(in_place_init);
     }
-    
+
     template<class Arg>
     explicit optional_base ( in_place_init_if_t, bool cond, Arg&& arg )
       :
@@ -477,7 +495,7 @@ class optional_base : public optional_tag
       if ( cond )
         construct(in_place_init, boost::forward<Arg>(arg));
     }
-    
+
     explicit optional_base ( in_place_init_if_t, bool cond )
       :
       m_initialized(false)
@@ -487,21 +505,21 @@ class optional_base : public optional_tag
     }
 
 #else
-     
+
     template<class Arg>
     void construct ( in_place_init_t, const Arg& arg )
      {
        ::new (m_storage.address()) value_type( arg );
        m_initialized = true ;
      }
-     
+
     template<class Arg>
     void construct ( in_place_init_t, Arg& arg )
      {
        ::new (m_storage.address()) value_type( arg );
        m_initialized = true ;
      }
-     
+
     void construct ( in_place_init_t )
      {
        ::new (m_storage.address()) value_type();
@@ -514,20 +532,20 @@ class optional_base : public optional_tag
       destroy();
       construct(in_place_init, arg);
     }
-     
+
     template<class Arg>
     void emplace_assign ( Arg& arg )
     {
       destroy();
       construct(in_place_init, arg);
     }
-     
+
     void emplace_assign ()
     {
       destroy();
       construct(in_place_init);
     }
-    
+
     template<class Arg>
     explicit optional_base ( in_place_init_t, const Arg& arg )
       : m_initialized(false)
@@ -541,13 +559,13 @@ class optional_base : public optional_tag
     {
       construct(in_place_init, arg);
     }
-    
+
     explicit optional_base ( in_place_init_t )
       : m_initialized(false)
     {
       construct(in_place_init);
     }
-    
+
     template<class Arg>
     explicit optional_base ( in_place_init_if_t, bool cond, const Arg& arg )
       : m_initialized(false)
@@ -555,15 +573,15 @@ class optional_base : public optional_tag
       if ( cond )
         construct(in_place_init, arg);
     }
-    
+
     template<class Arg>
     explicit optional_base ( in_place_init_if_t, bool cond, Arg& arg )
       : m_initialized(false)
     {
       if ( cond )
         construct(in_place_init, arg);
-    } 
-    
+    }
+
     explicit optional_base ( in_place_init_if_t, bool cond )
       : m_initialized(false)
     {
@@ -757,8 +775,6 @@ class optional_base : public optional_tag
     storage_type m_storage ;
 } ;
 
-
-
 #include <boost/optional/detail/optional_trivially_copyable_base.hpp>
 
 // definition of metafunciton is_optional_val_init_candidate
@@ -772,7 +788,7 @@ struct is_optional_related
 {};
 
 #if !defined(BOOST_OPTIONAL_DETAIL_NO_IS_CONSTRUCTIBLE_TRAIT)
-  
+
 template <typename T, typename U>
 struct is_convertible_to_T_or_factory
   : boost::conditional< boost::is_base_of<boost::in_place_factory_base, BOOST_DEDUCED_TYPENAME boost::decay<U>::type>::value
@@ -856,12 +872,12 @@ class optional
 
     // Creates an optional<T> initialized with 'val'.
     // Can throw if T::T(T const&) does
-    optional ( argument_type val ) : base(val) {}
+    optional ( argument_type val ) : base(optional_detail::init_value_tag(), val) {}
 
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // Creates an optional<T> initialized with 'move(val)'.
     // Can throw if T::T(T &&) does
-    optional ( rval_reference_type val ) : base( boost::forward<T>(val) ) 
+    optional ( rval_reference_type val ) : base(optional_detail::init_value_tag(), boost::forward<T>(val))
       {}
 #endif
 
@@ -872,7 +888,7 @@ class optional
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     /// Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional.
     // Can throw if T::T(T &&) does
-    optional ( bool cond, rval_reference_type val ) : base( cond, boost::forward<T>(val) ) 
+    optional ( bool cond, rval_reference_type val ) : base( cond, boost::forward<T>(val) )
       {}
 #endif
 
@@ -889,11 +905,11 @@ class optional
                       )
       :
       base()
-    {      
+    {
       if ( rhs.is_initialized() )
         this->construct(rhs.get());
     }
-    
+
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // Creates a deep move of another convertible optional<U>
     // Requires a valid conversion from U to T.
@@ -926,10 +942,10 @@ class optional
 
 
   template<class Expr>
-  explicit optional ( Expr&& expr, 
-                      BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate<T, Expr>, bool>::type = true 
-  ) 
-    : base(boost::forward<Expr>(expr),boost::addressof(expr)) 
+  explicit optional ( Expr&& expr,
+                      BOOST_DEDUCED_TYPENAME boost::enable_if< optional_detail::is_optional_val_init_candidate<T, Expr>, bool>::type = true
+  )
+    : base(boost::forward<Expr>(expr),boost::addressof(expr))
     {}
 
 #else
@@ -973,7 +989,7 @@ class optional
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
 
     template<class Expr>
-    BOOST_DEDUCED_TYPENAME boost::enable_if<optional_detail::is_optional_val_init_candidate<T, Expr>, optional&>::type 
+    BOOST_DEDUCED_TYPENAME boost::enable_if<optional_detail::is_optional_val_init_candidate<T, Expr>, optional&>::type
     operator= ( Expr&& expr )
       {
         this->assign_expr(boost::forward<Expr>(expr),boost::addressof(expr));
@@ -999,7 +1015,7 @@ class optional
         this->assign(rhs);
         return *this ;
       }
-      
+
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // Move-assigns from another convertible optional<U> (converts && deep-moves the rhs value)
     // Requires a valid conversion from U to T.
@@ -1030,14 +1046,14 @@ class optional
 #ifndef BOOST_OPTIONAL_DETAIL_NO_DEFAULTED_MOVE_FUNCTIONS
     optional& operator= ( optional && ) = default;
 #else
-    optional& operator= ( optional && rhs ) 
+    optional& operator= ( optional && rhs )
       BOOST_NOEXCEPT_IF(::boost::is_nothrow_move_constructible<T>::value && ::boost::is_nothrow_move_assignable<T>::value)
       {
         this->assign( static_cast<base &&>(rhs) ) ;
         return *this ;
       }
-#endif      
-      
+#endif
+
 #endif // BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
 
 #ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
@@ -1050,7 +1066,7 @@ class optional
         this->assign( boost::forward<T_>(val) ) ;
         return *this ;
       }
-      
+
 #else
 
     // Assigns from a T (deep-copies the rhs value)
@@ -1060,7 +1076,7 @@ class optional
         this->assign( val ) ;
         return *this ;
       }
-      
+
 #ifndef BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     // Assigns from a T (deep-moves the rhs value)
     optional& operator= ( rval_reference_type val )
@@ -1069,9 +1085,9 @@ class optional
         return *this ;
       }
 #endif
-      
+
 #endif // BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
-      
+
     // Assigns from a "none"
     // Which destroys the current value, if any, leaving this UNINITIALIZED
     // No-throw (assuming T::~T() doesn't)
@@ -1080,7 +1096,7 @@ class optional
         this->assign( none_ ) ;
         return *this ;
       }
-      
+
 #if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) && (!defined BOOST_NO_CXX11_VARIADIC_TEMPLATES)
     // Constructs in-place
     // upon exception *this is always uninitialized
@@ -1089,29 +1105,29 @@ class optional
     {
       this->emplace_assign( boost::forward<Args>(args)... );
     }
-     
+
     template<class... Args>
     explicit optional ( in_place_init_t, Args&&... args )
     : base( in_place_init, boost::forward<Args>(args)... )
     {}
-    
+
     template<class... Args>
     explicit optional ( in_place_init_if_t, bool cond, Args&&... args )
     : base( in_place_init_if, cond, boost::forward<Args>(args)... )
     {}
-    
+
 #elif (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
     template<class Arg>
     void emplace ( Arg&& arg )
      {
        this->emplace_assign( boost::forward<Arg>(arg) );
      }
-     
+
     void emplace ()
      {
        this->emplace_assign();
      }
-     
+
     template<class Args>
     explicit optional ( in_place_init_t, Args&& args )
     : base( in_place_init, boost::forward<Args>(args) )
@@ -1120,12 +1136,12 @@ class optional
     explicit optional ( in_place_init_t )
     : base( in_place_init )
     {}
-    
+
     template<class Args>
     explicit optional ( in_place_init_if_t, bool cond, Args&& args )
     : base( in_place_init_if, cond, boost::forward<Args>(args) )
     {}
-    
+
     explicit optional ( in_place_init_if_t, bool cond )
     : base( in_place_init_if, cond )
     {}
@@ -1135,23 +1151,23 @@ class optional
      {
        this->emplace_assign( arg );
      }
-     
+
     template<class Arg>
     void emplace ( Arg& arg )
      {
        this->emplace_assign( arg );
      }
-     
+
     void emplace ()
      {
        this->emplace_assign();
      }
-     
+
     template<class Arg>
     explicit optional ( in_place_init_t, const Arg& arg )
     : base( in_place_init, arg )
     {}
-    
+
     template<class Arg>
     explicit optional ( in_place_init_t, Arg& arg )
     : base( in_place_init, arg )
@@ -1160,17 +1176,17 @@ class optional
     explicit optional ( in_place_init_t )
     : base( in_place_init )
     {}
-    
+
     template<class Arg>
     explicit optional ( in_place_init_if_t, bool cond, const Arg& arg )
     : base( in_place_init_if, cond, arg )
     {}
-    
+
     template<class Arg>
     explicit optional ( in_place_init_if_t, bool cond, Arg& arg )
     : base( in_place_init_if, cond, arg )
-    {} 
-    
+    {}
+
     explicit optional ( in_place_init_if_t, bool cond )
     : base( in_place_init_if, cond )
     {}
@@ -1203,7 +1219,7 @@ class optional
     // Returns a reference to the value if this is initialized, otherwise,
     // the behaviour is UNDEFINED
     // No-throw
-#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) 
+#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
     reference_const_type operator *() const& { return this->get() ; }
     reference_type       operator *() &      { return this->get() ; }
     reference_type_of_temporary_wrapper operator *() && { return boost::move(this->get()) ; }
@@ -1212,42 +1228,42 @@ class optional
     reference_type       operator *()       { return this->get() ; }
 #endif // !defined BOOST_NO_CXX11_REF_QUALIFIERS
 
-#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES) 
+#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
     reference_const_type value() const&
-      { 
+      {
         if (this->is_initialized())
           return this->get() ;
         else
           throw_exception(bad_optional_access());
       }
-      
+
     reference_type value() &
-      { 
+      {
         if (this->is_initialized())
           return this->get() ;
         else
           throw_exception(bad_optional_access());
       }
-      
+
     reference_type_of_temporary_wrapper value() &&
-      { 
+      {
         if (this->is_initialized())
           return boost::move(this->get()) ;
         else
           throw_exception(bad_optional_access());
       }
 
-#else 
+#else
     reference_const_type value() const
-      { 
+      {
         if (this->is_initialized())
           return this->get() ;
         else
           throw_exception(bad_optional_access());
       }
-      
+
     reference_type value()
-      { 
+      {
         if (this->is_initialized())
           return this->get() ;
         else
@@ -1259,16 +1275,16 @@ class optional
 #ifndef BOOST_NO_CXX11_REF_QUALIFIERS
     template <class U>
     value_type value_or ( U&& v ) const&
-      { 
+      {
         if (this->is_initialized())
           return get();
         else
           return boost::forward<U>(v);
       }
-    
+
     template <class U>
-    value_type value_or ( U&& v ) && 
-      { 
+    value_type value_or ( U&& v ) &&
+      {
         if (this->is_initialized())
           return boost::move(get());
         else
@@ -1276,7 +1292,7 @@ class optional
       }
 #elif !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
     template <class U>
-    value_type value_or ( U&& v ) const 
+    value_type value_or ( U&& v ) const
       {
         if (this->is_initialized())
           return get();
@@ -1285,17 +1301,17 @@ class optional
       }
 #else
     template <class U>
-    value_type value_or ( U const& v ) const 
-      { 
+    value_type value_or ( U const& v ) const
+      {
         if (this->is_initialized())
           return get();
         else
           return v;
       }
-      
+
     template <class U>
-    value_type value_or ( U& v ) const 
-      { 
+    value_type value_or ( U& v ) const
+      {
         if (this->is_initialized())
           return get();
         else
@@ -1304,7 +1320,7 @@ class optional
 #endif
 
 
-#ifndef BOOST_NO_CXX11_REF_QUALIFIERS
+#if (!defined BOOST_NO_CXX11_REF_QUALIFIERS) && (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
     template <typename F>
     value_type value_or_eval ( F f ) const&
       {
@@ -1313,7 +1329,7 @@ class optional
         else
           return f();
       }
-      
+
     template <typename F>
     value_type value_or_eval ( F f ) &&
       {
@@ -1322,6 +1338,61 @@ class optional
         else
           return f();
       }
+
+    template <typename F>
+    optional<typename boost::result_of<F(reference_type)>::type> map(F f) &
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename boost::result_of<F(reference_const_type)>::type> map(F f) const&
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename boost::result_of<F(reference_type_of_temporary_wrapper)>::type> map(F f) &&
+      {
+        if (this->has_value())
+          return f(boost::move(this->get()));
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(reference_type)>::type>::type> flat_map(F f) &
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(reference_const_type)>::type>::type> flat_map(F f) const&
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(reference_type_of_temporary_wrapper)>::type>::type> flat_map(F f) &&
+      {
+        if (this->has_value())
+          return f(boost::move(get()));
+        else
+          return none;
+      }
+
 #else
     template <typename F>
     value_type value_or_eval ( F f ) const
@@ -1331,10 +1402,49 @@ class optional
         else
           return f();
       }
+
+    template <typename F>
+    optional<typename boost::result_of<F(reference_type)>::type> map(F f)
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename boost::result_of<F(reference_const_type)>::type> map(F f) const
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(reference_type)>::type>::type> flat_map(F f)
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
+    template <typename F>
+    optional<typename optional_detail::optional_value_type<typename boost::result_of<F(reference_const_type)>::type>::type> flat_map(F f) const
+      {
+        if (this->has_value())
+          return f(get());
+        else
+          return none;
+      }
+
 #endif
-      
+
+    bool has_value() const BOOST_NOEXCEPT { return this->is_initialized() ; }
+
     bool operator!() const BOOST_NOEXCEPT { return !this->is_initialized() ; }
-    
+
     BOOST_EXPLICIT_OPERATOR_BOOL_NOEXCEPT()
 } ;
 
@@ -1343,7 +1453,7 @@ class optional
 #endif // BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
 
 namespace boost {
-  
+
 #ifndef  BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
 template<class T>
 class optional<T&&>
@@ -1472,14 +1582,14 @@ get_pointer ( optional<T>& opt )
 } // namespace boost
 
 namespace boost {
-  
+
 // The following declaration prevents a bug where operator safe-bool is used upon streaming optional object if you forget the IO header.
 template<class CharType, class CharTrait>
 std::basic_ostream<CharType, CharTrait>&
 operator<<(std::basic_ostream<CharType, CharTrait>& os, optional_detail::optional_tag const&)
 {
   BOOST_STATIC_ASSERT_MSG(sizeof(CharType) == 0, "If you want to output boost::optional, include header <boost/optional/optional_io.hpp>");
-  return os;  
+  return os;
 }
 
 } // namespace boost