mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
refactor: Make Span an alias of std::span
This uses a macro, which can be a bit more brittle than an alias template. However, class template argument deduction for alias templates is only implemented in clang-19.
This commit is contained in:
@@ -47,13 +47,6 @@ BOOST_AUTO_TEST_SUITE(span_tests)
|
||||
// don't work. This makes it is possible to use the Span constructor in a SFINAE
|
||||
// contexts like in the Spannable function above to detect whether types are or
|
||||
// aren't compatible with Spans at compile time.
|
||||
//
|
||||
// Previously there was a bug where writing a SFINAE check for vector<bool> was
|
||||
// not possible, because in libstdc++ vector<bool> has a data() member
|
||||
// returning void, and the Span template guide ignored the data() return value,
|
||||
// so the template substitution would succeed, but the constructor would fail,
|
||||
// resulting in a fatal compile error, rather than a SFINAE error that could be
|
||||
// handled.
|
||||
BOOST_AUTO_TEST_CASE(span_constructor_sfinae)
|
||||
{
|
||||
BOOST_CHECK(Spannable(std::vector<int>{}));
|
||||
|
||||
Reference in New Issue
Block a user