diff --git a/etl-patreon.png b/etl-patreon.png deleted file mode 100644 index 5f2a68c3..00000000 Binary files a/etl-patreon.png and /dev/null differ diff --git a/etl-social.png b/etl-social.png deleted file mode 100644 index a9082edb..00000000 Binary files a/etl-social.png and /dev/null differ diff --git a/etl.ico b/etl.ico deleted file mode 100644 index fe0e3665..00000000 Binary files a/etl.ico and /dev/null differ diff --git a/etl.png b/etl.png deleted file mode 100644 index ca5e3de9..00000000 Binary files a/etl.png and /dev/null differ diff --git a/etl.xar b/etl.xar deleted file mode 100644 index cbfaa863..00000000 Binary files a/etl.xar and /dev/null differ diff --git a/etl16.png b/etl16.png deleted file mode 100644 index 44cad996..00000000 Binary files a/etl16.png and /dev/null differ diff --git a/etl32.png b/etl32.png deleted file mode 100644 index 3d5f9369..00000000 Binary files a/etl32.png and /dev/null differ diff --git a/etl48.png b/etl48.png deleted file mode 100644 index 03dcffbb..00000000 Binary files a/etl48.png and /dev/null differ diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 2cf75c1d..00000000 Binary files a/favicon.ico and /dev/null differ diff --git a/images/etl.pspimage b/images/etl.pspimage deleted file mode 100644 index a5329e63..00000000 Binary files a/images/etl.pspimage and /dev/null differ diff --git a/etl64.png b/images/etl64.png similarity index 100% rename from etl64.png rename to images/etl64.png diff --git a/favicon-32.png b/images/favicon-32.png similarity index 100% rename from favicon-32.png rename to images/favicon-32.png diff --git a/favicon-64.png b/images/favicon-64.png similarity index 100% rename from favicon-64.png rename to images/favicon-64.png diff --git a/include/etl/bitset.h b/include/etl/bitset.h index 391c96dc..c6538f3e 100644 --- a/include/etl/bitset.h +++ b/include/etl/bitset.h @@ -50,6 +50,7 @@ SOFTWARE. #include "char_traits.h" #include "static_assert.h" #include "error_handler.h" +#include "span.h" #include "private/minmax_push.h" @@ -132,6 +133,9 @@ namespace etl static const size_t BITS_PER_ELEMENT = etl::integral_limits::bits; + typedef etl::span span_type; + typedef etl::span const_span_type; + enum { npos = etl::integral_limits::max @@ -749,6 +753,24 @@ namespace etl etl::swap_ranges(pdata, pdata + SIZE, other.pdata); } + //************************************************************************* + /// span + /// Returns a span of the underlying data. + //************************************************************************* + span_type span() + { + return span_type(pdata, pdata + SIZE); + } + + //************************************************************************* + /// span + /// Returns a const span of the underlying data. + //************************************************************************* + const_span_type span() const + { + return const_span_type(pdata, pdata + SIZE); + } + protected: //************************************************************************* diff --git a/include/etl/version.h b/include/etl/version.h index b2cee19b..a9bfc807 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -38,7 +38,7 @@ SOFTWARE. ///\ingroup utilities #define ETL_VERSION_MAJOR 18 -#define ETL_VERSION_MINOR 10 +#define ETL_VERSION_MINOR 11 #define ETL_VERSION_PATCH 0 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) "." ETL_STRINGIFY(ETL_VERSION_MINOR) "." ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_STRINGIFY(ETL_VERSION_MAJOR) L"." ETL_STRINGIFY(ETL_VERSION_MINOR) L"." ETL_STRINGIFY(ETL_VERSION_PATCH) diff --git a/library.json b/library.json index b74ef73f..110c098b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "Embedded Template Library", - "version": "18.10.0", + "version": "18.11.0", "authors": { "name": "John Wellbelove", "email": "john.wellbelove@etlcpp.com" diff --git a/library.properties b/library.properties index 85bfd423..25846b8f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=18.10.0 +version=18.11.0 author= John Wellbelove maintainer=John Wellbelove license=MIT diff --git a/support/Release notes.txt b/support/Release notes.txt index bea8eea4..6360868c 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +18.11.0 +Added etl::ibitset::span() member function to return a span of the underlying binary data. + =============================================================================== 18.10.0 Fixed pointer vector move operators. diff --git a/test/test_bitset.cpp b/test/test_bitset.cpp index ad4de8da..ab961254 100644 --- a/test/test_bitset.cpp +++ b/test/test_bitset.cpp @@ -1012,7 +1012,6 @@ namespace CHECK_EQUAL(4U, data.find_next(true, 1)); } - //************************************************************************* TEST(test_swap) { @@ -1027,5 +1026,37 @@ namespace CHECK(data1 == compare2); CHECK(data2 == compare1); } + + //************************************************************************* + TEST(test_span) + { + using span_t = etl::ibitset::span_type; + + etl::bitset<32> b(0x12345678); + + span_t s = b.span(); + CHECK_EQUAL(0x78, s[0]); + CHECK_EQUAL(0x56, s[1]); + CHECK_EQUAL(0x34, s[2]); + CHECK_EQUAL(0x12, s[3]); + + s[2] = 0x9A; + uint32_t value = b.value(); + CHECK_EQUAL(0x129A5678, value); + } + + //************************************************************************* + TEST(test_const_span) + { + using span_t = etl::ibitset::const_span_type; + + const etl::bitset<32> b(0x12345678); + + span_t s = b.span(); + CHECK_EQUAL(0x78, s[0]); + CHECK_EQUAL(0x56, s[1]); + CHECK_EQUAL(0x34, s[2]); + CHECK_EQUAL(0x12, s[3]); + } }; } diff --git a/test/vs2019/etl.vcxproj b/test/vs2019/etl.vcxproj index 110cc10b..59eb876a 100644 --- a/test/vs2019/etl.vcxproj +++ b/test/vs2019/etl.vcxproj @@ -1671,6 +1671,7 @@ + diff --git a/test/vs2019/etl.vcxproj.filters b/test/vs2019/etl.vcxproj.filters index 8881f98c..f10c59f7 100644 --- a/test/vs2019/etl.vcxproj.filters +++ b/test/vs2019/etl.vcxproj.filters @@ -76,6 +76,9 @@ {0d5824b1-3ef9-43e0-b2d5-15d6246b843e} + + {c25471f3-451a-4279-925d-cbdcec912ef8} + @@ -1438,6 +1441,9 @@ Resource Files\CI\CircleCI + + Resource Files\CI\Github +