cmExpandedCommandArgument: add an overload for const char*

Static string comparisons were causing heap allocations just for a
comparison.
This commit is contained in:
Ben Boeckel
2018-01-24 07:57:57 -05:00
committed by Brad King
parent 88ed556d99
commit 901c4a1e05
2 changed files with 6 additions and 0 deletions

View File

@@ -24,6 +24,11 @@ bool cmExpandedCommandArgument::WasQuoted() const
return this->Quoted;
}
bool cmExpandedCommandArgument::operator==(const char* value) const
{
return this->Value == value;
}
bool cmExpandedCommandArgument::operator==(std::string const& value) const
{
return this->Value == value;

View File

@@ -24,6 +24,7 @@ public:
bool WasQuoted() const;
bool operator==(const char* value) const;
bool operator==(std::string const& value) const;
bool empty() const;