[libcxx-commits] [libcxx] [libc++] <algorithm>: __is_callable checks whether the callable can be called with rvalue (PR #73451)

Nhat Nguyen via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 9 11:18:43 PST 2023


changkhothuychung wrote:

> I don't understand the motivation behind static asserts like this. They have a number of downsides.
> 
> 1. They cost compile time and memory. The instantiations they perform live in the compilers AST until the end of the TU.
> 2. They don't catch broken code. The broken code is already broken, this just diagnoses it differently.
> 3. They break well formed code.
> 
> As evidenced here, when we get the needless checks wrong, they break valid code. Which is a lot worse than providing a slightly better diagnostic to ill-formed code.
> 
> I say we get rid of them entirely.

@ldionne l
do you have any opinions on this? I will wait for your response before I continue. 

https://github.com/llvm/llvm-project/pull/73451


More information about the libcxx-commits mailing list