M
M
Maxim Ivanov2016-05-12 22:00:36
C++ / C#
Maxim Ivanov, 2016-05-12 22:00:36

Is it possible somehow in C++ to pass an initialization list directly to a function?

For example, like this:
Array.add({5, 1, 2, 4});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Станислав Макаров, 2016-05-12
@splincodewd

void add(std::initializer_list<int> ints)
{
  //
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question