View source code
Display the source code in std/traits.d from which this
page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a
Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Enum member std.traits.isAutodecodableString
Detect whether type T
is a string that will be autodecoded.
enum isAutodecodableString(T)
= (is(T : const(char[])) || is(T : const(wchar[]))) && !isStaticArray!T;
All arrays that use char, wchar, and their qualified versions are narrow strings. (Those include string and wstring). Aggregates that implicitly cast to narrow strings are included.
Parameters
Name | Description |
---|---|
T | type to be tested |
Returns
true if T represents a string that is subject to autodecoding
See Also:
isNarrowString
Example
static struct Stringish
{
string s;
alias s this;
}
assert(isAutodecodableString!wstring);
assert(isAutodecodableString!Stringish);
assert(!isAutodecodableString!dstring);
Authors
Walter Bright,
Tomasz Stachowiak (isExpressions
),
Andrei Alexandrescu,
Shin Fujishiro,
Robert Clipsham,
David Nadlinger,
Kenji Hara,
Shoichi Kato
License
Copyright © 1999-2022 by the D Language Foundation | Page generated by ddox.