Skip to content

Commit

Permalink
remove inline
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Jul 20, 2023
1 parent a2d6996 commit 4abbbc9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion include/exiv2/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions include/exiv2/metadatum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down
30 changes: 15 additions & 15 deletions include/exiv2/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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_;
}
Expand All @@ -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");
}
Expand Down Expand Up @@ -530,49 +530,49 @@ struct Slice<T*> : public Internal::MutableSliceBase<Internal::PtrSliceStorage,
* parameter deduction.
*/
template <typename T>
inline Slice<T> makeSlice(T& cont, size_t begin, size_t end) {
return Slice<T>(cont, begin, end);
Slice<T> makeSlice(T& cont, size_t begin, size_t end) {
return {cont, begin, end};
}

/*!
* Overload of makeSlice for slices of C-arrays.
*/
template <typename T>
inline Slice<T*> makeSlice(T* ptr, size_t begin, size_t end) {
return Slice<T*>(ptr, begin, end);
Slice<T*> makeSlice(T* ptr, size_t begin, size_t end) {
return {ptr, begin, end};
}

/*!
* @brief Return a new slice spanning the whole container.
*/
template <typename container>
inline Slice<container> makeSlice(container& cont) {
return Slice<container>(cont, 0, cont.size());
Slice<container> makeSlice(container& cont) {
return {cont, 0, cont.size()};
}

/*!
* @brief Return a new slice spanning from begin until the end of the
* container.
*/
template <typename container>
inline Slice<container> makeSliceFrom(container& cont, size_t begin) {
return Slice<container>(cont, begin, cont.size());
Slice<container> makeSliceFrom(container& cont, size_t begin) {
return {cont, begin, cont.size()};
}

/*!
* @brief Return a new slice spanning until `end`.
*/
template <typename container>
inline Slice<container> makeSliceUntil(container& cont, size_t end) {
return Slice<container>(cont, 0, end);
Slice<container> makeSliceUntil(container& cont, size_t end) {
return {cont, 0, end};
}

/*!
* Overload of makeSliceUntil for pointer based slices.
*/
template <typename T>
inline Slice<T*> makeSliceUntil(T* ptr, size_t end) {
return Slice<T*>(ptr, 0, end);
Slice<T*> makeSliceUntil(T* ptr, size_t end) {
return {ptr, 0, end};
}

} // namespace Exiv2
Expand Down
2 changes: 1 addition & 1 deletion include/exiv2/tags.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(id);
}

Expand Down
2 changes: 1 addition & 1 deletion include/exiv2/value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4abbbc9

Please sign in to comment.