/* Proposed SG14 status_code (C) 2018 - 2019 Niall Douglas (5 commits) File Created: Feb 2018 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License in the accompanying file Licence.txt or at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Distributed under the Boost Software License, Version 1.0. (See accompanying file Licence.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_OUTCOME_SYSTEM_ERROR2_STATUS_CODE_HPP #define BOOST_OUTCOME_SYSTEM_ERROR2_STATUS_CODE_HPP #include "status_code_domain.hpp" #if __cplusplus >= 201700 || _HAS_CXX17 // 0.26 #include // for in_place BOOST_OUTCOME_SYSTEM_ERROR2_NAMESPACE_BEGIN using in_place_t = std::in_place_t; using std::in_place; BOOST_OUTCOME_SYSTEM_ERROR2_NAMESPACE_END #else BOOST_OUTCOME_SYSTEM_ERROR2_NAMESPACE_BEGIN //! Aliases `std::in_place_t` if on C++ 17 or later, else defined locally. struct in_place_t { explicit in_place_t() = default; }; //! Aliases `std::in_place` if on C++ 17 or later, else defined locally. constexpr in_place_t in_place{}; BOOST_OUTCOME_SYSTEM_ERROR2_NAMESPACE_END #endif BOOST_OUTCOME_SYSTEM_ERROR2_NAMESPACE_BEGIN //! Namespace for user injected mixins namespace mixins { template struct mixin : public Base { using Base::Base; }; } // namespace mixins /*! A tag for an erased value type for `status_code`. Available only if `ErasedType` satisfies `traits::is_move_relocating::value`. */ template ::value, bool>::type = true> struct erased { using value_type = ErasedType; }; namespace detail { template struct is_status_code { static constexpr bool value = false; }; template struct is_status_code> { static constexpr bool value = true; }; template struct is_erased_status_code { static constexpr bool value = false; }; template struct is_erased_status_code>> { static constexpr bool value = true; }; // From http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4436.pdf namespace impl { template struct make_void { using type = void; }; template using void_t = typename make_void::type; template struct types { using type = types; }; template