Re: [Boost-bugs] [Boost C++ Libraries] #196: operator<<(ostream &, const greg_month &) broken

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #196: operator<<(ostream &, const greg_month &) broken
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-09-12 09:39:26


#196: operator<<(ostream &, const greg_month &) broken
-----------------------+----------------------------------------------------
  Reporter: huanghao | Owner: az_sw_dude
      Type: Bugs | Status: closed
 Milestone: | Component: date_time
   Version: None | Severity:
Resolution: Fixed | Keywords:
-----------------------+----------------------------------------------------
Comment (by anonymous):

 I have it marked in my diary, can't wait now. Love Sandra, Sue & Sheelah.
 xxxx



 Replying to [ticket:196 huanghao]:
> {{{
>


 In greg_facet, the "os << .... << m" line will cause a
> recursion that will never return.
>
>
> template <class charT, class traits>
> inline
> std::basic_ostream<charT, traits>&
> operator<<(std::basic_ostream<charT, traits>& os,
> const greg_month& m)
> {
> typedef
> boost::date_time::ostream_month_formatter<greg_base_facet,
> charT> greg_month_formatter;
> std::locale locale = os.getloc();
> if (std::has_facet<greg_base_facet>(locale)) {
> const greg_base_facet& f =
> std::use_facet<greg_base_facet>(locale);
> greg_month_formatter::format_month(m, os, f);
>
> }
> else { //default to numeric
> os << std::setw(2) << std::setfill('0') << m;
> }
>
> return os;
> }
>
> }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/196#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC