Exclude assertion for dragonfly in std/experimental/allocator/mallocator.d (Needs further investigation, not sure why alliagned_realloc is causing trouble)
cleanup in std/datetime/timezone.d
The from*String functions in std.datetime did not have tests to make
sure that they worked with various character types or various levels of
constness, and some optimizations that were done to the from*String
functions on DateTime for 2.076 broke them for const strings. So, this
adds tests for all character types and levels of constness to each of
the from*String function in std.datetime, and fixes the functionality
for DateTime that then doesn't pass the tests.
I should have done this years ago, but this makes the documentation
clear that std.datetime's toString is intended simply for easy printing
of the type rather than for code that actually cares about the format of
the string. There are other, explicit functions for code that actually
cares.
ISO 8601 says that it's up to the application to decide how many digits
to put in the fractional seconds if they're present. SysTime.to*String
puts up to 7 (stripping trailing zeroes), because that's
hecto-nanosecond precision, and SysTime holds the time in
hecto-nanoseconds. Currently, from*String only accepts up to 7 digits in
the fractional seconds, which _does_ follow the spec in that (per the
spec) the number of digits is up to the applications. However, while we
never emit more than 7 digits, other applications do, so only accepting
7 digits makes us incompatible with them, whereas accepting them would
make us more compatible with other programs, and it would actually be
more efficient, since we'd have fewer checks in the code.
So, these changes make is so that SysTime.from*String accepts more than 7
digits in the fractional seconds, but the additional digits are
truncated (since SysTime doesn't support more than 7 digits of
precision).
std.datetime.package has StopWatch, benchmark, comparingBenchmark, and
measureTime, all of which use TickDuration (which would be deprecated,
but it can't be deprecated as long as those functions in std.datetime
are deprecated). This commit introduces
std.datetime.stopwatch to replace those functions in std.datetime. In
order to avoid symbol conflicts, std.datetime.stopwatch will not be
publicly import in std.datetime.package until the old symbols have been
removed.
std.datetime.experimental.stopwatch contains StopWatch and benchmark
which have essentially the same APIs as the ones in
std.datetime.package, but they use MonoTime and Duration.
comparingBenchmark has not been ported to MonoTime and Duration, because
it is simply a wrapper around benchmark.
measureTime has not been ported to MonoTime and Duration, because it is
equivalent to using StopWatch with a scope(exit) statement.
The old functionality will be deprecated the major release after the new
symbols have been introduced.