diff options
Diffstat (limited to 'libphobos/src')
-rw-r--r-- | libphobos/src/MERGE | 2 | ||||
-rw-r--r-- | libphobos/src/std/datetime/systime.d | 35 | ||||
-rw-r--r-- | libphobos/src/std/sumtype.d | 41 |
3 files changed, 21 insertions, 57 deletions
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE index e15541e..5fd357c 100644 --- a/libphobos/src/MERGE +++ b/libphobos/src/MERGE @@ -1,4 +1,4 @@ -41aaf8c2636df0e2e3ad39933b321d2b4cd231fa +a1f8c4c0700ce4e256f4130ad7883c6ea3890901 The first line of this file holds the git revision number of the last merge done from the dlang/phobos repository. diff --git a/libphobos/src/std/datetime/systime.d b/libphobos/src/std/datetime/systime.d index 9b2a844..db325f7 100644 --- a/libphobos/src/std/datetime/systime.d +++ b/libphobos/src/std/datetime/systime.d @@ -8713,13 +8713,14 @@ public: /++ Creates a $(LREF SysTime) from a string with the format - YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds is the time - zone). Whitespace is stripped from the given string. + YYYYMMDDTHHMMSS.FFFFFFFTZ (where F is fractional seconds and TZ + is the time zone). Whitespace is stripped from the given string. - The exact format is exactly as described in `toISOString` except that - trailing zeroes are permitted - including having fractional seconds with - all zeroes. However, a decimal point with nothing following it is - invalid. Also, while $(LREF toISOString) will never generate a string + The exact format is exactly as described in $(LREF toISOString) except + that trailing zeroes are permitted - including having fractional seconds + with all zeroes. The time zone and fractional seconds are optional, + however, a decimal point with nothing following it is invalid. + Also, while $(LREF toISOString) will never generate a string with more than 7 digits in the fractional seconds (because that's the limit with hecto-nanosecond precision), it will allow more than 7 digits in order to read strings from other sources that have higher precision @@ -9024,13 +9025,14 @@ public: /++ Creates a $(LREF SysTime) from a string with the format - YYYY-MM-DDTHH:MM:SS.FFFFFFFTZ (where F is fractional seconds is the - time zone). Whitespace is stripped from the given string. + YYYY-MM-DDTHH:MM:SS.FFFFFFFTZ (where F is fractional seconds and TZ + is the time zone). Whitespace is stripped from the given string. - The exact format is exactly as described in `toISOExtString` + The exact format is exactly as described in $(LREF toISOExtString) except that trailing zeroes are permitted - including having fractional - seconds with all zeroes. However, a decimal point with nothing following - it is invalid. Also, while $(LREF toISOExtString) will never generate a + seconds with all zeroes. The time zone and fractional seconds are + optional, however, a decimal point with nothing following it is invalid. + Also, while $(LREF toISOExtString) will never generate a string with more than 7 digits in the fractional seconds (because that's the limit with hecto-nanosecond precision), it will allow more than 7 digits in order to read strings from other sources that have higher @@ -9273,13 +9275,14 @@ public: /++ Creates a $(LREF SysTime) from a string with the format - YYYY-MM-DD HH:MM:SS.FFFFFFFTZ (where F is fractional seconds is the - time zone). Whitespace is stripped from the given string. + YYYY-Mon-DD HH:MM:SS.FFFFFFFTZ (where F is fractional seconds and TZ + is the time zone). Whitespace is stripped from the given string. - The exact format is exactly as described in `toSimpleString` except + The exact format is exactly as described in $(LREF toSimpleString) except that trailing zeroes are permitted - including having fractional seconds - with all zeroes. However, a decimal point with nothing following it is - invalid. Also, while $(LREF toSimpleString) will never generate a + with all zeroes. The time zone and fractional seconds are optional, + however, a decimal point with nothing following it is invalid. + Also, while $(LREF toSimpleString) will never generate a string with more than 7 digits in the fractional seconds (because that's the limit with hecto-nanosecond precision), it will allow more than 7 digits in order to read strings from other sources that have higher diff --git a/libphobos/src/std/sumtype.d b/libphobos/src/std/sumtype.d index 0dd636e..3833c84 100644 --- a/libphobos/src/std/sumtype.d +++ b/libphobos/src/std/sumtype.d @@ -1569,27 +1569,7 @@ private enum bool isSumTypeInstance(T) = is(T == SumType!Args, Args...); } /// True if `T` is a [SumType] or implicitly converts to one, otherwise false. -template isSumType(T) -{ - static if (is(T : SumType!Args, Args...)) - { - enum isSumType = true; - } - else static if (is(T == struct) && __traits(getAliasThis, T).length > 0) - { - // Workaround for https://issues.dlang.org/show_bug.cgi?id=21975 - import std.traits : ReturnType; - - alias AliasThisType = ReturnType!((T t) => - __traits(getMember, t, __traits(getAliasThis, T)[0]) - ); - enum isSumType = .isSumType!AliasThisType; - } - else - { - enum isSumType = false; - } -} +enum bool isSumType(T) = is(T : SumType!Args, Args...); /// @safe unittest @@ -1610,25 +1590,6 @@ template isSumType(T) assert(!isSumType!ContainsSumType); } -@safe unittest -{ - static struct AliasThisVar(T) - { - SumType!T payload; - alias payload this; - } - - static struct AliasThisFunc(T) - { - SumType!T payload; - ref get() { return payload; } - alias get this; - } - - static assert(isSumType!(AliasThisVar!int)); - static assert(isSumType!(AliasThisFunc!int)); -} - /** * Calls a type-appropriate function with the value held in a [SumType]. * |