# Shared Library Reference

Includes alias methods and macro. You can include this header or boost/dll/shared_library.hpp to reduce dependencies in case you do not use the refcountable functions.

Define this macro to explicitly specify translation unit in which alias must be instantiated. See section 'Limitations' for more info. You may find usage examples in source codes of almost each tutorial. Must be used in code, when BOOST_DLL_FORCE_NO_WEAK_EXPORTS is defined

Define this macro to disable exporting weak symbols and start using the BOOST_DLL_FORCE_ALIAS_INSTANTIATION. This may be usefull for working around linker problems or to test your program for compatability with linkers that do not support export of weak symbols.

Macro that allows linker to select any occurrence of this symbol instead of failing with 'multiple definitions' error at linktime.

This macro does not work on Android, IBM XL C/C++ and MinGW+Windows because of linker problems with exporting weak symbols (See https://code.google.com/p/android/issues/detail?id=70206, https://sourceware.org/bugzilla/show_bug.cgi?id=17480)

Name of the section. Must be a valid C identifier without quotes not longer than 8 bytes.

Can be "read" or "write" (without quotes!).

Macro that puts symbol to a specific section. On MacOS all the sections are put into "__DATA" segment.

Function or variable for which an alias must be made.

Name of the alias. Must be a valid C identifier.

Makes an alias name for exported function or variable.

This macro is useful in cases of long mangled C++ names. For example some `void boost::foo(std::sting)` function name will change to something like `N5boostN3foosE` after mangling. Importing function by `N5boostN3foosE` name does not looks user friendly, especially assuming the fact that different compilers have different mangling schemes. AliasName is the name that won't be mangled and can be used as a portable import name.

Can be used in any namespace, including global. FunctionOrVar must be fully qualified, so that address of it could be taken. Multiple different aliases for a single variable/function are allowed.

Make sure that AliasNames are unique per library/executable. Functions or variables in global namespace must not have names same as AliasNames.

Same AliasName in different translation units must point to the same FunctionOrVar.

Puts all the aliases into the "boostdll" read only section of the binary. Equal to BOOST_DLL_ALIAS_SECTIONED(FunctionOrVar, AliasName, boostdll).

Example:

     namespace foo {
       void bar(std::string&);

       BOOST_DLL_ALIAS(foo::bar, foo_bar)
     }

     BOOST_DLL_ALIAS(foo::bar, foo_bar_another_alias_name)

See: BOOST_DLL_ALIAS_SECTIONED for making alias in a specific section.

Function or variable for which an alias must be made.

Name of the alias. Must be a valid C identifier.

Name of the section. Must be a valid C identifier without quotes not longer than 8 bytes.

Same as BOOST_DLL_ALIAS but puts alias name into the user specified section.

Example:

     namespace foo {
       void bar(std::string&);

       BOOST_DLL_ALIAS_SECTIONED(foo::bar, foo_bar, sect_1) // section "sect_1" now exports "foo_bar"
     }

Function or variable for which an unmangled alias must be made.

Exports variable or function with unmangled alias name.

This macro is useful in cases of long mangled C++ names. For example some `void boost::foo(std::sting)` function name will change to something like `N5boostN3foosE` after mangling. Importing function by `N5boostN3foosE` name does not looks user friendly, especially assuming the fact that different compilers have different mangling schemes.*

Must be used in scope where FunctionOrVar declared. FunctionOrVar must be a valid C name, which means that it must not contain `::`.

Functions or variables in global namespace must not have names same as FunctionOrVar.

Puts all the aliases into the "boostdll" read only section of the binary. Almost same as BOOST_DLL_ALIAS(FunctionOrVar, FunctionOrVar).

Example:

     namespace foo {
       void bar(std::string&);
       BOOST_DLL_AUTO_ALIAS(bar)
     }

See: BOOST_DLL_ALIAS for making an alias with different names.

Contains only the `boost::dll::library_info` class that is capable of extracting different information from binaries.

Class that is capable of extracting different information from a library or binary file. Currently understands ELF, MACH-O and PE formats on all the platforms.
std::vector< std::string >

List of sections that exist in binary file.

std::vector< std::string >

List of all the exportable symbols from all the sections that exist in binary file.

std::vector< std::string > `const char *

Name of the section from which symbol names must be returned.

`

List of symbols from the specified section.

std::vector< std::string > `const std::string &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const boost::filesystem::path &

Path to the binary file from which the info must be extracted.

bool
true

Throw an exception if this file format is not supported by OS.

Opens file with specified path and prepares for information extraction.

`Nothing.`

Provides methods for getting acceptable by `boost::dll::shared_library` location of symbol, source line or program.

boost::filesystem::path

Type of the symbol, must not be explicitly specified.

const T &

Symbol which location is to be determined.

boost::system::error_code &

Variable that will be set to the result of the operation.

boost::filesystem::path `const T &`

On success returns full path and name of the binary object that holds symbol.

Examples:

     int var;
     void foo() {}

     int main() {
        dll::symbol_location(var);                     // returns program location
        dll::symbol_location(foo);                     // returns program location
        dll::symbol_location(std::cerr);               // returns location of libstdc++: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
        dll::symbol_location(std::placeholders::_1);   // returns location of libstdc++: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
        dll::symbol_location(std::puts);               // returns location of libc: "/lib/x86_64-linux-gnu/libc.so.6"
     }

Path to the binary object that holds symbol or empty path in case error.

`std::bad_alloc` in case of insufficient memory. Overload that does not accept boost::system::error_code also throws boost::system::system_error.

boost::filesystem::path `boost::system::error_code &

Variable that will be set to the result of the operation.

`
boost::filesystem::path

On success returns full path and name of the binary object that holds the current line of code (the line in which the `this_line_location()` method was called).

`std::bad_alloc` in case of insufficient memory. Overload that does not accept boost::system::error_code also throws boost::system::system_error.

boost::filesystem::path `boost::system::error_code &

Variable that will be set to the result of the operation.

`
boost::filesystem::path

On success returns full path and name of the currently running program (the one which contains the `main()` function).

Return value can be used as a parameter for `shared_library`. See Tutorial "Linking plugin into the executable" for usage example. Flag '-rdynamic' must be used when linking the plugin into the executable on Linux OS.

`std::bad_alloc` in case of insufficient memory. Overload that does not accept boost::system::error_code also throws boost::system::system_error.

Contains the `boost::dll::shared_library` class, core class for all the DLL/DSO operations.

This class can be used to load a Dynamic link libraries (DLL's) or Shared Libraries, also know as dynamic shared objects (DSO's) and get their exported symbols (functions and variables).

`shared_library` instances share reference count to an actual loaded DLL/DSO, so it is safe and memory efficient to have multiple instances of `shared_library` referencing the same DLL/DSO even if those instances were loaded using different paths (relative + absolute) referencing the same object.

On Linux/POSIX link with library "dl". "-fvisibility=hidden" flag is also recommended for use on Linux/POSIX.

platform_specific
`shared_library` & `const `shared_library` &

A library to copy.

` `boost::system::error_code &

Variable that will be set to the result of the operation.

`

Makes *this share the same shared object as lib. If *this is loaded, then unloads it.

lib.location() == this->location(), lib == *this

`std::bad_alloc` in case of insufficient memory.

`shared_library` & `const `shared_library` &

A library instance to assign from.

`

Makes *this share the same shared object as lib. If *this is loaded, then unloads it.

lib.location() == this->location()

`boost::system::system_error` in case of insufficient memory.

void `const boost::filesystem::path &

Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or boost::filesystem::path.

` `load_mode::typeload_mode::default_mode

A mode that will be used on library load.

`

Loads a library by specified path with a specified mode.

Note that if some library is already loaded in this instance, load will call unload() and then load the new provided library.

`boost::system::system_error` in case of insufficient memory.

void `const boost::filesystem::path &

Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or boost::filesystem::path.

` `boost::system::error_code &

Variable that will be set to the result of the operation.

` `load_mode::typeload_mode::default_mode

A mode that will be used on library load.

`

Loads a library by specified path with a specified mode.

Note that if some library is already loaded in this instance, load will call unload() and then load the new provided library.

`std::bad_alloc` in case of insufficient memory.

void `const boost::filesystem::path &` `load_mode::type` `boost::system::error_code &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void

Unloads a shared library. If library was loaded multiple times by different instances, the actual DLL/DSO won't be unloaded until there is at least one instance that references the DLL/DSO.

this->is_loaded() returns false.

`Nothing.`

bool

Check if an library is loaded.

true if a library has been loaded.

`Nothing.`

bool

Check if an library is not loaded.

true if a library has not been loaded.

`Nothing.`

bool

Check if an library is loaded.

true if a library has been loaded.

`Nothing.`

bool `const char *

Null-terminated symbol name. Can handle std::string, char*, const char*.

`

Search for a given symbol on loaded library. Works for all symbols, including alias names.

`true` if the loaded library contains a symbol with a given name.

`Nothing.`

bool `const std::string &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

boost::enable_if_c< boost::is_member_pointer< T >::value||boost::is_reference< T >::value, T >::type

Type of the symbol that we are going to import. Must be explicitly specified.

const std::string &

Null-terminated symbol name. Can handle std::string, char*, const char*.

Returns reference to the symbol (function or variable) with the given name from the loaded library. This call will always succeed and throw nothing if call to `has(const char* )` member function with the same symbol name returned `true`.

Example:

     int& i0 = lib.get<int>("integer_name");
     int& i1 = *lib.get<int*>("integer_alias_name");

Reference to the symbol.

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

boost::disable_if_c< boost::is_member_pointer< T >::value||boost::is_reference< T >::value, T & >::type `const std::string &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

boost::enable_if_c< boost::is_member_pointer< T >::value||boost::is_reference< T >::value, T >::type `const char *`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

boost::disable_if_c< boost::is_member_pointer< T >::value||boost::is_reference< T >::value, T & >::type `const char *`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

T &

Type of the symbol that we are going to import. Must be explicitly specified..

const char *

Null-terminated alias symbol name. Can handle std::string, char*, const char*.

Returns a symbol (function or variable) from a shared library by alias name of the symbol.

Example:

     int& i = lib.get_alias<int>("integer_alias_name");

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

T & `const std::string &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

native_handle_t

Returns the native handler of the loaded library.

Platform-specific handle.

boost::filesystem::path

Returns full path and name of this shared object.

Example:

     shared_library lib("test_lib.dll");
     filesystem::path full_path = lib.location(); // C:\Windows\System32\test_lib.dll

Full path to the shared library.

`boost::system::system_error`

boost::filesystem::path `boost::system::error_code &

Variable that will be set to the result of the operation.

`

Returns full path and name of shared module.

Example:

     shared_library lib("test_lib.dll");
     filesystem::path full_path = lib.location(); // C:\Windows\System32\test_lib.dll

Full path to the shared library.

`std::bad_alloc.`

void ``shared_library` &

Library to swap with.

`

Swaps two libraries. Does not invalidate existing symbols and functions loaded from libraries.

`Nothing.`

Creates in anstance that does not reference any DLL/DSO.

this->is_loaded() returns false.

`Nothing.`

const `shared_library` &

A library to copy.

Copy constructor that increments the reference count of an underlying shared library. Same as calling constructor with `lib.location()` parameter.

lib == *this

`boost::system::system_error` in case of insufficient memory.

const `shared_library` &

A shared library to copy.

boost::system::error_code &

Variable that will be set to the result of the operation.

Copy constructor that increments the reference count of an underlying shared library. Same as calling constructor with `lib.location(), ec` parameters.

lib == *this

`std::bad_alloc` in case of insufficient memory.

shared_library
&&

A shared library to move from.

Move constructor. Does not invalidate existing symbols and functions loaded from lib.

lib.is_loaded() returns false, this->is_loaded() return true.

`Nothing.`

const boost::filesystem::path &

Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or boost::filesystem::path.

load_mode::type
load_mode::default_mode

A mode that will be used on library load.

Loads a library by specified path with a specified mode.

`boost::system::system_error` in case of insufficient memory.

const boost::filesystem::path &

Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or boost::filesystem::path.

boost::system::error_code &

Variable that will be set to the result of the operation.

load_mode::type
load_mode::default_mode

A mode that will be used on library load.

Loads a library by specified path with a specified mode.

`std::bad_alloc` in case of insufficient memory.

const boost::filesystem::path &
load_mode::type
boost::system::error_code &

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

`shared_library` & `const `shared_library` &

A shared library to assign from.

`

Assignment operator. If this->is_loaded() then calls this->unload(). Does not invalidate existing symbols and functions loaded from lib.

lib == *this

`boost::system::system_error` in case of insufficient memory.

`shared_library` & ``shared_library` &&

A library to move from.

`

Move assignment operator. If this->is_loaded() then calls this->unload(). Does not invalidate existing symbols and functions loaded from lib.

lib.is_loaded() returns false.

`Nothing.`

Destroys the object by calling `unload()`. If library was loaded multiple times by different instances, the actual DLL/DSO won't be unloaded until there is at least one instance that references the DLL/DSO.

`Nothing.`

boost::filesystem::path

Returns suffix of shared module: in a call to load() or the constructor/load.

The suffix od shared module: ".dll" (Windows), ".so" (Unix/Linux/BSD), ".dylib" (MacOS/IOS)

bool `const `shared_library` &` `const `shared_library` &` Very fast equality check that compares the actual DLL/DSO objects. Throws nothing.
bool `const `shared_library` &` `const `shared_library` &` Very fast inequality check that compares the actual DLL/DSO objects. Throws nothing.
bool `const `shared_library` &` `const `shared_library` &` Compare the actual DLL/DSO objects without any guarantee to be stable between runs. Throws nothing.
void ``shared_library` &` ``shared_library` &` Swaps two shared libraries. Does not invalidate symbols and functions loaded from libraries. Throws nothing.

Contains only the boost::dll::load_mode::type enum and operators related to it.

Default open mode. See the Default: comments below to find out the flags that are enabled by default.

Platforms: Windows

Default: disabled

If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination. Also, the system does not load additional executable modules that are referenced by the specified module.

Note Do not use this value; it is provided only for backward compatibility. If you are planning to access only data or resources in the DLL, use LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_IMAGE_RESOURCE or both.

Platforms: Windows

Default: disabled

If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL.

Platforms: Windows

Default: disabled

If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy.

This value cannot be combined with any LOAD_LIBRARY_SEARCH flag.

Platforms: POSIX

Default: enabled

Relocations shall be performed at an implementation-defined time, ranging from the time of the dlopen() call until the first reference to a given symbol occurs.

Specifying RTLD_LAZY should improve performance on implementations supporting dynamic symbol binding as a process may not reference all of the functions in any given object. And, for systems supporting dynamic symbol resolution for normal process execution, this behavior mimics the normal handling of process execution.

Platforms: POSIX

Default: disabled

All necessary relocations shall be performed when the object is first loaded. This may waste some processing if relocations are performed for functions that are never referenced. This behavior may be useful for plugins that need to know as soon as an object is loaded that all symbols referenced during execution are available.

Platforms: POSIX

Default: disabled

The object's symbols shall be made available for the relocation processing of any other object. In addition, symbol lookup using dlopen(0, mode) and an associated dlsym() allows objects loaded with this mode to be searched.

Platforms: POSIX

Default: enabled

The object's symbols shall not be made available for the relocation processing of any other object.

This is a default Windows behavior that can not be changed.

Platforms: POSIX (requires glibc >= 2.3.4)

Default: disabled

The object will use its own symbols in preference to global symbols with the same name contained in libraries that have already been loaded. This flag is not specified in POSIX.1-2001.

Platforms: Windows, POSIX

Default: disabled

Append a platform specific extension and prefix to shared library filename before trying to load it. If load attempt fails, try to load with exactly specified name.

Example:

     // Opens `./my_plugins/plugin1.dll` on Windows, `./my_plugins/libplugin1.so` on Linux, `./my_plugins/libplugin1.dylib` on MacOS.
     // If that fails, loads `./my_plugins/plugin1`
     boost::dll::shared_library lib("./my_plugins/plugin1", load_mode::append_decorations);

Platforms: Windows, POSIX

Default: disabled

Allow loading from system folders if path to library contains no parent path.

Library load modes.

Each of system family provides own modes. Flags not supported by a particular platform will be silently ignored.

For a detailed description of platform specific options see: Windows specific options, POSIX specific options.

BOOST_CONSTEXPR type `type` `type` Free operators for load_mode::type flag manipulation.
BOOST_CXX14_CONSTEXPR type & `type &` `type`
BOOST_CONSTEXPR type `type` `type`
BOOST_CXX14_CONSTEXPR type & `type &` `type`
BOOST_CONSTEXPR type `type` `type`
BOOST_CXX14_CONSTEXPR type & `type &` `type`
BOOST_CONSTEXPR type `type`

Contains the `boost::dll::experimental::smart_library` class for loading mangled symbols.

Extremely experimental! Requires C++14! Will change in next version of Boost! boost/dll/smart_library.hpp is not included in boost/dll.hpp

This class is an extension of `shared_library`, which allows to load C++ symbols.

This class allows type safe loading of overloaded functions, member-functions, constructors and variables. It also allows to overwrite classes so they can be loaded, while being declared with different names.

Is still very experimental.

Currently known limitations:

Member functions must be defined outside of the class to be exported. That is:

     //not exported:
     struct BOOST_SYMBOL_EXPORT my_class { void func() {}};
     //exported
     struct BOOST_SYMBOL_EXPORT my_class { void func();};
     void my_class::func() {};

With the current analysis, the first version does get exported in MSVC. MinGW also does export it, BOOST_SYMBOL_EXPORT is written before it. To allow this on windows one can use BOOST_DLL_MEMBER_EXPORT for this, so that MinGW and MSVC can provide those functions. This does however not work with gcc on linux.

Direct initialization of members. On linux the following member variable i will not be initialized when using the allocating contructor:

     struct BOOST_SYMBOL_EXPORT my_class { int i; my_class() : i(42) {} };

This does however not happen when the value is set inside the constructor function.

const `shared_library` &

Get the underlying `shared_library`

const mangled_storage &

Acces to the mangled storage, which is created on construction.

`Nothing.`

void `const boost::filesystem::path &

Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or boost::filesystem::path.

` `load_mode::typeload_mode::default_mode

A mode that will be used on library load.

`

Loads a library by specified path with a specified mode.

Note that if some library is already loaded in this instance, load will call unload() and then load the new provided library.

(const boost::filesystem::path& lib_path, load_mode::type mode = load_mode::default_mode)
void `const boost::filesystem::path &

Library file name. Can handle std::string, const char*, std::wstring, const wchar_t* or boost::filesystem::path.

` `boost::system::error_code &` `load_mode::typeload_mode::default_mode

A mode that will be used on library load.

`

Loads a library by specified path with a specified mode.

Note that if some library is already loaded in this instance, load will call unload() and then load the new provided library.

(const boost::filesystem::path& lib_path, boost::system::error_code& ec, load_mode::type mode = load_mode::default_mode)
void `const boost::filesystem::path &` `load_mode::type` `boost::system::error_code &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

T &

Type of the variable

const std::string &

Name of the variable

Load a variable from the referenced library.

Unlinke shared_library::get this function will also load scoped variables, which also includes static class members.

When mangled, MSVC will also check the type.

A reference to the variable of type T.

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

Func &

Type of the function, required for determining the overload

const std::string &

Name of the function.

Load a function from the referenced library.

Example:

     smart_library lib("test_lib.so");
     typedef int      (&add_ints)(int, int);
     typedef double (&add_doubles)(double, double);
     add_ints     f1 = lib.get_function<int(int, int)>         ("func_name");
     add_doubles  f2 = lib.get_function<double(double, double)>("func_name");

When mangled, MSVC will also check the return type.

A reference to the function of type F.

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

unspecified

The class the function is a member of. If Class is const, the function will be assumed as taking a const this-pointer. The same applies for volatile.

Signature of the function, required for determining the overload

const std::string &

Name of the function.

Load a member-function from the referenced library.

Example (import class is MyClass, which is available inside the library and the host):

     smart_library lib("test_lib.so");

     typedef int      MyClass(*func)(int);
     typedef int   MyClass(*func_const)(int) const;

     add_ints     f1 = lib.get_mem_fn<MyClass, int(int)>              ("MyClass::function");
     add_doubles  f2 = lib.get_mem_fn<const MyClass, double(double)>("MyClass::function");

When mangled, MSVC will also check the return type.

A pointer to the member-function with the signature provided

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

constructor< Signature >

Signature of the function, required for determining the overload. The return type is the class which this is the constructor of.

Load a constructor from the referenced library.

Example (import class is MyClass, which is available inside the library and the host):

     smart_library lib("test_lib.so");

     constructor<MyClass(int)    f1 = lib.get_mem_fn<MyClass(int)>();

A constructor object.

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

destructor< Class >

The class whichs destructor shall be loaded

Load a destructor from the referenced library.

Example (import class is MyClass, which is available inside the library and the host):

     smart_library lib("test_lib.so");

     destructor<MyClass>     f1 = lib.get_mem_fn<MyClass>();

A destructor object.

`boost::system::system_error` if symbol does not exist or if the DLL/DSO was not loaded.

void `const std::string &

Name of the class the alias is for.

`

This function can be used to add a type alias.

This is to be used, when a class shall be imported, which is not declared on the host side.

Example:

     smart_library lib("test_lib.so");

     lib.add_type_alias<MyAlias>("MyClass"); //when using MyAlias, the library will look for MyClass

     //get the destructor of MyClass
     destructor<MyAlias> dtor = lib.get_destructor<MyAlias>();

If the alias-type is not large enough for the imported class, it will result in undefined behaviour.

The alias will only be applied for the type signature, it will not replace the token in the scoped name.

void

Unloads a shared library. If library was loaded multiple times by different instances, the actual DLL/DSO won't be unloaded until there is at least one instance that references the DLL/DSO.

bool

Check if an library is loaded.

bool

Check if an library is not loaded.

bool

Check if an library is loaded.

bool `const char *

Null-terminated symbol name. Can handle std::string, char*, const char*.

`

Search for a given symbol on loaded library. Works for all symbols, including alias names.

bool `const std::string &`

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

`smart_library` & `const `smart_library` &

A library instance to assign from.

`

Makes *this share the same shared object as lib. If *this is loaded, then unloads it.

void ``smart_library` &

Library to swap with.

`

Swaps two libraries. Does not invalidate existing symbols and functions loaded from libraries.

Creates in anstance that does not reference any DLL/DSO.

const boost::filesystem::path &
load_mode::type
load_mode::default_mode

Creates in anstance that does not reference any DLL/DSO.

(const boost::filesystem::path& lib_path, load_mode::type mode = load_mode::default_mode)
const boost::filesystem::path &
boost::system::error_code &
load_mode::type
load_mode::default_mode

Creates in anstance that does not reference any DLL/DSO.

(const boost::filesystem::path& lib_path, boost::system::error_code& ec, load_mode::type mode = load_mode::default_mode)
const boost::filesystem::path &
load_mode::type
boost::system::error_code &

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

smart_library
&&

Creates in anstance that does not reference any DLL/DSO.

(BOOST_RV_REF(smart_library) lib)

Destroys the object by calling `unload()`. If library was loaded multiple times by different instances, the actual DLL/DSO won't be unloaded until there is at least one instance that references the DLL/DSO.

bool `const `smart_library` &` `const `smart_library` &` Very fast equality check that compares the actual DLL/DSO objects. Throws nothing.
bool `const `smart_library` &` `const `smart_library` &` Very fast inequality check that compares the actual DLL/DSO objects. Throws nothing.
bool `const `smart_library` &` `const `smart_library` &` Compare the actual DLL/DSO objects without any guarantee to be stable between runs. Throws nothing.
void ``smart_library` &` ``smart_library` &` Swaps two shared libraries. Does not invalidate symbols and functions loaded from libraries. Throws nothing.