문제

Is there some sort of Pragma which stops the compilation because for example an error occured? I know about pragma(msg, ...) but that only prints an error, and not actually stops compilation.

The reason I want this is because in certain cases a lot of errors get generated that don't really make sense so I would like to 'override' those errors by putting my own clear message in.

도움이 되었습니까?

해결책

static assert(false, "Your Message")

Will cause compilation to halt.

다른 팁

You can use static assert to stop compilation. Example:

version(Windows)
    static assert(false, "Windows is not supported");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top