PrevUpHomeNext

Lazy-Instantiation Optimization

Book::Book() : impl_ptr_type(nullptr)
{
   // A Book proxy object is created with no implementation.
}

void
Book::do_something()
{
   if (!*this)
       impl_ptr_type::emplace(args); // Implementation is created later.
   ...
}

PrevUpHomeNext