If your compiler supports variable templates, and you are using Boost version 1.56 or higher, use emplace()without arguments:
opt.emplace();
If any of the conditions is not satisfied (either a compiler without variational patterns, or a senior Boost), use in_placefactory without arguments:
opt = boost::in_place();
in Boost 1.59, you can call a 0 argument emplace()even in C ++ 03 compilers.