Similar to uncalled functions, un-instantiated class and function templates are a potential source of noise and they may be symptomatic of a more serious problem such as missing paths.


Note: Even though a given class template may be instantiated many times, it is possible that some of its member functions are never instantiated.


== Noncompliant Code Example

----
template < typename T >
class Sample
{
public:
  void inst_mem ( ) { }
  void uninst_mem ( ) { } // Noncompliant, never instantiated
};

Sample<int64_t> s;
s.inst_mem ( ); // Call to s.inst_mem instantiates the member.
// s.uninst_mem is not called within the program and is not instantiated.
----


== Exceptions

This rule does not apply to libraries.


== See

* MISRA {cpp}:2008, 14-7-1


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

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
