mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: avoid constructor ambiguity for ISpanStream
- compiler cannot decide between std::string and std::string_view when creating from 'const char*' without also supplying the size, so also supply a 'const char*' constructor. ENH: additional string_view handling for ITstream and SubStrings
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
Test-stringSplit.C
|
||||
Test-stringSplit.cxx
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-stringSplit
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2017-2024 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -50,11 +50,12 @@ void printSubStrings
|
||||
<< split.size() << " elements {" << split.length() << " chars}"
|
||||
<< nl;
|
||||
|
||||
unsigned i = 0;
|
||||
for (const auto s : split)
|
||||
for (unsigned i = 0; i < split.size(); ++i)
|
||||
{
|
||||
Info<< "[" << i++ << "] {" << s.length() << " chars} = "
|
||||
<< s.str() << nl;
|
||||
const auto& s = split[i];
|
||||
Info<< "[" << i << "] {" << s.length() << " chars} = "
|
||||
<< split.view(i) << " == " << s.str()
|
||||
<< nl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user