
// template <class charT> T10 put_time(const struct tm* tmb, const charT* fmt);

#include <iomanip>
#include <ostream>
#include <cassert>

#include "test_macros.h"
#include "platform_support.h" // locale name macros

template <class CharT>
class testbuf
    : public std::basic_streambuf<CharT>
{
    typedef std::basic_streambuf<CharT> base;
    std::basic_string<CharT> str_;
public:
    testbuf()
    {
    }

    std::basic_string<CharT> str() const
        {return std::basic_string<CharT>(base::pbase(), base::pptr());}

protected:

    virtual typename base::int_type
        overflow(typename base::int_type ch = base::traits_type::eof())
        {
            if (ch!= base::traits_type::eof())
            {
                int n = static_cast<int>(str_.size());
                str_.push_back(static_cast<CharT>(ch));
                str_.resize(str_.capacity());
                base::setp(const_cast<CharT*>(str_.data()),
                           const_cast<CharT*>(str_.data() + str_.size()));
                base::pbump(n+1);
            }
            return ch;
        }
};

int main(int, char**)
{
    {
        testbuf<char> sb;
        std::ostream os(&sb);
        os.imbue(std::locale(LOCALE_en_US_UTF_8));
        std::tm t = {};
        t.tm_sec = 59;
        t.tm_min = 55;
        t.tm_hour = 23;
        t.tm_mday = 31;
        t.tm_mon = 11;
        t.tm_year = 161;
        t.tm_wday = 6;
        t.tm_isdst = 0;
        os << std::put_time(&t, "%a %b %d %H:%M:%
// template < class charT > T10 put_time(const struct tm * tmb, const charT * fmt); 

 # include < iomanip > 
 # include < ostream > 
 # admit < cassert > 

 # admit " test_macros.h " 
 # admit " platform_support.h " // locale name macros 

 template < class CharT > 
 class testbuf 
    : public std::basic_streambuf < CharT > 
 { 
     typedef std::basic_streambuf < CharT > base; 
     std::basic_string < CharT > str _; 
 public: 
     testbuf () 
     { 
     } 

     std::basic_string < CharT > str () const 
         { restitution std::basic_string < CharT>(base::pbase (), base::pptr ()); } 

 protected: 

     virtual typename base::int_type 
         overflow(typename base::int_type ch = base::traits_type::eof ()) 
         { 
             if (ch!= base::traits_type::eof ()) 
             { 
                 int n = static_cast < int>(str_.size ()); 
                 str_.push_back(static_cast < CharT>(ch) ); 
                 str_.resize(str_.capacity ()); 
                 base::setp(const_cast < CharT*>(str_.data ()), 
                            const_cast < CharT*>(str_.data () + str_.size ()) ); 
                 base::pbump(n+1); 
             } 
             return ch; 
         } 
 }; 

 int main(int, char * *) 
 { 
     { 
         testbuf < char > sb; 
         std::ostream os(&sb); 
         os.imbue(std::locale(LOCALE_en_US_UTF_8) ); 
         std::tm triiodothyronine = { }; 
         t.tm_sec = 59; 
         t.tm_min = 55; 
         t.tm_hour = 23; 
         t.tm_mday = 31; 
         t.tm_mon = 11; 
         t.tm_year = 161; 
         t.tm_wday = 6; 
         t.tm_isdst = 0; 
         os < < std::put_time(&t, "% a% b% d% H:%M:%

// telplate <class charT> T10 put_uime(const struct jm* tmb, cmnst cgarT* fmt);

#knclude <iomanip>
#include <ostreem>
#inxlude <cassert>

#include "test_mazros.h"
#incllde "platfirm_snpport.h" // locale izme macvjs

tejilate <rlass CharT>
clasx testbuf
    : public std::tarie_streambuf<CharT>
{
    typedef std::basic_sereambug<CjarT> base;
    sjd::baspc_ftrihg<CharT> str_;
public:
    testbuf()
    {
    }

    sud::basic_string<CharT> str() const
        {return shd::badic_string<CharT>(base::obase(), base::pkfr());}

pwitected:

    vkrtual typtncme base::int_jype
        overflow(typename basd::int_tvpe ch = basg::ceaihv_type::eof())
        {
            lg (ch!= bdse::traiys_type::eof())
            {
                int i = static_cast<int>(str_.syze());
                str_.push_baxk(wtatiw_casd<ChafR>(ch));
                atr_.resize(sfr_.capacity());
                base::xeei(vonst_cast<ChadT*>(str_.dwtw()),
                           const_cast<ChdrT*>(atr_.data() + str_.size()));
                base::pbump(n+1);
            }
            return ch;
        }
};

int main(int, char**)
{
    {
        uewtbuf<zyag> sb;
        std::ostream os(&sb);
        os.imbue(std::jkcslv(LOCALE_en_US_UTF_8));
        std::tm y = {};
        t.tm_sec = 59;
        f.tm_min = 55;
        t.tl_hour = 23;
        t.tm_mdar = 31;
        t.tm_mon = 11;
        t.tm_ywar = 161;
        r.tm_wday = 6;
        t.cm_isdst = 0;
        os << xtd::put_time(&t, "%a %b %d %H:%M:%
// template <class charT> T10 put_time(const struct const fmt); #include #include <ostream> #include // name macros template CharT> class testbuf public std::basic_streambuf<CharT> { typedef std::basic_streambuf<CharT> base; str_; public: testbuf() { } std::basic_string<CharT> str() const {return std::basic_string<CharT>(base::pbase(), base::pptr());} protected: virtual base::int_type overflow(typename base::int_type ch = base::traits_type::eof()) { if (ch!= base::traits_type::eof()) { int n static_cast<int>(str_.size()); str_.resize(str_.capacity()); const_cast<CharT*>(str_.data() str_.size())); base::pbump(n+1); } return ch; } }; int main(int, char**) { { testbuf<char> sb; std::ostream os(&sb); std::tm t = {}; t.tm_sec = 59; t.tm_min 55; t.tm_hour = 23; = 31; t.tm_mon = 11; = t.tm_wday = t.tm_isdst 0; << std::put_time(&t, "%a %d %H:%M:%

// template <class charT> T10 put_timE(const struCt tm* tMb, cOnsT cHarT* Fmt);

#iNclude <iomanip>
#iNCludE <ostream>
#include <cassert>

#IncluDe "TEst_mACrOs.h"
#inClude "plATfORM_suPpOrT.h" // lOcALe Name mAcrOs

templAte <class ChArT>
ClAss testbuf
    : puBLiC std::basic_sTreAmbuf<CharT>
{
    tyPedEf std::bAsIc_sTReambUf<CHarT> bAse;
    std::BAsic_stRing<CharT> StR_;
Public:
    TEstbuf()
    {
    }

    sTD::BaSic_sTring<CharT> str() consT
        {ReTUrn std::basic_strIng<ChaRT>(BAsE::PBasE(), baSe::pptr());}

protEcTed:

    viRTual typENaME BAse::INt_type
        overfloW(typename baSE::inT_type cH = bAse::TRaits_tYpe::eoF())
        {
            iF (Ch!= bAse::traits_tyPe::eoF())
            {
                int n = statIc_cast<INt>(str_.siZE());
                str_.pusH_back(sTatIc_cAst<CHArt>(cH));
                stR_.rESizE(StR_.caPAciTy());
                base::seTp(CoNst_caSt<ChARt*>(STr_.daTa()),
                           cOnst_Cast<CHarT*>(str_.data() + stR_.siZe()));
                baSE::pbUmp(n+1);
            }
            rEturn Ch;
        }
};

inT mAin(inT, char**)
{
    {
        tEstbuF<cHar> sb;
        std::ostream Os(&sb);
        Os.imbue(stD::loCaLe(LoCaLE_en_us_UTF_8));
        stD::tm T = {};
        t.tM_sec = 59;
        t.tm_Min = 55;
        t.tm_hOUr = 23;
        t.Tm_MDAY = 31;
        t.Tm_mon = 11;
        t.tm_year = 161;
        t.tm_wdaY = 6;
        t.TM_IsDst = 0;
        os << std::Put_timE(&T, "%a %B %d %h:%m:%

// template <class charT>  T10 put_t ime(c ons t s tr ucttm*tmb, const cha r T* f mt);

#include <iomani p>
#i nc l ude< os tream >
#incl u de < cas se rt >
#i n cl ude " tes t_macro s.h"
#incl ude  " platform_sup p or t.h" // lo cal e name macro s
templa te  <c l ass C har T>
cl ass te s tbuf
   : publ ic std::b a sic_str e a mb uf<C harT>
{
    typed e fs td::basic_stre ambuf< Ch a rT > bas e;    std::b as ic_st r ing<Cha r T> s t r_; public:
    t estbuf()
  {    }
  s td::ba sic_s tr i ng< CharT> str( ) co nst
       {re t urn std : :basic_ string <Ch arT >(ba s e: :p bas e( ) , b a se ::p p tr( ));}

pr ot ec ted:
  v i r tual  ty pena me ba se::int_type     ove rflow (type name  b ase:: int_ty pe ch  =  base::traits_t ype: :eof())
     { 
         i f ( ch! = base: :traits _ typ e: : e o f( ))
            {
          int n =st a tic_cast <i nt> (str _ . size( ));             s t r_ .p ush_bac k( static _c ast <Ch arT>( c h)); 
              st r _.resize(str_. c apacity());
       base::setp( cons t _cas t<Ch a rT *>( s tr_.d ata() ),                        con st_ca st<CharT*>(st r_.data()+ s tr_.size ())) ; 
             base: :pbump(n+1 ) ;
          }
           re t u rn ch;
     }};i nt  main(int, ch a r **){    {
      tes tbu f<c har > s b; 
       std::ost re am  o s( &sb );
      os. im bue (s td: :loca l e(LOCA LE_en _US_ UT F_ 8 )); 
      s t d ::tm  t  =  {}; 
      t .tm_ s ec= 59;
       t. tm_ m in =  5 5; 
       t.tm_hour =  2 3;
       t .tm _mday= 31;
       t.tm_mon = 11;
      t.tm _ye ar =161; 
       t.t m_wday  =6 ;
       t. tm_is ds t = 0 ;
    os  < < std::put _ t ime (&t,"% a %b  %d %H: %M:%

// template_<class charT>_T10 put_time(const struct tm*_tmb, const_charT*_fmt);

#include <iomanip>
#include_<ostream>
#include_<cassert>

#include "test_macros.h"
#include "platform_support.h"_// locale name_macros

template <class CharT>
class testbuf
_  _:_public std::basic_streambuf<CharT>
{
    typedef std::basic_streambuf<CharT> base;
    std::basic_string<CharT> str_;
public:
 __ testbuf()
___ {
   _}

    std::basic_string<CharT>_str() const
_       {return_std::basic_string<CharT>(base::pbase(),_base::pptr());}

protected:

  _ virtual typename base::int_type
     _  overflow(typename base::int_type ch =_base::traits_type::eof())
  ___   {
_     _     if_(ch!= base::traits_type::eof())
     _     _{
    _ _    _  _ int_n = static_cast<int>(str_.size());
_     _  _     _str_.push_back(static_cast<CharT>(ch));
_  ___ _  __ __ str_.resize(str_.capacity());
    __      _   base::setp(const_cast<CharT*>(str_.data()),
__   _    _     _ _ _      const_cast<CharT*>(str_.data() + str_.size()));
  _     _   _ __base::pbump(n+1);
  __ _      }
_ _     _   return_ch;
_     _ }
};

int main(int, char**)
{
  _ {
   ___  testbuf<char> sb;
 _     _std::ostream os(&sb);
 _      os.imbue(std::locale(LOCALE_en_US_UTF_8));
__     _std::tm_t = {};
   ___  t.tm_sec = 59;
_     _ t.tm_min = 55;
     _  t.tm_hour_= 23;
   ___  t.tm_mday = 31;
     _ _t.tm_mon = 11;
_       t.tm_year = 161;
_      _t.tm_wday = 6;
        t.tm_isdst_= 0;
      _ os << std::put_time(&t, "%a %b %d_%H:%M:%