M
mrstephengross
I'd like to know if there's a standard way that the compiler interprets
a template argument. That is, let's say you pass a Foo instance as a
template argument to some function. Is the instance itself passed, or
does the compiler assume it's a Foo reference? For example:
================================
template<typename I> someFunc(I i) { /* ... */ }
Foo f;
someFunc(f);
=================================
In someFunc(), does I = Foo, or I = Foo&, or I = const Foo & ?
Thanks,
--Steve
a template argument. That is, let's say you pass a Foo instance as a
template argument to some function. Is the instance itself passed, or
does the compiler assume it's a Foo reference? For example:
================================
template<typename I> someFunc(I i) { /* ... */ }
Foo f;
someFunc(f);
=================================
In someFunc(), does I = Foo, or I = Foo&, or I = const Foo & ?
Thanks,
--Steve