Help needed with explicit instantiation of template methods

Jonathan Wakely jwakely.gcc@gmail.com
Wed Nov 6 15:52:00 GMT 2013


On 6 November 2013 15:27, David Aldrich <David.Aldrich@emea.nec.com> wrote:
> Hi Jonathan
>
>> Can you simply instantiate the whole class, instead of the copy constructor?
>>
>> template class Matrix< std::complex<double> >;
>
> That solution worked. Thanks very much for your help.

I raised this with the C++ standards committee and was pointed to a
known issue in the standard:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1665
The proposed resolution would mean your explicit instantiation refers
to the template constructor, so it seems that instantiating the whole
class is the best way to instantiate the copy constructor.



More information about the Gcc-help mailing list