Re: How give a module to a CTFE function

2018-03-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 12 March 2018 at 22:24:15 UTC, Xavier Bigand wrote: mixin(implementFunctionsOf("derelict.opengl3.functions")); As string I get the following error: ..\src\api_entry.d(16): Error: variable `mod` cannot be read at compile time ..\src\api_entry.d(48):called from here:

Re: How give a module to a CTFE function

2018-03-12 Thread arturg via Digitalmars-d-learn
On Monday, 12 March 2018 at 22:34:10 UTC, Xavier Bigand wrote: Ok, it works with the alias, I didn't see the last () in the implementFunctionsOf prototype. Thank you a lot. no problem. :)

Re: How give a module to a CTFE function

2018-03-12 Thread arturg via Digitalmars-d-learn
On Monday, 12 March 2018 at 22:28:30 UTC, Xavier Bigand wrote: I forgot to precise, that I don't have a main, because I am trying to create an opengl32.dll. This is why I already have a mixin to inject to function definitions in the root scope. you have to pass the string as a template arg

Re: How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/03/2018 à 23:28, Xavier Bigand a écrit : Le 12/03/2018 à 23:24, Xavier Bigand a écrit : Le 12/03/2018 à 22:30, arturg a écrit : On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter.

Re: How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/03/2018 à 23:24, Xavier Bigand a écrit : Le 12/03/2018 à 22:30, arturg a écrit : On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like :

Re: How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/03/2018 à 22:30, arturg a écrit : On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like : mixin(implementFunctionsOf()); string implementFunctionsOf() {

Re: How give a module to a CTFE function

2018-03-12 Thread arturg via Digitalmars-d-learn
On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like : mixin(implementFunctionsOf()); string implementFunctionsOf() { import std.traits; string

How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like : mixin(implementFunctionsOf()); string implementFunctionsOf() { import std.traits; string res; foreach(name; __traits(allMembers,