On Sunday, 27 November 2016 at 06:01:13 UTC, Tofu Ninja wrote:
Basically the title says it all.
alias A = AliasSeq!(...);
alias B = AliasSeq!(...);
static assert(A.length == B.length);
template T(An, Bn){ ... }
alias C = AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])); // how
to make this :/
How
On Sunday, 27 November 2016 at 06:01:13 UTC, Tofu Ninja wrote:
Basically the title says it all.
alias A = AliasSeq!(...);
alias B = AliasSeq!(...);
static assert(A.length == B.length);
template T(An, Bn){ ... }
alias C = AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])); // how
to make this :/
How
How to get hash value of an object?
Use hashOf? or typeid(T).getHash(&o)?
I test with the following code:
System:
windows 10
dmd --version
DMD32 D Compiler v2.072.0 (official download version)
ldc2 --version
LDC - the LLVM D compiler (1.1.0git-62a2252) (the latest git
master version)
base
Basically the title says it all.
alias A = AliasSeq!(...);
alias B = AliasSeq!(...);
static assert(A.length == B.length);
template T(An, Bn){ ... }
alias C = AliasSeq!(T!(A[0], B[0]) ... T!(A[n], B[n])); // how to
make this :/
How do I actually make the sequence C?
a simple example:
mixin template v1()
{
void foo(){}
}
mixin template v2()
{
void foo(int){}
}
class Test
{
mixin v1;
mixin v2;
}
void main()
{
__traits(getOverloads, Test, "foo").length.writeln; // 0
}
i know you can use alias to manually make them visible for
getOverloa
On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi
wrote:
This is stated in documentation [1]:
What's the link?
This is a known limitation, it has never worked. The docs should
reflect that, though some day, it might start working.
This is stated in documentation [1]:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
unittest
{
assert(aa["foo"] == 5);
assert(aa["bar"] == 10);
assert(aa["baz"] == 2000);
}
But results to:
Error: non-constant expression ["foo":5L, "bar":10L,
"baz":2000L