options: add variadic call of add()

This commit is contained in:
zawz 2020-08-11 16:26:21 +02:00
parent 39b0319cab
commit ddf6711a44

View file

@ -115,6 +115,9 @@ namespace ztd
/*CREATION FUNCTIONS*/
//! @brief Add option to the set
inline void add(option opt) { option_vec.push_back(opt); }
//! @brief Variadic call of add()
template<class... Args>
void add(Args... args) { std::vector<option> rargs = { static_cast<option>(args)...}; for(auto it: rargs) add(it); }
/*PRINT FUNCTIONS*/
//! @brief Print help for the full option set