const return value and template instantiation
- by Rimo
From Herb Sutter's GotW #6
Return-by-value should normally be const for non-builtin return types.
....
Note: Lakos (pg. 618) argues against returning const value,
and notes that it is redundant for builtins anyway
(for example, returning "const int"), which he notes may
interfere with template instantiation.
....
While Sutter seems to disagree on whether to return a const value or non-const value when returning an object of a non-built type by value with Lakos, he generally agrees that returning a const value of a built-in type (e.g const int) is not a good idea.
While I understand why that is useless because the return value cannot be modified as it is an rvalue, I cannot find an example of how that might interfere with template instantiation.
Please give me an example of how having a const qualifier for a return type might interfere with template instantiation.