maflcko
9f9f65c7e2
Mark gsl::not_null swap noexcept ( #1235 )
...
Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz >
2026-03-23 12:16:36 -06:00
Carson Radtke
ec729d63a7
introduce gsl::not_null<T>::element_type ( #1196 )
...
* introduce gsl::not_null<T>::element_type
* use std::is_same instead of is_same_v
* fix: cannot put a non-pointer in a gsl::not_null
2025-02-12 09:16:05 -06:00
Werner Henze
1cdb8d295e
More checks for non-compilable code, plus fix for span ( #1180 )
2025-01-04 11:50:31 -06:00
Werner Henze
16a60199df
strict_not_null for unique_ptr ( #1179 )
...
- `strict_not_null<std::unique_ptr<int>>{ std::make_unique<int>()}` failed to compile
- `strict_not_null` ctor needs to move the passed `unique_ptr`, not copy
- Copied `not_null` `TestNotNullConstructors` for `strict_not_null`
- The `noexcept` specifiers on the `strict_not_null` and `not_null` constructors were out of sync.
- Added unit test for `not_null<unique_ptr<T>>` and for `strict_not_null<unique_ptr<T>>`
- Added unit test for `gsl::swap` for two `strict_not_null`
- Added unit test for `gsl::swap` for `not_null` and `strict_not_null`
Co-authored-by: Werner Henze <w.henze@avm.de >
2024-12-26 11:00:36 -06:00
Werner Henze
fcd55ee924
Better use of std::enable_if ( #1177 )
...
* this commits adds tests that should fail, but don't
* Better use of std::enable_if
Replace the occurances of `class = std::enable_if_t<Cond>` and `typename = std::enable_if_t<Cond>` that have been identified in the previous commit with `std::enable_if_t<Cond, bool> = true`.
This commit is inspired by #1174 , which changed one occurance in the owner header. This commit is aimed to fix all remaining occurances.
* fix failing checks
- core.cxx_gsl aktualisiert auf [](https://gitlab.avm.de/fos/repos/core.cxx_gsl/-/commit/ )
- plc.access_lib aktualisiert auf [](https://gitlab.avm.de/fos/repos/plc.access_lib/-/commit/ )
- plc.common aktualisiert auf [](https://gitlab.avm.de/fos/repos/plc.common/-/commit/ )
- plc.daemon aktualisiert auf [](https://gitlab.avm.de/fos/repos/plc.daemon/-/commit/ )
-
Test Plan:
-
---------
Co-authored-by: Werner Henze <werner.henze+gitcommits@posteo.de >
Co-authored-by: Werner Henze <w.henze@avm.de >
2024-12-23 10:40:22 -06:00
Carson Radtke
272463043e
introduce gsl::swap for swapping gsl::not_null ( #1160 )
...
fixes: https://github.com/microsoft/GSL/issues/1129
* create gsl::swap<T>(T&, T&) which wraps std::swap
* specialize gsl::swap<T>(gsl::not_null<T>&, gsl::not_null<T>&)
* add tests
2024-12-13 15:16:53 -06:00