This is initial setup to enabling use of zip() on sentinel based ranges.
Store the range's type in the zip signature, and store the types of
std::begin/std::end for the iterators, rather than assuming that
std::begin and std::end return the same type.
Allow the caller to pick which sequences can terminate the zip iterator.
For compatibility and performance, default to the historical behavior of
examining only the first sequence. The zip iteration terminates when
any of the examined sequences reaches its end, even if other sequences
have not reached their respective end.
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.
Any integer type can convert to match this signature, but the diagnostic
will only report that this deleted function was matched. Switch to a
template function so that the diagnostic can report the unconverted
integer type.
Switch from using a macro to capture __FILE__,__LINE__ to using
__builtin_FILE(),__builtin_LINE(). Make the event an explicit argument,
instead of assuming it is a variable named `event`. Move the
implementation out of line.
Since this should never be invoked, simplify the definition. The new
version is slightly less informative in case a logic error causes it to
be called, but is far shorter and easier to understand.
object_create_muzzle_flash delegated to
object_create_explosion_without_damage, adding one parameter that
callers ought to provide instead. Inline object_create_muzzle_flash into
callers and change them to provide `Vclip`.
Win32 aliases `size_t` to `unsigned int`, causing
`static_cast<size_t>(V)` to be a useless cast when `V` has type
`unsigned int`. Switch to using direct initialization, which is not a
cast and so does not trigger a warning, but does produce the correct
type. This form disallows narrowing, so inputs that might change in
value as a result of the conversion are an error. Since this is a
sanity checking macro, that is a useful safety measure.
Reported-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/678#issue-1437577368>
`object_create_explosion` delegated to
`object_create_explosion_without_damage`, adding one parameter that
callers ought to provide instead. Inline `object_create_explosion` into
callers and change them to provide `Vclip`.
Apple clang is currently version 14, but Apple's libc++ is version 13,
and so lacks even more std::ranges support than previously reported.
Add more stub backports to work around this.
The Rebirth main screen grd_curscreen borrows the memory allocated by
SDL_CreateRGBSurface to store its data. Store the pointer to that
surface inside grd_curscreen and make grd_curscreen responsible for
freeing the surface.
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.
Adding `final` can allow gcc to devirtualize a call. Request compiler
warnings wherever `final` would improve this. As of this writing, there
are no places where `final` would be helpful and would also be wrong, so
this is enabled everywhere.