On Thursday, 17 March 2016 at 14:12:38 UTC, Edwin van Leeuwen
wrote:
On Thursday, 17 March 2016 at 13:53:00 UTC, JR wrote:
Interesting, any idea if it is possible to do assignment
within template.. Either:
printVars!(int abc=5,string def="58")();
or something like
On Wednesday, 16 March 2016 at 21:05:43 UTC, JR wrote:
On Wednesday, 16 March 2016 at 20:43:09 UTC, jkpl wrote:
I try to anticipate the reason why you want this. [...]
I use something *kinda* sort of similar in my toy project to
print all fields of a struct, for debugging purposes when stuff
On Thursday, 17 March 2016 at 11:52:13 UTC, Edwin van Leeuwen
wrote:
On Wednesday, 16 March 2016 at 20:53:42 UTC, JR wrote:
void printVars(Args...)()
if (Args.length > 0)
{
import std.stdio : writefln;
foreach (i, arg; Args) {
writefln("%s\t%s:\t%s", typeof(Args[i]).stringof,
On 3/16/16 4:24 PM, data pulverizer wrote:
Hi D gurus,
is there a way to obtain parameter names within the function body? I am
particularly interested in variadic functions. Something like:
void myfun(T...)(T x){
foreach(i, arg; x)
writeln(i, " : ", arg);
}
void main(){
On Wednesday, 16 March 2016 at 20:24:38 UTC, data pulverizer
wrote:
Hi D gurus,
is there a way to obtain parameter names within the function
body? I am particularly interested in variadic functions.
Something like:
void myfun(T...)(T x){
foreach(i, arg; x)
writeln(i, " : ",
Hi D gurus,
is there a way to obtain parameter names within the function
body? I am particularly interested in variadic functions.
Something like:
void myfun(T...)(T x){
foreach(i, arg; x)
writeln(i, " : ", arg);
}
void main(){
myfun(a = 2, b = "two", c = 2.0);
}
// should
On Wednesday, 16 March 2016 at 20:53:42 UTC, JR wrote:
void printVars(Args...)()
if (Args.length > 0)
{
import std.stdio : writefln;
foreach (i, arg; Args) {
writefln("%s\t%s:\t%s", typeof(Args[i]).stringof,
Args[i].stringof, arg);
}
}
void main() {
int abc = 3;
On Wednesday, 16 March 2016 at 20:24:38 UTC, data pulverizer
wrote:
Hi D gurus,
is there a way to obtain parameter names within the function
body? I am particularly interested in variadic functions.
Something like:
void myfun(T...)(T x){
foreach(i, arg; x)
writeln(i, " : ",
On Wednesday, 16 March 2016 at 20:53:42 UTC, JR wrote:
On Wednesday, 16 March 2016 at 20:24:38 UTC, data pulverizer
wrote:
Hi D gurus,
is there a way to obtain parameter names within the function
body? I am particularly interested in variadic functions.
Something like:
void myfun(T...)(T
On Thursday, 17 March 2016 at 13:53:00 UTC, JR wrote:
Interesting, any idea if it is possible to do assignment
within template.. Either:
printVars!(int abc=5,string def="58")();
or something like
printVars!("abc","def",ghi)(5,"58");
What would the use-cases for those be?
I don't think the
On Wednesday, 16 March 2016 at 20:43:09 UTC, jkpl wrote:
I try to anticipate the reason why you want this. [...]
I use something *kinda* sort of similar in my toy project to
print all fields of a struct, for debugging purposes when stuff
goes wrong. Getting the names of the member variables
11 matches
Mail list logo