Function std.exception.doesPointTo
Checks whether a given source object contains pointers or references to a given target object.
						
				bool doesPointTo(S, T, Tdummy)
				(
				
				  auto const ref S source,
				
				  const ref T target
				
				) pure nothrow @nogc @trusted
				
				if (__traits(isRef, source) || isDynamicArray!S || isPointer!S || is(S == class));
				
				
				bool doesPointTo(S, T)
				(
				
				  auto const shared ref S source,
				
				  const shared ref T target
				
				) pure nothrow @trusted;
						
					
				Parameters
| Name | Description | 
|---|---|
| source | The source object | 
| target | The target object | 
Bugs
The function is explicitly annotated @nogc because inference could fail,
    see issue 17084.
Returns
true if source's representation embeds a pointer
that points to target's representation or somewhere inside
it.
If source is or contains a dynamic array, then, then these functions will check
if there is overlap between the dynamic array and target's representation.
If source is a class, then it will be handled as a pointer.
If target is a pointer, a dynamic array or a class, then these functions will only
check if source points to target, not what target references.
If source is or contains a union, then there may be either false positives or
false negatives:
doesPointTo will return true if it is absolutely certain
source points to target. It may produce false negatives, but never
false positives. This function should be prefered when trying to validate
input data.
mayPointTo will return false if it is absolutely certain
source does not point to target. It may produce false positives, but never
false negatives. This function should be prefered for defensively choosing a
code path.
Note
Evaluating doesPointTo(x, x) checks whether x has
internal pointers. This should only be done as an assertive test,
as the language is free to assume objects don't have internal pointers
(TDPL 7.1.3.5).
Example
Pointers
int  i = 0;
int* p = null;
assert(!pExample
Structs and Unions
struct S
{
    int v;
    int* p;
}
int i;
auto s = S(0, &i);
// structs and unions "own" their members
// pointsTo will answer true if one of the members pointsTo.
assert(!sExample
Arrays (dynamic and static)
int i;
int* p = &i; // trick the compiler when initializing slicep; https://issues.dlang.org/show_bug.cgi?id=18637
int[]  slice = [0, 1, 2, 3, 4];
int[5] arr   = [0, 1, 2, 3, 4];
int*[]  slicep = [p];
int*[1] arrp   = [&i];
// A slice points to all of its members:
assert( sliceExample
Classes
class C
{
    this(int* p){this