D as a prototyping language (for C/C++ projects)

Rob T alanb at ucora.com
Wed Feb 27 19:35:17 PST 2013


On Wednesday, 27 February 2013 at 20:43:47 UTC, Jacob Carlborg 
wrote:
> That's a good idea. This is my library:
>
> https://github.com/jacob-carlborg/mambo
>
> It's a bit outdated. It started around 2007 with D1 and Tango.
>

I had a look at your isBlank function. Why not check if length 
exists and run it as follows?

@property bool isBlank (T) (T t)
{

    static if (__traits(compiles, t.length))
    {
        if (t.length == 0)
           return true;
    }

...

That would be more generic I think.

--rt


More information about the Digitalmars-d mailing list