New
v0.43.0
Additions:
not_null<>now supports function pointers and nullable function objects such asstd::function<>and (for C++11 and newer) defines a conditionally enabled forwardingoperator()to permit function-call syntax (#353, thanks to @n0F4x)not_null<>now supports implicit construction from non-nullable arguments such as function objects and functions (#353)- Add
is_nullable<>trait (#353, thanks to @BenFrantzDale) - Add tentative C++26 detection macro
gsl_CPP26_OR_GREATER,CONSTEXPR_26language feature, andgsl_constexpr26keyword macro (61b8d1b72f6fb59fdcc86a9af8d3a005453ab877, 150c418e08d8db60f7ea93c13f9bd26af744f4b0) - For C++20 and newer, define
operator<=>fornot_null<>in C++20 (613a9ff8d8ec8dbab151dd4a9c82d45ebfa51a31) - For C++20 and newer, add
gsl_NO_UNIQUE_ADDRESSwhich uses MSVC's ABI-breaking[[msvc::no_unique_address]]attribute if necessary (315c93569ac6539fb0f322a2441dfdac1c1aa156, a45222fb8f791def3d7e9a43fe69222ec5299952, 991aee66c31cb755559a8e9d36b6cc2693d183e2)
Changes:
- Add feature macro
gsl_FEATURE_STRING_SPAN, defaulting to 0 for version-1 defaults, to control the availability of string spans, which are no longer part of the GSL specification and have been deprecated for a while (2117b41f45c0d921e36996ee9f919475dd5bfffd) - Add feature macro
gsl_FEATURE_BYTE, defaulting to 0 for version-1 defaults, to control the availability ofbyte, which has been superseded bystd::bytein C++17 (dd3251e95144e7794163b6b31dc056f0992e6489) - If
gsl_FEATURE_STRING_SPAN=0, we now avoid pulling in standard library header files<ios>and<string>(2117b41f45c0d921e36996ee9f919475dd5bfffd) - In version-1 mode, default to
gsl_CONFIG_CONTRACT_VIOLATION_ASSERTSrather thangsl_CONFIG_CONTRACT_VIOLATION_TERMINATES, which is more convenient in practice (4e24de09ae3642fe71b99a3789180e6763b0a2b4) gsl_FEATURE_WITH_CONTAINER_TO_STDnow defaults to 0 with version-1 defaults (#353)- Remove unsupported CUDA toolkits and older GCC versions no longer available through Azure Pipelines (#353)
Fixes:
- Add
[[maybe_unused]]annotations to macro-generated function definitions to avoid Clang warnings about unused functions in anonymous namespaces (30e1390c1020172cee9c23e0a71f135b0e658abc)