Implicit instantiation of parameterless templates
Paulo Pinto
pjmlp at progtools.org
Fri Oct 5 14:28:01 PDT 2012
On Friday, 5 October 2012 at 20:42:06 UTC, Maxim Fomin wrote:
> On Friday, 5 October 2012 at 20:19:26 UTC, Piotr Szturmaj wrote:
>> F i L wrote:
>>> Dmitry Olshansky wrote:
>>>> Hm... If placed at the global scope it looks like a
>>>> namespace.
>>>
>>> I don't see anything wrong with that. It's just another way
>>> (somewhat
>>> unique to D) you can categorize your code. Most people
>>> probably won't
>>> use this sort of thing all over the place, but it actually
>>> might be
>>> useful for "enforcing" naming classifications:
>>>
>>> // File system/io.d
>>>
>>> template Console
>>> {
>>> void write( ... )
>>> void read()
>>> }
>>
>> final abstract class Console
>> {
>> static:
>> void write() { }
>> void read() { }
>> }
>>
>> Console.write();
>>
>> P.S. Yes, simultaneous final and abstract actually works :)
>
> Thanks to how dmd parses code, many simultaneous things
> actually work, sometimes it is nonsense
> http://dpaste.dzfl.pl/04e6bf33
Time to write "D the good parts" or "Effective D" ?
More information about the Digitalmars-d
mailing list