template<typename STRINGISH_T = Characters::String>
class Stroika::Foundation::Execution::Activity< STRINGISH_T >
An Activity is typically a static const or sometimes even constexpr object which contains a description of an ongoing activity. They are generally not meant to be stored or copied, but REFERENCED with DeclareActivity to form a 'current activity stack'.
- Example Usage
static constexpr Activity kBuildingThingy_{
"building thingy"sv };
auto otherActivity = Activity<String> { "abc" + argument };
auto lazyEvalActivity = LazyEvalActivity ([&] () -> String { return argument.Repeat (5) + "x"; });
- Note
- the intended purpose of this is to provide better 'context' for default exception messages, when exceptions are created/thrown.
- See also
- CaptureCurrentActivities
- Note
- for now, constexpr Activity<wstring_view> kActivity; // FAILS This is because AsStringObj_ has a virtual destructor (necessary for other types). That's crazy because constexpr objects are never destroyed, so its crazy to care that they have a virtual DTOR. Still, g++ and msvc both agree on this; I think this MAYBE fixed in C++20 (not yet tested) - because there they at least allow virtual constexpr methods. That might impact (indirectly) whether an object can be constexpr (having a virtual dtor).
Definition at line 69 of file Activity.h.