Boost logo

Boost Users :

From: Éò»Û·å (useradd_at_[hidden])
Date: 2005-08-17 05:46:41


The example of
"boost/doc/html/date_time/examples.html#date_time.examples.month_add" can
not be compiled.
I use the vc71+stlport 4.62, the command line is cl /MD /EHsc
/DBOOST_LIB_DIAGNOSTIC.
I also can not find this example code under the directory
"boost\libs\date_time\example\gregorian\".
The example code is :
/* Simple program that uses the gregorian calendar to progress by exactly
 * one month, irregardless of how many days are in that month.
 *
 * This method can be used as an alternative to iterators
 */

#include "boost/date_time/gregorian/gregorian.hpp"
#include <iostream>

int
main()
{

  using namespace boost::gregorian;

  date d = day_clock::local_day();
  add_month mf(1);
  date d2 = d + mf.get_offset(d);
  std::cout << "Today is: " << to_simple_string(d) << ".\n"
            << "One month from today will be: " << to_simple_string(d2)
            << std::endl;

  return 0;
}


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