]> git.tdb.fi Git - libs/datafile.git/commitdiff
Make boolean conversion operators explicit
authorMikko Rasa <tdb@tdb.fi>
Sun, 31 Oct 2021 18:39:47 +0000 (20:39 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 31 Oct 2021 18:39:47 +0000 (20:39 +0200)
source/input.h
source/parser.h

index d30abd618b755c6e4c524ba1174345a1b2da08c8..61633458f53af02e411294822cc1d60dc2dd9d9c 100644 (file)
@@ -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
index c7c10f162f3339b4085f88df03afe69dc5bad3dc..c15fee8eb6ade6445d2f485ae5b86fe7a23f199d 100644 (file)
@@ -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