structs are now lvalues - what is with "auto ref"?

Jonathan M Davis jmdavisProg at gmx.com
Mon Dec 24 00:14:33 PST 2012


On Monday, December 24, 2012 09:08:09 Namespace wrote:
> Yes that's what I thought. My question was, if it's bad if now a
> lot of my functions/methods are templatized.

That would depend on what you're doing. It's a problem with classes, because 
templated functions can't be virtual. With everything else, it mostly depends 
on whether you care about the fact that the function won't exist if it's not 
use and the fact that if you're putting it in a library, it won't really be 
compiled into the library unless it's actually used in the library (so it 
won't save you any disk space). Also, it will have to have its full source 
code in .di files if you use .di files. You also potentially have to put up with 
a different set of compiler bugs, since some bugs affect templated functions but 
not non-templated functions (and probably vice versa), which probably isn't 
much of an issue, but that would depend on whatever bugs there happen to 
currently be.

So, for the most part, I'd say that it's a non-issue aside from classes, but 
you might care, depending on what you're doing.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list