// 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
#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>
#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);
}