Skip to content

Commit da207d4

Browse files
sipafurszy
authored andcommitted
doc: Mention Span in developer-notes.md
1 parent 138053d commit da207d4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/developer-notes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,12 @@ class A
500500
- *Rationale*: Easier to understand what is happening, thus easier to spot mistakes, even for those
501501
that are not language lawyers
502502
503+
- Use `Span` as function argument when it can operate on any range-like container.
504+
505+
- *Rationale*: Compared to `Foo(const vector<int>&)` this avoids the need for a (potentially expensive)
506+
conversion to vector if the caller happens to have the input stored in another type of container.
507+
However, be aware of the pitfalls documented in [span.h](../src/span.h).
508+
503509
Strings and formatting
504510
------------------------
505511

0 commit comments

Comments
 (0)