Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4718: date::day_of_week documentation is unhelpful
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-19 12:09:22
#4718: date::day_of_week documentation is unhelpful
--------------------------------------+-------------------------------------
Reporter: russell.silva@⦠| Owner: az_sw_dude
Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
Version: Boost 1.44.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------
Comment (by TCN):
Documentation should have an example like this (tested with boost 1.45.0):
{{{
#include <iostream>
#include <boost/date_time/gregorian/gregorian.hpp>
using namespace boost::gregorian;
using namespace std;
...
// Inside main() or some other function
date d(2012, Apr, 19);
cout << "Date : " << d << endl;
greg_weekday wd(d.day_of_week());
greg_day_of_year_rep yd(d.day_of_year());
cout << "Day of week : " << wd // or
wd.as_short_string()
<< " (full name : " << wd.as_long_string() << ")" // returns a
char*, as above
<< " (as number : " << wd.as_number() << ")" // returns an
unsigned short
<< endl;
cout << "Day of year : " << yd << endl; // returns an
unsigned short
}}}
And/or it should point the user to greg_weekday.hpp, greg_day_of_year.hpp
(Naming inconsistencies, yuck!)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/4718#comment:5> 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:50:09 UTC