12 init_(
true) {
new(buf_) T(v); }
15 init_(o.init_) {
if (init_)
new(buf_) T(*o); }
22 operator bool()
const {
return init_; }
24 T& operator*() {
return *
static_cast<T*
>(address()); }
25 const T& operator*()
const {
return *
static_cast<const T*
>(address()); }
27 T* operator->() {
return &(operator*()); }
28 const T* operator->()
const {
return &(operator*()); }
31 void clear() {
static_cast<T*
>(address())->~T(); }
33 void* address() {
return buf_; }
34 const void* address()
const {
return buf_; }
Definition: optional.hpp:6