Re: Static CT Factory

2016-08-18 Thread Engine Machine via Digitalmars-d-learn
On Friday, 19 August 2016 at 02:54:48 UTC, Basile B. wrote: On Friday, 19 August 2016 at 01:53:22 UTC, Engine Machine wrote: On Friday, 19 August 2016 at 01:25:10 UTC, Anonymouse wrote: On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine x = 1.234; Ok, well, I guess the error comes

Re: Static CT Factory

2016-08-18 Thread Basile B. via Digitalmars-d-learn
On Friday, 19 August 2016 at 01:53:22 UTC, Engine Machine wrote: On Friday, 19 August 2016 at 01:25:10 UTC, Anonymouse wrote: On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine x = 1.234; Ok, well, I guess the error comes from something else. *x = 1.234 for when T verifies is(T ==

Re: Static CT Factory

2016-08-18 Thread Engine Machine via Digitalmars-d-learn
On Friday, 19 August 2016 at 01:18:28 UTC, Adam D. Ruppe wrote: On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote: I feel that in this case I feel that the scope of the static if should allow things to escape since, well, they are static if's. They do. What, exactly, did you

Re: Static CT Factory

2016-08-18 Thread Engine Machine via Digitalmars-d-learn
On Friday, 19 August 2016 at 01:25:10 UTC, Anonymouse wrote: On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote: I have a template that is suppose to create a type based on a template parameter static if (T == "int") { auto x = New!int(); } else static if (T == "double") {

Re: Static CT Factory

2016-08-18 Thread Anonymouse via Digitalmars-d-learn
On Friday, 19 August 2016 at 01:10:42 UTC, Engine Machine wrote: I have a template that is suppose to create a type based on a template parameter static if (T == "int") { auto x = New!int(); } else static if (T == "double") { auto x = New!double(); } x = 1.234; This is just an

Static CT Factory

2016-08-18 Thread Engine Machine via Digitalmars-d-learn
I have a template that is suppose to create a type based on a template parameter static if (T == "int") { auto x = New!int(); } else static if (T == "double") { auto x = New!double(); } x = 1.234; This is just an example, I use custom types. The static if's prevent x's scope from

Re: compile error while use `extern(C++, class)`

2016-08-18 Thread mogu via Digitalmars-d-learn
On Thursday, 18 August 2016 at 16:41:27 UTC, Lodovico Giaretta wrote: On Thursday, 18 August 2016 at 16:19:41 UTC, Johan Engelen wrote: On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta wrote: Which compiler version are you using? On DMD 2.071.0 this does not work. Note: this

Re: RSA library

2016-08-18 Thread Andre via Digitalmars-d-learn
On Thursday, 18 August 2016 at 14:29:54 UTC, Adam D. Ruppe wrote: On Thursday, 18 August 2016 at 09:00:58 UTC, Andre Pany wrote: Is there a D library which can be built with a plain x86 DMD and without dll dependencies? Not that I know of, and I don't think the win32 api includes rsa256

Re: compile error while use `extern(C++, class)`

2016-08-18 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 18 August 2016 at 16:19:41 UTC, Johan Engelen wrote: On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta wrote: Which compiler version are you using? On DMD 2.071.0 this does not work. Note: this does work with LDC 1.1.0 even though it is based on DMD 2.071.

Re: compile error while use `extern(C++, class)`

2016-08-18 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta wrote: On Thursday, 18 August 2016 at 11:11:10 UTC, mogu wrote: Compiler Error exactly. The minimal code is(dmd or ldc2 in ubuntu 16.04 lts): ``` extern (C++, struct) class A {} ``` Error: identifier expected for C++ namespace

Re: RSA library

2016-08-18 Thread Kagamin via Digitalmars-d-learn
Well, windows api has RSA https://msdn.microsoft.com/en-us/library/windows/desktop/aa375534%28v=vs.85%29.aspx is it different from RSA256?

Re: RSA library

2016-08-18 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 18 August 2016 at 09:00:58 UTC, Andre Pany wrote: Is there a D library which can be built with a plain x86 DMD and without dll dependencies? Not that I know of, and I don't think the win32 api includes rsa256 (though .net does!). The botan lib though, why doesn't it work on 32

Re: compile error while use `extern(C++, class)`

2016-08-18 Thread pineapple via Digitalmars-d-learn
On Thursday, 18 August 2016 at 11:43:03 UTC, Lodovico Giaretta wrote: On Thursday, 18 August 2016 at 11:11:10 UTC, mogu wrote: On Thursday, 18 August 2016 at 10:45:14 UTC, Lodovico Giaretta wrote: Which kind of error? An error message by the compiler? One by the linker? The compiler crashes?

Re: compile error while use `extern(C++, class)`

2016-08-18 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 18 August 2016 at 11:11:10 UTC, mogu wrote: On Thursday, 18 August 2016 at 10:45:14 UTC, Lodovico Giaretta wrote: Which kind of error? An error message by the compiler? One by the linker? The compiler crashes? Compiler Error exactly. The minimal code is(dmd or ldc2 in ubuntu

Re: compile error while use `extern(C++, class)`

2016-08-18 Thread mogu via Digitalmars-d-learn
On Thursday, 18 August 2016 at 10:45:14 UTC, Lodovico Giaretta wrote: Which kind of error? An error message by the compiler? One by the linker? The compiler crashes? Compiler Error exactly. The minimal code is(dmd or ldc2 in ubuntu 16.04 lts): ``` extern (C++, struct) class A {} ```