Skip to content

Commit

Permalink
string_utils.h updated
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeprieto committed Aug 8, 2024
1 parent 1a9f2bb commit 99d867e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/openmc/string_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ bool starts_with(const std::string& value, const std::string& beginning);
template<typename T>
inline std::string concatenate(const T& values, const std::string& del = " ")
{
std::ostringstream oss;
if (values.size() == 0)
return "";

std::stringstream oss;
auto it = values.begin();
if (it != values.end()) {
oss << *it; // Insert the first element without a delimiter
++it;
}
for (; it != values.end(); ++it) {
oss << del << *it;
oss << *it++;
while (it != values.end()) {
oss << del << *it++;
}
return oss.str();
}
Expand Down

0 comments on commit 99d867e

Please sign in to comment.