View source code
Display the source code in std/traits.d from which this page was generated on
github.
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.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Template std.traits.hasAliasing
Returns true
if and only if T
's representation includes at
least one of the following:
- a raw pointer
U*
andU
is not immutable; - an array
U[]
andU
is not immutable; - a reference to a class or interface type
C
andC
is not immutable. - an associative array that is not immutable.
- a delegate.
Arguments
template hasAliasing(T...);
Example
struct S1 { int a; Object b; } struct S2 { string a; } struct S3 { int a; immutable Object b; } struct S4 { float[3] vals; } static assert( hasAliasing!S1); static assert(!hasAliasing!S2); static assert(!hasAliasing!S3); static assert(!hasAliasing!S4);
Authors
Walter Bright,
Tomasz Stachowiak (
),
Andrei Alexandrescu,
Shin Fujishiro,
Robert Clipsham,
David Nadlinger,
Kenji Hara,
Shoichi Kato
isExpressions