]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/outcome/boost_result.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / outcome / boost_result.hpp
index 47171c01886696ec14e650a10eb0dcde339e7b6b..40ca5d372b61a6906b2d2961907d03c1c1a5a00f 100644 (file)
@@ -1,5 +1,5 @@
 /* A very simple result type
-(C) 2017-2019 Niall Douglas <http://www.nedproductions.biz/> (10 commits)
+(C) 2017-2020 Niall Douglas <http://www.nedproductions.biz/> (10 commits)
 File Created: June 2017
 
 
@@ -33,12 +33,13 @@ DEALINGS IN THE SOFTWARE.
 
 #include "config.hpp"
 
-#include "boost/exception_ptr.hpp"
 #include "boost/system/system_error.hpp"
+#include "boost/exception_ptr.hpp"
+#include "boost/version.hpp"
 
 BOOST_OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
 
-/*! AWAITING HUGO JSON CONVERSION TOOL 
+/*! AWAITING HUGO JSON CONVERSION TOOL
 SIGNATURE NOT RECOGNISED
 */
 namespace policy
@@ -50,14 +51,7 @@ namespace policy
     inline boost::system::error_code make_error_code(boost::system::error_code v) { return v; }
 
     /* Pass through `make_exception_ptr` function for `boost::exception_ptr`.
-        The reason this needs to be here, declared before the rest of Outcome,
-        is that there is no boost::make_exception_ptr as Boost still uses the old
-        naming boost::copy_exception. Therefore the ADL discovered make_exception_ptr
-        doesn't work, hence this hacky pre-declaration here.
-
-        I was tempted to just inject a boost::make_exception_ptr, but I can see
-        Boost doing that itself at some point. This hack should keep working after.
-        */
+    */
     inline boost::exception_ptr make_exception_ptr(boost::exception_ptr v) { return v; }
   }  // namespace detail
 }  // namespace policy
@@ -94,7 +88,7 @@ namespace detail
 #endif
     )
     {
-      state._status |= status_error_is_errno;
+      state._status.set_have_error_is_errno(true);
     }
   }
   template <class State> constexpr inline void _set_error_is_errno(State &state, const boost::system::error_condition &error)
@@ -105,14 +99,17 @@ namespace detail
 #endif
     )
     {
-      state._status |= status_error_is_errno;
+      state._status.set_have_error_is_errno(true);
     }
   }
-  template <class State> constexpr inline void _set_error_is_errno(State &state, const boost::system::errc::errc_t & /*unused*/) { state._status |= status_error_is_errno; }
+  template <class State> constexpr inline void _set_error_is_errno(State &state, const boost::system::errc::errc_t & /*unused*/)
+  {
+    state._status.set_have_error_is_errno(true);
+  }
 
 }  // namespace detail
 
-/*! AWAITING HUGO JSON CONVERSION TOOL 
+/*! AWAITING HUGO JSON CONVERSION TOOL
 SIGNATURE NOT RECOGNISED
 */
 namespace trait
@@ -156,18 +153,18 @@ namespace trait
 }  // namespace trait
 
 
-/*! AWAITING HUGO JSON CONVERSION TOOL 
+/*! AWAITING HUGO JSON CONVERSION TOOL
 SIGNATURE NOT RECOGNISED
 */
 template <class R, class S = boost::system::error_code, class NoValuePolicy = policy::default_policy<R, S, void>>  //
 using boost_result = basic_result<R, S, NoValuePolicy>;
 
-/*! AWAITING HUGO JSON CONVERSION TOOL 
+/*! AWAITING HUGO JSON CONVERSION TOOL
 type alias template <class R, class S = boost::system::error_code> boost_unchecked. Potential doc page: `boost_unchecked<T, E = boost::system::error_code>`
 */
 template <class R, class S = boost::system::error_code> using boost_unchecked = boost_result<R, S, policy::all_narrow>;
 
-/*! AWAITING HUGO JSON CONVERSION TOOL 
+/*! AWAITING HUGO JSON CONVERSION TOOL
 type alias template <class R, class S = boost::system::error_code> boost_checked. Potential doc page: `boost_checked<T, E = boost::system::error_code>`
 */
 template <class R, class S = boost::system::error_code> using boost_checked = boost_result<R, S, policy::throw_bad_result_access<S, void>>;