]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/dll/smart_library.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / dll / smart_library.hpp
index de0909c62a2c12727ae0e10ba024bc91713b12e2..1df20a24d5448b5a738da387ca1ed309d86b18aa 100644 (file)
@@ -1,4 +1,5 @@
 //  Copyright 2016 Klemens Morgenstern
+//  Copyright 2019-2020 Antony Polukhin
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt
@@ -8,7 +9,7 @@
 #define BOOST_DLL_SMART_LIBRARY_HPP_
 
 /// \file boost/dll/smart_library.hpp
-/// \warning Extremely experimental! Requires C++14! Will change in next version of Boost! boost/dll/smart_library.hpp is not included in boost/dll.hpp
+/// \warning Extremely experimental! Requires C++11! Will change in next version of Boost! boost/dll/smart_library.hpp is not included in boost/dll.hpp
 /// \brief Contains the boost::dll::experimental::smart_library class for loading mangled symbols.
 
 #include <boost/dll/config.hpp>
 #   include <boost/dll/detail/demangling/itanium.hpp>
 #endif
 
+#if (__cplusplus < 201103L) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201103L)
+#  error This file requires C++11 at least!
+#endif
+
 #include <boost/dll/shared_library.hpp>
 #include <boost/dll/detail/get_mem_fn_type.hpp>
 #include <boost/dll/detail/ctor_dtor.hpp>
@@ -434,14 +439,14 @@ void get(const smart_library& sm, const std::string &name);
 #endif
 
 template<class T>
-T& get(const smart_library& sm, const std::string &name, typename boost::enable_if<boost::is_object<T>,T>::type* = nullptr)
+typename boost::enable_if<boost::is_object<T>, T&>::type get(const smart_library& sm, const std::string &name)
 
 {
     return sm.get_variable<T>(name);
 }
 
 template<class T>
-auto get(const smart_library& sm, const std::string &name, typename boost::enable_if<boost::is_function<T>>::type* = nullptr)
+typename boost::enable_if<boost::is_function<T>, T&>::type get(const smart_library& sm, const std::string &name)
 {
     return sm.get_function<T>(name);
 }