If I explicitly instantiate a template class which has a default destructor, default move constructor, etc, and never use that type in that translation unit, then it does not include the compiler-generated member functions.
For instance, if a template class array2d
has compiler generated member functions e.g.:
array2d(array2d const &b) = default;
array2d(array2d &&b) noexcept = default;
~array2d() = default;
array2d &operator=(array2d const &) = default;
array2d &operator=(array2d &&) noexcept = default;
and if I explicitly instantiate this like so:
#include "array2d.hh"
template class array2d<float>;
and compile this to array.cc.o
I get these symbols:
0000000000000000 W void swap<float>(array2d<float>&, array2d<float>&)
0000000000000000 W array2d<float>::swap(array2d<float>&)
0000000000000000 W array2d<float>::array2d(long, long)
0000000000000000 W array2d<float>::array2d()
0000000000000000 W array2d<float>::array2d(long, long)
0000000000000000 W array2d<float>::array2d()
0000000000000000 n array2d<float>::array2d(long, long)
0000000000000000 n array2d<float>::array2d()
0000000000000000 W array2d<float>::operator()(long, long)
0000000000000000 W array2d<float>::operator[](long)
0000000000000000 W array2d<float>::rows() const
0000000000000000 W array2d<float>::empty() const
0000000000000000 W array2d<float>::columns() const
0000000000000000 W array2d<float>::operator()(long, long) const
0000000000000000 W array2d<float>::operator[](long) const
None of the symbols for compiler generated member functions exist.
Why doesn't explicit template class instantiation create these symbols?