]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/regmatch.h
Add move semantics to Variant
[libs/core.git] / source / strings / regmatch.h
index 0858e5a8dfc5cec44afba0d308ca45ef3c8d3206..8d4406a483ac19b01476a3684b73a2bde7a4e094 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <string>
 #include <vector>
+#include <msp/core/mspcore_api.h>
 
 namespace Msp {
 
@@ -16,7 +17,7 @@ part matched by the whole regex.  Further groups, if present, indicate parts
 matched by subregexes.  These are ordered from left to right, by the opening
 parenthesis of the subregex.
 */
-class RegMatch
+class MSPCORE_API RegMatch
 {
 public:
        /**
@@ -32,7 +33,7 @@ public:
                size_type length;    //< Length of the match (end-begin)
                std::string str;     //< The part of the string that matched
 
-               operator bool() const { return match; }
+               explicit operator bool() const { return match; }
        };
 
 private:
@@ -40,7 +41,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
@@ -65,7 +66,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