cxxomfort  rel.20210622
Simple backports for C++ - http://ryan.gulix.cl/fossil.cgi/cxxomfort/
"I12N (initialization)"

Utilities for the initialization of sequence-liek objects / containers.

Defines the dual macros CXXO_I12N_BEG and CXXO_I12N_END that provide initialization semantics for containers similar to the initializer_list constructors in C++11.

It's called "i12n" from "initialization", the same way "i18n" is used for "internationalization".

Interfaces defined:

Sample usage:

// Create a vector<int> with a given sequence of values.
CXXO_I12N_BEG( vector<int> , vn );
{1, 2, 3, 4, 5, 6, 7}
CXXO_I12N_END( vector<int> , vn );
// Create a deque<int> with a given sequence of values.
CXXO_I12N_SEQ( deque<int> , dn ,
{1, 2, 3, 4, 5, 6, 7}
);

Requirements:

Requirements:

Because of these requirements and other reasons intrinsic to its structure as a pseudo-container different from the C++ template sequences, i12n can not work with std::array<...>.

See also
  • seq_() - generation of sequences.