think-cell / think-cell-library

think-cell core library
https://www.think-cell.com/en/career/devblog/overview
Boost Software License 1.0
407 stars 52 forks source link

Add static_cast around return-statement of `tc::as_lvalue` #26

Closed Ukilele closed 4 months ago

Ukilele commented 5 months ago

Due to https://wg21.link/p2266, the function tc::as_lvalue is (will be) ill-formed in C++23 mode. See also: https://eel.is/c++draft/diff.cpp20.expr#1. Adding the static_cast<T&> fixes it.

foonathan commented 4 months ago

Thanks for the PR! I've noticed that issue a couple of months ago myself and fixed it already in our codebase. I've just exported our internal changes, which include the same fix. But very good catch. :)