NanoRange icon indicating copy to clipboard operation
NanoRange copied to clipboard

Add [[nodiscard]] to algorithms and views

Open bstaletic opened this issue 5 years ago • 0 comments

All views are now marked with [[nodiscard]], although some things may have been missed. For algorithms, [[nodiscard]] wasn't added to:

  1. In-place, modifying algorithms - the caller often knows what to expect and the return value isn't that useful.
  2. Algorithms that take an output iterator - that output iterator might be ostream_iterator<T>(cout).
  3. next_permutation and prev_permutation - the in_found_result::found seems useful, but I wasn't sure if it is useful enough.

bstaletic avatar Jul 13 '20 18:07 bstaletic