Re: returning and receiving multiple values from a function

2018-05-15 Thread timepp via Digitalmars-d

On Tuesday, 15 May 2018 at 02:01:38 UTC, arturg wrote:

On Tuesday, 15 May 2018 at 01:40:50 UTC, timepp wrote:

Now C++ allow this in a very clean way:

std::tuple foo() {   return {128, true, 
1.5f}; }



auto [value1, value2, value3] = foo();



Would D plan to support that in syntax level?


it depends if some dip like 
https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md is accepted.


thanks arturg !
hope this can be done sooner


returning and receiving multiple values from a function

2018-05-14 Thread timepp via Digitalmars-d

Now C++ allow this in a very clean way:

std::tuple foo() {   return {128, true, 
1.5f}; }



auto [value1, value2, value3] = foo();



Would D plan to support that in syntax level?


how to understand different attribute styles?

2016-10-17 Thread timepp via Digitalmars-d-learn

there is "@disable", using @ as prefix;
there is "__gshared", using __ as prefix;
there is also "align", not using prefix.

I failed to summarize a rule here. Can anyone tell the underlined 
philosiphy?


Re: CompileTime performance measurement

2016-09-05 Thread timepp via Digitalmars-d
On Sunday, 4 September 2016 at 04:24:34 UTC, rikki cattermole 
wrote:

void writeln(T...)(T args) {
if (__ctfe){
debug {
__ctfeWriteln(args);
}
} else {
// ... current implementation
}
}

Are you sure?

any usage example?

consider a normal usage:
writeln("done.");

I just want a runtime output. how can I tell the compiler not to 
print "done." at compile time?




DUB: can I fully control the output file name?

2016-08-09 Thread timepp via Digitalmars-d-learn
I'm writing a Total Commander plugin, which has the "wdx" file 
extension, so I wish to let dub generate xxx.wdx directly but not 
xxx.dll.


How can I write my file to achieve this goal?

---

my dub.json:


{
"name": "tckeyex",
"targetType": "dynamicLibrary",
"description": "A minimal D application.",
"copyright": "Copyright 2016, idtong",
"authors": ["idtong"],
"sourceFiles": ["source/app.def"],
"dependencies": {
"wind": { "path": "thirdparty/wind" }
}
}


and my build script:

@echo off

call makeversion.bat

dub build -b release
copy /y tckeyex.dll tckeyex.wdx

dub build -b release -a x86_64
copy /y tckeyex.dll tckeyex.wdx64