Is it possible to assert type of a function that I call to return by reference?

The assertion is expected to happen only at compile time (but not required).

It is useful for debugging purpose. 

Example
-------

I have a simple `std::vector<T>` encapsulator as followed:-

```
template<class T> class CustomArray{
    //..... some datastructure ...
    T& get(int index) { ... }
}

```

Some game/business logic may use this class e.g. 

```
CustomArray<CreditCard> array ;
//... do some business logic
CreditCard& c= array.get(0);
c.pinNumber = 1403; //modification

```

The modification of **pinNumber** effects the value in CustomArray, nice.

If someone in my team want to use his own data structure and edit my code e.g.

```
HisCustomArray<CreditCard> array ;
//replace the line : CustomArray<CreditCard> array 

```

I want an automatic **weak** way to ensure that HisCustomArray::get(int) always return as T& not T, otherwise the line will be broken.

```
 c.pinNumber = 1403;

```

I expect something similar to:

```
CustomArray<CreditCard> array ;
assertReturn_JUST_DUMMY(   array::get(int)  , CreditCard& ); //possible format
//.... other business logic ....

```