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: Trying to get current function name results in compiler error with __traits

2018-12-06 Thread Neia Neutuladh via Digitalmars-d-learn
On Fri, 07 Dec 2018 02:37:34 +, Arun Chandrasekaran wrote: > I'm trying to get the current function name and apparently the commented > line errors out. > > What am I doing wrong? Referring to nested functions is weird. Dotted identifiers let you traverse aggregates. Modules, C++ namespaces

Trying to get current function name results in compiler error with __traits

2018-12-06 Thread Arun Chandrasekaran via Digitalmars-d-learn
I'm trying to get the current function name and apparently the commented line errors out. What am I doing wrong? https://run.dlang.io/is/EGsRU2 ``` #!/usr/bin/rdmd void main() { import std.experimental.all; void foo() { // __traits(identifier, mixin(__FUNCTION__)).writeln; //

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

Re: struct sta­tic ini­tial­izer method apply to UDA

2018-12-06 Thread learnfirst1 via Digitalmars-d-learn
On Thursday, 6 December 2018 at 12:50:34 UTC, Radu wrote: On Thursday, 6 December 2018 at 11:09:47 UTC, Basile B. wrote: Which would be a real nice feature to have. this is what I need, I guess I has to wait.

Re: dub is building docs of dependencies

2018-12-06 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 6 December 2018 at 14:09:34 UTC, Jedzia wrote: On Wednesday, 5 December 2018 at 12:00:45 UTC, Andre Pany wrote: [...] Thank you Andre, but that refers to ddox which is badly applicable under windows, thanks to the "Unexpected OPTLINK Termination at EIP=." problem. A solution

Re: dub is building docs of dependencies

2018-12-06 Thread Jedzia via Digitalmars-d-learn
Okay, what i am trying to achieve is simply not there. BuildOption._docs is a enum, that is passed recursively to the dependencies and switches doc building on and object building off for the different generators (I missed to say that i am using dmd -> "-o-", "-Dddocs"). What i was looking f

Re: Ambiguous virtual function

2018-12-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 6 December 2018 at 07:37:12 UTC, John Chapman wrote: Is the compiler giving the non-mixed-in function special treatment? Yes, this is by design: https://dlang.org/spec/template-mixin.html#mixin_scope It allows you to have multiple functions in a mixin and override them selectiv

Re: dub is building docs of dependencies

2018-12-06 Thread Jedzia via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 12:00:45 UTC, Andre Pany wrote: On Wednesday, 5 December 2018 at 02:08:13 UTC, Jedzia wrote: dmd2-2.083.0, win minimal dub init with dub.json: { "description": "A minimal D application.", "dependencies": { "iz": "~>0.6.23"

Re: struct sta­tic ini­tial­izer method apply to UDA

2018-12-06 Thread Radu via Digitalmars-d-learn
On Thursday, 6 December 2018 at 11:09:47 UTC, Basile B. wrote: On Thursday, 6 December 2018 at 11:04:23 UTC, learnfirst1 wrote: my question is how to easy use struct sta­tic ini­tial­izer method with UDA. Fake code: struct DbColumn { string name; boolunique ; bool

Re: struct sta­tic ini­tial­izer method apply to UDA

2018-12-06 Thread Basile B. via Digitalmars-d-learn
On Thursday, 6 December 2018 at 11:04:23 UTC, learnfirst1 wrote: my question is how to easy use struct sta­tic ini­tial­izer method with UDA. Fake code: struct DbColumn { string name; boolunique ; boolsigned ; boolnullable ; } struct Order {

struct sta­tic ini­tial­izer method apply to UDA

2018-12-06 Thread learnfirst1 via Digitalmars-d-learn
my question is how to easy use struct sta­tic ini­tial­izer method with UDA. Fake code: struct DbColumn { string name; boolunique ; boolsigned ; boolnullable ; } struct Order { uint id; @DbColumn({ .nullable= true}) // not w

Re: Ambiguous virtual function

2018-12-06 Thread Dennis via Digitalmars-d-learn
On Thursday, 6 December 2018 at 07:37:12 UTC, John Chapman wrote: Is the compiler giving the non-mixed-in function special treatment? I think you're running into this bug: https://issues.dlang.org/show_bug.cgi?id=19365 I see that it is not limited to operator overloading, in general the overl