diff --git a/lib/cast.h b/lib/cast.h index 9229528d..5cbbcf6d 100644 --- a/lib/cast.h +++ b/lib/cast.h @@ -8,14 +8,8 @@ #include -#include "must_be.h" - -#define const_cast(T, p) \ -({ \ - static_assert(is_same_type(typeof(&*(p)), const T), ""); \ - (T) (p); \ -}) +#define const_cast(T, p) _Generic(p, const T: (T) (p)) #endif // include guard