Skip to content

Commit

Permalink
Remove remaining parts of Boost.Move
Browse files Browse the repository at this point in the history
  • Loading branch information
apolukhin committed Dec 15, 2024
1 parent 52e4837 commit b42fdd8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
2 changes: 2 additions & 0 deletions include/boost/dll/detail/posix/shared_library_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <boost/core/invoke_swap.hpp>
#include <boost/predef/os.h>

#include <utility> // std::move

#include <dlfcn.h>
#include <cstring> // strncmp
#if !BOOST_OS_MACOS && !BOOST_OS_IOS && !BOOST_OS_QNX
Expand Down
2 changes: 2 additions & 0 deletions include/boost/dll/detail/windows/shared_library_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include <boost/winapi/dll.hpp>

#include <utility> // std::move

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif
Expand Down
29 changes: 15 additions & 14 deletions include/boost/dll/import_class.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <boost/dll/smart_library.hpp>
#include <boost/dll/import_mangled.hpp>
#include <memory>
#include <utility> // std::move

#if (__cplusplus < 201103L) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201103L)
# error This file requires C++11 at least!
Expand Down Expand Up @@ -147,14 +148,14 @@ class imported_class
static imported_class<T> make(smart_library&& lib, Args...args)
{
typedef detail::sequence<Args...> *seq;
return imported_class(seq(), boost::move(lib), static_cast<Args>(args)...);
return imported_class(seq(), std::move(lib), static_cast<Args>(args)...);
}

template<typename ...Args>
static imported_class<T> make(smart_library&& lib, std::size_t size, Args...args)
{
typedef detail::sequence<Args...> *seq;
return imported_class(seq(), boost::move(lib), size, static_cast<Args>(args)...);
return imported_class(seq(), std::move(lib), size, static_cast<Args>(args)...);
}
template<typename ...Args>
static imported_class<T> make(const smart_library& lib, Args...args)
Expand Down Expand Up @@ -340,7 +341,7 @@ imported_class<T>::imported_class(detail::sequence<Args...> *, const smart_libra
template<typename T>
template<typename ...Args>
imported_class<T>::imported_class(detail::sequence<Args...> *, smart_library && lib, Args...args)
: _lib(boost::move(lib)),
: _lib(std::move(lib)),
_data(make_data<Args...>(lib, static_cast<Args>(args)...)),
_is_allocating(false),
_size(0),
Expand All @@ -352,7 +353,7 @@ imported_class<T>::imported_class(detail::sequence<Args...> *, smart_library &&
template<typename T>
template<typename ...Args>
imported_class<T>::imported_class(detail::sequence<Args...> *, smart_library && lib, std::size_t size, Args...args)
: _lib(boost::move(lib)),
: _lib(std::move(lib)),
_data(make_data<Args...>(lib, size, static_cast<Args>(args)...)),
_is_allocating(true),
_size(size),
Expand Down Expand Up @@ -427,15 +428,15 @@ import_class(const smart_library& lib_, std::size_t size, Args...args)
{
smart_library lib(lib_);

return imported_class<T>::template make<Args...>(boost::move(lib), size, static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), size, static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
template<typename T, typename ... Args> imported_class<T>
import_class(const smart_library& lib_, Args...args)
{
smart_library lib(lib_);
return imported_class<T>::template make<Args...>(boost::move(lib), static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
Expand All @@ -444,7 +445,7 @@ import_class(const smart_library& lib_, const std::string & alias_name, Args...a
{
smart_library lib(lib_);
lib.add_type_alias<T>(alias_name);
return imported_class<T>::template make<Args...>(boost::move(lib), static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
Expand All @@ -454,7 +455,7 @@ import_class(const smart_library& lib_, std::size_t size, const std::string & al
smart_library lib(lib_);

lib.add_type_alias<T>(alias_name);
return imported_class<T>::template make<Args...>(boost::move(lib), size, static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), size, static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
Expand All @@ -464,45 +465,45 @@ import_class(const smart_library& lib_, const std::string & alias_name, std::siz
smart_library lib(lib_);

lib.add_type_alias<T>(alias_name);
return imported_class<T>::template make<Args...>(boost::move(lib), size, static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), size, static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
template<typename T, typename ... Args> imported_class<T>
import_class(smart_library && lib, Args...args)
{
return imported_class<T>::template make<Args...>(boost::move(lib), static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
template<typename T, typename ... Args> imported_class<T>
import_class(smart_library && lib, const std::string & alias_name, Args...args)
{
lib.add_type_alias<T>(alias_name);
return imported_class<T>::template make<Args...>(boost::move(lib), static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
template<typename T, typename ... Args> imported_class<T>
import_class(smart_library && lib, std::size_t size, Args...args)
{
return imported_class<T>::template make<Args...>(boost::move(lib), size, static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), size, static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
template<typename T, typename ... Args> imported_class<T>
import_class(smart_library && lib, std::size_t size, const std::string & alias_name, Args...args)
{
lib.add_type_alias<T>(alias_name);
return imported_class<T>::template make<Args...>(boost::move(lib), size, static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), size, static_cast<Args>(args)...);
}

//! \overload boost::dll::import_class(const smart_library& lib, std::size_t, Args...)
template<typename T, typename ... Args> imported_class<T>
import_class(smart_library && lib, const std::string & alias_name, std::size_t size, Args...args)
{
lib.add_type_alias<T>(alias_name);
return imported_class<T>::template make<Args...>(boost::move(lib), size, static_cast<Args>(args)...);
return imported_class<T>::template make<Args...>(std::move(lib), size, static_cast<Args>(args)...);
}


Expand Down
2 changes: 2 additions & 0 deletions include/boost/dll/shared_library.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
# include <boost/dll/detail/posix/shared_library_impl.hpp>
#endif

#include <utility> // std::move

#ifdef BOOST_HAS_PRAGMA_ONCE
# pragma once
#endif
Expand Down
2 changes: 1 addition & 1 deletion include/boost/dll/smart_library.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/is_function.hpp>


#include <utility> // std::move

namespace boost {
namespace dll {
Expand Down

0 comments on commit b42fdd8

Please sign in to comment.