span, doc: provide span.h context and explain lifetimebound definition
This commit is contained in:
1 file changed
+6
-2
+6
-2
@@ -30,7 +30,11 @@
|
|||||||
|
|
||||||
/** A Span is an object that can refer to a contiguous sequence of objects.
|
/** A Span is an object that can refer to a contiguous sequence of objects.
|
||||||
*
|
*
|
||||||
* It implements a subset of C++20's std::span.
|
* This file implements a subset of C++20's std::span. It can be considered
|
||||||
|
* temporary compatibility code until C++20 and is designed to be a
|
||||||
|
* self-contained abstraction without depending on other project files. For this
|
||||||
|
* reason, Clang lifetimebound is defined here instead of including
|
||||||
|
* <attributes.h>, which also defines it.
|
||||||
*
|
*
|
||||||
* Things to be aware of when writing code that deals with Spans:
|
* Things to be aware of when writing code that deals with Spans:
|
||||||
*
|
*
|
||||||
@@ -60,7 +64,7 @@
|
|||||||
* types that expose a data() and size() member function), functions that
|
* types that expose a data() and size() member function), functions that
|
||||||
* accept a Span as input parameter can be called with any compatible
|
* accept a Span as input parameter can be called with any compatible
|
||||||
* range-like object. For example, this works:
|
* range-like object. For example, this works:
|
||||||
*
|
*
|
||||||
* void Foo(Span<const int> arg);
|
* void Foo(Span<const int> arg);
|
||||||
*
|
*
|
||||||
* Foo(std::vector<int>{1, 2, 3}); // Works
|
* Foo(std::vector<int>{1, 2, 3}); // Works
|
||||||
|
|||||||
Reference in new issue
Block a user