The std::initializer_list (C++11) is a simple proxy object around a const-array that is automatically constructed when a braced-initializer-list is:
- used as a function argument
- used to initialize or assign to an object with an appropriate constructor/assignment operator
- bound to auto
Note that we cannot move from a const array, which has performance implications.
Compiler Explorer link: https://compiler-explorer.com/z/WjzETocx7