Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright 2015-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_MAKE_DEFAULT_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_MAKE_DEFAULT_HPP
0009 
0010 namespace boost {
0011 namespace histogram {
0012 namespace detail {
0013 
0014 template <class T>
0015 T make_default_impl(const T& t, decltype(t.get_allocator(), 0)) {
0016   return T(t.get_allocator());
0017 }
0018 
0019 template <class T>
0020 T make_default_impl(const T&, float) {
0021   return T{};
0022 }
0023 
0024 template <class T>
0025 T make_default(const T& t) {
0026   return make_default_impl(t, 0);
0027 }
0028 
0029 } // namespace detail
0030 } // namespace histogram
0031 } // namespace boost
0032 
0033 #endif