Releases: gsl-lite/gsl-lite
Releases · gsl-lite/gsl-lite
v0.41.0
Additions:
- Add tentative C++23 detection macro
gsl_CPP23_OR_GREATER
,CONSTEXPR_23
language feature, andgsl_constexpr23
keyword macro (#329) - Add
gsl_CONFIG_VALIDATES_UNENFORCED_CONTRACT_EXPRESSIONS
config switch for suppressing the compile-time syntax validation of contract check expressions (#330)
Changes:
- Deprecate
string_span
andzstring_span
and prepare for removal (#335) - Continuous Integration now also tests GCC 12, Clang 14 thru 16, and NVCC 11.8 and 12.1
- Remove Continuous Integration for GCC 6 and earlier, Clang 5 and earlier, Apple Clang 11.0.0 and earlier, and CUDA 10.2 and earlier (#333, #334)
Fixes:
- Use NVCC's
__builtin_assume()
forgsl_ASSUME_()
in device code (#324, thanks to @codecircuit) - Fix
not_null_ic<>
copy construction (#326, thanks to @runer112) - Respect libc++ configuration option to disable
wchar_t
(#331, thanks to @burnpanck) - Suppress "-Wweak-vtables" warning for Clang (#332, thanks to @mrahn)
- Suppress "-Wuseless-cast" warning for GCC (#332, thanks to @wirew0rm)
v0.40.0
Additions:
- Add debug-mode contract checking macros
gsl_ExpectsDebug()
,gsl_EnsuresDebug()
,gsl_AssertDebug()
which are sensitive
to theNDEBUG
macro, and thus similar toassert()
(#316) - Add dedicated contract check configuration macros for device code:
gsl_CONFIG_DEVICE_CONTRACT_CHECKING_AUDIT
/ON
/OFF
,
gsl_CONFIG_DEVICE_CONTRACT_VIOLATION_ASSERTS
/TRAPS
/CALLS_HANDLER
, and
gsl_CONFIG_DEVICE_UNENFORCED_CONTRACTS_ASSUME
/ELIDE
(#317) - Add
gsl::is_valid()
for explicitly detecting the moved-from state of agsl::not_null<>
object (#318) - Add device code detection macro
gsl_DEVICE_CODE
(evaluates to 1 when compiling CUDA device code, 0 when compiling host code)
Changes:
- Continuous Integration now also tests Clang 13 and updates CUDA version to 11.5
- Improve documentation for contract checking macros and configuration macros
Fixes:
v0.39.0
Additions:
- Add
gsl::make_unique<T>()
andgsl::make_shared<T>()
which resemble the eponymous functions fromstd
but return
gsl::not_null<std::unique_ptr<T>>
andgsl::not_null<std::shared_ptr<T>>
(#312) - Add basic support for NVHPC compiler (#308, thanks to @olupton)
Changes:
- Continuous Integration now also tests GCC 11, Clang 12, and AppleClang 12.0.5 and 13, and updates CUDA version to 11.4 (#314)
- Remove C++98 polyfills
std98::equal()
,std98::lexicographical_compare()
from public interface (#313)
Fixes:
gsl::not_null<std::shared_ptr<T>>
now correctly converts tostd::weak_ptr<T>
(#311, thanks to @stohrendorf)
v0.38.1
Additions:
- Add feature detection macro
gsl_HAVE( C99_PREPROCESSOR )
- Add
gsl_CONSTRAINT()
which can be used to impose concept requirements on template type parameters in a backward-compatible manner:
template< gsl_CONSTRAINT(Concept) T >
expands totemplate< Concept T >
for C++20 and totemplate< typename T >
otherwise - Add C++20 polyfill
std20::endian()
(#305) - Restore Continuous Integration testing for NVCC 10.2
- Add basic CUDA runtime tests to test suite (#307)
Changes:
- Continuous Integration now also tests "RelWithDebInfo" configuration for select compilers and platforms
Fixes:
- Fix regression in precondition/postcondition/assertion checks for CUDA (cf. #302, thanks to @Spielix)
- Add workaround for GCC bug to test suite (cf. #303, thanks to @sanjayankur31)
- Fix endianness issues in test suite (cf. #304, thanks to @sanjayankur31)
- Improve
constexpr
support forspan<>
; addconstexpr
tests (#306)
0.38.0
Additions:
- Add macros
gsl_Assert()
,gsl_AssertAudit()
to express checks which are neither pre- nor postconditions (#294) - Add fail-fast operation
gsl_FailFast()
which is guaranteed to terminate normal execution in some way
(exception,std::terminate()
, or trap instruction) (#294) - Add configuration option
gsl_CONFIG_CONTRACT_VIOLATION_TRAPS
which makesgsl_Expects()
/gsl_Ensures()
/gsl_Assert()
(and
theAudit
variants if audit mode is enabled) andgsl_FailFast()
execute a trap instruction in case of a contract violation - Add configuration option
gsl_CONFIG_CONTRACT_VIOLATION_ASSERTS
which implementsgsl_Expects()
/gsl_Ensures()
/gsl_Assert()
(and theAudit
variants if audit mode is enabled) in terms of theassert()
macro from the standard library. This has the
benefits that both legacy assertions and contract checks can be globally suppressed with a single macro (NDEBUG
), and that
assert()
prints an informative error message which contains the contract check expression. - Add
as_nullable()
function (#251, thanks to @petamas) - Add compiler detection macro for NVCC (#294)
- Add compiler detection macro and tentative support (no CI) for ARMCC (#293; thanks to @woodsking2)
- Add conditional
std::hash<>
specialization fornot_null<>
(#297; thanks to @mbs-c) - Track language and library versions separately; new macros
gsl_STDLIB_CPPxx_OR_GREATER
indicate availability of the standard library - Add feature detection macros
gsl_HAVE( HASH )
,gsl_HAVE( MOVE_FORWARD )
,gsl_HAVE( OVERRIDE_FINAL )
- Add
size_type
tospan<>
andbasic_string_span<>
- Add Continuous Integration testing for NVCC 11.0-11.2 (CUDA14, CUDA17), Clang 10-11, GCC 10, Apple Clang 12.0.0
- Add Continuous Integration testing for Clang with libstdc++
- Add Valgrind "memcheck" run to Continuous Integration
- Add testing for more configuration scenarios, e.g. building with exceptions disabled and using different ways of precondition
violation handling
Changes:
- Remove dependency on standard library headers <algorithm> and <iterator> (#290, #295; thanks to @mpusz)
- Use of
gsl_HAVE()
,gsl_CONFIG()
,gsl_FEATURE()
with unknown arguments now causes compilation errors (#272) narrow<>()
now issues astatic_assert()
that refers tonarrow_failfast<>()
if exceptions are unavailable (#269)- With version-1 defaults,
not_null<>
now has a specialization for raw pointers which avoids unnecessary contract checks (#300) - The contract expression is now part of the exception message in
gsl_CONFIG_CONTRACT_VIOLATION_THROWS
mode narrowing_error
now produces a less unhelpful exception message ("narrowing_error")gsl_noexcept
now falls back tothrow()
ifnoexcept
is unavailable- Most symbols are now accessible through both
namespace gsl
andnamespace gsl_lite
to ease migration not_null_ic<>
is now also visible innamespace gsl_lite
(#280; thanks to @woodsking2)nullptr_t
comparison operators fornot_null<>
are now explicitly deleted- More uses of
gsl_NODISCARD
throughout the library - For NVCC ≥11.3, make use of new
__builtin_unreachable()
intrinsic ingsl_CONFIG_UNENFORCED_CONTRACTS_ASSUME
mode
Fixes:
0.37.0
Additions:
- Add configuration option
gsl_CONFIG_NARROW_THROWS_ON_TRUNCATION
- Add configuration option
gsl_CONFIG_ALLOWS_SPAN_COMPARISON
- Add
narrow_failfast<>()
, a fast-fail variant ofnarrow<>()
(#52) - Add
front()
andback()
tospan<>
andbasic_string_span<>
(#241, thanks to @ned14)
Changes:
- Rename
as_writeable_bytes()
->as_writable_bytes()
to follow C++20 in spelling; the old name is still provided for compatibility - Rename
gsl_DEPRECATED()
->gsl_DEPRECATED_MSG()
, addgsl_DEPRECATED
- Add more
gsl_DEPRECATED()
annotations - Deprecate
span<>::at()
,basic_string_span<>::at()
, and call indexing - Minor documentation improvements
- Unify internal SFINAE macros to
gsl_ENABLE_IF_()
(#238; thanks to @martinmoene) - Add more comprehensive tests for
narrow<>()
andnarrow_failfast<>()
Fixes:
- Fix spurious static assertion for pre-/postcondition check arguments explicitly convertible to bool if
gsl_CONFIG_CONTRACT_CHECKING_OFF
is defined - Fix hard failure in
span<>
constrained constructor (#242, thanks to @orangeturtle739) - Make
gsl::detail::is_compatible_container<>
a proper type trait
0.37.0
0.36.0
The repository now moved to a dedicated GitHub organization: https://github.com/gsl-lite/gsl-lite
gsl-lite is now mostly maintained by @mbeutel (#175).
Additions:
- Describe versioning semantics in Readme
- Add audit-level contract checks
gsl_ExpectsAudit()
andgsl_EnsuresAudit()
(#172) - Add
basic_zstring_span<>
andzstring_span
(#136, #154, thanks to @chan-lee) - Add support for user-defined contract violation handler
fail_fast_assert_handler()
- Add macros
gsl_NORETURN
,gsl_NODISCARD
,gsl_DEPRECATED()
,gsl_constexpr17
,gsl_constexpr20
- Add C++11 polyfills in
gsl::std11
:remove_reference<>
- Add C++17 polyfills in
gsl::std17
:conjunction<>
,disjunction<>
,negation<>
,void_t<>
- Add C++20 polyfills in
gsl::std20
:identity
,type_identity<>
,ssize()
(#144, #180),remove_cvref<>
- Add configuration macro
gsl_CONFIG_TRANSPARENT_NOT_NULL
(#185) - Add configuration macro
gsl_CONFIG_INDEX_TYPE
which controls the type ofgsl::index
independently ofgsl::span<>::index_type
(#169) - Add language feature macro
gsl_HAVE_EXCEPTIONS
- Add macros
gsl_DEFINE_ENUM_BITMASK_OPERATORS()
andgsl_DEFINE_ENUM_RELATIONAL_OPERATORS()
- Add header <gsl-lite/gsl-lite.hpp> and namespace
gsl_lite
to pave the way for future coexistence with M-GSL (#221, #222), cf. Using gsl-lite in libraries - Add Continuous Integration for more versions of GCC (4.7 through 9), Clang (3.5 through 9), AppleClang (7.3 through 11), and MSVC (2010 through 2019)
- Run tests with AddressSanitizer and UndefinedBehaviorSanitizer in CI (GCC 9, Clang 9)
- Add Continuous Integration for NVCC 10.2 (with GCC 7, 8 on Linux, MSVC 2019 on Windows) to test CUDA support
Changes:
not_null<>
now properly supports smart pointers (#184, #197; huge thanks to @petamas)- Restructure contract checking configuration macros such that checking policy (off, on, audit), violation handling (throws, terminates, calls handler) and unenforced contract handling (assume, elide) can be configured independently (cf. https://github.com/martinmoene/gsl-lite/#contract-violation-response-macros)
gsl_noexcept
no longer depends on contract violation settings (cf. 0c296a9)gsl_FEATURE_IMPLICIT_MACRO
now defaults to 0 (#156, thanks to @tadeu)- AppleClang is now considered a separate compiler (use
gsl_COMPILER_APPLECLANG_VERSION
for checking) - CMake installs arch-independent by default
- CMake doesn't install M-GSL compatibility header <gsl/gsl> and legacy headers <gsl.h>, <gsl.hpp>, and <gsl/gsl-lite.h> by default
- gsl-lite now compiles warning-free with MSVC at warning level 4
- Many small improvements (thanks to @AraHaan, @codecircuit, @elnull, @ilyalesokhin-starkware, @ngrodzitski, @petamas, @stohrendorf, @theodelrieu)
0.34.0
This release of gsl lite changes the CMake package folder name to gsl-lite
(it was gsl
) and it adds a usage description for the Conda package manager to the Readme.
Further macro gsl_REQUIRES_T()
was introduced (nonstd lite issue 18) and the lest test framework has been updated to v1.35.1
0.33.0
This release of gsl lite has changes that originate from the nonstd-lite project and quite a few fixes by its users.
Additions
- Add script/create-cov-rpt.py to create OpenCppCoverage report (nonstd-lite project issue 29)
- Add script/create-vcpkg.py (nonstd-lite-project issue 28)
- Add script/upload-conan.py (nonstd-lite-project issue 26)
- Add conanfile.py, edit it from script/update-version.py (nonstd-lite-project issue 26)
- Add CMake installation and config-file packaging; Let tests and example use gsl-lite interface library
- Add "LANGUAGES CXX" to CMake project
- Add GNUC
-Wsign-conversion
warning to CMake configuration - Add AppleClang to CMake configuration
- Add OSX to Travis configuration
- Add TOC entry for Standard selection macro (#128, thanks to @egarrulo)
- Add
span::ssize()
,ssize(span)
,size(span)
(#144) - Add test/tc-cl.bat
Changes
- Rename "Guideline support library" to "Guidelines -" (#134)
- Align Appveyor configuration (plan 9, nonstd-lite-project issue 14)
- Align CMakefiles.txt (plan 8, nonstd-lite-project issue 13)
- Align test scripts (nonstd-lite-project issue 12)
- Align badges in readme (nonstd-lite-project issue 3)
- Obviate need for
-DNOMINMAX
with MSVC (nonstd-lite issue 16) - Prevent and suppress warnings from clang
- Let ctest produce output on failure
- Update lest test framework to v1.35.0.
Fixes
- Fix CMake install command (expected-lite issue 25, thanks to @rmorozov)
- Fix clashing CMake cached variable, use 'gsl' for namespace and package folder (thanks to @rmorozov)
- Fix template argument in
not_null<>
comparison operators (#143, thanks @stohrendorf) - Fix macro
gsl_IN_STD
(#142, thanks to @Flamefire) - Fix possible int overflow in
nonstd::span::subspan()
range (issue #138, thanks to @fefe17) - Fix link to P0122 (#130, thanks to @alexeyr)
- Fix for misleading
__cplusplus
of GCC 4.7.0 and earlier (#127, thanks to @egarrulo) - Fix
final_action_return()
andfinal_action_error()
during stack unwinding (#126, thanks to @patstew) - Fix unused parameter if
Expects()
elided via new macrogsl_EXPECTS_UNUSED_PARAM
(#123, #124, thanks to @kugelrund)