Skip to content

Commit 8ce5f85

Browse files
authored
style(clang-tidy): fix modernize-use-trailing-return-type checks (#1808)
Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent eade13f commit 8ce5f85

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/core/jsonpointer/include/sourcemeta/core/jsonpointer_subpointer_walker.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ template <typename PointerT> class GenericSubPointerIterator {
2020
GenericSubPointerIterator(pointer input) : data{input} {}
2121

2222
/// Get the current subpointer as a reference
23-
reference operator*() const { return *(this->data); }
23+
auto operator*() const -> reference { return *(this->data); }
2424

2525
/// Get the current subpointer as a pointer
26-
pointer operator->() { return this->data; }
26+
auto operator->() -> pointer { return this->data; }
2727

2828
/// Advance the iterator to the next subpointer
29-
GenericSubPointerIterator &operator++() {
29+
auto operator++() -> GenericSubPointerIterator & {
3030
if (this->data->empty()) {
3131
// Turn the instance into the impossible subpointer iterator
3232
this->data = nullptr;
@@ -37,8 +37,8 @@ template <typename PointerT> class GenericSubPointerIterator {
3737
return *this;
3838
}
3939

40-
friend bool operator==(const GenericSubPointerIterator &left,
41-
const GenericSubPointerIterator &right) {
40+
friend auto operator==(const GenericSubPointerIterator &left,
41+
const GenericSubPointerIterator &right) -> bool {
4242
return (!left.data && !right.data) ||
4343
(left.data && right.data && *(left.data) == *(right.data));
4444
};
@@ -54,10 +54,10 @@ template <typename PointerT> class GenericSubPointerWalker {
5454
using const_iterator = GenericSubPointerIterator<PointerT>;
5555
GenericSubPointerWalker(PointerT pointer) : data{std::move(pointer)} {}
5656

57-
const_iterator begin() { return {&this->data}; }
58-
const_iterator end() { return {nullptr}; }
59-
const_iterator cbegin() { return {&this->data}; }
60-
const_iterator cend() { return {nullptr}; }
57+
auto begin() -> const_iterator { return {&this->data}; }
58+
auto end() -> const_iterator { return {nullptr}; }
59+
auto cbegin() -> const_iterator { return {&this->data}; }
60+
auto cend() -> const_iterator { return {nullptr}; }
6161

6262
private:
6363
PointerT data;

0 commit comments

Comments
 (0)