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 from

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 == int

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 d

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") { a

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 example,

Re: Static CT Factory

2016-08-18 Thread Adam D. Ruppe via Digitalmars-d-learn
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 do and what, exactly did you see as the error?

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 being

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 doe

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 (thou

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. https://

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 fo

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 b

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 {} ``` Erro

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

2016-08-18 Thread Lodovico Giaretta via Digitalmars-d-learn
On Thursday, 18 August 2016 at 01:06:29 UTC, mogu wrote: 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 c

RSA library

2016-08-18 Thread Andre Pany via Digitalmars-d-learn
Hi, I am searching for a RSA (256) library to validate the signature of a JWT token. Although there are OpenSSL and Botan both have some small disadvantages. For OpenSSL I always have include the DLLs on windows and for Botan you have to install the Microsoft Linker or built it as win64 appli