2
0
mirror of https://github.com/boostorg/dll.git synced 2026-01-26 06:32:10 +00:00

Modernize code and drop Boost.Function dependency

This commit is contained in:
Antony Polukhin
2024-12-17 13:15:55 +03:00
parent c66dfab77f
commit f8b1153105
21 changed files with 77 additions and 114 deletions

View File

@@ -27,9 +27,10 @@ std::size_t search_for_symbols(const std::vector<boost::dll::fs::path>& plugins)
}
// library has symbol, importing...
typedef boost::shared_ptr<my_plugin_api> (pluginapi_create_t)();
boost::function<pluginapi_create_t> creator
= dll::import_alias<pluginapi_create_t>(std::move(lib), "create_plugin");
using pluginapi_create_t = boost::shared_ptr<my_plugin_api>();
auto creator = dll::import_alias<pluginapi_create_t>(
std::move(lib), "create_plugin"
);
std::cout << "Matching plugin name: " << creator()->name() << std::endl;
++ plugins_found;