1
0
mirror of https://github.com/exaloop/codon.git synced 2025-06-03 15:03:52 +08:00
2021-09-27 14:02:44 -04:00

34 lines
884 B
C++

#pragma once
#include <vector>
namespace seq {
namespace ir {
namespace util {
/// Utility function to strip parameter packs.
/// @param dst the destination vector
/// @param first the value
template <typename Desired>
void stripPack(std::vector<Desired *> &dst, Desired &first) {
dst.push_back(&first);
}
/// Utility function to strip parameter packs.
/// @param dst the destination vector
template <typename Desired> void stripPack(std::vector<Desired *> &dst) {}
/// Utility function to strip parameter packs.
/// @param dst the destination vector
/// @param first the value
/// @param args the argument pack
template <typename Desired, typename... Args>
void stripPack(std::vector<Desired *> &dst, Desired &first, Args &&...args) {
dst.push_back(&first);
stripPack<Desired>(dst, std::forward<Args>(args)...);
}
} // namespace util
} // namespace ir
} // namespace seq