diff --git a/paddle/fluid/framework/no_need_buffer_vars_inference.h b/paddle/fluid/framework/no_need_buffer_vars_inference.h index 9124489ec686e5ac0744cbdc3f8d04a5770815b9..c1640f6ccb8eed31096dfe9b8c66ecf7636d75b1 100644 --- a/paddle/fluid/framework/no_need_buffer_vars_inference.h +++ b/paddle/fluid/framework/no_need_buffer_vars_inference.h @@ -114,7 +114,7 @@ class InferNoNeedBufferVarsFN { return (*inferer_)(ctx); } - inline operator bool() const { return inferer_ != nullptr; } + inline explicit operator bool() const { return inferer_ != nullptr; } inline bool operator!() const { return inferer_ == nullptr; }