Add remove_cv too per Casey's suggestion

Co-authored-by: Casey Carter <Casey@Carter.net>
This commit is contained in:
Herb Sutter 2022-08-31 16:48:13 -07:00 committed by GitHub
parent 352f73df92
commit d569ed65d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ private:
template <class F>
GSL_NODISCARD auto finally(F&& f) noexcept
{
return final_action<std::remove_reference_t<F>>{std::forward<F>(f)};
return final_action<std::remove_cv_t<std::remove_reference_t<F>>>{std::forward<F>(f)};
}
// narrow_cast(): a searchable way to do narrowing casts of values