fix compilation with cpp type checking