On 24/07/2018 4:43 PM, Guillaume Lathoud wrote:
Hello,
__traits and std.traits already offer access to function information
like input parameters, e.g. in std.traits: ParameterIdentifierTuple
ParameterStorageClassTuple
Even if that might sound strange, is there a compile time access to the
Hello,
__traits and std.traits already offer access to function
information like input parameters, e.g. in std.traits:
ParameterIdentifierTuple ParameterStorageClassTuple
Even if that might sound strange, is there a compile time access
to the body of the function, e.g. as a code string, or a
On Monday, 23 July 2018 at 19:31:42 UTC, aliak wrote:
Ok, now I'm totally confused. Defining an extra type
constructor makes everything work. I.e add a const one to the
inout one:
auto defined(T)(const auto ref T value) {
return W!T(value);
}
and everything works!
Can anyone say why that
On Monday, 23 July 2018 at 19:22:13 UTC, aliak wrote:
On Monday, 23 July 2018 at 19:02:02 UTC, Jacob Carlborg wrote:
This [1] compiles the first example but not the second.
[1] https://run.dlang.io/is/SJ02kP
Aye it does, but it also sets T to always const which is
unfortunately impractical
On Monday, 23 July 2018 at 19:02:02 UTC, Jacob Carlborg wrote:
This [1] compiles the first example but not the second.
[1] https://run.dlang.io/is/SJ02kP
Aye it does, but it also sets T to always const which is
unfortunately impractical for my use case :(
On 2018-07-23 20:39, aliak wrote:
Hi,
I'm playing around with an Optional wrapper type. It stores a type T and
a bool that defines whether a value is defined or not:
struct Optional(T) {
T value;
bool defined = false;
this(U : T)(auto ref inout(U) value) inout {
this.value = val
Hi,
I'm playing around with an Optional wrapper type. It stores a
type T and a bool that defines whether a value is defined or not:
struct Optional(T) {
T value;
bool defined = false;
this(U : T)(auto ref inout(U) value) inout {
this.value = value;
this.defined = true;
}
}
To
On Monday, 23 July 2018 at 12:02:58 UTC, aliak wrote:
Thank you Ali! That helped :) I've gotten most of it sorted out
now, and the factory wrap is definitely the way to go, it also
turned out that inout(T) and inout T (so inout without parens)
was surprisingly different (maybe it's a bug? - t
On Saturday, 21 July 2018 at 19:11:08 UTC, Dr.No wrote:
So I went to try out QWebView on Windows from this wrapper:
https://github.com/MGWL/QtE5
all the examples went fine until I tried QWebView:
Prior to version Qt-5.5 WebKit was used, and for later versions
of chromium-based WebEngine. You
On Monday, 23 July 2018 at 12:07:37 UTC, Seb wrote:
You could use chunkBy:
auto res = sarr.chunkBy!((a, b) => a.s == b.s).map!(a =>
tuple(a.front.s, a.map!(b => b.i).sum));
https://run.dlang.io/is/TJOEmf
Ha... This helps! Thanks a lot! :)
On Monday, 23 July 2018 at 11:49:58 UTC, Alex wrote:
Hi all,
I'm looking for a d-ish way to solve a basic
"split-apply-combine" workflow. The idea is described (and
solved) here:
https://stackoverflow.com/questions/39922986/pandas-group-by-and-sum
So, given a structure with some fields, say
On Monday, 23 July 2018 at 12:02:58 UTC, aliak wrote:
https://run.dlang.io/is/gd5oxW
Sorry wrong link!
This one is correct -> https://run.dlang.io/is/azxmGN
On 23/07/2018 11:49 PM, Alex wrote:
At this moment, I assume, that I'm approaching the problem from the
wrong end, and simply don't see something trivial... Anyway, does
anybody has a hint for me?
Map the range to the integer value, then sum it.
On Sunday, 22 July 2018 at 23:11:09 UTC, Ali Çehreli wrote:
Without much confidence on my side, first, I think you need to
make the constructor parameter inout(T) as well. Otherwise, you
may be making a const(W!T) initialized with a non-const T.
After that, I like the "type constructor" syntax
Hi all,
I'm looking for a d-ish way to solve a basic
"split-apply-combine" workflow. The idea is described (and
solved) here:
https://stackoverflow.com/questions/39922986/pandas-group-by-and-sum
So, given a structure with some fields, say
´´´
struct S
{
string s;
int i;
}
´´´
15 matches
Mail list logo