June 2017
Intermediate to advanced
532 pages
12h 59m
English
In this recipe, we create an example class that could suit as a member of a typical header-only library. The target is to give it a static member and instantiate it in a globally available manner using the inline keyword, which would not be possible like this before C++17:
// foo_lib.hpp class process_monitor { public: static const std::string standard_string {"some static globally available string"}; }; process_monitor global_process_monitor;
Read now
Unlock full access