Both are valid, and were the only ways of initializing objects before C++11, I think.
Brace initialization has an advantage in that it allows you to initialize compound values, like containers and structs, even if they're nested:
std::map<int, std::string> m = { // nested list-initialization
{1, "a"},
{2, {'a', 'b', 'c'} },
{3, s1}
};
Ref: https://en.cppreference.com/w/cpp/language/list_initializati... https://en.cppreference.com/w/cpp/language/aggregate_initial...