Skip to content

Latest commit

 

History

History
34 lines (17 loc) · 1.13 KB

File metadata and controls

34 lines (17 loc) · 1.13 KB

Safety

Dangling references

This library's syntax explicitly forces you to choose between std::move()-ing or std::ref()-ing existing variables into adaptors.1 This avoids unintendedly creating dangling references.

See the examples.

Undefined behaviour

An unsorted list of instances where usage patterns that result in standard library undefined behaviour are ill-formed (and thus prevented) with this library:

  • Assigning through range adaptors that would invalidate those range adaptors in non-obvious ways (e.g. changing the element underlying a filter adaptor so that it no longer satisfies the predicat).
  • Some (but not all) examples of inadvertantly creating a multi-pass adaptor that violates the multi-pass guarantee. See also tradeoffs.

Many of these have examples on the examples page.

Footnotes

  1. Note that we are not technically storing std::reference_wrapper, we are just using std::ref as a marker for opting in to the indirection.