mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user