From: Jérémie Galarneau Date: Fri, 21 Apr 2023 19:11:44 +0000 (-0400) Subject: lttng: rename iterator_template to _iterator X-Git-Url: https://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=767954d25dee78ad2c5ccfc1ee40a5dbb157ca21 lttng: rename iterator_template to _iterator iterator_template is not meant to be used directly and is private: it should be prefixed with an underscore. Moreover, "template" in the name doesn't really add anything; remove it. Signed-off-by: Jérémie Galarneau Change-Id: Id891afeb596788d8d40cdf45e3f50dd8bf0427cc --- diff --git a/src/bin/lttng/utils.hpp b/src/bin/lttng/utils.hpp index 61fb6f6ff..990bad575 100644 --- a/src/bin/lttng/utils.hpp +++ b/src/bin/lttng/utils.hpp @@ -41,42 +41,44 @@ struct session_spec { */ class session_list { template - class iterator_template : public std::iterator { + class _iterator + : public std::iterator { public: - explicit iterator_template(ContainerType& list, std::size_t k) : _list(list), _index(k) + explicit _iterator(ContainerType& list, std::size_t k) : + _list(list), _index(k) { } - iterator_template& operator++() noexcept + _iterator& operator++() noexcept { ++_index; return *this; } - iterator_template& operator--() noexcept + _iterator& operator--() noexcept { --_index; return *this; } - iterator_template& operator++(int) noexcept + _iterator& operator++(int) noexcept { _index++; return *this; } - iterator_template& operator--(int) noexcept + _iterator& operator--(int) noexcept { _index--; return *this; } - bool operator==(iterator_template other) const noexcept + bool operator==(_iterator other) const noexcept { return _index == other._index; } - bool operator!=(iterator_template other) const noexcept + bool operator!=(_iterator other) const noexcept { return !(*this == other); } @@ -91,8 +93,8 @@ class session_list { std::size_t _index; }; - using iterator = iterator_template; - using const_iterator = iterator_template; + using iterator = _iterator; + using const_iterator = _iterator; public: session_list() : _sessions_count(0), _sessions(nullptr)