Cannot synthesize is_aggregate pattern. The rules of whether something is involved in aggregate initialization cannot be detected by C ++ 14 metaprogramming methods (this will require reflection support).
A common reason for not having this is the lack of a clear need. Even in the case of your wrapper , there is little harm in applying to non-aggregate types, since the syntax syntax can be applied to non-aggregates. You will not make all the transformations explicit , but this is something that can be fixed using clever metaprogramming / enable_if gymnastics.
The most useful place for such a thing would be in allocator::construct , which would allow using aggregate initialization to construct an object if T was an aggregate, and otherwise direct design calls (to avoid the "no" uniform "part of uniform initialization) .
source share