Imported Upstream version 1.71.0
[platform/upstream/boost.git] / boost / histogram / detail / replace_default.hpp
1 // Copyright 2015-2019 Hans Dembinski
2 //
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #ifndef BOOST_HISTOGRAM_DETAIL_REPLACE_DEFAULT_HPP
8 #define BOOST_HISTOGRAM_DETAIL_REPLACE_DEFAULT_HPP
9
10 #include <boost/core/use_default.hpp>
11 #include <type_traits>
12
13 namespace boost {
14 namespace histogram {
15 namespace detail {
16
17 template <class T, class Default>
18 using replace_default =
19     std::conditional_t<std::is_same<T, boost::use_default>::value, Default, T>;
20
21 } // namespace detail
22 } // namespace histogram
23 } // namespace boost
24
25 #endif