mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rationalize some string methods.
- silently deprecate 'startsWith', 'endsWith' methods
(added in 2016: 2b14360662), in favour of
'starts_with', 'ends_with' methods, corresponding to C++20 and
allowing us to cull then in a few years.
- handle single character versions of starts_with, ends_with.
- add single character version of removeEnd and silently deprecate
removeTrailing which did the same thing.
- drop the const versions of removeRepeated, removeTrailing.
Unused and with potential confusion.
STYLE: use shrink_to_fit(), erase()
This commit is contained in:
committed by
Andrew Heather
parent
ea214727a5
commit
7c1190f0b1
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -51,7 +52,7 @@ string getLine(std::ifstream& is)
|
||||
{
|
||||
std::getline(is, line);
|
||||
}
|
||||
while (line.size() && line[0] == '#');
|
||||
while (line.starts_with('#'));
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user