From 3dac369f47a47540ca5e0d691c9b6e5cd41e127e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 3 Jan 2023 13:05:22 +0200 Subject: [PATCH] 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. --- source/input.cpp | 5 ----- source/input.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) 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 -- 2.43.0