mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
isMutable should return false for inout type
This commit is contained in:
parent
bf7f4e5f1c
commit
be181743c1
1 changed files with 3 additions and 1 deletions
|
@ -3022,7 +3022,7 @@ unittest
|
||||||
*/
|
*/
|
||||||
template isMutable(T)
|
template isMutable(T)
|
||||||
{
|
{
|
||||||
enum isMutable = !is(T == const) && !is(T == immutable);
|
enum isMutable = !is(T == const) && !is(T == immutable) && !is(T == inout);
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
unittest
|
||||||
|
@ -3033,7 +3033,9 @@ unittest
|
||||||
static assert( isMutable!(shared const(int)[]));
|
static assert( isMutable!(shared const(int)[]));
|
||||||
|
|
||||||
static assert(!isMutable!(const int));
|
static assert(!isMutable!(const int));
|
||||||
|
static assert(!isMutable!(inout int));
|
||||||
static assert(!isMutable!(shared(const int)));
|
static assert(!isMutable!(shared(const int)));
|
||||||
|
static assert(!isMutable!(shared(inout int)));
|
||||||
static assert(!isMutable!(immutable string));
|
static assert(!isMutable!(immutable string));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue