src/InitTweak/InitTweak.cc
Statement * InitImpl_old::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) {
		if ( ! init ) return nullptr;
		CompoundStmt * block = new CompoundStmt();
		build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) );
		if ( block->get_kids().empty() ) {
			delete block;
			return nullptr;
		} else {
			init = nullptr; // init was consumed in creating the list init
			return block;
		}
	}
// if array came with an initializer list: initialize each element
// may have more initializers than elements in the array - need to check at each index that
// we haven't exceeded size.
// may have fewer initializers than elements in the array - need to default construct
// remaining elements.
// To accomplish this, generate switch statement, consuming all of expander's elements
if array came with an initializer list: initialize each element
may have more initializers than elements in the array - need to check at each index that
we haven't exceeded size.
may have fewer initializers than elements in the array - need to default construct
remaining elements.
To accomplish this, generate switch statement, consuming all of expander's elements
if array came with an initializer list : initialize each element may have more initializers than elements in the array - need to check at each index that we haven ' t exceeded size . may have fewer initializers than elements in the array - need to default construct remaining elements . To accomplish this generate switch statement consuming all of expander ' s elements
Statement * InitImpl_old::buildListInit( UntypedExpr * dst, std::list< Expression * > & indices ) {
		if ( ! init ) return nullptr;
		CompoundStmt * block = new CompoundStmt();
		build( dst, indices.begin(), indices.end(), init, back_inserter( block->get_kids() ) );
		if ( block->get_kids().empty() ) {
			delete block;
			return nullptr;
		} else {
			init = nullptr; 
			return block;
		}
	}
Statement * InitImpl_old :: buildListInit ( UntypedExpr * dst , std :: list < Expression * > & indices ) { if ( ! init ) return nullptr ; CompoundStmt * block = new CompoundStmt ( ) ; build ( dst , indices . begin ( ) , indices . end ( ) , init , back_inserter ( block -> get_kids ( ) ) ) ; if ( block -> get_kids ( ) . empty ( ) ) { delete block ; return nullptr ; } else { init = nullptr ; return block ; } }
if array came with an initializer list: initialize each element
may have more initializers than elements in the array - need to check at each index that
we haven't exceeded size.
if array came with an initializer list : initialize each element may have more initializers than elements in the array - need to check at each index that we haven ' t exceeded size .
// init was consumed in creating the list init