Commit graph

730 commits

Author SHA1 Message Date
berni44
459f271fbe Remove two unnecessary 'the' in documentation. 2021-03-19 00:17:27 +01:00
Nathan Sashihara
edc5961693 Simplify std.traits.isFunctionPointer & std.traits.isDelegate 2021-03-10 00:20:41 +01:00
Iain Buclaw
79ad118345 Remove tests for complex and imaginary types 2021-01-28 03:05:46 +01:00
MoonlightSentinel
67eb976fea Fix Issue 21103 - isDynamicArray instantiates unecessary templates
Use an `is(...)` expression to do the actual check but include a
workaround to reatin the old (buggy) behaviour regarding enums (for now).
2021-01-22 18:27:26 +01:00
MoonlightSentinel
ad8e138eb4 Make isAutoDecodableString independent of issue 21570
The current implementation relies on issue 21570 to reject enums with
static arrays as their base type.

Use another is-expression instead of `isStaticArray` to detect types
that are (convertible to) static arrays.

See https://issues.dlang.org/show_bug.cgi?id=21570
2021-01-22 00:21:16 +01:00
berni42
5c3028789e Fix issue 21444: bad string concat in static assert message 2021-01-18 01:03:40 +01:00
Q. F. Schroll
d64b78e27d fix Issue 21452 - isCallable erroneously returns false on function templates 2020-12-04 01:09:19 +01:00
Nathan Sashihara
9a85496b9a Fix Issue 15425 - std.traits.hasIndirections fails to recognize nested structs 2020-11-18 01:50:27 +01:00
Nathan Sashihara
25348d61dd Simplify std.traits.isBoolean 2020-11-07 14:20:13 +01:00
Nathan Sashihara
aa16e2d99a Streamline std.traits.AliasThisTypeOf
Faster and uses less memory.
2020-09-14 05:35:35 +02:00
Paul Backus
33b1c17540 Fix issue 21237: isLvalueAssignable and isRvalueAssignable should be public 2020-09-12 14:03:14 +02:00
Nathan Sashihara
2f67646b16 Slightly decrease trait template cascades 2020-09-12 12:28:43 +02:00
Geod24
35016ff42d std.traits: Adapt unittest to pass with -preview=in 2020-08-31 05:32:26 +02:00
Geod24
4d01cacfb4 Fix 21210: std.traits : isAssignable false positive on disabled copy struct
`isAssignable` would previously return `true` for non-copyable types,
even though code that tried to use an lvalue would not compile.
This behavior was originally found when implementing `-preview=in`.

