D
desktop
I am trying to understand the following template:
template <typename T>
inline T const& max (T const& a, T const& b) {
return a < b ? b : a;
}
does it say that the function max returns a constant reference to T of
any type?
I have never seen a function returning references before, does it mean
that it returns the address of the value returned?
normally the address of eg. an integer is:
int x = 22;
&x
but in the above function its more like:
x&
template <typename T>
inline T const& max (T const& a, T const& b) {
return a < b ? b : a;
}
does it say that the function max returns a constant reference to T of
any type?
I have never seen a function returning references before, does it mean
that it returns the address of the value returned?
normally the address of eg. an integer is:
int x = 22;
&x
but in the above function its more like:
x&