Boost logo

Boost :

Subject: Re: [boost] [gsoc 2013] draft proposal for chrono::date
From: Anurag Kalia (anurag.kalia_at_[hidden])
Date: 2013-05-04 18:15:11


Anders Dalvander-3 wrote
> On 2013-05-04 15:26, Rob Stewart wrote:
>> On May 4, 2013, at 8:46 AM, "Vicente J. Botet Escriba" <

> vicente.botet@

> > wrote:
>>
>>> Le 04/05/13 14:28, Rob Stewart a écrit :
>>>> On May 3, 2013, at 6:24 PM, Anurag Kalia <

> anurag.kalia@

> > wrote:
>>>>> At which point I wonder, why can't we be symmetrical and allow a
>>>>> function like:
>>>>>
>>>>> make_date(2013, 2, 27);
>>>> You could have these, instead, for more consistency:
>>>>
>>>> make_date(2013, 45);
>>>> make_date(2013, w7, fri);
>>> The later overload is Ok. The following is ambiguous
>>>
>>> make_date(2013, 45);
>>>
>>> and need
>>>
>>> make_date(year(2013), 45);
>> Right
>>
>>> BTW, do you prefer w7 or w_7? Or a literal 7_w instead of a constant
>>> object?
>> I'd prefer at least "wk" if not "week" in the name. I don't think an
>> underscore is nice there, and I don't like the literal ordering.
>> Therefore, I'd like to see week7 or wk7.
>>
> Weeks? According to what way of counting weeks? Monday-weeks (Europe,
> ISO 8601), Saturday-weeks (Middle East), or Sunday-weeks (Canada, US,
> Mexico)?
>
> If boost should adhere to ISO 8601, which I think it should, why not go
> all in and mandate ordering of YMD as well?
>
> Regards,
> Anders Dalvander

My opinions:

1) ISO week date says week as W07. So my suggestion was to not deviate too
much from it: w7, W7 and W07 are all acceptable to me. w7 is the easiest to
write among them so the first choice of mine.

That is, if we mandate use of enums at all. Otherwise, sticking to week(n)
is the cleanest option.

2) We should stick to ISO 8601 week standard, i.e. Monday weeks. They are
not commonplace enough to warrant multiple notations.

OTOH, the different day formats are actually followed in different
countries, according to that useful link by Howard. My suggestion is to use
ISo ordering only in functions like date() or make_date().

But when using slash, as in:

    date d = day(25) / dec / 2013;

It is very natural to me. Here in my part of world, d-m-y is the dominant
format. Otherwise use of '/' itself is of no much use.

Regards,
Anurag.

--
View this message in context: http://boost.2283326.n4.nabble.com/gsoc-2013-draft-proposal-for-chrono-date-tp4646142p4646673.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk