A
A
Alex Serov2015-10-25 01:27:52
C++ / C#
Alex Serov, 2015-10-25 01:27:52

How slow is std::initializer_list?

Where is this object created: on the stack or on the heap?
Can it be used to pass parameters to a function that needs to be fast? For example, to access a cell of a multidimensional array class.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AtomKrieg, 2015-10-25
@gibsonman01

Slow compared to what? All this performance stuff is a waste of time until you do a full performance test of your entire application. And when it turns out that access to a cell of a multidimensional array class is slowing down, then optimize. Therefore, instead of answering the question, I offer you a simple piece of advice - write as you like, and then optimize.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question