Commit graph

23 commits

Author SHA1 Message Date
Kp f804d98825 Make enumerate inherit ranges::subrange directly
Remove the intermediate layer of partial_range_t.
2022-12-31 16:21:47 +00:00
Kp 4071cd0cbf Replace range_owns_iterated_storage with ranges::borrowed_range
The standard type imposes some additional requirements that are not
necessary here, but using this concept allows standard containers to be
classified correctly without specific overrides.
2022-12-31 16:21:47 +00:00
Kp 01fd4079ba Remove unnecessary enumerate constructor 2022-12-18 23:10:39 +00:00
Kp 3d5de92058 Fix OS X clang build
OS X still uses clang-14, which lacks sufficient std::ranges support for
recent Rebirth changes.

- Rewrite uses of std::ranges::SYMBOL to ranges::SYMBOL
- Add a stub header that, on gcc, provides for each SYMBOL a statement
  `using std::ranges::SYMBOL;`, to delegate back to the standard library
  implementation.
- On clang, define a minimal implementation of the required symbols,
  without constraint enforcement.  Compile-testing with gcc will catch
  constraint violations.

Once OS X clang ships a standard library with the required features,
this stub header will be removed and the uses changed back to their full
names.
2022-10-31 00:51:32 +00:00
Kp bde7c9b3c4 Return sentinel type from enumerate::end() 2022-10-09 23:15:20 +00:00
Kp f61db8ae7a Make enumerate() default to std::size_t for index_type
Change from `uint_fast32_t` to `std::size_t` for consistency with how
arrays are typically indexed.

Change the decltype() lookup to use a non-template function for the
fallback case.

Move the remove_reference logic into the caller, to allow fewer
instantiations of `array_index_type`.
2022-10-09 23:15:20 +00:00
Kp 5d412f3c19 Remove unnecessary explicit definition of enumerated_iterator::operator!= 2022-10-09 23:15:19 +00:00
Kp 8c037b7c26 Split player start generation
Move some of the logic to a separate function to enable use of `return`
instead of a `break` from a composite loop.
2022-02-19 14:52:17 +00:00
Kp b1278b8e39 Flatten type hierarchy for enumerated_iterator
Pass adjust_iterator_dereference_type directly, instead of passing
iterator_dereference_type and letting enumerated_iterator compute
adjust_iterator_dereference_type.
2022-02-19 14:52:17 +00:00
Kp 72064c62e7 Add unit tests for enumerate 2022-02-13 19:13:38 +00:00
Kp 44a50b6206 Make enumerate() index by array's index_type 2021-09-04 12:17:14 +00:00
Kp 704f8f662d Allow rvalue reference as input to enumerated_iterator 2021-06-28 03:37:50 +00:00
Kp 028f4f8a56 Use structured bindings to access enumerated ranges 2021-06-28 03:37:50 +00:00
Kp 7b12aac1bb Transpose returned values for enumerate() of non-tuple
Match the order used for tuple.
2021-06-28 03:37:50 +00:00
Kp 8d2ee6f14d Replace enumerate helper function with class template argument deduction 2020-07-16 02:31:04 +00:00
Kp 665713f315 Remove static inline declarations from fwd-partial_range.h
A declaration is useful if it declares an external function.  A static
inline declaration, if not followed by the definition later in the same
translation unit, will not be useful.  Remove such declarations, and
rely on using the definition as a declaration for those files that
actually call partial_range() or similar functions.
2020-06-10 02:25:32 +00:00
Kp 619ac0abff Use structured bindings for enumerate+zip 2020-05-02 21:18:43 +00:00
Kp 755186ada2 Remove use of deprecated std::iterator 2020-05-02 21:18:43 +00:00
Kp 2b2ca67de5 Add enumerated_iterator::operator==
Defining _GLIBCXX_DEBUG introduces a dependency on this method.
Implement it so that _GLIBCXX_DEBUG can be used.
2019-08-24 18:14:16 +00:00
Kp aacdaa77fe Use std::find_if in create_buddy_bot
Avoid open-coded for loop.
2019-06-27 03:26:20 +00:00
Kp 538286e02c Add range helper zip() 2019-05-04 18:27:36 +00:00
Kp 12b57e84e6 Switch most in-tree http:// links to https://
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it.  These domains were converted:

* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
2018-09-02 00:57:29 +00:00
Kp 716b320c34 Use utility d_enumerate for do_cloak_stuff 2016-11-19 17:24:52 +00:00