Boost logo

Boost :

From: Roland Richter (roland_at_[hidden])
Date: 2003-10-24 09:24:54


  I currently implement some logging queue, which has
  a function something like this:

boost::optional<std::string> Logger::get()
   boost::optional<std::string> next;
   if( !queue.empty() )
     next.reset( queue.front() );

   return next; // <-- valid of not?

  This worked for Boost 1.30.0.
  I recently switched to the current Boost CVS snapshot -
  now MSVC++ 7.0 tells that I can no longer return next:

e:\project\something\Logger.cpp(53): error C2558: class 'boost::optional<T>' :
no copy constructor available or copy constructor is declared 'explicit'

  I am aware that optional was updated sometimes back in September -
  what did I miss?

- Roland

Boost list run by bdawes at, gregod at, cpdaniel at, john at