span: update constructors to match c++20 draft spec and add lifetimebound attribute
Summary:
span: (almost) match std::span's constructor behavior
c++20's draft of std::span no longer includes move constructors.
span: add lifetimebound attribute
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0936r0.pdf for
reference.This helps to guard against dangling references caused by construction from
temporaries such as:`Span<const int> sp(std::vector<int>{1,2,3});`
Add lifetimebound to attributes for general-purpose usage
Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
This is a backport of core#19387
Test Plan:
With clang and gcc:
ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10888