With the new -preview=in check, the const-folding seemed to be a bit
too aggressive when an rvalue is passed, meaning that the check might
fail (probably due to the code that initialize the temporary).
2020-08-31 03:13:56 +02:00
Sebastian Wilzbach
1af4e48c4e Revert "std.traits: Adapt unittest to pass with -preview=in (#7609)"
This reverts commit aca1e1208f.
2020-08-30 11:07:05 +02:00
Mathias LANG
aca1e1208f
std.traits: Adapt unittest to pass with -preview=in (#7609)
* std.traits: Use delegates within some __traits(compiles) check to avoid constfold

With the new -preview=in check, the const-folding seems to be a bit
too aggressive when an rvalue is passed, meaning that the check might
fail (probably due to the code that initialize the temporary).
To avoid this issue, we simply wrap the assignment in a lambda that
will not be called, as there is no downside to that change.

* std.traits: Adapt unittest to pass with `-preview=in`
2020-08-29 19:42:12 +08:00
Nathan Sashihara
99e390486c Reduce the number of isAggregateType!T checks
Some are redundant. Others can be replaced by cheaper traits checks.
2020-08-18 03:50:12 +02:00
Nathan Sashihara
453faadf5b Replace is(Unqual!T == Unqual!U) with is(immutable T == immutable U) for speed & memory usage 2020-08-03 15:07:32 +02:00
Geod24
1e73cb8ca7 std.traits: Add support for 'in' storage class
For a long time, the 'in' storage class was only a second class citizen,
merely an alias for 'const', which is a type constructor.
While it was also documented for a long time as being 'scope',
this was removed when 'scope' actually started to have an effect
(when DIP1000 started to be implemented).
Currently, a switch (-preview=in) allows to get back this 'scope'.

However, the 'in' storage class does not really exists,
it gets lowered to 'const [scope]' at an early stage by the compiler,
which means that we expose what is essentially an implementation
detail to the user.

There is a PR in DMD (dlang/dmd#11474) that aims to give 'in' an actual
identity, instead of it being lowered to 'const [scope]'.
The underlying motivation is to allow for extending 'in''s functionality,
giving it the ability to pass by 'ref' when necessary, and accept rvalues.

However, regardless of the second goal, having proper support for 'in'
would lead to less confusing messages, better code generation,
and less confusion w.r.t. the behavior of `std.traits.ParameterStorageClass`.
2020-08-01 19:39:20 +09:00
Per Nordlöw
8ef03bc2ee
Reuse new builtin trait isCopyable in std.traits.isCopyable (#7522) 2020-07-17 09:46:32 +08:00
Hiroki Noda
7fa4aaf86f std.traits: FunctionAttribute supports live function 2020-05-22 12:36:13 +09:00
Mathis Beer
cc8537110e Fix issue 20755: keep constness in ImplicitConversionTargets!(const/immutable class) 2020-04-21 13:25:39 +02:00
Mathis Beer
038d9fbc90 Fix parameter names on CopyConstness comment 2020-04-21 13:22:58 +02:00
The Dlang Bot
ffca395ed2
Merge pull request #7441 from Geod24/bugzilla-links
Change all bug ID to links
merged-on-behalf-of: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
2020-04-14 17:42:07 +02:00
Steven Schveighoffer
0d7bdb90fb Fix issue 20733. Remove docs about copy construction from hasElaborateAssign. 2020-04-13 11:46:58 -04:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Geod24
3140fb9e3a Issue 12931: Move shared to the RHS 2020-02-03 18:23:01 +09:00
Bernhard Seckinger
c6ef9e136d Fix Issue 8388 - std.traits.MemberFunctionsTuple doesn't work with
constructors or destructors
2020-01-29 09:28:42 +01:00
Alexandru Militaru
bb62aaca3d Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest 2020-01-19 14:05:17 +02:00
Bernhard Seckinger
2584fd837f Fix Issue 15940 - ImplicitConversionTargets and class alias in struct 2019-12-10 15:29:18 +01:00
Simen Kjærås
2a2018cf34 Fix issue 20054 - getSymbolsByUDA no longer works on modules 2019-12-02 00:42:23 +02:00
Simen Kjærås
f286ee1b2f Revert "Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA"
This reverts commit 86733d5a4a.
2019-12-01 21:58:39 +02:00
Harry T. Vennik
d6256037e1 Add Unconst to std.traits 2019-09-01 11:13:26 +02:00
Walter Bright
64ccd34045 improve documentation and tests for isAutodecodable() 2019-08-12 19:19:37 -07:00
RazvanN7
86733d5a4a Fix Issue 19105 - Bogus recursive template expansion via getSymbolsByUDA 2019-07-10 11:06:24 +03:00
Les De Ridder
4be9b5f59f Implement Phobos side of DIP1014 2019-06-30 22:51:05 +02:00
Marco de Wild
db843f1882
Explicitly stated that the enum name can be retrieved with __traits 2019-05-14 12:34:10 +02:00
Razvan Nitu
ef151b3ee8 Comment broken test in std/traits.d (#6956) 2019-04-11 16:37:38 +03:00
David Nadlinger
6b97ae69d7 std.range.primitive.{Autodecoding -> autodecodeStrings}
This follows Phobos naming conventions and is more self-documenting.
2019-03-23 19:32:56 +00:00
Walter Bright
158fb2f656 add std.range.primitives.Autodecoding 2019-03-23 01:57:04 -07:00
Andrei Alexandrescu
d0993b33fe
Code font 2019-03-18 19:20:40 -04:00
Walter Bright
56e36fb62e Improve documentation for StringTypeOf 2019-03-18 15:56:58 -07:00
tibi77
7ae2e67a47 Remove redundant body of @disable functions. Issue 14854 DMD (#6893)
Remove redundant body of @disable functions. Issue 14854 DMD
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-03-06 02:00:04 +01:00
Mathis Beer
8f24c53ec7 Fix issue 19689: don't use recursive template parameter iteration in std.traits.
Pull inner Impl templates out into std.traits so they're only instantiated once.
Use anySatisfy, staticMap instead of manually recursing.
2019-02-22 16:48:48 +01:00
Sebastian Wilzbach
c1c6c80909 std.traits: use assumePurein the public example 2019-01-31 14:59:02 +01:00
The Dlang Bot
93f1b31fbf
Merge pull request #6799 from TurkeyMan/max_alignment
simplify maxAlignment
merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2018-12-29 22:02:49 +01:00
Martin Nowak
6804bf18cd Merge remote-tracking branch 'upstream/stable' into merge_stable 2018-12-24 17:26:02 +01:00
The Dlang Bot
43be36c179
Merge pull request #6790 from joakim-noah/stable
Android and AArch64: tweak tests that trip
merged-on-behalf-of: unknown
2018-12-18 03:26:39 +01:00
Joakim
073ea406c6 Loosen two tests for IEEE Quadruple precision and make sure std.variant.VariantN is properly aligned for Quadruples. 2018-12-17 19:58:33 +05:30
Manu Evans
19e8ff244d Simplify isInnerClass 2018-12-10 21:23:59 -08:00