Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ms-gsl for openSUSE:Factory checked in at 2026-10-02 23:01:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ms-gsl (Old) and /work/SRC/openSUSE:Factory/.ms-gsl.new.1631729 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ms-gsl" Fri Oct 2 23:01:08 2026 rev:8 rq:1381733 version:5.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ms-gsl/ms-gsl.changes 2026-09-07 11:30:30.950491525 +0200 +++ /work/SRC/openSUSE:Factory/.ms-gsl.new.1631729/ms-gsl.changes 2026-10-02 23:01:09.494806875 +0200 @@ -1,0 +2,11 @@ +Tue Sep 22 18:14:51 UTC 2026 - Scott Bradnick <[email protected]> + +- Update to upstream version 5.0.1: + * cherrypicks to rel/5.0 in preparation for a 5.0.1 release + by Carson Radtke (@carsonRadtke) in #1276 + - Let dyn_array_iterator convert to its const_iterator + by Jeff Lenamon (@lenamonj) in #1271 + - Complete the random access iterator interface of dyn_array_iterator + by Jeff Lenamon (@lenamonj) in #1272 + +------------------------------------------------------------------- Old: ---- ms-gsl-5.0.0.tar.gz New: ---- ms-gsl-5.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ms-gsl.spec ++++++ --- /var/tmp/diff_new_pack.ggUMgi/_old 2026-10-02 23:01:11.230879457 +0200 +++ /var/tmp/diff_new_pack.ggUMgi/_new 2026-10-02 23:01:11.233879583 +0200 @@ -17,7 +17,7 @@ Name: ms-gsl -Version: 5.0.0 +Version: 5.0.1 Release: 0 Summary: Guidelines Support Library License: MIT ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.ggUMgi/_old 2026-10-02 23:01:11.358884809 +0200 +++ /var/tmp/diff_new_pack.ggUMgi/_new 2026-10-02 23:01:11.367885185 +0200 @@ -1,5 +1,5 @@ -mtime: 1787765882 -commit: 154ce31db20f97efc1936ec2946c73be0fd15c806fef7be1b71dbd423091c2ae +mtime: 1790188736 +commit: 63b358187b6cadf569add9284ba03d92f94bf2a7fddaf2756c89f6725570aadc url: https://src.opensuse.org/sbradnick/ms-gsl revision: main ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-09-23 20:38:56.000000000 +0200 @@ -0,0 +1,4 @@ +_buildconfig-* +_buildinfo-* +*.obscpio +ms-gsl/ ++++++ ms-gsl-5.0.0.tar.gz -> ms-gsl-5.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSL-5.0.0/CMakeLists.txt new/GSL-5.0.1/CMakeLists.txt --- old/GSL-5.0.0/CMakeLists.txt 2026-08-25 22:57:48.000000000 +0200 +++ new/GSL-5.0.1/CMakeLists.txt 2026-09-22 18:59:02.000000000 +0200 @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.14...3.16) -project(GSL VERSION 5.0.0 LANGUAGES CXX) +project(GSL VERSION 5.0.1 LANGUAGES CXX) add_library(GSL INTERFACE) add_library(Microsoft.GSL::GSL ALIAS GSL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSL-5.0.0/README.md new/GSL-5.0.1/README.md --- old/GSL-5.0.0/README.md 2026-08-25 22:57:48.000000000 +0200 +++ new/GSL-5.0.1/README.md 2026-09-22 18:59:02.000000000 +0200 @@ -189,7 +189,7 @@ FetchContent_Declare(GSL GIT_REPOSITORY "https://github.com/microsoft/GSL" - GIT_TAG "v5.0.0" + GIT_TAG "v5.0.1" GIT_SHALLOW ON ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSL-5.0.0/include/gsl/dyn_array new/GSL-5.0.1/include/gsl/dyn_array --- old/GSL-5.0.0/include/gsl/dyn_array 2026-08-25 22:57:48.000000000 +0200 +++ new/GSL-5.0.1/include/gsl/dyn_array 2026-09-22 18:59:02.000000000 +0200 @@ -176,10 +176,11 @@ using reference = T&; using const_reference = const T&; using iterator_category = std::random_access_iterator_tag; +#if defined(__cpp_lib_ranges) || (defined(_MSVC_STL_VERSION) && defined(__cpp_lib_concepts)) + using iterator_concept = std::contiguous_iterator_tag; +#endif /* __cpp_lib_ranges || (_MSVC_STL_VERSION && __cpp_lib_concepts) */ -#if defined(__cpp_lib_ranges) && (__cpp_lib_ranges >= 201911L) constexpr dyn_array_iterator() = default; -#endif /* __cpp_lib_ranges >= 201911L */ constexpr operator dyn_array_iterator<const T>() const { return {_ptr, _pos, _end_pos}; } @@ -199,6 +200,25 @@ return !(*this == other); } + constexpr auto operator<(const dyn_array_iterator& other) const + { + Expects(_ptr == other._ptr); + Expects(_end_pos == other._end_pos); + return _pos < other._pos; + } + + constexpr auto operator>(const dyn_array_iterator& other) const { return other < *this; } + + constexpr auto operator<=(const dyn_array_iterator& other) const + { + return !(other < *this); + } + + constexpr auto operator>=(const dyn_array_iterator& other) const + { + return !(*this < other); + } + constexpr auto operator*() const -> reference { Expects(_ptr != nullptr); @@ -206,6 +226,13 @@ return _ptr[_pos]; } + constexpr auto operator->() const -> pointer + { + Expects(_ptr != nullptr); + Expects(_pos < _end_pos); + return _ptr + _pos; + } + constexpr auto operator++() -> dyn_array_iterator& { Expects(_pos < _end_pos); @@ -256,6 +283,11 @@ return dyn_array_iterator{_ptr, gsl::narrow<size_type>(new_pos), _end_pos}; } + friend constexpr auto operator+(difference_type diff, const dyn_array_iterator& it) + { + return it + diff; + } + constexpr auto operator-(difference_type diff) const { return *this + (-diff); } constexpr auto operator-(const dyn_array_iterator& other) const @@ -265,16 +297,7 @@ return gsl::narrow<difference_type>(_pos) - gsl::narrow<difference_type>(other._pos); } - constexpr auto operator[](size_type pos) -> reference - { - Expects(_pos + pos < _end_pos); - return _ptr[_pos + pos]; - } - - constexpr auto operator[](size_type pos) const -> const_reference - { - return const_cast<dyn_array_iterator&>(*this).operator[](pos); - } + constexpr auto operator[](difference_type pos) const -> reference { return *(*this + pos); } private: constexpr dyn_array_iterator(pointer ptr, size_type pos, size_type end_pos) @@ -288,8 +311,12 @@ size_type _pos{}; size_type _end_pos{}; + template <typename> + friend class dyn_array_iterator; template <typename, typename> friend class ::gsl::dyn_array; + template <typename Ptr> + friend struct std::pointer_traits; }; } // namespace details @@ -443,4 +470,17 @@ #endif /* __cpp_deduction_guides >= 201703L */ } // namespace gsl +namespace std +{ +template <class Type> +struct pointer_traits<::gsl::details::dyn_array_iterator<Type>> +{ + using pointer = ::gsl::details::dyn_array_iterator<Type>; + using element_type = Type; + using difference_type = ptrdiff_t; + + static constexpr element_type* to_address(const pointer i) noexcept { return i._ptr + i._pos; } +}; +} // namespace std + #endif /* defined(GSL_DYN_ARRAY_H) */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSL-5.0.0/tests/dyn_array_tests.cpp new/GSL-5.0.1/tests/dyn_array_tests.cpp --- old/GSL-5.0.0/tests/dyn_array_tests.cpp 2026-08-25 22:57:48.000000000 +0200 +++ new/GSL-5.0.1/tests/dyn_array_tests.cpp 2026-09-22 18:59:02.000000000 +0200 @@ -9,6 +9,10 @@ #include <iostream> #include <sstream> #include <type_traits> +#include <utility> +#if defined(__cplusplus) && __cplusplus >= 202002L +#include <span> +#endif /* __cplusplus >= 202002L */ // Despite using <algorithm> and <ranges> utilities in this test, they // are not being included directly by this file as a test to ensure @@ -37,11 +41,21 @@ #if defined(__cpp_lib_concepts) && (__cpp_lib_concepts >= 202002L) static_assert(std::input_iterator<gsl::dyn_array<int>::iterator>, "gsl::dyn_array should expose a valid input_iterator"); +static_assert(std::random_access_iterator<gsl::dyn_array<int>::iterator>, + "gsl::dyn_array should expose a valid random_access_iterator"); +static_assert(std::random_access_iterator<gsl::dyn_array<int>::const_iterator>, + "gsl::dyn_array should expose a valid random_access const_iterator"); +static_assert(std::contiguous_iterator<gsl::dyn_array<int>::iterator>, + "gsl::dyn_array should expose a valid contiguous_iterator"); +static_assert(std::contiguous_iterator<gsl::dyn_array<int>::const_iterator>, + "gsl::dyn_array should expose a valid contiguous const_iterator"); #endif /* __cpp_lib_concepts >= 202002L */ #if defined(__cpp_lib_ranges) && (__cpp_lib_ranges >= 201911L) static_assert(std::ranges::input_range<gsl::dyn_array<int>>, "gsl::dyn_array should be a valid input range"); +static_assert(std::ranges::contiguous_range<gsl::dyn_array<int>>, + "gsl::dyn_array should be a valid contiguous range"); #endif /* __cpp_lib_ranges >= 201911L */ TEST(dyn_array_tests, default_ctor) @@ -585,6 +599,15 @@ EXPECT_EQ(pirates[0], 'a'); } +TEST(dyn_array_tests, iterator_converts_to_const_iterator) +{ + gsl::dyn_array<char> mariners{'a', 'b', 'c'}; + gsl::dyn_array<char>::const_iterator it = mariners.begin(); + EXPECT_EQ(*it, 'a'); + EXPECT_TRUE(it == mariners.cbegin()); + EXPECT_TRUE(mariners.cend() == mariners.end()); +} + TEST(dyn_array_tests, reverse_iterator) { const gsl::dyn_array<char> padres{'a', 'b', 'c'}; @@ -622,6 +645,51 @@ EXPECT_EQ(next, 'd'); } +TEST(dyn_array_tests, random_access_iterator_comparisons) +{ + gsl::dyn_array<char> giants{'c', 'a', 'b'}; + + const auto first = giants.begin(); + const auto last = giants.end(); + + EXPECT_TRUE(first < last); + EXPECT_TRUE(last > first); + EXPECT_TRUE(first <= first); + EXPECT_TRUE(first >= first); + EXPECT_FALSE(last <= first); + EXPECT_EQ(2 + first, last - 1); + EXPECT_EQ(*(1 + first), 'a'); + + std::sort(giants.begin(), giants.end()); + EXPECT_EQ(giants[0], 'a'); + EXPECT_EQ(giants[1], 'b'); + EXPECT_EQ(giants[2], 'c'); +} + +TEST(dyn_array_tests, iterator_member_access_and_default_construction) +{ + gsl::dyn_array<std::pair<char, int>> rockies{{'a', 1}, {'b', 2}}; + EXPECT_EQ(rockies.begin()->second, 1); + EXPECT_EQ((rockies.begin() + 1)->first, 'b'); + + gsl::dyn_array<int>::iterator it{}; + gsl::dyn_array<int>::const_iterator cit{}; + EXPECT_TRUE(it == gsl::dyn_array<int>::iterator{}); + EXPECT_TRUE(cit == gsl::dyn_array<int>::const_iterator{}); +} + +#if defined(__cpp_lib_span) && (__cpp_lib_span >= 202002L) +TEST(dyn_array_tests, converts_to_a_span) +{ + gsl::dyn_array<char> giants{'a', 'b', 'c'}; + const std::span<char> span{giants}; + + EXPECT_EQ(span.size(), giants.size()); + EXPECT_EQ(span.data(), giants.data()); + EXPECT_EQ(std::to_address(giants.end()), giants.data() + giants.size()); +} +#endif /* __cpp_lib_span >= 202002L */ + TEST(dyn_array_tests, input_iterator_constructor) { std::istringstream stream{"n a t s"};
