GSL/include/gsl
Herb Sutter 7d49d4b45d
Clean up final_act and finally, closes #846 (#977)
Somewhere along the way, GSL's implementation of final_act and finally seems to have become way overthought. This PR is to re-simplify these facilities back to what C++ Core Guidelines C.30 said which is simple and clear and works. It just copies the invocable thing, and doesn't bother trying to optimize the copy. This should be fine, because we're typically passing something that's cheap to copy, often a stateless lambda.

The problem in #846 appears to be because finally looks like was originally written as a const&/&& overload (its state at the time that issue was opened)... to eliminate a copy when you invoke it with a temporary. If so, then the && was probably never intended to be a forwarder, but an rvalue reference that tripped over the horrid C++ syntax collision where a && parameter magically instead means a forwarding reference because the type happens to be a template parameter type here. So I suspect the original author was just trying to write an rvalue overload, and the forwarder that's there now was never intended at all.
2022-10-10 16:09:21 -07:00
..
algorithm quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
assert gsl::at behavior change regarding gsl::span (#985) 2021-05-20 18:18:08 -07:00
byte renaming main logic files. Added warning message of the removal and include passthrough. Renamed includes in the source files. Ran Clang-Format (#946) 2020-10-29 17:38:48 -07:00
gsl quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_algorithm quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_assert quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_byte quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_narrow quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
gsl_util quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
narrow Suppress es.46 warning in implementation of gsl::narrow (#1046) 2022-04-28 09:49:38 -07:00
pointers quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
span solve span compile problem with gcc 5.5.0 (#1052) 2022-08-18 12:28:11 -07:00
span_ext Resolve MSVC warning C5260 (#1049) 2022-07-18 17:42:21 -07:00
string_span quoted form of #include when GSL includes GSL files (#1030) 2022-01-31 13:06:42 -08:00
util Clean up final_act and finally, closes #846 (#977) 2022-10-10 16:09:21 -07:00