diff --git a/include/exiv2/error.hpp b/include/exiv2/error.hpp index 6b7e18e408..b240624c04 100644 --- a/include/exiv2/error.hpp +++ b/include/exiv2/error.hpp @@ -292,7 +292,7 @@ class EXIV2API Error : public std::exception { }; //! %Error output operator -inline std::ostream& operator<<(std::ostream& os, const Error& error) { +static std::ostream& operator<<(std::ostream& os, const Error& error) { return os << error.what(); } diff --git a/include/exiv2/metadatum.hpp b/include/exiv2/metadatum.hpp index 33ffbc320d..8b0dd8c935 100644 --- a/include/exiv2/metadatum.hpp +++ b/include/exiv2/metadatum.hpp @@ -92,7 +92,7 @@ class EXIV2API Key { }; // class Key //! Output operator for Key types -inline std::ostream& operator<<(std::ostream& os, const Key& key) { +static std::ostream& operator<<(std::ostream& os, const Key& key) { return key.write(os); } @@ -273,7 +273,7 @@ class EXIV2API Metadatum { @brief Output operator for Metadatum types, writing the interpreted tag value. */ -inline std::ostream& operator<<(std::ostream& os, const Metadatum& md) { +static std::ostream& operator<<(std::ostream& os, const Metadatum& md) { return md.write(os); } diff --git a/include/exiv2/slice.hpp b/include/exiv2/slice.hpp index 9842ebcb0c..4bd882474d 100644 --- a/include/exiv2/slice.hpp +++ b/include/exiv2/slice.hpp @@ -17,7 +17,7 @@ namespace Internal { * knowledge about the stored data. */ struct SliceBase { - inline SliceBase(size_t begin, size_t end) : begin_(begin), end_(end) { + SliceBase(size_t begin, size_t end) : begin_(begin), end_(end) { if (begin >= end) { throw std::out_of_range("Begin must be smaller than end"); } @@ -26,7 +26,7 @@ struct SliceBase { /*! * Return the number of elements in the slice. */ - [[nodiscard]] inline size_t size() const noexcept { + [[nodiscard]] size_t size() const noexcept { // cannot underflow, as we know that begin < end return end_ - begin_; } @@ -38,7 +38,7 @@ struct SliceBase { * @throw std::out_of_range when `index` will access an element * outside of the slice */ - inline void rangeCheck(size_t index) const { + void rangeCheck(size_t index) const { if (index >= size()) { throw std::out_of_range("Index outside of the slice"); } @@ -530,24 +530,24 @@ struct Slice : public Internal::MutableSliceBase -inline Slice makeSlice(T& cont, size_t begin, size_t end) { - return Slice(cont, begin, end); +Slice makeSlice(T& cont, size_t begin, size_t end) { + return {cont, begin, end}; } /*! * Overload of makeSlice for slices of C-arrays. */ template -inline Slice makeSlice(T* ptr, size_t begin, size_t end) { - return Slice(ptr, begin, end); +Slice makeSlice(T* ptr, size_t begin, size_t end) { + return {ptr, begin, end}; } /*! * @brief Return a new slice spanning the whole container. */ template -inline Slice makeSlice(container& cont) { - return Slice(cont, 0, cont.size()); +Slice makeSlice(container& cont) { + return {cont, 0, cont.size()}; } /*! @@ -555,24 +555,24 @@ inline Slice makeSlice(container& cont) { * container. */ template -inline Slice makeSliceFrom(container& cont, size_t begin) { - return Slice(cont, begin, cont.size()); +Slice makeSliceFrom(container& cont, size_t begin) { + return {cont, begin, cont.size()}; } /*! * @brief Return a new slice spanning until `end`. */ template -inline Slice makeSliceUntil(container& cont, size_t end) { - return Slice(cont, 0, end); +Slice makeSliceUntil(container& cont, size_t end) { + return {cont, 0, end}; } /*! * Overload of makeSliceUntil for pointer based slices. */ template -inline Slice makeSliceUntil(T* ptr, size_t end) { - return Slice(ptr, 0, end); +Slice makeSliceUntil(T* ptr, size_t end) { + return {ptr, 0, end}; } } // namespace Exiv2 diff --git a/include/exiv2/tags.hpp b/include/exiv2/tags.hpp index 1eae8b0abd..dcf7c9f506 100644 --- a/include/exiv2/tags.hpp +++ b/include/exiv2/tags.hpp @@ -176,7 +176,7 @@ enum class IfdId : uint32_t { ignoreId = lastId }; -inline std::ostream& operator<<(std::ostream& os, IfdId id) { +static std::ostream& operator<<(std::ostream& os, IfdId id) { return os << static_cast(id); } diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp index 0c55d822e0..86655e8997 100644 --- a/include/exiv2/value.hpp +++ b/include/exiv2/value.hpp @@ -239,7 +239,7 @@ class EXIV2API Value { }; //! Output operator for Value types -inline std::ostream& operator<<(std::ostream& os, const Value& value) { +static std::ostream& operator<<(std::ostream& os, const Value& value) { return value.write(os); }