[cfe-dev] Recognizing aggregates

Sebastian Redl sebastian.redl at getdesigned.at
Mon Dec 19 05:09:38 PST 2011


On 19.12.2011 00:01, Eli Friedman wrote:
> On Sat, Dec 17, 2011 at 10:51 AM, Sebastian Redl
> <sebastian.redl at getdesigned.at>  wrote:
>> Hi,
>>
>> I've got a problem. I've just finished a partial implementation of list-initialization of non-aggregates, and now several test cases fail. These test cases just test whether specific types are aggregates, but to do so, they attempt to use list-initialization on them. Now that list-initialization is possible for non-aggregates, these tests no longer work. Because these tests want to test the C++11 definition of aggregates, they have to run in C++11 mode.
>>
>> Is there an alternative to list-initialization for detecting aggregates? There is no type trait, and while I could easily implement one, doing so just for some tests seems like massive overkill.
> I don't see why list-initialization is insufficient: if a type isn't
> an aggregate, it will start looking for constructors, and you can
> easily ensure no constructor matches.
>
I had hoped for something prettier, but I suppose this will do.

Sebastian



More information about the cfe-dev mailing list