Код: Выделить всё
//Abstract base class
class ParameterBase
{
public:
std::string name();
bool specified();
};
class ParameterInt : public ParameterBase
{
//whatever
};
class ParameterString : public ParameterBase
{
//whatever
};
/// Check that all parameters in the list are specified and
/// print the name of the first unspecified parameter.
bool all_specified(const magic_container
& parameters)
{
for(const auto& par : parameters)
{
if (!par.specified())
{
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79163488/how-to-pass-variable-number-of-references-in-container-or-similar-structure-as-a[/url]
Мобильная версия