|
Boost : |
From: Philippe A. Bouchard (philippe_at_[hidden])
Date: 2003-08-06 00:02:19
Douglas Gregor wrote:
[...]
>> foo<int, long, double>(1, 2, 3);
>> foo<1, 2, 3, 4, 5>();
>> foo<map, list, vector>();
>
> You can always write a forwarding 'foo' that checks the argument
> types, but
> I understand the reason you'd like this feature. My only question is
> whether it is worth the additional machinery that it would take,
> e.g., would this help a large amount of code? Perhaps you have a
> particular "real world" use in mind? I can't think of one, and
> there's a bit of code in the paper that uses the template varargs
> stuff but didn't need it.
I don't have any real world issues yet but eventually it could be used for
efficient signal / slots declarations (list of pointer to members), etc. I
would be the first one to use this feature ;)
I convertion function would be great also in the standards to have type
names in a official way:
demangle(typeid().name());
C++ will then be able to communicate with external languages & vice-versa
[...]
Philippe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk