diff --git a/CMakeLists.txt b/CMakeLists.txt index 25d59ffe..888283fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,15 +18,12 @@ target_link_libraries(boost_dll Boost::config Boost::core Boost::filesystem - Boost::function - Boost::move Boost::predef Boost::smart_ptr Boost::spirit Boost::system Boost::throw_exception Boost::type_index - Boost::type_traits Boost::winapi ) diff --git a/build.jam b/build.jam index 5e67738b..19c19dd2 100644 --- a/build.jam +++ b/build.jam @@ -16,7 +16,6 @@ constant boost_dependencies : /boost/system//boost_system /boost/throw_exception//boost_throw_exception /boost/type_index//boost_type_index - /boost/type_traits//boost_type_traits /boost/winapi//boost_winapi ; project /boost/dll diff --git a/include/boost/dll/detail/aggressive_ptr_cast.hpp b/include/boost/dll/detail/aggressive_ptr_cast.hpp index 75ddc654..8d0615f5 100644 --- a/include/boost/dll/detail/aggressive_ptr_cast.hpp +++ b/include/boost/dll/detail/aggressive_ptr_cast.hpp @@ -13,15 +13,9 @@ # pragma once #endif -#include -#include -#include -#include -#include -#include -#include -#include #include // std::memcpy +#include +#include #if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 301) # pragma GCC system_header @@ -32,16 +26,16 @@ namespace boost { namespace dll { namespace detail { // GCC warns when reinterpret_cast between function pointer and object pointer occur. // This method suppress the warnings and ensures that such casts are safe. template -BOOST_FORCEINLINE typename boost::disable_if_c::value || boost::is_reference::value || boost::is_member_pointer::value, To>::type +BOOST_FORCEINLINE typename std::enable_if::value && !std::is_reference::value && !std::is_member_pointer::value, To>::type aggressive_ptr_cast(From v) noexcept { static_assert( - boost::is_pointer::value && boost::is_pointer::value, + std::is_pointer::value && std::is_pointer::value, "`agressive_ptr_cast` function must be used only for pointer casting." ); static_assert( - boost::is_void< typename boost::remove_pointer::type >::value + std::is_void< typename std::remove_pointer::type >::value || boost::is_void< typename boost::remove_pointer::type >::value, "`agressive_ptr_cast` function must be used only for casting to or from void pointers." ); @@ -60,25 +54,25 @@ BOOST_FORCEINLINE typename boost::disable_if_c::val #endif template -BOOST_FORCEINLINE typename boost::disable_if_c::value || boost::is_member_pointer::value, To>::type +BOOST_FORCEINLINE typename std::enable_if::value && !std::is_member_pointer::value, To>::type aggressive_ptr_cast(From v) noexcept { static_assert( - boost::is_pointer::value, + std::is_pointer::value, "`agressive_ptr_cast` function must be used only for pointer casting." ); static_assert( - boost::is_void< typename boost::remove_pointer::type >::value, + std::is_void< typename std::remove_pointer::type >::value, "`agressive_ptr_cast` function must be used only for casting to or from void pointers." ); static_assert( - sizeof(v) == sizeof(typename boost::remove_reference::type*), + sizeof(v) == sizeof(typename std::remove_reference::type*), "Pointer to function and pointer to object differ in size on your platform." ); return static_cast( - **reinterpret_cast::type**>( + **reinterpret_cast::type**>( v ) ); @@ -89,16 +83,16 @@ BOOST_FORCEINLINE typename boost::disable_if_c::value | #endif template -BOOST_FORCEINLINE typename boost::disable_if_c::value || boost::is_member_pointer::value, To>::type +BOOST_FORCEINLINE typename std::enable_if::value && !std::is_member_pointer::value, To>::type aggressive_ptr_cast(From v) noexcept { static_assert( - boost::is_pointer::value, + std::is_pointer::value, "`agressive_ptr_cast` function must be used only for pointer casting." ); static_assert( - boost::is_void< typename boost::remove_pointer::type >::value, + std::is_void< typename boost::remove_pointer::type >::value, "`agressive_ptr_cast` function must be used only for casting to or from void pointers." ); @@ -108,16 +102,16 @@ BOOST_FORCEINLINE typename boost::disable_if_c::va } template -BOOST_FORCEINLINE typename boost::disable_if_c::value || !boost::is_member_pointer::value, To>::type +BOOST_FORCEINLINE typename std::enable_if::value && std::is_member_pointer::value, To>::type aggressive_ptr_cast(From /* v */) noexcept { static_assert( - boost::is_pointer::value, + std::is_pointer::value, "`agressive_ptr_cast` function must be used only for pointer casting." ); static_assert( - boost::is_void< typename boost::remove_pointer::type >::value, + std::is_void< typename std::remove_pointer::type >::value, "`agressive_ptr_cast` function must be used only for casting to or from void pointers." ); diff --git a/include/boost/dll/detail/demangling/itanium.hpp b/include/boost/dll/detail/demangling/itanium.hpp index 236477f1..3db5ac53 100644 --- a/include/boost/dll/detail/demangling/itanium.hpp +++ b/include/boost/dll/detail/demangling/itanium.hpp @@ -8,13 +8,9 @@ #define BOOST_DLL_DETAIL_DEMANGLING_ITANIUM_HPP_ #include + #include #include -#include -#include -#include -#include -#include namespace boost { namespace dll { namespace detail { diff --git a/include/boost/dll/detail/demangling/mangled_storage_base.hpp b/include/boost/dll/detail/demangling/mangled_storage_base.hpp index d1241a00..32d0a7cc 100644 --- a/include/boost/dll/detail/demangling/mangled_storage_base.hpp +++ b/include/boost/dll/detail/demangling/mangled_storage_base.hpp @@ -10,10 +10,12 @@ #include #include #include +#include + #include #include #include -#include + namespace boost { namespace dll { namespace detail { diff --git a/include/boost/dll/detail/demangling/msvc.hpp b/include/boost/dll/detail/demangling/msvc.hpp index 6f98e780..638b1fe5 100644 --- a/include/boost/dll/detail/demangling/msvc.hpp +++ b/include/boost/dll/detail/demangling/msvc.hpp @@ -10,12 +10,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include diff --git a/include/boost/dll/detail/import_mangled_helpers.hpp b/include/boost/dll/detail/import_mangled_helpers.hpp index 9838f818..c1c77813 100644 --- a/include/boost/dll/detail/import_mangled_helpers.hpp +++ b/include/boost/dll/detail/import_mangled_helpers.hpp @@ -8,11 +8,7 @@ #define BOOST_DLL_DETAIL_IMPORT_MANGLED_HELPERS_HPP_ -#include -#include -#include -#include -#include +#include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -34,9 +30,9 @@ struct push_front> template struct unqalified_is_same : - boost::is_same< - typename boost::remove_cv::type, - typename boost::remove_cv::type + std::is_same< + typename std::remove_cv::type, + typename std::remove_cv::type > { }; @@ -48,19 +44,19 @@ template struct is_function_seq; //type-trait for function overloads template struct is_function_seq> - : boost::conditional< - boost::is_function::value, + : std::conditional< + std::is_function::value, is_function_seq>, - boost::false_type>::type + std::false_type>::type {}; template -struct is_function_seq> : boost::is_function +struct is_function_seq> : std::is_function { }; template<> -struct is_function_seq> : boost::false_type +struct is_function_seq> : std::false_type { }; @@ -151,11 +147,11 @@ struct make_mem_fn_seq * Class, const Class, void(int)//--> ovl class. * */ - static_assert(boost::is_object::value, ""); + static_assert(std::is_object::value, ""); typedef typename make_mem_fn_seq_getter< unqalified_is_same::value, T0, T1, T2>::type mem_fn_type; - typedef typename boost::conditional< + typedef typename std::conditional< unqalified_is_same::value, make_mem_fn_seq, make_mem_fn_seq> ::type next; @@ -203,46 +199,46 @@ struct make_mem_fn_seq template struct is_mem_fn_seq_impl { - typedef typename boost::conditional< - boost::is_function::value || boost::dll::experimental::detail::unqalified_is_same::value, + typedef typename std::conditional< + std::is_function::value || boost::dll::experimental::detail::unqalified_is_same::value, typename is_mem_fn_seq_impl::type, - boost::false_type>::type type; + std::false_type>::type type; }; template struct is_mem_fn_seq_impl { - typedef typename boost::conditional< - boost::is_function::value && boost::is_object::value, - boost::true_type, boost::false_type>::type type; + typedef typename std::conditional< + std::is_function::value && std::is_object::value, + std::true_type, std::false_type>::type type; }; template struct is_mem_fn_seq_impl { - typedef typename boost::conditional< - (boost::is_function::value || boost::dll::experimental::detail::unqalified_is_same::value) - && boost::is_function::value, - boost::true_type, boost::false_type>::type type; + typedef typename std::conditional< + (std::is_function::value || boost::dll::experimental::detail::unqalified_is_same::value) + && std::is_function::value, + std::true_type, std::false_type>::type type; }; -template struct is_mem_fn_seq : boost::false_type {}; +template struct is_mem_fn_seq : std::false_type {}; //If only two arguments are provided at all. template -struct is_mem_fn_seq> : boost::conditional< - boost::is_object::value && boost::is_function::value, - boost::true_type, boost::false_type>::type +struct is_mem_fn_seq> : std::conditional< + std::is_object::value && std::is_function::value, + std::true_type, std::false_type>::type { }; template struct is_mem_fn_seq> : - boost::conditional< - boost::is_class::value && boost::is_function::value, + std::conditional< + std::is_class::value && std::is_function::value, typename is_mem_fn_seq_impl::type, - boost::false_type>::type {}; + std::false_type>::type {}; /* ********************************** mem fn sequence tuple ******************************/ diff --git a/include/boost/dll/import.hpp b/include/boost/dll/import.hpp index 5d953134..0397f787 100644 --- a/include/boost/dll/import.hpp +++ b/include/boost/dll/import.hpp @@ -9,12 +9,12 @@ #define BOOST_DLL_IMPORT_HPP #include -#include -#include -#include #include #include +#include // std::addressof +#include + #ifdef BOOST_HAS_PRAGMA_ONCE # pragma once #endif @@ -58,7 +58,7 @@ namespace detail { template using import_type = typename std::conditional< - boost::is_object::value, + std::is_object::value, boost::shared_ptr, boost::dll::detail::library_function >::type; @@ -111,7 +111,7 @@ BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(const boost::dll::fs::path& lib, cons using type = boost::dll::detail::import_type; auto p = boost::make_shared(lib, mode); - return type(p, boost::addressof(p->get(name))); + return type(p, std::addressof(p->get(name))); } //! \overload boost::dll::import_symbol(const boost::dll::fs::path& lib, const char* name, load_mode::type mode) @@ -128,7 +128,7 @@ BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(const shared_library& lib, const char using type = boost::dll::detail::import_type; auto p = boost::make_shared(lib); - return type(p, boost::addressof(p->get(name))); + return type(p, std::addressof(p->get(name))); } //! \overload boost::dll::import_symbol(const boost::dll::fs::path& lib, const char* name, load_mode::type mode) @@ -145,7 +145,7 @@ BOOST_DLL_IMPORT_RESULT_TYPE import_symbol(shared_library&& lib, const char* nam auto p = boost::make_shared( std::move(lib) ); - return type(p, boost::addressof(p->get(name))); + return type(p, std::addressof(p->get(name))); } //! \overload boost::dll::import_symbol(const boost::dll::fs::path& lib, const char* name, load_mode::type mode) diff --git a/include/boost/dll/import_mangled.hpp b/include/boost/dll/import_mangled.hpp index c4dfe18c..1a5e22cf 100644 --- a/include/boost/dll/import_mangled.hpp +++ b/include/boost/dll/import_mangled.hpp @@ -21,10 +21,9 @@ #include #include #include -#include -#include -#include -#include + +#include // std::addressof +#include #ifdef BOOST_HAS_PRAGMA_ONCE @@ -93,8 +92,8 @@ class mangled_library_mem_fn> { // simple enough to be here -template struct is_variable : boost::false_type {}; -template struct is_variable> : boost::is_object {}; +template struct is_variable : std::false_type {}; +template struct is_variable> : std::is_object {}; template ::value, @@ -112,7 +111,7 @@ struct mangled_import_type, true,false,false> //is function { return type( boost::make_shared(p.shared_lib()), - boost::addressof(p.get_function(name))...); + std::addressof(p.get_function(name))...); } }; @@ -153,7 +152,7 @@ struct mangled_import_type, false, false, true> //is variable { return type( boost::make_shared(p.shared_lib()), - boost::addressof(p.get_variable(name))); + std::addressof(p.get_variable(name))); } }; @@ -281,7 +280,7 @@ BOOST_DLL_MANGLED_IMPORT_RESULT_TYPE import_mangled(const shared_library& lib, c typedef typename boost::dll::experimental::detail::mangled_import_type> type; boost::shared_ptr p = boost::make_shared(lib); - return type::make(p, name); + return type::boostmake(p, name); } //! \overload boost::dll::import(const boost::dll::fs::path& lib, const char* name, load_mode::type mode) diff --git a/include/boost/dll/library_info.hpp b/include/boost/dll/library_info.hpp index 95747e0c..d68d7a9a 100644 --- a/include/boost/dll/library_info.hpp +++ b/include/boost/dll/library_info.hpp @@ -14,9 +14,9 @@ #include #include #include -#include #include +#include #include #include @@ -50,15 +50,15 @@ class library_info: private boost::noncopyable { } fmt_; /// @cond - inline static void throw_if_in_32bit_impl(boost::true_type /* is_32bit_platform */) { + inline static void throw_if_in_32bit_impl(std::true_type /* is_32bit_platform */) { boost::throw_exception(std::runtime_error("Not native format: 64bit binary")); } - inline static void throw_if_in_32bit_impl(boost::false_type /* is_32bit_platform */) noexcept {} + inline static void throw_if_in_32bit_impl(std::false_type /* is_32bit_platform */) noexcept {} inline static void throw_if_in_32bit() { - throw_if_in_32bit_impl( boost::integral_constant() ); + throw_if_in_32bit_impl( std::integral_constant() ); } static void throw_if_in_windows() { diff --git a/include/boost/dll/shared_library.hpp b/include/boost/dll/shared_library.hpp index c85a1046..30b44f13 100644 --- a/include/boost/dll/shared_library.hpp +++ b/include/boost/dll/shared_library.hpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -26,6 +25,7 @@ # include #endif +#include #include // std::move #ifdef BOOST_HAS_PRAGMA_ONCE @@ -341,19 +341,19 @@ class shared_library * \throw \forcedlinkfs{system_error} if symbol does not exist or if the DLL/DSO was not loaded. */ template - inline typename boost::enable_if_c::value || boost::is_reference::value, T>::type get(const std::string& symbol_name) const { + inline typename std::enable_if::value || std::is_reference::value, T>::type get(const std::string& symbol_name) const { return get(symbol_name.c_str()); } //! \overload T& get(const std::string& symbol_name) const template - inline typename boost::disable_if_c::value || boost::is_reference::value, T&>::type get(const std::string& symbol_name) const { + inline typename std::enable_if::value || std::is_reference::value), T&>::type get(const std::string& symbol_name) const { return get(symbol_name.c_str()); } //! \overload T& get(const std::string& symbol_name) const template - inline typename boost::enable_if_c::value || boost::is_reference::value, T>::type get(const char* symbol_name) const { + inline typename std::enable_if::value || std::is_reference::value, T>::type get(const char* symbol_name) const { return boost::dll::detail::aggressive_ptr_cast( get_void(symbol_name) ); @@ -361,7 +361,7 @@ class shared_library //! \overload T& get(const std::string& symbol_name) const template - inline typename boost::disable_if_c::value || boost::is_reference::value, T&>::type get(const char* symbol_name) const { + inline typename std::enable_if::value || std::is_reference::value), T&>::type get(const char* symbol_name) const { return *boost::dll::detail::aggressive_ptr_cast( get_void(symbol_name) ); diff --git a/include/boost/dll/smart_library.hpp b/include/boost/dll/smart_library.hpp index 12b14bbf..d1c6ae24 100644 --- a/include/boost/dll/smart_library.hpp +++ b/include/boost/dll/smart_library.hpp @@ -27,10 +27,8 @@ #include #include #include -#include -#include -#include +#include #include // std::move namespace boost { @@ -436,14 +434,14 @@ void get(const smart_library& sm, const std::string &name); #endif template -typename boost::enable_if, T&>::type get(const smart_library& sm, const std::string &name) +typename std::enable_if::value, T&>::type get(const smart_library& sm, const std::string &name) { return sm.get_variable(name); } template -typename boost::enable_if, T&>::type get(const smart_library& sm, const std::string &name) +typename std::enable_if::value, T&>::type get(const smart_library& sm, const std::string &name) { return sm.get_function(name); }