mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00
fix Issue 13000 - Casts should be removed to utilize features of inout
This commit is contained in:
parent
19fa794617
commit
18efc8c5dc
2 changed files with 5 additions and 5 deletions
|
@ -2071,9 +2071,9 @@ private:
|
||||||
return set.length - FD_SET_OFFSET;
|
return set.length - FD_SET_OFFSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
final socket_t[] fds() inout @property
|
final inout(socket_t)[] fds() inout @property
|
||||||
{
|
{
|
||||||
return cast(socket_t[])set[FD_SET_OFFSET..FD_SET_OFFSET+count];
|
return cast(inout(socket_t)[])set[FD_SET_OFFSET..FD_SET_OFFSET+count];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -657,7 +657,7 @@ public:
|
||||||
* assert(a == 6);
|
* assert(a == 6);
|
||||||
* ----
|
* ----
|
||||||
*/
|
*/
|
||||||
@property T* peek(T)() inout
|
@property inout(T)* peek(T)() inout
|
||||||
{
|
{
|
||||||
static if (!is(T == void))
|
static if (!is(T == void))
|
||||||
static assert(allowed!(T), "Cannot store a " ~ T.stringof
|
static assert(allowed!(T), "Cannot store a " ~ T.stringof
|
||||||
|
@ -665,9 +665,9 @@ public:
|
||||||
if (type != typeid(T))
|
if (type != typeid(T))
|
||||||
return null;
|
return null;
|
||||||
static if (T.sizeof <= size)
|
static if (T.sizeof <= size)
|
||||||
return cast(T*)&store;
|
return cast(inout T*)&store;
|
||||||
else
|
else
|
||||||
return *cast(T**)&store;
|
return *cast(inout T**)&store;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue