partial_date pd(26, Jun); std::stringstream ss2; ss2 << pd; check("partial date stream out", ss2.str() == std::string("26 Jun"));  ss2.str(""); nth_kday_of_month nkm(nth_kday_of_month::second, Friday, Sep); ss2 << nkm; check("nth kday of month", ss2.str() == std::string("second Fri of Sep"));  ss2.str(""); first_kday_of_month fkm(Saturday, May); ss2 << fkm; check("first kday of month", ss2.str() == std::string("first Sat of May"));  ss2.str(""); last_kday_of_month lkm(Monday, Aug); ss2 << lkm; check("last kday of month", ss2.str() == std::string("last Mon of Aug"));  ss2.str(""); first_kday_after  fka(Thursday); ss2 << fka; check("first kday after", ss2.str() == std::string("Thu after"));  ss2.str(""); first_kday_before fkb(Tuesday); ss2 << fkb; check("first kday after", ss2.str() == std::string("Tue before"));  std::cout << pd << '\n' << nkm << '\n' << fkm << '\n' << lkm << '\n' << fka << '\n' << fkb << '\n' << std::endl;
main() {  boost::gregorian::date d1(2002,01,02);  std::string ds1 = boost::gregorian::to_simple_string(d1);  check("check string:     " + ds1, ds1 == "2002-Jan-02");   std::string ids1(boost::gregorian::to_iso_string(d1));  //  std::cout << boost::gregorian::to_iso_string(d1) << std::endl;  check("check iso normal: " + ids1, ids1 == "20020102");  std::string sds1 = boost::gregorian::to_sql_string(d1);  check("check sql string: "+sds1, sds1 == "2002-01-02");  boost::gregorian::date d2(2001,12,30);  std::string ds2 = boost::gregorian::to_simple_string(d2);  check("check string:     "+ds2, ds2 == "2001-Dec-30");  std::string ids2 = boost::gregorian::to_iso_extended_string(d2);  check("check iso extended string: "+ids2, ids2 == "2001-12-30");  //TODO REMOVE THIS STUFF  //  std::stringstream os;  // typedef boost::gregorian::date::ymd_type ymd_type;  //   typedef boost::date_time::ymd_formatter<ymd_type, boost::date_time::simple_format> ymdf;//   ymd_type ymd = d1.year_month_day();//   ymdf::ymd_put(ymd, os);//   check("ostream low level check string", //     os.str() == std::string("2002-Jan-02"));//   typedef boost::date_time::date_formatter<boost::gregorian::date, //                                       boost::date_time::simple_format> datef;//   os.str("");//   datef::date_to_ostream(d1, os);//   check("ostream low level check string", //     os.str() == std::string("2002-Jan-02"));       using namespace boost::gregorian;  date d3(neg_infin);  check("check negative infinity",             (to_simple_string(d3) == std::string("-infinity  ")));  date d4(pos_infin);  check("check positive infinity",             (to_simple_string(d4) == std::string("+infinity  ")));  date d5(not_a_date_time);  std::cout << to_simple_string(d5) << "|" << std::endl;  check("check not a date",             (to_simple_string(d5) == std::string("not-a-date")));  date_period p1(date(2000,Jan,1), date(2001,Jan,1));  check("check period format",             (to_simple_string(p1) == std::string("[2000-Jan-01/2000-Dec-31]")));  date_period p2(date(2000,Jan,1), date(pos_infin));  check("check period format",             (to_simple_string(p2) == std::string("[2000-Jan-01/+infinity  ]")));  std::cout << to_simple_string(p2) << std::endl;  partial_date pd(26, Jun);  std::stringstream ss2;  ss2 << pd;  check("partial date stream out", ss2.str() == std::string("26 Jun"));  ss2.str("");  nth_kday_of_month nkm(nth_kday_of_month::second, Friday, Sep);  ss2 << nkm;  check("nth kday of month", ss2.str() == std::string("second Fri of Sep"));  ss2.str("");  first_kday_of_month fkm(Saturday, May);  ss2 << fkm;  check("first kday of month", ss2.str() == std::string("first Sat of May"));  ss2.str("");  last_kday_of_month lkm(Monday, Aug);  ss2 << lkm;  check("last kday of month", ss2.str() == std::string("last Mon of Aug"));  ss2.str("");  first_kday_after  fka(Thursday);//fkb.get_date(d)  ss2 << fka;  check("first kday after", ss2.str() == std::string("Thu after"));  ss2.str("");  first_kday_before fkb(Tuesday); // same ^  ss2 << fkb;  check("first kday after", ss2.str() == std::string("Tue before"));  std::cout << pd << '\n'            << nkm << '\n'            << fkm << '\n'            << lkm << '\n'            << fka << '\n'            << fkb << '\n'            << std::endl;    //  TODO enhance wchar support //   std::wstringstream wss;//   wss << d3 << std::endl;//   std::wcout << d3;  return printTestStats();}