I'm working on a C++14 project and I just wrote a function with parameter pack.
template <typename... Args>
void func(Args&&... args) {
...
}
The args
should contain only int
or std::string
, it can't be any other types.
Is there any way to do the check at compile time? Maybe something as below?
template <typename... Args, std::enable_if_t<???* = nullptr>
void func(Args&&... args) {
...
}
Aucun commentaire:
Enregistrer un commentaire