Small question about classes

i am looking at code for a custom vector class and i see something like this
1
2
3
4
  ClassName a;
  ClassName d{5};
  cout<< d


what is {5} and what the difference with d(5) the intent is to store one element ' 5' into a vector like class

thanks
It is brace initialization.

http://en.cppreference.com/w/cpp/language/aggregate_initialization

It was added in C++11 and is preferred in many cases.
Last edited on
thanks just starting to learn all the new featured on c++11
Topic archived. No new replies allowed.