Re: Compiling a template

2018-12-06 Thread albertas-jn via Digitalmars-d-learn
On Friday, 7 December 2018 at 01:21:42 UTC, Ali Çehreli wrote: There is no trace of the template in the library or the object file. You can investigate the compiled symbols with e.g. the 'nm' tool on Linux systems: // deneme.d: void foo(T)(T t) { import std.stdio; writeln(t); } void

Re: Compiling a template

2018-12-06 Thread Neia Neutuladh via Digitalmars-d-learn
On Thu, 06 Dec 2018 22:50:49 +, albertas-jn wrote: > If templates are a compile-time feature and instances of templates are > generated by compiler at compile time, why is it possible to compile a > template definition with dmd -lib or -c? You compile files, not individual declarations like a

Re: Compiling a template

2018-12-06 Thread Ali Çehreli via Digitalmars-d-learn
On 12/06/2018 02:50 PM, albertas-jn wrote: If templates are a compile-time feature and instances of templates are generated by compiler at compile time, why is it possible to compile a template definition with dmd -lib or -c? There is no trace of the template in the library or the object file.

Compiling a template

2018-12-06 Thread albertas-jn via Digitalmars-d-learn
If templates are a compile-time feature and instances of templates are generated by compiler at compile time, why is it possible to compile a template definition with dmd -lib or -c?

Re: Compiling a template

2018-12-06 Thread Basile B. via Digitalmars-d-learn
On Thursday, 6 December 2018 at 22:50:49 UTC, albertas-jn wrote: If templates are a compile-time feature and instances of templates are generated by compiler at compile time, why is it possible to compile a template definition with dmd -lib or -c? Because to instantiate the source code is stil