tcbrindle / NanoRange

Range-based goodness for C++17
Boost Software License 1.0
358 stars 28 forks source link

Add [[nodiscard]] to algorithms and views #106

Open bstaletic opened 4 years ago

bstaletic commented 4 years ago

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.