The issue with consteval function related to the use of typeid().name() is that the function is evaluated at compile-time, and therefore, the typeid().name() function may not produce the expected results. This is because typeid().name() is evaluated at run-time and may change depending on the platform or compiler used. In addition, the use of this function in a consteval function may result in undefined behavior. Therefore, it is recommended to avoid using typeid().name() in consteval functions or to use a more reliable way to obtain type information, such as using type traits.
Asked: 2023-06-27 16:10:42 +0000
Seen: 15 times
Last updated: Jun 27 '23