This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Simplifing tuples


Phil Edwards wrote:

>> Another thing that came to my mind is that __builtin_static_assert
>> would have another argument which is the exact number of
>> instantiation contexts to hide while priting the error. For
>> instance, with the static_assert above you get this:
>
> Oh, yuck.  Part of the point of C++'s implicit instantiation of needed
> templates is that it all happens automatically, to whatever depth is
> needed.  Users of __builtin_static_assert should not be required to
> count instantiation levels.

They are not *required* in the strict sense of the term. If you specify '0', it
would still emit the human-readable error message, but with a deeper
instantiation stack. Tuning that parameter is just a way to help the user
stripping out useless information.

Another quick solution would having this special parameter as a boolean flag,
where true means "skip all the instantiation contexts which happen in system
headers, get straight to user's code". This would probably do the trick for v3,
and even faster and stabler, but would not be usable for anybody else (e.g.
Boost library authors). Actually, now that I think of it, I could implement
both variants at the same time (like 0 do nothing, -1 skip system headers, +N
skip N instantiation depths).

Giovanni Bajo



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]