diff --git a/common.h b/common.h index 9c852f18f..268334002 100644 --- a/common.h +++ b/common.h @@ -22,6 +22,12 @@ #include #include "util.h" +/** + Avoid writing the type name twice in a common "static_cast-initialization". + Caveat: This doesn't work with type names containing commas! +*/ +#define CAST_INIT(type, dst, src) type dst = static_cast(src) + class completion_t; /* Common string type */