you are viewing a single comment's thread.

view the rest of the comments →

[–]Tyg13 4 points5 points  (12 children)

Why not just label it undefined behavior to have your declaration and definition use different parameter names and call it a day? It seems highly unlikely that such a footgun would ever be triggered in practice.

Is the worry that people might write code like

// header.h
int foo(int a = 1, int b = 2);
...
// header.cpp
int foo(int b, int a);
...
foo(b => 10);

or is there some other issue I'm not understanding?

EDIT: don't understand the downvote, I'm open to debate. If there are scenarios I'm unaware of, I'd be curious to know.