MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / as

Method as

01.29-optional4/main.cpp:60–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 storage_t() = default;
59
60 T* as() { return reinterpret_cast<T*>(&data); }
61 // use placement new to create an instance of T inside this union
62 };
63 storage_t value;

Callers 2

~optionalMethod · 0.45
~optionalMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected