mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 22:21:09 +03:00
fix6208 on inout
This commit is contained in:
parent
5687e20d2b
commit
42324e028b
3 changed files with 20 additions and 13 deletions
|
@ -787,7 +787,7 @@ that points to $(D target)'s representation or somewhere inside
|
|||
it. Note that evaluating $(D pointsTo(x, x)) checks whether $(D x) has
|
||||
internal pointers.
|
||||
*/
|
||||
bool pointsTo(S, T)(ref const S source, ref const T target) @trusted pure nothrow
|
||||
bool pointsTo(S, T, Tdummy=void)(ref const S source, ref const T target) @trusted pure nothrow
|
||||
{
|
||||
static if (is(S P : U*, U))
|
||||
{
|
||||
|
@ -813,6 +813,12 @@ bool pointsTo(S, T)(ref const S source, ref const T target) @trusted pure nothro
|
|||
return false;
|
||||
}
|
||||
}
|
||||
// for shared objects
|
||||
bool pointsTo(S, T)(ref const shared S source, ref const shared T target) @trusted pure nothrow
|
||||
{
|
||||
alias pointsTo!(shared(S), shared(T), void) ptsTo; // do instantiate explicitly
|
||||
return ptsTo(source, target);
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue