Error using `equal` with various string types

Jonathan M Davis jmdavisProg at gmx.com
Sun Feb 24 11:09:10 PST 2013


On Sunday, February 24, 2013 13:02:46 monarch_dodra wrote:
> My first reaction when I stumbled upon it actually. Then again,
> can't the same be said about lambas? Technically, they *are*
> templates, since the type is determined when they are actually
> called.
> 
> Also, when you say "alias", do you mean "pass as alias
> parameter", or the actual "alias"?

Both.

> Because templates can be
> aliased un parametrized.
> 
> import std.algorithm, std.stdio;
> 
> void main()
> {
>      alias map2 = map;
>      writeln(map2!"a * 2"([1, 2, 3]));
> }

Maybe the problem is when you try and partially instantiate them, but that's 
why some templated functions (like map) are a template wrapping a templated 
function rather than just being a straight templated function.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list