== Why is this an issue?

The explicit keyword prevents the constructor from being used to implicitly convert from a fundamental type to the class type.


=== Noncompliant code example

[source,cpp]
----
class C
{
public:
  C ( int32_t a ) // Noncompliant
  {
  }
};
----


=== Compliant solution

[source,cpp]
----
class D
{
public:
  explicit D ( int32_t a )
  {
  }
};
----


== Resources

* MISRA {cpp}:2008, 12-1-3


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

=== duplicates: S1709

=== on 17 Nov 2015, 21:49:14 Evgeny Mandrikov wrote:
\[~ann.campbell.2] duplicates RSPEC-1709 ?

=== on 18 Nov 2015, 17:38:58 Ann Campbell wrote:
It sure does [~evgeny.mandrikov]. Closed & MISRA reference added to RSPEC-1709

endif::env-github,rspecator-view[]
