I've learned some guidelines that all told me pass a variable by reference should always use const, like func(const T& a)
. And I know the second template parameter in CList
is a ARG_TYPE
. Like CList::AddTail(ARG_TYPE item)
would use ARG_TYPE
as its parameter type.
I saw the sample codes in msdn shows me it uses the non-const
Type as its second template argument. Any reasons to prefer this non-const
Type as parameter type?
CList<string, &string> a;
vs CList<string, const &string> b;
Any suggestion would be helpful. Thanks.