Opened 10 years ago

Closed 9 years ago

#1524 closed Bugs (duplicate)

format_date_parser.hpp(221) : cannot convert parameter 1

Reported by: olafvdspek@… Owned by: az_sw_dude
Milestone: Boost 1.36.0 Component: date_time
Version: Boost 1.34.1 Severity: Problem
Keywords: Cc:


Forwarded from

#include <boost/date_time/gregorian/greg_date.hpp>
#include <boost/date_time/format_date_parser.hpp>
#include <boost/date_time/special_values_parser.hpp>
#include <locale>

int main ()
  boost::date_time::format_date_parser<boost::gregorian::date, char>
      parser(std::string("%Y-%m-%d"), std::locale("C"));
  boost::date_time::special_values_parser<boost::gregorian::date, char>
	  special_parser("a", "a", "a", "a", "a");
  parser.parse_date("2007-01-01", "%Y-%m-%d", special_parser);
  return 0;

1>XBT Tracker.cpp
1>c:\vc\misc\include\boost\date_time\format_date_parser.hpp(221) : error C2664: 'std::istreambuf_iterator<_Elem,_Traits>::istreambuf_iterator(std::basic_streambuf<_Elem,_Traits> *) throw()' : cannot convert parameter 1 from 'std::basic_ostringstream<_Elem,_Traits,_Alloc>' to 'std::basic_streambuf<_Elem,_Traits> *'
1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>
1>        ]
1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>        c:\vc\misc\include\boost\date_time\format_date_parser.hpp(218) : while compiling class template member function 'boost::gregorian::date boost::date_time::format_date_parser<date_type,charT>::parse_date(const std::basic_string<_Elem,_Traits,_Ax> &,const std::basic_string<_Elem,_Traits,_Ax> &,const boost::date_time::special_values_parser<date_type,charT> &) const'
1>        with
1>        [
1>            date_type=boost::gregorian::date,
1>            charT=char,
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _Ax=std::allocator<char>
1>        ]
1>        c:\vc\xbt\tracker\xbt tracker.cpp(10) : see reference to class template instantiation 'boost::date_time::format_date_parser<date_type,charT>' being compiled
1>        with
1>        [
1>            date_type=boost::gregorian::date,
1>            charT=char
1>        ]}}}

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by Andrey Semashev

Resolution: fixed
Status: newclosed

comment:2 Changed 9 years ago by smr@…

Resolution: fixed
Status: closedreopened

This remains a problem with Boost 1.37. The error message from GNU C++ 4.3 is as follows.

/usr/include/boost/date_time/format_date_parser.hpp: In member function ‘date_type boost::date_time::format_date_parser<date_type, charT>::parse_date(const std::basic_string<charT, std::char_traits<_CharT>, std::allocator<_T2> >&, const std::basic_string<charT, std::char_traits<_CharT>, std::allocator<_T2> >&, const boost::date_time::special_values_parser<date_type, charT>&) const [with date_type = boost::gregorian::date, charT = char]’: bug-448576.cxx:33: instantiated from here /usr/include/boost/date_time/format_date_parser.hpp:221: error: invalid conversion from ‘void*’ to ‘std::basic_streambuf<char, std::char_traits<char> >*’ /usr/include/boost/date_time/format_date_parser.hpp:221: error: initializing argument 1 of ‘std::istreambuf_iterator<_CharT, _Traits>::istreambuf_iterator(std::basic_streambuf<_CharT, _Traits>*) [with _CharT = char, _Traits = std::char_traits<char>]’

comment:3 Changed 9 years ago by Andrey Semashev

Resolution: duplicate
Status: reopenedclosed

Duplicate for #1299.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain az_sw_dude.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.