Help!
Manu
turkeyman at gmail.com
Mon Nov 26 11:43:10 PST 2012
On 26 November 2012 21:15, David Nadlinger <see at klickverbot.at> wrote:
> On Monday, 26 November 2012 at 17:18:28 UTC, Manu wrote:
>
>> the supplementary question is, how do I then
>> discover if bar[0] is a symbol or not? I can't see any traits to test for
>> builtin types...
>>
>
> Depends on your definition of symbol, but if you mean symbol as in "an
> alias parameter accepts it", the obvious solution is:
>
> ---
> template isSymbol(alias S) {
> enum isSymbol = true;
> }
>
> template isSymbol(S) {
> enum isSymbol = false;
> }
> ---
>
> David
>
struct S {}
isSymbol!S <- why isn't this ambiguous? both templates match that equally,
why would it prefer the alias one?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121126/5d78b210/attachment.html>
More information about the Digitalmars-d
mailing list