]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/histogram/detail/make_default.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / histogram / detail / make_default.hpp
index 738bde6fb6ecc46618ed06c5c3edeb28a6fc4126..d364393244e247037fed46287784a7dae6134177 100644 (file)
@@ -7,17 +7,23 @@
 #ifndef BOOST_HISTOGRAM_DETAIL_MAKE_DEFAULT_HPP
 #define BOOST_HISTOGRAM_DETAIL_MAKE_DEFAULT_HPP
 
-#include <boost/histogram/detail/detect.hpp>
-#include <boost/histogram/detail/static_if.hpp>
-
 namespace boost {
 namespace histogram {
 namespace detail {
 
 template <class T>
-auto make_default(const T& t) {
-  return static_if<has_allocator<T>>([](const auto& t) { return T(t.get_allocator()); },
-                                     [](const auto&) { return T{}; }, t);
+T make_default_impl(const T& t, decltype(t.get_allocator(), 0)) {
+  return T(t.get_allocator());
+}
+
+template <class T>
+T make_default_impl(const T&, float) {
+  return T{};
+}
+
+template <class T>
+T make_default(const T& t) {
+  return make_default_impl(t, 0);
 }
 
 } // namespace detail