[DynInst_API:] commit: fix template instantiation in emitElf


Date: Mon, 18 Apr 2016 15:18:28 -0500
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: [DynInst_API:] commit: fix template instantiation in emitElf
As per subject. My language lawyering was not up to snuff.

The following pattern of explicit instantiation appears to have the broadest support:

foo.h:
template<typename T> class foo
{
    // declaration
};
extern template class foo<bar>;
extern template class foo<baz>;

foo.C:

template<typename T> foo<T>::func()
{
}
...

template class foo<bar>;
template class foo<baz>;

Open to suggestions for still-more-portable ways to make explicit instantiations properly visible without having giant implementations living in header files.

--bw
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] commit: fix template instantiation in emitElf, Bill Williams <=