STYLE: remove substring operator() (issue #554)

- duplicate functionality to the substr() method and more difficult to
  notice when it is being used.
This commit is contained in:
Mark Olesen
2017-10-04 16:49:45 +02:00
parent c903c39763
commit b02623f974
2 changed files with 1 additions and 30 deletions

View File

@ -151,7 +151,7 @@ public:
inline string(const char c);
//- Construct from copies of a single character
inline string(const size_type, const char);
inline string(const size_type len, const char c);
//- Construct from Istream
string(Istream& is);
@ -267,19 +267,6 @@ public:
// \return True when strings match literally.
inline bool operator()(const std::string& text) const;
//- Return sub-string from the i-th character for \a n characters
inline string operator()
(
const size_type i,
const size_type n
) const;
//- Return sub-string from the first character for \a n characters
inline string operator()
(
const size_type n
) const;
// IOstream Operators

View File

@ -243,22 +243,6 @@ inline bool Foam::string::operator()(const std::string& text) const
}
inline Foam::string Foam::string::operator()
(
const size_type i,
const size_type n
) const
{
return substr(i, n);
}
inline Foam::string Foam::string::operator()(const size_type n) const
{
return substr(0, n);
}
inline unsigned Foam::string::hash::operator()
(
const string& str,