Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template get

boost::dll::experimental::get

Synopsis

// In header: <boost/dll/smart_library.hpp>


template<typename T> 
  boost::enable_if< boost::is_object< T >, T & >::type 
  get(const smart_library & sm, const std::string & name);

Description

Helper functions for overloads.

Gets either a variable, function or member-function, depending on the signature.

smart_library sm("lib.so");
get<int>(sm, "space::value"); //import a variable
get<void(int)>(sm, "space::func"); //import a function
get<some_class, void(int)>(sm, "space::class_::mem_fn"); //import a member function

Parameters:

name

The name of the entity to import

sm

A reference to the smart_library


PrevUpHomeNext