#include #include #include struct A { A(void) { std::cout << "A constructor (" << this << ')' << std::endl; } A(const A&) { std::cout << "A copy constructor (" << this << ')' << std::endl; } ~A(void) { std::cout << "A destructor (" << this << ')' << std::endl; } }; int main(void) { A a1; boost::optional opt1(a1); boost::optional opt2; std::cout << std::endl; opt2 = opt1; std::cout << std::endl; return boost::exit_success; }