Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Stroika::Foundation::Execution::LazyEvalActivity< CTOR_ARG > Class Template Referencefinal

#include <Activity.h>

Inheritance diagram for Stroika::Foundation::Execution::LazyEvalActivity< CTOR_ARG >:
Stroika::Foundation::Execution::Private_::Activities_::AsStringObj_

Detailed Description

template<typename CTOR_ARG>
class Stroika::Foundation::Execution::LazyEvalActivity< CTOR_ARG >

When creating the activity would be expensive, just capture it in a lambda, and only convert that lambda to an actual string if/when CaptureCurrentActivities is called.

Note
would LIKE to know how to do this as a template specialization of Activity, but haven't figured that out yet.
Example Usage
auto scanningThisAddress = LazyEvalActivity ([&] () -> String { return "scanning ports on {}"_f (ia); });
DeclareActivity da{&scanningThisAddress};
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201

Definition at line 99 of file Activity.h.


The documentation for this class was generated from the following files: