Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does rule A2-10-5 apply to reusing an external identifier as a member identifier?
#1
Rule A2-10-5 states: Regardless of scope, no identifier with static storage duration should be reused across any source files in the project. Are cases where an identifier is reused as a member non-compliant with this rule? In particular, the case where an operator function is defined as a global and a member function.
Code:
struct S
{
  void operator<<(S&) {}
  void f1(int par) {}
};

namespace N
{
  void operator<<(int i, S&) {}  // Is compliant or non-compliant?
  void f1(int par) {}            // Is compliant or non-compliant?
}
Reply


Messages In This Thread
Does rule A2-10-5 apply to reusing an external identifier as a member identifier? - by mstaron - 06-07-2026, 12:23 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)