List of initializers that do not work in Visual Studio 2012 CTP 4 Update 2 (March)

After installing Visual Studio 2012 Update 2 CTP 4 (March), this code does not compile:

vector<int> b = {1, 2, 3}; 

with the following error message:

 'std::vector<_Ty>' : Types with a base are not aggregate 

Previously, reporting the same issue with the previous CTP was mentioned using the initializer_list header, but CTP 4 did not install it. Any suggestions for fixing it?

0
source share
1 answer

The compiler supports initializer lists, but the standard library (std :: vector, etc.) does not. You will have to wait until your line compiles.

+1
source

Source: https://habr.com/ru/post/950008/


All Articles