aboutsummaryrefslogtreecommitdiff
path: root/src/span.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-09-23 17:22:15 +0200
committerJon Atack <jon@atack.com>2021-09-23 17:50:47 +0200
commit33c6a208a9e2512a174c99c224a933a59f091bc2 (patch)
tree006e07c086904d589cc19326ff91cd42b817d9e9 /src/span.h
parentd14395bc5db55331115fa3c1e71741d1de7f092f (diff)
downloadbitcoin-33c6a208a9e2512a174c99c224a933a59f091bc2.tar.xz
span, doc: provide span.h context and explain lifetimebound definition
Diffstat (limited to 'src/span.h')
-rw-r--r--src/span.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/span.h b/src/span.h
index 830164514b..c4562aebff 100644
--- a/src/span.h
+++ b/src/span.h
@@ -30,7 +30,11 @@
/** 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:
*
@@ -60,7 +64,7 @@
* types that expose a data() and size() member function), functions that
* accept a Span as input parameter can be called with any compatible
* range-like object. For example, this works:
-*
+ *
* void Foo(Span<const int> arg);
*
* Foo(std::vector<int>{1, 2, 3}); // Works