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 Aug 3, 2023
1 parent 4d2d5f3 commit 06cf19a
Showing 1 changed file with 15 additions and 15 deletions.
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

0 comments on commit 06cf19a

Please sign in to comment.