
"Joe Gottman" <jgottman@carolina.rr.com> wrote in message news:dp1uie$q48$1@sea.gmane.org...
There is an error in the implementation of the converting assignment operator for optional<T>. It is currently implemented as
template<class U> optional& operator= ( optional<U> const& rhs ) { this->assign(rhs.get()); return *this ; }
The problem with this is that if rhs is not initialized then rhs.get() asserts.
I posted this bug report about a month ago. With the new version of boost coming out, I think that it should be fixed in time for boost 1.34. It seems to me that this is a fairly simple fix: template <class U> optional& operator=(optional<U> const &rhs) { if (rhs.is_initialized()) { this->assign(*rhs); } else if (this->is_initialized()) { this->destroy(); } return *this; } Joe Gottman