Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
An initializer list is on option that can be used, depending on the standard used:
initializer list in the C++98 standard
initializer list in the C++0x standard
initializer list in the C++98 standard
initializer list is not supported in C++98.
#include <vector> |
Compiler output:
/MyFolder/main.cpp:5: error: in C++98 'v' must be initialized by constructor, not by '{...}' |
initializer list in the C++0x standard
An initializer list is an additional initialization option:
#include <vector> |
Technical note: the code shown is compiled successfully using the G++ 4.4.5 compiler, which is supplied with the Qt Creator 2.0.0 IDE.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.