refactor(*): replace the old with the new iterator and range library

This commit is contained in:
2024-12-17 21:49:37 +08:00
parent 0a37460f24
commit 6a37e91639
21 changed files with 312 additions and 640 deletions

View File

@ -12,6 +12,20 @@ NAMESPACE_REDCRAFT_BEGIN
NAMESPACE_MODULE_BEGIN(Redcraft)
NAMESPACE_MODULE_BEGIN(Utility)
// NOTE: In the STL, use std::from_range_t as a disambiguation tag that resolves ambiguity
// introduced by the list-initialization. For example, for the following code:
//
// R RangeOfInts = /* ... */;
// static_assert(CRange<R> and CSameAs<TRangeElement<R>, int>);
//
// TArray Arr(RangeOfInts);
// TArray Brr{RangeOfInts};
//
// If R is TArray<int> than decltype(Arr) is TArray<int> and decltype(Brr) is TArray<int>,
// otherwise, decltype(Arr) is TArray<int> and decltype(Brr) is TArray<R>.
//
// But Redcraft can't use the std::from_range_t tag because list-initialization is discouraged.
/** A concept specifies a container that can reserve size. */
template <typename C>
concept CReservableContainer = CSizedRange<C>