Why can't I assign a mixin to an alias?

2016-06-10 Thread Dechcaudron via Digitalmars-d-learn
I have the following code: private string getVariableSignalWrappersName(VarType)() { return VarType.stringof ~ "SignalWrappers"; } void addVariableListener(VarType)(int variableIndex, void delegate(int, VarType)) { alias typeSignalWrappers =

Re: Why can't I assign a mixin to an alias?

2016-06-12 Thread Dechcaudron via Digitalmars-d-learn
On Saturday, 11 June 2016 at 01:53:10 UTC, David Nadlinger wrote: This might be a gratuitous grammar restriction. There are a few of those surrounding alias "targets". A template that simply returns its parameter might work, though, such as std.meta.Alias (alias foo = Alias!(mixin(…));). It

Broken TLS?

2016-07-27 Thread Dechcaudron via Digitalmars-d-learn
I keep getting data from within a struct shared across threads for apparently no reason: the code is the following: import std.stdio; import std.concurrency; import core.thread : Thread, thread_joinAll; struct Foo { int a; int b; this(int a, int b) { this.a = a;

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
I don't know anything about the driver you are using, but from my general experience with DBs I'll try to give you some insight. On Thursday, 28 July 2016 at 14:01:45 UTC, Suliman wrote: 1. Should declaration of them be field of class? I'd say so. If you intend to use each instance of the

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
On Thursday, 28 July 2016 at 14:24:16 UTC, Suliman wrote: void dbInsert(string login, string uploading_date, string geometry_type, string data) { Statement stmt = conn.createStatement(); //stmt.executeUpdate("..."); // some processing of

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
On Thursday, 28 July 2016 at 15:18:24 UTC, Lodovico Giaretta wrote: 3) at program end, live objects are not scheduled for finalization; 4) at program end, pending finalizations from previous collections may not be run. I didn't know these two, can I get source on them? Also, I'm assuming

Re: Question about destructor of database and multiple use access

2016-07-28 Thread Dechcaudron via Digitalmars-d-learn
On Thursday, 28 July 2016 at 14:43:32 UTC, Lodovico Giaretta wrote: No! Never run important finalization in a class destructor! The GC is not obliged to run the destructors, so you may end up with your objects destroyed but the connections still open. For this kind of important things, you

Re: Broken TLS?

2016-07-27 Thread Dechcaudron via Digitalmars-d-learn
On Wednesday, 27 July 2016 at 20:54:00 UTC, ag0aep6g wrote: Looks pretty bad. There's an open issue on this: https://issues.dlang.org/show_bug.cgi?id=16095 Giving my 20 votes to the issue (are votes even taken into account?). At least now I know the source of attribute-enforcements breakdown

value of 'this' is not know at CT for typeof(this)

2018-01-26 Thread Dechcaudron via Digitalmars-d-learn
So I'm trying to get this to compile: ``` static foreach (alias member; getSymbolsByUDA!(typeof(this), Serialize)) serializeMember!member(bundle); ``` And I'm getting the following error: value of 'this' is not known at compile time for the line on top. typeof(this) to get the

Re: value of 'this' is not know at CT for typeof(this)

2018-01-27 Thread Dechcaudron via Digitalmars-d-learn
On Friday, 26 January 2018 at 20:13:14 UTC, Simen Kjærås wrote: I can't reproduce the problem. Could you give us some more code - preferably a compilable segment that gives the same problem? -- Simen https://github.com/Dechcaudron/dserialize/tree/6c67e44dedf81d9cb8c0d9d80cf4eb85e9abecd0

Re: Using systemDependencies in DUB

2018-06-24 Thread Dechcaudron via Digitalmars-d-learn
On Sunday, 24 June 2018 at 12:15:42 UTC, Timoses wrote: What about the "libs" build settings (or "lflags")? (http://code.dlang.org/package-format?lang=json) "libs": "clang" There it was, hidden in plain sight. Thanks for the extra pair of eyes Timoses. I don't know how I missed it.

Using systemDependencies in DUB

2018-06-24 Thread Dechcaudron via Digitalmars-d-learn
Hi, I'm trying to use dub to compile a quick experiment that uses Deimos libclang bindings, which of course requires linking against an installed libclang. I believe this is what I need to include in dub.json: "systemDependencies": "libclang-6.0" But it just won't link against the lib in