From b18b4f236fda53c8130bbbf0f381a396191c1c15 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 11 Apr 2016 17:16:43 -0500 Subject: [PATCH] Make the PVScalarValue explicit specializations inline Microsoft's compiler seems to prefer this when building a static library. --- src/factory/PVScalar.cpp | 18 ------------------ src/pv/pvData.h | 25 ++++++++++++++++++------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/factory/PVScalar.cpp b/src/factory/PVScalar.cpp index 942cf52..dee59d1 100644 --- a/src/factory/PVScalar.cpp +++ b/src/factory/PVScalar.cpp @@ -29,22 +29,4 @@ namespace epics { namespace pvData { { return static_pointer_cast(PVField::getField()); } - - template<> - std::ostream& PVScalarValue::dumpValue(std::ostream& o) const - { - return o << static_cast(get()); - } - - template<> - std::ostream& PVScalarValue::dumpValue(std::ostream& o) const - { - return o << static_cast(get()); - } - - template<> - std::ostream& PVScalarValue::dumpValue(std::ostream& o) const - { - return o << std::boolalpha << static_cast(get()); - } }} diff --git a/src/pv/pvData.h b/src/pv/pvData.h index 796abd6..2c6d128 100644 --- a/src/pv/pvData.h +++ b/src/pv/pvData.h @@ -437,14 +437,25 @@ private: }; /** - * @brief Some explicit specializations exist (defined in PVScalar.cpp) + * @brief Some explicit specializations exist */ -template<> - std::ostream& PVScalarValue::dumpValue(std::ostream& o) const; -template<> - std::ostream& PVScalarValue::dumpValue(std::ostream& o) const; -template<> - std::ostream& PVScalarValue::dumpValue(std::ostream& o) const; +template<> inline +std::ostream& PVScalarValue::dumpValue(std::ostream& o) const +{ + return o << static_cast(get()); +} + +template<> inline +std::ostream& PVScalarValue::dumpValue(std::ostream& o) const +{ + return o << static_cast(get()); +} + +template<> inline +std::ostream& PVScalarValue::dumpValue(std::ostream& o) const +{ + return o << std::boolalpha << static_cast(get()); +} /** * typedefs for the various possible scalar types.