Re: Which Docker to use?

2018-10-22 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-10-21 20:45, Jon Degenhardt wrote: My comment painted too broad a brush. I had forgotten how specific the issue I saw was. Apologies for the confusion. The issue that caused me to go to Ubuntu 16.04 had to do with uncaught exceptions when using LTO with the gold linker and LDC 1.5.

Re: assigment to null class object member compiled? is this a bug?

2018-10-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 19 October 2018 at 06:53:32 UTC, dangbinghoo wrote: why the code bellow compiles? D compilers are allowed to make that an error, but it might not. With the current implementation, dmd that.d will compile, but dmd -O that.d will fail with an error. Yes, turning on optimizations

Re: assigment to null class object member compiled? is this a bug?

2018-10-22 Thread Alex via Digitalmars-d-learn
On Monday, 22 October 2018 at 01:39:48 UTC, dangbinghoo wrote: On Friday, 19 October 2018 at 09:08:32 UTC, Vijay Nayar wrote: Technically the code you have is syntactically correct. You are permitted to create a class variable without assigning it to a class object. (Assigning it to a class

Re: custom sorting of lists ?

2018-10-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/19/18 3:58 PM, Carl Sturtivant wrote: On Friday, 19 October 2018 at 17:53:58 UTC, Stanislav Blinov wrote: On Friday, 19 October 2018 at 17:40:59 UTC, Carl Sturtivant wrote: If we imagine an Ordered Range being a finite Range of some kind with the additional property that its values are

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 12:32:57 UTC, test wrote: On Monday, 22 October 2018 at 12:16:50 UTC, Stanislav Blinov wrote: On Monday, 22 October 2018 at 12:03:22 UTC, test wrote: You're trying to call a static function 'getThis' on Fiber. The type 'Fiber' is really a Proxy!FiberS. Proxy

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 12:16:50 UTC, Stanislav Blinov wrote: On Monday, 22 October 2018 at 12:03:22 UTC, test wrote: You're trying to call a static function 'getThis' on Fiber. The type 'Fiber' is really a Proxy!FiberS. Proxy doesn't have a static getThis() function. So the compiler

Re: need help about get all public static function name

2018-10-22 Thread Stanislav Blinov via Digitalmars-d-learn
On Monday, 22 October 2018 at 12:03:22 UTC, test wrote: On Monday, 22 October 2018 at 11:59:21 UTC, test wrote: On Monday, 22 October 2018 at 11:42:59 UTC, test wrote: I try made a simple example but it has no error: I find the way to show the error: https://run.dlang.io/is/f8cULz import

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 11:59:21 UTC, test wrote: On Monday, 22 October 2018 at 11:42:59 UTC, test wrote: I try made a simple example but it has no error: I find the way to show the error: https://run.dlang.io/is/f8cULz import std.traits; struct FiberS { static auto

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 11:42:59 UTC, test wrote: On Monday, 22 October 2018 at 11:18:20 UTC, Stanislav Blinov wrote: Error: template instance `TypeTemplate!(BaseType)` error instantiating I use alias this to allow call static method on proxyType. It work some time, but on other

Re: need help about get all public static function name

2018-10-22 Thread Stanislav Blinov via Digitalmars-d-learn
On Monday, 22 October 2018 at 11:42:59 UTC, test wrote: some how when I call "is(typeof(__traits(getMember, BaseType, name))) " in the template, my code report others error like: Error: no property fromPointer for type void Error: template instance TypeTemplate!(BaseType) is used as a type

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 11:18:20 UTC, Stanislav Blinov wrote: On Monday, 22 October 2018 at 10:49:10 UTC, test wrote: note the added check that the member is not a type: is(typeof(__traits(getMember, BaseType, name))). You'll still need to iterate overloads if you want to get all

Re: need help about get all public static function name

2018-10-22 Thread Stanislav Blinov via Digitalmars-d-learn
On Monday, 22 October 2018 at 10:49:10 UTC, test wrote: test1.d = alias Fn1 = void function(); struct XX { alias Fn= Fn1; // ... } 'Fn' is not a static function, it's a type. I.e. you can declare a function pointer with it: Fn func;

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 10:49:10 UTC, test wrote: On Monday, 22 October 2018 at 10:45:07 UTC, test wrote: On Monday, 22 October 2018 at 10:29:56 UTC, Stanislav Blinov wrote: extern(C) void main(){ GetPub!XX; } https://run.dlang.io/is/f295qE

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 10:45:07 UTC, test wrote: On Monday, 22 October 2018 at 10:29:56 UTC, Stanislav Blinov wrote: On Monday, 22 October 2018 at 10:16:22 UTC, test wrote: and On Monday, 22 October 2018 at 10:45:07 UTC, test wrote: test1.d = alias Fn1 =

Re: need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
On Monday, 22 October 2018 at 10:29:56 UTC, Stanislav Blinov wrote: On Monday, 22 October 2018 at 10:16:22 UTC, test wrote: I try use traits get all public static function of a struct pass to template... how to do this ? void allFunctions(T)() { import std.stdio; foreach (name;

Re: need help about get all public static function name

2018-10-22 Thread Stanislav Blinov via Digitalmars-d-learn
On Monday, 22 October 2018 at 10:16:22 UTC, test wrote: I try use traits get all public static function of a struct pass to template... how to do this ? void allFunctions(T)() { import std.stdio; foreach (name; __traits(allMembers, T)) { static foreach (overload;

need help about get all public static function name

2018-10-22 Thread test via Digitalmars-d-learn
I try use traits get all public static function of a struct pass to template. Compiler report " .Function is not accessible from module " with __traits(isStaticFunction, __traits(getMember, Type , name)). If I add " __traits(getProtection, __traits(getMember, Type, name)) == "public"