diff --git a/include/version.inl b/include/version.inl index 7e73d05..c9dc498 100644 --- a/include/version.inl +++ b/include/version.inl @@ -30,8 +30,8 @@ namespace version { namespace { - /// Utility function to splice all vector elements to output stream, using designated separator and - /// function object for getting value from vector element. + /// Utility function to splice all vector elements to output stream, using designated separator + /// between elements and function object for getting values from vector elements. template std::ostream& splice(std::ostream& os, const std::vector& v, const std::string& sep, F read) { for (auto it = v.cbegin(); it < v.cend() - 1; ++it) { @@ -85,13 +85,13 @@ namespace version { template std::ostream& operator<<(std::ostream& os, const version::Basic_version& v) { os << v.ver_.major << "." << v.ver_.minor << "." << v.ver_.patch; - if (!v.ver_.prerelease_ids.empty()) { - os << "-"; - splice(os, v.ver_.prerelease_ids, ".", [](const auto& id) { return id.first;}); + std::string prl = v.prerelease(); + if (!prl.empty()) { + os << "-" << prl; } - if (!v.ver_.build_ids.empty()) { - os << "+"; - splice(os, v.ver_.build_ids, ".", [](const auto& id) { return id;}); + std::string bld = v.build(); + if (!bld.empty()) { + os << "+" << bld; } return os; }