Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:12

0001 // Copyright 2019 Hans Dembinski
0002 //
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt
0005 // or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_HISTOGRAM_DETAIL_REPLACE_TYPE_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_REPLACE_TYPE_HPP
0009 
0010 #include <boost/core/use_default.hpp>
0011 #include <string>
0012 #include <type_traits>
0013 
0014 namespace boost {
0015 namespace histogram {
0016 namespace detail {
0017 
0018 template <class T, class From, class To>
0019 using replace_type = std::conditional_t<std::is_same<T, From>::value, To, T>;
0020 
0021 template <class T, class Default>
0022 using replace_default = replace_type<T, boost::use_default, Default>;
0023 
0024 template <class T>
0025 using replace_cstring = replace_type<T, const char*, std::string>;
0026 
0027 } // namespace detail
0028 } // namespace histogram
0029 } // namespace boost
0030 
0031 #endif