mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Move template in-class function definitions out of class
Keeping them defined in-class caused linker issues with the extern template declaration in a non-optimized MinGW debug build. Apparently it did not inline them but instead relied on the extern declaration and expected them defined somewhere else.
This commit is contained in:
committed by
Klaus Basan
parent
5ac7c224bf
commit
29f464189b
@@ -41,6 +41,18 @@ namespace BlackMisc
|
||||
{
|
||||
namespace PhysicalQuantities
|
||||
{
|
||||
template <class MU, class PQ>
|
||||
const MU & CPhysicalQuantity<MU, PQ>::getUnit() const
|
||||
{
|
||||
return m_unit;
|
||||
}
|
||||
|
||||
template <class MU, class PQ>
|
||||
void CPhysicalQuantity<MU, PQ>::setUnit(const MU &unit)
|
||||
{
|
||||
m_unit = unit;
|
||||
}
|
||||
|
||||
template <class MU, class PQ>
|
||||
void CPhysicalQuantity<MU, PQ>::setUnitBySymbol(const QString &unitName)
|
||||
{
|
||||
|
||||
@@ -70,11 +70,11 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
//! Unit
|
||||
const MU &getUnit() const { return m_unit; }
|
||||
const MU &getUnit() const;
|
||||
|
||||
//! Simply set unit, do no calclulate conversion
|
||||
//! \sa switchUnit
|
||||
void setUnit(const MU &unit) { m_unit = unit; }
|
||||
void setUnit(const MU &unit);
|
||||
|
||||
//! Set unit by string
|
||||
void setUnitBySymbol(const QString &unitName);
|
||||
|
||||
@@ -481,6 +481,12 @@ namespace BlackMisc
|
||||
this->getAndFetchModelCG();
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
void CInterpolator<Derived>::markAsUnitTest()
|
||||
{
|
||||
m_unitTest = true;
|
||||
}
|
||||
|
||||
CInterpolationResult::CInterpolationResult()
|
||||
{
|
||||
this->reset();
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace BlackMisc
|
||||
void initCorrespondingModel(const CAircraftModel &model = {});
|
||||
|
||||
//! Mark as unit test
|
||||
void markAsUnitTest() { m_unitTest = true; }
|
||||
void markAsUnitTest();
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
|
||||
@@ -643,6 +643,12 @@ namespace BlackMisc
|
||||
return dt.isValid() ? dt.toMSecsSinceEpoch() : -1;
|
||||
}
|
||||
|
||||
template <class OBJ, class CONTAINER>
|
||||
void ITimestampWithOffsetObjectList<OBJ, CONTAINER>::setAdjustedSortHint(HintAdjustedTimestampSort hint)
|
||||
{
|
||||
m_tsAdjustedSortHint = hint;
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
// https://isocpp.org/wiki/faq/templates#separate-template-fn-defn-from-decl
|
||||
template class BLACKMISC_EXPORT_DEFINE_TEMPLATE ITimestampObjectList<BlackMisc::CCountry, BlackMisc::CCountryList>;
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace BlackMisc
|
||||
qint64 oldestAdjustedTimestampMsecsSinceEpoch() const;
|
||||
|
||||
//! Set the hint
|
||||
void setAdjustedSortHint(HintAdjustedTimestampSort hint) { m_tsAdjustedSortHint = hint; }
|
||||
void setAdjustedSortHint(HintAdjustedTimestampSort hint);
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
|
||||
Reference in New Issue
Block a user