From f156916c0c24d89d1066dfe88b69fb325cb9b9cb Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Tue, 14 Jan 2014 00:46:24 +0000 Subject: [PATCH] A copy constructor is needed for CPhysicalQuantity to fix an MSVC2010 linker error introduced by the previous commit. refs #84 --- src/blackmisc/pqphysicalquantity.cpp | 10 ++++++++++ src/blackmisc/pqphysicalquantity.h | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/src/blackmisc/pqphysicalquantity.cpp b/src/blackmisc/pqphysicalquantity.cpp index 436ad1624..27fcb2769 100644 --- a/src/blackmisc/pqphysicalquantity.cpp +++ b/src/blackmisc/pqphysicalquantity.cpp @@ -20,6 +20,16 @@ namespace BlackMisc // void } + /* + * Copy constructor + * (The implicitly generated copy constructor would suffice, but for what seems to be a bug in MSVC2010 template instantiation) + */ + template CPhysicalQuantity::CPhysicalQuantity(const CPhysicalQuantity &other) : + m_value(other.m_value), m_unit(other.m_unit) + { + // void + } + /* * Equal operator == */ diff --git a/src/blackmisc/pqphysicalquantity.h b/src/blackmisc/pqphysicalquantity.h index 841a6cdaf..18ce23f68 100644 --- a/src/blackmisc/pqphysicalquantity.h +++ b/src/blackmisc/pqphysicalquantity.h @@ -61,6 +61,12 @@ namespace BlackMisc */ CPhysicalQuantity(double value, const MU &unit); + /*! + * \brief Copy constructor + * \param other + */ + CPhysicalQuantity(const CPhysicalQuantity &other); + /*! * \brief Rounded value as string * \param i18n