01-08-2025, 11:49 AM
In the introduction to the rules, there's the requirement:
"3.7.3 Templates
Unless otherwise stated, the guidelines shall only be applied to fully instantiated templates"
For a template variable, each instantiation has to be considered separately. So your example with <const int> is compliant, but if it were replaced by <int> it would be non-compliant
"3.7.3 Templates
Unless otherwise stated, the guidelines shall only be applied to fully instantiated templates"
For a template variable, each instantiation has to be considered separately. So your example with <const int> is compliant, but if it were replaced by <int> it would be non-compliant
Posted by and on behalf of
the MISRA C++ Working Group
the MISRA C++ Working Group