юнити в итоге транслирует c# в c++
С++
в твоем вопросе.bool*
к типу bool**
.std::copy( x.begin(), std::next( x.begin(), std::max( std::size( data ), x.size() ) ), data );
constexpr Array(const std::initializer_list<T>& x)
: size(x.size()), data(x.begin()) {}
The underlying array is not guaranteed to exist after the lifetime of the original initializer list object has ended. The storage for std::initializer_list is unspecified (i.e. it could be automatic, temporary, or static read-only memory, depending on the situation).
The underlying array is a temporary array of type const T[N], in which each element is copy-initialized (except that narrowing conversions are invalid) from the corresponding element of the original initializer list. The lifetime of the underlying array is the same as any other temporary object, except that initializing an initializer_list object from the array extends the lifetime of the array exactly like binding a reference to a temporary (with the same exceptions, such as for initializing a non-static class member). The underlying array may be allocated in read-only memory.
std::array
, который позволил бы инициализацию произвольной длины для объекта этого типа.int arr = {1, 2, 3};
- это будет компилироваться, как думаешь?int arr[] = {1, 2, 3};
, то точно ли 3
вернет операция sizeof(arr)
? Я так не думаю.