Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
9-3-3 and interfaces enforced via templates instead of virtual functions
#2
We're not sure what the problem is that you are concerned about.

If you have class A with  void run() const;  and  class B with  void run();  and the two versions of run satisfy 9-3-3  (i.e. A::run() can be const, but B::run() can't be const), then you can instantiate foo with both A and B.

We can see that you may get a violation of 7-1-2 (make reference parameters const where possibly), but that can be avoided by overloading foo with void foo(const FooT& f)

Please clarify the concern
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: 9-3-3 and interfaces enforced via templates instead of virtual functions - by misra cpp - 13-01-2022, 11:09 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)