mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Merge pull request #428 from ascherer/typeset-NaN
Consistent formatting of 'NaN'.
This commit is contained in:
commit
ef03d8b700
|
@ -4036,7 +4036,7 @@ Many language and library facilities rely on default constructors to initialize
|
||||||
The default constructor is only auto-generated if there is no user-declared constructor, hence it's impossible to initialize the vector `vd1` in the example above.
|
The default constructor is only auto-generated if there is no user-declared constructor, hence it's impossible to initialize the vector `vd1` in the example above.
|
||||||
|
|
||||||
There is no "natural" default date (the big bang is too far back in time to be useful for most people), so this example is non-trivial.
|
There is no "natural" default date (the big bang is too far back in time to be useful for most people), so this example is non-trivial.
|
||||||
`{0, 0, 0}` is not a valid date in most calendar systems, so choosing that would be introducing something like floating-point's NaN.
|
`{0, 0, 0}` is not a valid date in most calendar systems, so choosing that would be introducing something like floating-point's `NaN`.
|
||||||
However, most realistic `Date` classes have a "first date" (e.g. January 1, 1970 is popular), so making that the default is usually trivial.
|
However, most realistic `Date` classes have a "first date" (e.g. January 1, 1970 is popular), so making that the default is usually trivial.
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
Loading…
Reference in New Issue
Block a user