Example I have some random class, which constructor have some default arguments. And I have a function to construct there class with some given arguments, and I need somehow to check if I can construct there class with those given arguments
class someRandomClass
{
public:
someRandomClass(int a = 0, float b = 0.f, double c = 0.0, const char* d = "") {}
// any argument you can think of
};
template<typename Cls, typename... Ts>
void constructClass(Ts... args) {
// something to check
if (constructable(Cls, Ts...))
Cls myClass(args...);
}
Are there some way to achieve this?