I'd just like to say thanks for D

Lars T. Kyllingstad public at kyllingen.net
Sun Mar 10 23:13:32 PDT 2013


On Monday, 11 March 2013 at 05:24:34 UTC, H. S. Teoh wrote:
> - Ahem. Next, the compiler complains, "you wrote a template 
> name with no
>   parameters; that's illegal!" Perfectly legal complaint, but 
> the line
>   concerned read:
>
> 	std::unordered_map::iterator it = fcache.find(key);
>
>   Fixing the compiler error required me to change this 
> already-verbose
>   line to:
>
> 	std::unordered_map<cache_key_type, vertex_set>::iterator it = 
> fcache.find(key);
>
>   Argh! What is this, Java?! How I miss D's type inference... 
> The only
>   way to make this *not* painful was to use a typedef.

Tip: Since you've already enabled C++11 extensions, you could 
just do:

     auto it = fcache.find(key);

It... it... almost looks like D? :)

IMO, the redefinition of 'auto' to mean type inference is the 
biggest improvement in C++11.

Lars


More information about the Digitalmars-d mailing list