Mercurial > octave
changeset 29244:d1473e75d7d6
lo-utils: Export template instantiations (patch #8919).
* liboctave/util/lo-utils.cc: Export template instantiations of read_value<T>
and write_value<T>. Break some long lines.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Fri, 01 Jan 2021 17:33:04 +0100 |
parents | e2bca6106057 |
children | 33496684ca5d |
files | liboctave/util/lo-utils.cc |
diffstat | 1 files changed, 35 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/util/lo-utils.cc Fri Jan 01 17:12:21 2021 +0100 +++ b/liboctave/util/lo-utils.cc Fri Jan 01 17:33:04 2021 +0100 @@ -188,15 +188,15 @@ return retval; } - template bool read_value<bool> (std::istream& is); - template octave_int8 read_value<octave_int8> (std::istream& is); - template octave_int16 read_value<octave_int16> (std::istream& is); - template octave_int32 read_value<octave_int32> (std::istream& is); - template octave_int64 read_value<octave_int64> (std::istream& is); - template octave_uint8 read_value<octave_uint8> (std::istream& is); - template octave_uint16 read_value<octave_uint16> (std::istream& is); - template octave_uint32 read_value<octave_uint32> (std::istream& is); - template octave_uint64 read_value<octave_uint64> (std::istream& is); + template OCTAVE_API bool read_value<bool> (std::istream& is); + template OCTAVE_API octave_int8 read_value<octave_int8> (std::istream& is); + template OCTAVE_API octave_int16 read_value<octave_int16> (std::istream& is); + template OCTAVE_API octave_int32 read_value<octave_int32> (std::istream& is); + template OCTAVE_API octave_int64 read_value<octave_int64> (std::istream& is); + template OCTAVE_API octave_uint8 read_value<octave_uint8> (std::istream& is); + template OCTAVE_API octave_uint16 read_value<octave_uint16> (std::istream& is); + template OCTAVE_API octave_uint32 read_value<octave_uint32> (std::istream& is); + template OCTAVE_API octave_uint64 read_value<octave_uint64> (std::istream& is); // Note that the caller is responsible for repositioning the stream on // failure. @@ -405,20 +405,30 @@ os << value; } - template void write_value<bool> (std::ostream& os, const bool& value); - template void write_value<octave_int8> (std::ostream& os, const octave_int8& value); - template void write_value<octave_int16> (std::ostream& os, const octave_int16& value); - template void write_value<octave_int32> (std::ostream& os, const octave_int32& value); - template void write_value<octave_int64> (std::ostream& os, const octave_int64& value); - template void write_value<octave_uint8> (std::ostream& os, const octave_uint8& value); - template void write_value<octave_uint16> (std::ostream& os, const octave_uint16& value); - template void write_value<octave_uint32> (std::ostream& os, const octave_uint32& value); - template void write_value<octave_uint64> (std::ostream& os, const octave_uint64& value); + template OCTAVE_API void + write_value<bool> (std::ostream& os, const bool& value); + template OCTAVE_API void + write_value<octave_int8> (std::ostream& os, const octave_int8& value); + template OCTAVE_API void + write_value<octave_int16> (std::ostream& os, const octave_int16& value); + template OCTAVE_API void + write_value<octave_int32> (std::ostream& os, const octave_int32& value); + template OCTAVE_API void + write_value<octave_int64> (std::ostream& os, const octave_int64& value); + template OCTAVE_API void + write_value<octave_uint8> (std::ostream& os, const octave_uint8& value); + template OCTAVE_API void + write_value<octave_uint16> (std::ostream& os, const octave_uint16& value); + template OCTAVE_API void + write_value<octave_uint32> (std::ostream& os, const octave_uint32& value); + template OCTAVE_API void + write_value<octave_uint64> (std::ostream& os, const octave_uint64& value); // Note: precision is supposed to be managed outside of this function by // setting stream parameters. - template <> OCTAVE_API void write_value (std::ostream& os, const double& value) + template <> OCTAVE_API void + write_value (std::ostream& os, const double& value) { if (lo_ieee_is_NA (value)) os << "NA"; @@ -430,7 +440,8 @@ os << value; } - template <> OCTAVE_API void write_value (std::ostream& os, const Complex& value) + template <> OCTAVE_API void + write_value (std::ostream& os, const Complex& value) { os << '('; write_value<double> (os, real (value)); @@ -442,7 +453,8 @@ // Note: precision is supposed to be managed outside of this function by // setting stream parameters. - template <> OCTAVE_API void write_value (std::ostream& os, const float& value) + template <> OCTAVE_API void + write_value (std::ostream& os, const float& value) { if (lo_ieee_is_NA (value)) os << "NA"; @@ -454,7 +466,8 @@ os << value; } - template <> OCTAVE_API void write_value (std::ostream& os, const FloatComplex& value) + template <> OCTAVE_API void + write_value (std::ostream& os, const FloatComplex& value) { os << '('; write_value<float> (os, real (value));