2021-09-27 14:02:44 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2021-10-04 12:10:59 -05:00
|
|
|
namespace codon {
|
2021-09-27 14:02:44 -04:00
|
|
|
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
|
2021-10-04 12:10:59 -05:00
|
|
|
} // namespace codon
|