Re: Why does this mixin fail to compile?

2024-07-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On Tuesday, 2 July 2024 at 07:23:42 UTC, ryuukk_ wrote: I said it 2 times already, i don't want string concatenation, i'll benchmark later, but not right now, right now i'm looking for a functioning code without string concatenation Your buffer solution works, but you need to put it inside a

Re: Why does this mixin fail to compile?

2024-07-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, July 2, 2024 1:23:42 AM MDT ryuukk_ via Digitalmars-d-learn wrote: > I said it 2 times already, i don't want string concatenation, > i'll benchmark later, but not right now, right now i'm looking > for a functioning code without string concatenation D has two options for mixins, and

Re: Default struct constructors if a struct member is a union

2024-07-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 29 June 2024 at 23:33:41 UTC, solidstate1991 wrote: My usecase scenario doesn't really allow constructors for the struct, since it's a binding to an external library via C API. BTW, this is not true. A constructor does not change the struct layout or anything about it from the

Re: Default struct constructors if a struct member is a union

2024-07-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 29 June 2024 at 23:33:41 UTC, solidstate1991 wrote: ```d union U { int i32; long i64; float f32; double f64; } struct S { TypeEnum type; U data; } S foo0 = S(TypeEnum.Integer32, S(20)); //Ugly, but works S foo1 = S(TypeEnum.Integer64, S(20L)); //Error:

Re: Why does this mixin fail to compile?

2024-07-02 Thread ryuukk_ via Digitalmars-d-learn
On Monday, 1 July 2024 at 21:43:02 UTC, Dennis wrote: On Monday, 1 July 2024 at 13:00:55 UTC, ryuukk_ wrote: please stick to what i wrote, i don't want string concatenation, i provide a reduced example from my project, everything should be a single template block, no extra functions other

odbc error Im008 sql server :(

2024-07-02 Thread alina via Digitalmars-d-learn
hello people I need help to connect to sqlserver this is my code and that is the error returned ``` import odbc.sql; import odbc.sqlext; import odbc.sqlucode; import odbc.sqltypes; import std.stdio; import std.string : fromStringz, toStringz; version(Windows) { string connectionString =