Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package xtl for openSUSE:Factory checked in at 2023-02-09 16:23:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/xtl (Old) and /work/SRC/openSUSE:Factory/.xtl.new.4462 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xtl" Thu Feb 9 16:23:31 2023 rev:6 rq:1063986 version:0.7.5 Changes: -------- --- /work/SRC/openSUSE:Factory/xtl/xtl.changes 2022-11-16 15:43:29.759860590 +0100 +++ /work/SRC/openSUSE:Factory/.xtl.new.4462/xtl.changes 2023-02-09 16:23:38.346846533 +0100 @@ -1,0 +2,6 @@ +Sat Jan 21 17:28:38 UTC 2023 - Dirk Müller <[email protected]> + +- update to 0.7.5: + * added a backport of the C++20 header for integer comparison + +------------------------------------------------------------------- Old: ---- xtl-0.7.4.tar.gz New: ---- xtl-0.7.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xtl.spec ++++++ --- /var/tmp/diff_new_pack.HSvXNS/_old 2023-02-09 16:23:38.730848511 +0100 +++ /var/tmp/diff_new_pack.HSvXNS/_new 2023-02-09 16:23:38.734848532 +0100 @@ -1,7 +1,7 @@ # # spec file for package xtl # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: xtl -Version: 0.7.4 +Version: 0.7.5 Release: 0 Summary: The x template library License: BSD-3-Clause ++++++ xtl-0.7.4.tar.gz -> xtl-0.7.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/.azure-pipelines/azure-pipelines-osx.yml new/xtl-0.7.5/.azure-pipelines/azure-pipelines-osx.yml --- old/xtl-0.7.4/.azure-pipelines/azure-pipelines-osx.yml 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/.azure-pipelines/azure-pipelines-osx.yml 2023-01-11 16:19:55.000000000 +0100 @@ -2,10 +2,10 @@ - job: 'OSX' strategy: matrix: - macOS_10_14: - image_name: 'macOS-10.14' - macOS_10_15: - image_name: 'macOS-10.15' + macOS_11: + image_name: 'macOS-11' + macOS_12: + image_name: 'macOS-12' pool: vmImage: $(image_name) variables: @@ -15,9 +15,7 @@ steps: - script: | echo "Removing homebrew for Azure to avoid conflicts with conda" - curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew - chmod +x ~/uninstall_homebrew - ~/uninstall_homebrew -f -q + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" displayName: Remove homebrew - bash: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/.azure-pipelines/azure-pipelines-win.yml new/xtl-0.7.5/.azure-pipelines/azure-pipelines-win.yml --- old/xtl-0.7.4/.azure-pipelines/azure-pipelines-win.yml 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/.azure-pipelines/azure-pipelines-win.yml 2023-01-11 16:19:55.000000000 +0100 @@ -2,7 +2,7 @@ jobs: - job: 'Windows_clangcl' pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-2019' timeoutInMinutes: 360 steps: @@ -38,7 +38,7 @@ ninja ^ doctest ^ nlohmann_json ^ - python=3.6 + python=3.9 conda list displayName: "Install conda packages" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/CMakeLists.txt new/xtl-0.7.5/CMakeLists.txt --- old/xtl-0.7.4/CMakeLists.txt 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/CMakeLists.txt 2023-01-11 16:19:55.000000000 +0100 @@ -41,6 +41,7 @@ ${XTL_INCLUDE_DIR}/xtl/xbasic_fixed_string.hpp ${XTL_INCLUDE_DIR}/xtl/xbase64.hpp ${XTL_INCLUDE_DIR}/xtl/xclosure.hpp + ${XTL_INCLUDE_DIR}/xtl/xcompare.hpp ${XTL_INCLUDE_DIR}/xtl/xcomplex.hpp ${XTL_INCLUDE_DIR}/xtl/xcomplex_sequence.hpp ${XTL_INCLUDE_DIR}/xtl/xspan.hpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/azure-pipelines.yml new/xtl-0.7.5/azure-pipelines.yml --- old/xtl-0.7.4/azure-pipelines.yml 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/azure-pipelines.yml 2023-01-11 16:19:55.000000000 +0100 @@ -2,7 +2,7 @@ - master jobs: - - template: ./.azure-pipelines/azure-pipelines-win.yml + #- template: ./.azure-pipelines/azure-pipelines-win.yml - template: ./.azure-pipelines/azure-pipelines-linux-clang.yml - template: ./.azure-pipelines/azure-pipelines-linux-gcc.yml - template: ./.azure-pipelines/azure-pipelines-osx.yml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/docs/source/changelog.rst new/xtl-0.7.5/docs/source/changelog.rst --- old/xtl-0.7.4/docs/source/changelog.rst 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/docs/source/changelog.rst 2023-01-11 16:19:55.000000000 +0100 @@ -7,6 +7,11 @@ Changelog ========= +0.7.5 +----- + +- added a backport of the C++20 header for integer comparison + 0.7.4 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/docs/source/miscellaneous.rst new/xtl-0.7.5/docs/source/miscellaneous.rst --- old/xtl-0.7.4/docs/source/miscellaneous.rst 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/docs/source/miscellaneous.rst 2023-01-11 16:19:55.000000000 +0100 @@ -22,3 +22,11 @@ TODO +Comparison +---------- + +.. cpp:namespace-push:: xt + +.. doxygengroup:: xtl_xcompare + +.. cpp:namespace-pop:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/include/xtl/xcompare.hpp new/xtl-0.7.5/include/xtl/xcompare.hpp --- old/xtl-0.7.4/include/xtl/xcompare.hpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xtl-0.7.5/include/xtl/xcompare.hpp 2023-01-11 16:19:55.000000000 +0100 @@ -0,0 +1,179 @@ +/*************************************************************************** +* Copyright (c) QuantStack * +* * +* Distributed under the terms of the BSD 3-Clause License. * +* * +* The full license is in the file LICENSE, distributed with this software. * +****************************************************************************/ + +#ifndef XTL_COMPARE_HPP +#define XTL_COMPARE_HPP + +#include <type_traits> + +namespace xtl +{ + + /** + * @defgroup xtl_xcompare + * + * Compare the values of two integers t and u. Unlike builtin comparison operators, + * negative signed integers always compare less than (and not equal to) unsigned integers. + */ + + namespace detail + { + template <class T, class U> + struct same_signedness : + std::integral_constant<bool, std::is_signed<T>::value == std::is_signed<U>::value> + { + }; + + template < + class T, + class U, + std::enable_if_t<same_signedness<T, U>::value, bool> = true + > + constexpr bool cmp_equal_impl(T t, U u) noexcept + { + return t == u; + } + + template < + class T, + class U, + std::enable_if_t< + !same_signedness<T, U>::value && std::is_signed<T>::value, + bool + > = true + > + constexpr bool cmp_equal_impl(T t, U u) noexcept + { + using UT = std::make_unsigned_t<T>; + return t < 0 ? false : static_cast<UT>(t) == u; + } + + template < + class T, + class U, + std::enable_if_t< + !same_signedness<T, U>::value && !std::is_signed<T>::value, + bool + > = true + > + constexpr bool cmp_equal_impl(T t, U u) noexcept + { + using UU = std::make_unsigned_t<U>; + return u < 0 ? false : t == static_cast<UU>(u); + } + } + + /** + * ``true`` if @p t is equal to @p u. + * + * @ingroup xtl_xcompare + */ + template <class T, class U> + constexpr bool cmp_equal(T t, U u) noexcept + { + return detail::cmp_equal_impl(t, u); + } + + /** + * ``true`` if @p t is not equal to @p u. + * + * @ingroup xtl_xcompare + */ + template <class T, class U> + constexpr bool cmp_not_equal(T t, U u) noexcept + { + return !cmp_equal(t, u); + } + + namespace detail + { + template < + class T, + class U, + std::enable_if_t<detail::same_signedness<T, U>::value, bool> = true + > + constexpr bool cmp_less_impl(T t, U u) noexcept + { + return t < u; + } + + template < + class T, + class U, + std::enable_if_t< + !detail::same_signedness<T, U>::value && std::is_signed<T>::value, + bool + > = true + > + constexpr bool cmp_less_impl(T t, U u) noexcept + { + using UT = std::make_unsigned_t<T>; + return t < 0 ? true : static_cast<UT>(t) < u; + } + + template < + class T, + class U, + std::enable_if_t< + !detail::same_signedness<T, U>::value && !std::is_signed<T>::value, + bool + > = true + > + constexpr bool cmp_less_impl(T t, U u) noexcept + { + using UU = std::make_unsigned_t<U>; + return u < 0 ? false : t < static_cast<UU>(u); + } + } + + /** + * ``true`` if @p t is striclty less than @p u. + * + * @ingroup xtl_xcompare + */ + template <class T, class U> + constexpr bool cmp_less(T t, U u) noexcept + { + return detail::cmp_less_impl(t, u); + } + + /** + * ``true`` if @p t is striclty greater than @p u. + * + * @ingroup xtl_xcompare + */ + template <class T, class U> + constexpr bool cmp_greater(T t, U u) noexcept + { + return cmp_less(u, t); + } + + /** + * ``true`` if @p t is less or equal to @p u. + * + * @ingroup xtl_xcompare + */ + template <class T, class U> + constexpr bool cmp_less_equal(T t, U u) noexcept + { + return !cmp_greater(t, u); + } + + /** + * ``true`` if @p t is greater or equal to @p u. + * + * @ingroup xtl_xcompare + */ + template <class T, class U> + constexpr bool cmp_greater_equal(T t, U u) noexcept + { + return !cmp_less(t, u); + } +} + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/include/xtl/xtl_config.hpp new/xtl-0.7.5/include/xtl/xtl_config.hpp --- old/xtl-0.7.4/include/xtl/xtl_config.hpp 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/include/xtl/xtl_config.hpp 2023-01-11 16:19:55.000000000 +0100 @@ -12,7 +12,7 @@ #define XTL_VERSION_MAJOR 0 #define XTL_VERSION_MINOR 7 -#define XTL_VERSION_PATCH 4 +#define XTL_VERSION_PATCH 5 #ifndef __has_feature #define __has_feature(x) 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/test/CMakeLists.txt new/xtl-0.7.5/test/CMakeLists.txt --- old/xtl-0.7.4/test/CMakeLists.txt 2021-11-24 09:32:31.000000000 +0100 +++ new/xtl-0.7.5/test/CMakeLists.txt 2023-01-11 16:19:55.000000000 +0100 @@ -87,6 +87,7 @@ test_xbase64.cpp test_xbasic_fixed_string.cpp test_xcomplex.cpp + test_xcompare.cpp test_xcomplex_sequence.cpp test_xclosure.cpp test_xdynamic_bitset.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xtl-0.7.4/test/test_xcompare.cpp new/xtl-0.7.5/test/test_xcompare.cpp --- old/xtl-0.7.4/test/test_xcompare.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/xtl-0.7.5/test/test_xcompare.cpp 2023-01-11 16:19:55.000000000 +0100 @@ -0,0 +1,41 @@ +/*************************************************************************** +* Copyright (c) QuantStack * +* * +* Distributed under the terms of the BSD 3-Clause License. * +* * +* The full license is in the file LICENSE, distributed with this software. * +****************************************************************************/ + +#include "xtl/xcompare.hpp" + +#include "test_common_macros.hpp" + +namespace xtl +{ + TEST(xcompare, cmp_equal) + { + EXPECT_TRUE(cmp_equal(0, 0)); + EXPECT_TRUE(cmp_equal(1ul, 1ul)); + EXPECT_TRUE(cmp_equal(1, 1ul)); + EXPECT_TRUE(cmp_equal(1ul, 1)); + EXPECT_TRUE(cmp_equal(-1, -1)); + + EXPECT_FALSE(cmp_equal(0, 1)); + EXPECT_FALSE(cmp_equal(-1, 1ul)); + EXPECT_FALSE(cmp_equal(0ul, 1ul)); + } + + TEST(xcompare, cmp_less) + { + EXPECT_FALSE(cmp_less(0, 0)); + EXPECT_FALSE(cmp_less(1ul, 1ul)); + EXPECT_FALSE(cmp_less(1, 1ul)); + EXPECT_FALSE(cmp_less(1ul, 1)); + EXPECT_FALSE(cmp_less(-1, -1)); + + EXPECT_TRUE(cmp_less(1, 2)); + EXPECT_TRUE(cmp_less(-2, -1)); + EXPECT_TRUE(cmp_less(-2, 1)); + EXPECT_FALSE(cmp_less(1, -1)); + } +}
