Skip to content

Commit

Permalink
Squashed 'externals/coda-oss/' changes from ed283d676..b173830ca
Browse files Browse the repository at this point in the history
b173830ca fix C++17 overload resolution

git-subtree-dir: externals/coda-oss
git-subtree-split: b173830ca9d9946bc4375786bd39abfdbc2ed9c9
  • Loading branch information
Dan Smith committed Dec 19, 2023
1 parent b3745ac commit e2ca833
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions modules/c++/sys/include/sys/Path.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ class CODA_OSS_API Path
std::ostream& operator<<(std::ostream& os, const sys::Path& path);
std::istream& operator>>(std::istream& os, sys::Path& path);

// Convert between collections of paths as strings and sys::filesystem::path
CODA_OSS_API std::vector<std::string> convertPaths(coda_oss::span<const filesystem::path>);
CODA_OSS_API std::vector<filesystem::path> convertPaths(coda_oss::span<const std::string>);
// Convert between collections of paths as strings and coda_oss::filesystem::path
CODA_OSS_API std::vector<std::string> convertPaths(coda_oss::span<const coda_oss::filesystem::path>);
CODA_OSS_API std::vector<coda_oss::filesystem::path> convertPaths(coda_oss::span<const std::string>);
template<typename T>
inline auto convertPaths(const std::vector<T>& paths)
{
Expand Down
8 changes: 4 additions & 4 deletions modules/c++/sys/source/Path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,8 @@ std::string Path::expandEnvironmentVariables(const std::string& path, fs::file_t
bool unused_checkIfExists = true;
return expandEnvironmentVariables_(path, unused_checkIfExists, &type);
}
} // sys


template<typename TReturn, typename TSpan, typename TFunc>
inline auto convertPaths_(coda_oss::span<const TSpan> paths, TFunc fun)
Expand All @@ -857,13 +859,11 @@ inline auto convertPaths_(coda_oss::span<const TSpan> paths, TFunc fun)
std::transform(paths.begin(), paths.end(), std::back_inserter(retval), fun);
return retval;
}
std::vector<std::string> convertPaths(coda_oss::span<const fs::path> paths)
std::vector<std::string> sys::convertPaths(coda_oss::span<const fs::path> paths)
{
return convertPaths_<std::string>(paths, [](const auto& p) { return p.string(); });
}
std::vector<fs::path> convertPaths(coda_oss::span<const std::string> paths)
std::vector<fs::path> sys::convertPaths(coda_oss::span<const std::string> paths)
{
return convertPaths_<fs::path>(paths, [](const auto& p) { return p; });
}

}

0 comments on commit e2ca833

Please sign in to comment.