-
-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the shared equivalent of Unconst. It allows code to strip off shared without stripping off const.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Add Unshared to std.traits. | ||
|
||
`Unshared` is the `shared` equivalent of `Unconst`. It strips off the outer | ||
layer of `shared` from a type. e.g. | ||
|
||
``` | ||
static assert(Unshared!(shared int) == int); | ||
static assert(Unshared!(shared(int[])) == shared(int)[]); | ||
``` | ||
|
||
So, `Unconst` strips off the outer layer of `const`, `immutable`, and `inout`; | ||
`Unshared` strips off the outer layer of `shared`; and `Unqual` strips off all | ||
qualifiers from the outer layer of a type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters