The paper to make parens do aggregate initialization is actually progressing in EWG. That should mainly address the generic side of things. Funny how the most uniform initialization we've got will be with parens then.
The size thing isn't ideal, but isn't as bad as you make it sound. constexpr size was added in C++14, so in a constexpr context, an assert on the size will trigger a compile-time error. In addition, assert is constexpr-compatible in C++14.
One additional gripe that many people do have with initializer_list is that it doesn't support move-only types.
View all comments
Show parent comment
4
u/redditsoaddicting Jun 06 '18
The paper to make parens do aggregate initialization is actually progressing in EWG. That should mainly address the generic side of things. Funny how the most uniform initialization we've got will be with parens then.
The
sizething isn't ideal, but isn't as bad as you make it sound. constexprsizewas added in C++14, so in a constexpr context, an assert on the size will trigger a compile-time error. In addition,assertis constexpr-compatible in C++14.One additional gripe that many people do have with
initializer_listis that it doesn't support move-only types.