...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::dll::symbol_location
// In header: <boost/dll/runtime_symbol_info.hpp> template<typename T> boost::dll::fs::path symbol_location(const T & symbol, boost::dll::fs::error_code & ec);
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" }
Parameters: |
|
||||
Template Parameters: |
|
||||
Returns: |
Path to the binary object that holds symbol or empty path in case error. |
||||
Throws: |
std::bad_alloc in case of insufficient memory. Overload that does not accept boost::dll::fs::error_code also throws boost::dll::fs::system_error. |