Is there a way to check whether the concatenation of two variadic argument packs is the same as a third variadic argument pack.
template<typename... Args>
struct ClassOne
{
}
template<typename... Args>
struct ClassTwo
{
}
template<typename... Args>
struct ClassThree
{
}
template<typename... PackA, typename... PackB, typename... PackC>
void foo(ClassOne<PackA...>, ClassTwo<PackB...>, ClassThree<PackC...>)
{
}
I would like foo to only be enabled if PackA... = PackB..., PackC...
Rather straightforward...
template <typename ...>
struct pack{};
template<typename... PackA, typename... PackB, typename... PackC,
typename = typename std::enable_if
<std::is_same<pack<PackA...>,
pack<PackB..., PackC...>>::value
>::type>
void foo(ClassOne<PackA...>, ClassTwo<PackB...>, ClassThree<PackC...>)
{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With