From 29d6baf27b5b35a2074d4862cd3232a8d5438c9c Mon Sep 17 00:00:00 2001 From: Federico Aponte <97532903+federico-sysdig@users.noreply.github.com> Date: Wed, 16 Aug 2023 18:54:37 +0200 Subject: [PATCH] fix(userspace/libsinsp): avoid minor warning with recent C++ standards and compilers An unusual syntax of the declaration of a constructor (`libsinps::events::set()`) raises a warning when the compiler is gcc-11 and the build is done with C++20. Signed-off-by: Jason Dellaluce Co-authored-by: Federico Aponte --- userspace/libsinsp/events/sinsp_events_set.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/userspace/libsinsp/events/sinsp_events_set.h b/userspace/libsinsp/events/sinsp_events_set.h index 06c505fd85..df818585df 100644 --- a/userspace/libsinsp/events/sinsp_events_set.h +++ b/userspace/libsinsp/events/sinsp_events_set.h @@ -68,7 +68,7 @@ class set } public: - struct iterator + struct iterator { using iterator_category = std::forward_iterator_tag; using difference_type = std::ptrdiff_t; @@ -83,7 +83,7 @@ class set } reference operator*() { return m_val; } pointer operator->() { return &m_val; } - iterator& operator++() { m_index++; set_val(); return *this; } + iterator& operator++() { m_index++; set_val(); return *this; } iterator operator++(int) { iterator i = *this; ++(*this); return i; } friend bool operator== (const iterator& a, const iterator& b) { @@ -110,7 +110,7 @@ class set set(const set&) = default; set& operator=(set&&) noexcept = default; set& operator=(const set&) = default; - set() = delete; + set() = delete; template static set from(InputIterator first, InputIterator last) @@ -128,7 +128,7 @@ class set { return from(v.begin(), v.end()); } - + template set(const Iterable& v): set(from(v)) { }