The article describes two problems with _Generic.<p>There is a third: the discarded branches must typecheck. (Unlike C++ templates, where substitution failure is not an error.) Simon Tatham described the issue in more detail:<p><a href="https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/c11-generic/" rel="nofollow">https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/c11-g...</a>
Nice, does this mean we can have const-generic accesors now? I.e. &s->somefield and get a const pointer if s was a const pointer, but a mutable one otherwise? I guess we still need to define two functions though, but that can probably be handled by macros. This is something that really hinders use of const in current C.