From: Mikko Rasa Date: Tue, 3 Jan 2023 11:05:22 +0000 (+0200) Subject: Move the definition of Input's operator bool to the header X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3dac369f47a47540ca5e0d691c9b6e5cd41e127e;p=libs%2Fdatafile.git Move the definition of Input's operator bool to the header The class should be considered as internal, but Parser invokes the bool conversion from its own. This avoids having to export Input. --- diff --git a/source/input.cpp b/source/input.cpp index 8aec39e..4496439 100644 --- a/source/input.cpp +++ b/source/input.cpp @@ -39,10 +39,5 @@ int Input::peek() return next; } -Input::operator bool() const -{ - return next>=0 || !in->eof(); -} - } // namespace DataFile } // namespace Msp diff --git a/source/input.h b/source/input.h index 6cc53e7..7f4dd7b 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; } - explicit operator bool() const; + explicit operator bool() const { return (next>=0 || !in->eof()); } }; } // namespace DataFile