xte::init_list<>

Defined in header <xte/util/init_list.hpp>

A wrapper for std::initializer_list {}, allowing its elements to be moved from.


Definition

template<typename T>
using init_list = std::initializer_list</* ... */>;



Example

struct ptr_array {
	xte::array<xte::ptr<int>> data;

	ptr_array(xte::init_list<xte::ptr<int>> init_list) {
		for (auto&& item : init_list) {
			this->data.push(xte::xvalue(item));
		}
	}
};

ptr_array a = {
	xte::ptr<int>::make(1),
	xte::ptr<int>::make(2),
	xte::ptr<int>::make(3)
};
[View in Compiler Explorer]