Make the PVScalarValue explicit specializations inline

Microsoft's compiler seems to prefer this when building a static library.
This commit is contained in:
Andrew Johnson
2016-04-11 17:16:43 -05:00
parent 605d4e99b9
commit b18b4f236f
2 changed files with 18 additions and 25 deletions

View File

@@ -29,22 +29,4 @@ namespace epics { namespace pvData {
{
return static_pointer_cast<const Scalar>(PVField::getField());
}
template<>
std::ostream& PVScalarValue<int8>::dumpValue(std::ostream& o) const
{
return o << static_cast<int>(get());
}
template<>
std::ostream& PVScalarValue<uint8>::dumpValue(std::ostream& o) const
{
return o << static_cast<unsigned int>(get());
}
template<>
std::ostream& PVScalarValue<boolean>::dumpValue(std::ostream& o) const
{
return o << std::boolalpha << static_cast<bool>(get());
}
}}

View File

@@ -437,14 +437,25 @@ private:
};
/**
* @brief Some explicit specializations exist (defined in PVScalar.cpp)
* @brief Some explicit specializations exist
*/
template<>
std::ostream& PVScalarValue<int8>::dumpValue(std::ostream& o) const;
template<>
std::ostream& PVScalarValue<uint8>::dumpValue(std::ostream& o) const;
template<>
std::ostream& PVScalarValue<boolean>::dumpValue(std::ostream& o) const;
template<> inline
std::ostream& PVScalarValue<int8>::dumpValue(std::ostream& o) const
{
return o << static_cast<int>(get());
}
template<> inline
std::ostream& PVScalarValue<uint8>::dumpValue(std::ostream& o) const
{
return o << static_cast<unsigned int>(get());
}
template<> inline
std::ostream& PVScalarValue<boolean>::dumpValue(std::ostream& o) const
{
return o << std::boolalpha << static_cast<bool>(get());
}
/**
* typedefs for the various possible scalar types.