Skip to content

Commit 33c6a20

Browse files
committed
span, doc: provide span.h context and explain lifetimebound definition
1 parent d14395b commit 33c6a20

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/span.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030

3131
/** A Span is an object that can refer to a contiguous sequence of objects.
3232
*
33-
* It implements a subset of C++20's std::span.
33+
* This file implements a subset of C++20's std::span. It can be considered
34+
* temporary compatibility code until C++20 and is designed to be a
35+
* self-contained abstraction without depending on other project files. For this
36+
* reason, Clang lifetimebound is defined here instead of including
37+
* <attributes.h>, which also defines it.
3438
*
3539
* Things to be aware of when writing code that deals with Spans:
3640
*
@@ -60,7 +64,7 @@
6064
* types that expose a data() and size() member function), functions that
6165
* accept a Span as input parameter can be called with any compatible
6266
* range-like object. For example, this works:
63-
*
67+
*
6468
* void Foo(Span<const int> arg);
6569
*
6670
* Foo(std::vector<int>{1, 2, 3}); // Works

0 commit comments

Comments
 (0)