From: Mikko Rasa Date: Sun, 31 Oct 2021 18:39:47 +0000 (+0200) Subject: Make boolean conversion operators explicit X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9d0291952255969770e4978a0fe9e7e4839359c8;p=libs%2Fdatafile.git Make boolean conversion operators explicit --- diff --git a/source/input.h b/source/input.h index d30abd6..6163345 100644 --- a/source/input.h +++ b/source/input.h @@ -23,7 +23,7 @@ public: int get(); int peek(); unsigned get_line_number() const { return line; } - operator bool() const; + explicit operator bool() const; }; } // namespace DataFile diff --git a/source/parser.h b/source/parser.h index c7c10f1..c15fee8 100644 --- a/source/parser.h +++ b/source/parser.h @@ -51,7 +51,7 @@ public: statement's signature. */ bool parse_and_load(unsigned, Loader &, const LoaderAction &); - operator bool() const { return good && in; } + explicit operator bool() const { return good && in; } }; } // namespace DataFile