Boost logo

Boost :

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


Hi,

  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() );
     queue.pop();
   }

   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'
         with
         [
             T=_STL::string
         ]

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

- Roland


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk