singleton: add a public query for validity

This commit is contained in:
Danny Robson 2020-01-28 14:13:12 +11:00
parent 46d19464b5
commit 44509498b7

View File

@ -27,6 +27,13 @@ namespace cruft {
static SelfT *instance;
public:
static bool
valid (void) noexcept
{
return instance;
}
/// instantiates the one blessed value of this type.
///
/// `instantiate` must be called once and once only before any calls