MISRA.CTOR.NOT_EXPLICITConstructor with one argument of built-in type is not declared 'explicit'. MISRA-C++ Rule 12-1-3 (required): All constructors that are callable with a single argument of fundamental type shall be declared explicit.RationaleThe explicit keyword prevents the constructor from being used to implicitly convert from a fundamental type to the class type. Exampleclass C { public: C ( int32_t a ) // Non-compliant { } }; class D { public: explicit D ( int32_t a ) // Compliant { } }; |