'Why isn't default or value initialization more common for aggregates?

I believe since C++14, the brace-or-equal initialization became available in standard. I try to always initialize my data to avoid any surprises, and extend that practice to initializing my aggregates, i.e.,

struct bar {
   int a = 0;
   int c = 1;
   double b = 2.3;
};

I hardly ever see anyone else do this. It's my understanding that this preserves the aggregate layout and the struct will just default-initialize members that you do not value-initialize or assign. I'm wondering if maybe I'm doing something wrong since I don't see others do this. Am I misunderstanding something or overlooking potential problems this introduces?

Edit: Thanks for the replies. In my above example, it may be an aggregate containing tuning parameters for some system, where double b = 2.3 may indeed make sense. I understand that a constructor can do this as well, so I suppose my question really boils down to: What difference is there between the default-initialization scheme I have above vs. a constructor?

c++


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source