On Thursday, 18 August 2016 at 03:58:00 UTC, Meta wrote:
On Thursday, 18 August 2016 at 02:55:49 UTC, Basile B. wrote:
On Thursday, 18 August 2016 at 02:51:48 UTC, Meta wrote:
On Thursday, 18 August 2016 at 00:49:49 UTC, Engine Machine
wrote:
https://en.wikipedia.org/wiki/Virtual_class
Can D
On Thursday, 18 August 2016 at 03:54:24 UTC, WhatMeWorry wrote:
When I saw the .dll in OpenGL.dll, I immediately thought: just
Windows. But does this hold true for the linux shared opengl
libraries as well? Is this why DerelictGL3.reload() does not
take a path argument. But then why
On Thursday, 18 August 2016 at 02:55:49 UTC, Basile B. wrote:
On Thursday, 18 August 2016 at 02:51:48 UTC, Meta wrote:
On Thursday, 18 August 2016 at 00:49:49 UTC, Engine Machine
wrote:
https://en.wikipedia.org/wiki/Virtual_class
Can D do stuff like this naturally?
Yes, D's `alias this`
On Thursday, 18 August 2016 at 03:11:17 UTC, WhatMeWorry wrote:
On Wednesday, 17 August 2016 at 23:21:59 UTC, Rene Zwanenburg
wrote:
On Wednesday, 17 August 2016 at 22:59:31 UTC, WhatMeWorry
wrote:
I want to store all my shared/dynamic libraries within a
special directory relative to where the
On Wednesday, 17 August 2016 at 23:21:59 UTC, Rene Zwanenburg
wrote:
On Wednesday, 17 August 2016 at 22:59:31 UTC, WhatMeWorry wrote:
I want to store all my shared/dynamic libraries within a
special directory relative to where the application directory
is. All of the derelictXX.loads(path)
On Thursday, 18 August 2016 at 02:51:48 UTC, Meta wrote:
On Thursday, 18 August 2016 at 00:49:49 UTC, Engine Machine
wrote:
https://en.wikipedia.org/wiki/Virtual_class
Can D do stuff like this naturally?
Yes, D's `alias this` feature supports this.
On Thursday, 18 August 2016 at 00:49:49 UTC, Engine Machine wrote:
https://en.wikipedia.org/wiki/Virtual_class
Can D do stuff like this naturally?
Yes, D's `alias this` feature supports this.
https://dlang.org/spec/class.html#alias-this
On Thursday, 18 August 2016 at 00:49:49 UTC, Engine Machine wrote:
https://en.wikipedia.org/wiki/Virtual_class
Can D do stuff like this naturally?
Not naturally. The ancestor must be specified for the inner
"virtual class":
°°°
class Foo
{
class Internal
From spec (Interfacing to C++)
https://dlang.org/spec/cpp_interface.html:
```
When mapping a D class onto a C++ struct, use extern(C++, struct)
to avoid linking problems with C++ compilers (notably MSVC) that
distinguish between C++'s class and struct when mangling.
Conversely, use
https://en.wikipedia.org/wiki/Virtual_class
Can D do stuff like this naturally?
On Wednesday, 17 August 2016 at 22:59:31 UTC, WhatMeWorry wrote:
I want to store all my shared/dynamic libraries within a
special directory relative to where the application directory
is. All of the derelictXX.loads(path) compiles except
DerelictGL3.reload(lib); which doesn't seem to be
On 08/17/2016 09:21 PM, Lodovico Giaretta wrote:
import std.traits: TemplateOf;
static if (__traits(isSame, TemplateOf!(x.args[2]), MySequence))
{
...
}
std.traits.TemplateOf extracts the symbol representing the
uninstantiated template.
__traits(isSame, symbol1, symbol2) evaluates at
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
On 08/17/2016 08:38 PM, Engine Machine wrote:
[...]
[...]
[...]
With MySequence being a type, you can do this:
static if (is(x.args[2] == MySequence!Args, Args ...))
{
...
}
It works! Nifty that you can do that
On Wednesday, 17 August 2016 at 19:21:57 UTC, Lodovico Giaretta
wrote:
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
[...]
import std.traits: TemplateOf;
static if (__traits(isSame, TemplateOf!(x.args[2]), MySequence))
{
...
}
std.traits.TemplateOf extracts the symbol
On Wednesday, 17 August 2016 at 18:38:48 UTC, Engine Machine
wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico Giaretta
wrote:
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe
wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length =
On Wednesday, 17 August 2016 at 19:15:48 UTC, ag0aep6g wrote:
On 08/17/2016 08:38 PM, Engine Machine wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico
Giaretta wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length = Args.length;
alias args = Args;
On 08/17/2016 08:38 PM, Engine Machine wrote:
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico Giaretta wrote:
[...]
You mean something like:
struct MySequence(Args...)
{
enum length = Args.length;
alias args = Args;
}
alias x = MySequence!(a, b, MySequence!(c, d));
static
On Wednesday, 17 August 2016 at 08:37:32 UTC, Lodovico Giaretta
wrote:
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe wrote:
On Tuesday, 16 August 2016 at 19:17:27 UTC, Engine Machine
wrote:
alias x = AliasSeq!(a, b, AliasSeq!(c, d));
results in a flat sequence. I would like to be
On Wednesday, 17 August 2016 at 13:33:26 UTC, Steven
Schveighoffer wrote:
I think the OP's case is a bug. Please file.
Thanks, I've filed it. Just wanted to get a second opinion before
concluding that it's a bug.
On 8/17/16 9:23 AM, Lodovico Giaretta wrote:
On Wednesday, 17 August 2016 at 13:21:16 UTC, Cauterite wrote:
On Wednesday, 17 August 2016 at 13:18:06 UTC, Adam D. Ruppe wrote:
Best you can do is use them in an alias argument directly, but you
cannot use them in an enum argument.
I think you
On Wednesday, 17 August 2016 at 13:21:16 UTC, Cauterite wrote:
On Wednesday, 17 August 2016 at 13:18:06 UTC, Adam D. Ruppe
wrote:
Best you can do is use them in an alias argument directly, but
you cannot use them in an enum argument.
I think you missed the point; it works perfectly fine
On Wednesday, 17 August 2016 at 13:18:06 UTC, Adam D. Ruppe wrote:
Best you can do is use them in an alias argument directly, but
you cannot use them in an enum argument.
I think you missed the point; it works perfectly fine without
having this `({return 0;})()` in the template body (which,
On Wednesday, 17 August 2016 at 13:09:40 UTC, Cauterite wrote:
Just by having a random `({return 0;})()` in the template body,
suddenly the template rejects its arguments. I'm so confused,
is this a bug? Or am I missing something?
Function pointers and delegates are not valid compile time
// -- Example: --
template A(alias Arg) {
enum A = Arg;
enum Unrelated = ({return 0;})(); // this line prevent
compilation
};
void main() {
enum FnPtr =
enum _ = A!FnPtr;
};
void asdf() {};
// ( https://dpaste.dzfl.pl/79301f12e5fc )
Just by having a
On Wednesday, 17 August 2016 at 12:39:18 UTC, ag0aep6g wrote:
On 08/17/2016 02:08 PM, Eugene Wissner wrote:
I have a problem, that .stringof doesn't return what I'm
expecting.
Consider the following:
template A(string T)
{
enum A : bool
{
yes = true,
}
}
void main()
{
On 08/17/2016 02:08 PM, Eugene Wissner wrote:
I have a problem, that .stringof doesn't return what I'm expecting.
Consider the following:
template A(string T)
{
enum A : bool
{
yes = true,
}
}
void main()
{
A!"asdf" a1;
typeof(a1) a2;
mixin(typeof(a1).stringof ~
I have a problem, that .stringof doesn't return what I'm
expecting. Consider the following:
template A(string T)
{
enum A : bool
{
yes = true,
}
}
void main()
{
A!"asdf" a1;
typeof(a1) a2;
mixin(typeof(a1).stringof ~ " a3;");
}
I
On Wednesday, 17 August 2016 at 10:47:54 UTC, Guillaume Piolat
wrote:
On Wednesday, 17 August 2016 at 10:45:01 UTC, Saurabh Das wrote:
Is there any way I can log to a terminal or a file from inside
an @nogc function?
Thanks,
Saurabh
import core.stdc.stdio;
printf("am logging C-style\n");
On Tuesday, 16 August 2016 at 16:40:30 UTC, Adam D. Ruppe wrote:
On Tuesday, 16 August 2016 at 16:29:18 UTC, Guillaume Piolat
wrote:
Hey, I also stumbled upon this with imageformats decoding PNG.
Image loading makes 10x the garbage it should.
Let's see what this threads unveils...
leet me
On Wednesday, 17 August 2016 at 10:45:01 UTC, Saurabh Das wrote:
Is there any way I can log to a terminal or a file from inside
an @nogc function?
Thanks,
Saurabh
import core.stdc.stdio;
printf("am logging C-style\n");
Is there any way I can log to a terminal or a file from inside an
@nogc function?
Thanks,
Saurabh
On Tuesday, 16 August 2016 at 23:18:28 UTC, Adam D. Ruppe wrote:
On Tuesday, 16 August 2016 at 19:17:27 UTC, Engine Machine
wrote:
alias x = AliasSeq!(a, b, AliasSeq!(c, d));
results in a flat sequence. I would like to be able to keep
them separate so I can have sub sequences.
wrap them in
On Tuesday, 16 August 2016 at 07:19:18 UTC, Edwin van Leeuwen
wrote:
I am using:
http://code.dlang.org/packages/docopt
It's not really json configurable, but that shouldn't be to
complex to implement yourself.
That's also very nice. I hadn't thought of writing the help text
first and then
33 matches
Mail list logo