1

From certain time I've started encounter the following type of initialization from C++11 I think. Instead of the classic '=', now just '{}'. For example, instead of

uint32_t count = 0;

I find

uint32_t count{ 0 };

or even

uint32_t count{};

how is this better to just doing = something? (which I find more readable by the way). I know that now we have in class initialization and others types of initialization but I could not find anything about this particular case.

cauchi
  • 1,463
  • 2
  • 17
  • 45

0 Answers0