1- // NOLINTBEGIN(misc-const-correctness,clang-analyzer-deadcode.DeadStores,unused-includes )
1+ // NOLINTBEGIN(misc-const-correctness,clang-analyzer-deadcode.DeadStores)
22#if defined(__cpp_constexpr) && __cpp_constexpr >= 202207L // C++26
33#include < algorithm>
44#include < array>
1515
1616#include " byte_span/byte_span.hpp"
1717
18-
1918using range3::as_bytes;
2019using range3::as_span;
2120using range3::as_sv;
@@ -32,32 +31,28 @@ using namespace std::string_view_literals;
3231#pragma GCC diagnostic ignored "-Wunused-variable"
3332#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
3433
35-
36-
3734TEST_CASE (" byte_span compile-time construction" , " [byte_span]" ) {
38- SECTION (" from iterator and sentinel" ) {
39- constexpr std::array<char , 4 > arr = {' a' , ' b' , ' c' , ' d' };
40- constexpr byte_span view (arr.begin (), arr.end ());
41- STATIC_REQUIRE (view.size () == 4 );
42- REQUIRE (view.size () == 4 );
43- }
44-
45- SECTION (" from iterator and count" ) {
46- constexpr std::array<char , 4 > arr = {' a' , ' b' , ' c' , ' d' };
47- constexpr byte_span view (arr.begin (), 4 );
48- STATIC_REQUIRE (view.size () == 4 );
49- REQUIRE (view.size () == 4 );
50- }
51-
52- /*
53- SECTION("from std::array") {}
54- SECTION("from C array") {}
55- SECTION("from std::span") {}
56- */
35+ SECTION (" from iterator and sentinel" ) {
36+ constexpr std::array<char , 4 > arr = {' a' , ' b' , ' c' , ' d' };
37+ constexpr byte_span view (arr.begin (), arr.end ());
38+ STATIC_REQUIRE (view.size () == 4 );
39+ REQUIRE (view.size () == 4 );
40+ }
41+
42+ SECTION (" from iterator and count" ) {
43+ constexpr std::array<char , 4 > arr = {' a' , ' b' , ' c' , ' d' };
44+ constexpr byte_span view (arr.begin (), 4 );
45+ STATIC_REQUIRE (view.size () == 4 );
46+ REQUIRE (view.size () == 4 );
47+ }
48+
49+ /*
50+ SECTION("from std::array") {}
51+ SECTION("from C array") {}
52+ SECTION("from std::span") {}
53+ */
5754}
5855
59-
60-
6156#pragma GCC diagnostic pop
6257
6358#endif
0 commit comments