X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstrings%2Fregmatch.h;h=6af309ea72185ea91e43706c1ef38538ced51976;hb=41363aed34382386f915f17c1a961750b4fdcb14;hp=b79104bad530f9f6846791e97cda7771f9252d37;hpb=f24e7b96e76b63c9b9b8a6bce4c7a9db64276ea8;p=libs%2Fcore.git diff --git a/source/strings/regmatch.h b/source/strings/regmatch.h index b79104b..6af309e 100644 --- a/source/strings/regmatch.h +++ b/source/strings/regmatch.h @@ -26,14 +26,13 @@ public: { typedef std::string::size_type size_type; - bool match; //< Whether or not this group matched - size_type begin; //< First offset of the match - size_type end; //< One-past-last offset - size_type length; //< Length of the match (end-begin) - std::string str; //< The part of the string that matched - - Group(): match(false) { } - operator bool() const { return match; } + bool match = false; //< Whether or not this group matched + size_type begin; //< First offset of the match + size_type end; //< One-past-last offset + size_type length; //< Length of the match (end-begin) + std::string str; //< The part of the string that matched + + explicit operator bool() const { return match; } }; private: @@ -41,7 +40,7 @@ private: public: /** Constructs a RegMatch representing a non-match. */ - RegMatch() { } + RegMatch() = default; /** Constructs a new RegMatch from a string and groups. The length and str members of each group are computed and need not be set. Intended to be used @@ -66,7 +65,7 @@ public: /** Shorthand for the group() function. */ const Group &operator[](unsigned i) const { return group(i); } - operator bool() const { return !empty(); } + explicit operator bool() const { return !empty(); } }; } // namespace Msp