Boost logo

Boost Users :

From: Keith MacDonald (boost_at_[hidden])
Date: 2004-03-14 07:27:55


I'm trying to convert a gregorian::date to a string, as shown in the
following code:

// Build: cl /EHsc /I \CVS\boost dt.cpp
#include <iostream>
#include <boost/date_time/gregorian/gregorian.hpp>
int main()
{
   boost::gregorian::date today(2004, boost::gregorian::Mar, 14);

   std::cout << today << std::endl;
   return 0;
}

When I compile it with Visual C++ 7.1, using Boost from CVS head, I get the
following error:

\CVS\boost\boost\lexical_cast.hpp(150) : error C2679: binary '>>' : no
operator
found which takes a right-hand operand of type
'boost::date_time::date_formatter
<date_type,format_type,charT>::string_type' (or there is no acceptable
conversion)
        with
        [
            date_type=boost::gregorian::date,
            format_type=boost::date_time::simple_format,
            charT=wchar_t
        ]

The same thing happens when using to_simple_string and
to_simple_string_type<char>, rather than operator<<. I actually want the
result as a basic_string<wchar_t>, but all variations produce this same
error. What am I doing wrong?

Thanks,
Keith MacDonald


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net