From d14395bc5db55331115fa3c1e71741d1de7f092f Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Thu, 23 Sep 2021 17:22:05 +0200 Subject: [PATCH 1/2] net, doc: provide context for UnserializeV1Array() --- src/netaddress.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/netaddress.h b/src/netaddress.h index eb35ed3fac7..d76e4d525ae 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -386,6 +386,12 @@ private: /** * Unserialize from a pre-ADDRv2/BIP155 format from an array. + * + * This function is only called from UnserializeV1Stream() and is a wrapper + * for SetLegacyIPv6(); however, we keep it for symmetry with + * SerializeV1Array() to have pairs of ser/unser functions and to make clear + * that if one is altered, a corresponding reverse modification should be + * applied to the other. */ void UnserializeV1Array(uint8_t (&arr)[V1_SERIALIZATION_SIZE]) { From 33c6a208a9e2512a174c99c224a933a59f091bc2 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Thu, 23 Sep 2021 17:22:15 +0200 Subject: [PATCH 2/2] span, doc: provide span.h context and explain lifetimebound definition --- src/span.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/span.h b/src/span.h index 830164514b9..c4562aebffa 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 + * , 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 arg); * * Foo(std::vector{1, 2, 3}); // Works