Simplifing tuples

Gabriel Dos Reis gdr@cs.tamu.edu
Mon Oct 18 18:35:00 GMT 2004


Benjamin Kosnik <bkoz@redhat.com> writes:

| We used to compute <limits> at build time, and it only worked (well) for
| native targets. I don't see why this should be a limitation for tuple.

100% agreed.

[...]

| You might ask Chris about this. I think this might be useful, actually.
| However, here we go again, with dependent expressions.....  Do you have
| an implementation in mind? If you come up with one perhaps we could
| experiment with it, and see. This would probably be useful, actually:
| 
| template<typename T, int N>
| void error()
| {
|   __builtin_static_assert(sizeof(T)>N, "type %qT too small", T);
| }
| 
| int main()
| {
|   error<int, 2>();

That requires execution.

I think the static_assert is better than nothing, but is way too low
level to help structures in useful ways. It does not help considering
alternatives and a construct is invalid.

-- Gaby



More information about the Libstdc++ mailing list