
2008/5/23 Frank Birbacher <bloodymir.crap@gmx.net>:
Hi!
Joachim Faulhaber schrieb:
For every time<TimeSystem>- type the semantics of the minimal unit should be chosen as a static property of the types TimeSystem, that can not be changed for a given type-instance. That way, strong typing will help not to accidentally mix nanoseconds with decades ;-)
Hmm, I thought of using the same type (e.g. ptime) with different units (seconds, hours, days). Just like a std::basic_string can be used with "char" but two different character traits.
Yes of course ... one class template with different instances. Yet different instances of the same class template are different types so compilers can help to avoid errors ... But ... to make the discussion more substantial and to give the authors of boost::date_time the acknowledgement that they surely deserve I am going to study the documentation more closely first before making more suggestions. As a first reading shows customization of resolution and iteration on different granularity levels are sagely provided. Regards Joachim