Added detection of dependency relationships from unexposed template params

This commit is contained in:
Bartek Kryza
2022-03-13 23:33:08 +01:00
parent 98a118db1d
commit 40dec39995
7 changed files with 114 additions and 18 deletions

View File

@@ -158,6 +158,16 @@ bool starts_with(const std::vector<T> &col, const std::vector<T> &prefix)
std::vector<std::string>(col.begin(), col.begin() + prefix.size());
}
template <typename T>
bool ends_with(const std::vector<T> &col, const std::vector<T> &suffix)
{
if (suffix.size() > col.size())
return false;
return std::vector<std::string>(suffix.rbegin(), suffix.rend()) ==
std::vector<std::string>(col.rbegin(), col.rbegin() + suffix.size());
}
/**
* @brief Removes prefix sequence of elements from the beggining of col.
*