Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Compilation in Code

Tags:

assert

pragma

d

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.

like image 870
Jeroen Avatar asked Dec 17 '13 20:12

Jeroen


1 Answers

static assert(false, "Your Message")

Will cause compilation to halt.

like image 85
dymk Avatar answered Oct 04 '22 07:10

dymk