Parameter names are not part of the declared object. This is true for both functions and templates. The following code declares only two separate objects:
extern void f(int, char, bool); extern void f(int a, char b, bool c); extern void f(int x, char b, bool z); template <typename> struct X; template <typename A> struct X; template <typename T> struct X;
Please note in particular that the following code works great:
template <typename T> struct X { void f(); };
All attempts to obtain an additional structure from parameter names must deal with this situation. One of the most popular queries in this area is function parameters; to date, there has not been a satisfactory proposal for such an extension.
To some extent, all such suggestions will require parameter names to be part of the declared object. For example, for functions that would raise the question of whether to distort parameter names and expose them to the linker.
source share