11/*
2- * Copyright (c) 2016-2022 Morwenn
2+ * Copyright (c) 2016-2025 Morwenn
33 * SPDX-License-Identifier: MIT
44 */
55#ifndef CPPSORT_DETAIL_ASSOCIATE_ITERATOR_H_
1111#include < iterator>
1212#include < utility>
1313#include < cpp-sort/utility/iter_move.h>
14- #include " attributes.h"
1514#include " iterator_traits.h"
1615
1716namespace cppsort
@@ -80,14 +79,14 @@ namespace detail
8079 return *this ;
8180 }
8281
83- CPPSORT_ATTRIBUTE_NODISCARD
82+ [[nodiscard]]
8483 auto get ()
8584 -> decltype(*it)
8685 {
8786 return *it;
8887 }
8988
90- CPPSORT_ATTRIBUTE_NODISCARD
89+ [[nodiscard]]
9190 auto get () const
9291 -> decltype(*it)
9392 {
@@ -134,14 +133,14 @@ namespace detail
134133 return *this ;
135134 }
136135
137- CPPSORT_ATTRIBUTE_NODISCARD
136+ [[nodiscard]]
138137 auto get ()
139138 -> Value&
140139 {
141140 return value;
142141 }
143142
144- CPPSORT_ATTRIBUTE_NODISCARD
143+ [[nodiscard]]
145144 auto get () const
146145 -> const Value&
147146 {
@@ -182,7 +181,7 @@ namespace detail
182181 // //////////////////////////////////////////////////////////
183182 // Members access
184183
185- CPPSORT_ATTRIBUTE_NODISCARD
184+ [[nodiscard]]
186185 auto base () const
187186 -> iterator_type
188187 {
@@ -192,14 +191,14 @@ namespace detail
192191 // //////////////////////////////////////////////////////////
193192 // Element access
194193
195- CPPSORT_ATTRIBUTE_NODISCARD
194+ [[nodiscard]]
196195 auto operator *() const
197196 -> decltype (*base ())
198197 {
199198 return *_it;
200199 }
201200
202- CPPSORT_ATTRIBUTE_NODISCARD
201+ [[nodiscard]]
203202 auto operator ->() const
204203 -> pointer
205204 {
@@ -240,7 +239,7 @@ namespace detail
240239 // //////////////////////////////////////////////////////////
241240 // Elements access operators
242241
243- CPPSORT_ATTRIBUTE_NODISCARD
242+ [[nodiscard]]
244243 auto operator [](difference_type pos) const
245244 -> decltype (base()[pos])
246245 {
@@ -250,14 +249,14 @@ namespace detail
250249 // //////////////////////////////////////////////////////////
251250 // Comparison operators
252251
253- CPPSORT_ATTRIBUTE_NODISCARD
252+ [[nodiscard]]
254253 friend auto operator ==(const associate_iterator& lhs, const associate_iterator& rhs)
255254 -> bool
256255 {
257256 return lhs.base () == rhs.base ();
258257 }
259258
260- CPPSORT_ATTRIBUTE_NODISCARD
259+ [[nodiscard]]
261260 friend auto operator !=(const associate_iterator& lhs, const associate_iterator& rhs)
262261 -> bool
263262 {
@@ -267,28 +266,28 @@ namespace detail
267266 // //////////////////////////////////////////////////////////
268267 // Relational operators
269268
270- CPPSORT_ATTRIBUTE_NODISCARD
269+ [[nodiscard]]
271270 friend auto operator <(const associate_iterator& lhs, const associate_iterator& rhs)
272271 -> bool
273272 {
274273 return lhs.base () < rhs.base ();
275274 }
276275
277- CPPSORT_ATTRIBUTE_NODISCARD
276+ [[nodiscard]]
278277 friend auto operator <=(const associate_iterator& lhs, const associate_iterator& rhs)
279278 -> bool
280279 {
281280 return lhs.base () <= rhs.base ();
282281 }
283282
284- CPPSORT_ATTRIBUTE_NODISCARD
283+ [[nodiscard]]
285284 friend auto operator >(const associate_iterator& lhs, const associate_iterator& rhs)
286285 -> bool
287286 {
288287 return lhs.base () > rhs.base ();
289288 }
290289
291- CPPSORT_ATTRIBUTE_NODISCARD
290+ [[nodiscard]]
292291 friend auto operator >=(const associate_iterator& lhs, const associate_iterator& rhs)
293292 -> bool
294293 {
@@ -298,31 +297,31 @@ namespace detail
298297 // //////////////////////////////////////////////////////////
299298 // Arithmetic operators
300299
301- CPPSORT_ATTRIBUTE_NODISCARD
300+ [[nodiscard]]
302301 friend auto operator +(associate_iterator it, difference_type size)
303302 -> associate_iterator
304303 {
305304 it += size;
306305 return it;
307306 }
308307
309- CPPSORT_ATTRIBUTE_NODISCARD
308+ [[nodiscard]]
310309 friend auto operator +(difference_type size, associate_iterator it)
311310 -> associate_iterator
312311 {
313312 it += size;
314313 return it;
315314 }
316315
317- CPPSORT_ATTRIBUTE_NODISCARD
316+ [[nodiscard]]
318317 friend auto operator -(associate_iterator it, difference_type size)
319318 -> associate_iterator
320319 {
321320 it -= size;
322321 return it;
323322 }
324323
325- CPPSORT_ATTRIBUTE_NODISCARD
324+ [[nodiscard]]
326325 friend auto operator -(const associate_iterator& lhs, const associate_iterator& rhs)
327326 -> difference_type
328327 {
@@ -339,7 +338,7 @@ namespace detail
339338 iter_swap (lhs.base (), rhs.base ());
340339 }
341340
342- CPPSORT_ATTRIBUTE_NODISCARD
341+ [[nodiscard]]
343342 friend auto iter_move (associate_iterator it)
344343 -> associated_value<
345344 value_type_t<typename value_type_t<Iterator>::iterator_type>,
@@ -361,7 +360,7 @@ namespace detail
361360 // Construction function
362361
363362 template <typename Iterator>
364- CPPSORT_ATTRIBUTE_NODISCARD
363+ [[nodiscard]]
365364 auto make_associate_iterator (Iterator it)
366365 -> associate_iterator<Iterator>
367366 {
0 commit comments