this code give error:
```d
static if( !__traits(compiles, mixin("enum v = V;")) ) {
enum v = V;
}
```
```sh
Error: static variable `NotWorkVar` cannot be read at compile
time
```
V is alias get from `typeof(__traits(getMember, M, symbol)`, M
is `module` from importC.
the importC so
This simple mixin fails to compile, anyone know why?
```D
mixin implement;
mixin template implement() {
mixin("struct _gen(T) {");
mixin("}");
}
void main(){}
```
```
onlineapp.d-mixin-5(5): Error: `}` expected following members in
`struct` declaration
onlineapp.d-mixin-5(5):
On Monday, 1 July 2024 at 09:25:39 UTC, ryuukk_ wrote:
This simple mixin fails to compile, anyone know why?
```D
mixin implement;
mixin template implement() {
mixin("struct _gen(T) {");
mixin("}");
}
A string mixin must form a complete declaration / statement /
expression / type, so
On Monday, 1 July 2024 at 09:29:50 UTC, Dennis wrote:
On Monday, 1 July 2024 at 09:25:39 UTC, ryuukk_ wrote:
This simple mixin fails to compile, anyone know why?
```D
mixin implement;
mixin template implement() {
mixin("struct _gen(T) {");
mixin("}");
}
A string mixin must form a com
On 01.07.2024 12:39, ryuukk_ wrote:
On Monday, 1 July 2024 at 09:29:50 UTC, Dennis wrote:
On Monday, 1 July 2024 at 09:25:39 UTC, ryuukk_ wrote:
This simple mixin fails to compile, anyone know why?
```D
mixin implement;
mixin template implement() {
mixin("struct _gen(T) {");
mixin("}"
On Monday, 1 July 2024 at 10:20:25 UTC, drug007 wrote:
On 01.07.2024 12:39, ryuukk_ wrote:
On Monday, 1 July 2024 at 09:29:50 UTC, Dennis wrote:
On Monday, 1 July 2024 at 09:25:39 UTC, ryuukk_ wrote:
This simple mixin fails to compile, anyone know why?
```D
mixin implement;
mixin template im
On Monday, 1 July 2024 at 07:32:30 UTC, Dakota wrote:
this code give error:
```d
static if( !__traits(compiles, mixin("enum v = V;")) ) {
enum v = V;
}
```
__traits(compiles, ...) can't check if a declaration is valid
directly. You have to wrap it in a function literal expression:
```d
On 01.07.2024 13:31, ryuukk_ wrote:
On Monday, 1 July 2024 at 10:20:25 UTC, drug007 wrote:
No problem, make a full string then mixin it.
Your "no problem" = lot of string concatenation therefore slower and
memory hungry, i have no desire to do that
Do you think that string concatenation is
Ok, i'll just do it and benchmark at the end
Another question:
Why doesn't this work?:
```D
mixin implement;
mixin template implement()
{
char[4096] buffer = 0;
int pos = 0;
void append(string str)
{
buffer[pos .. pos + str.length] = str[];
pos += str.length;
On 01.07.2024 15:26, ryuukk_ wrote:
Ok, i'll just do it and benchmark at the end
Another question:
Why doesn't this work?:
I'm pretty sure your code does not work the way you think it does.
String Mixins and Template Mixins are two different things. If you want
to use String Mixins just m
On Monday, 1 July 2024 at 13:00:55 UTC, ryuukk_ wrote:
i don't want string concatenation
This limitation is very intentional, add it to the pile like file
io in ctfe of stuff that the core devs think "you shouldnt even
want that" for "safety"
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 than the append() one
Mixin templates are a declaration s
On Monday, 1 July 2024 at 11:15:46 UTC, Nick Treleaven wrote:
On Monday, 1 July 2024 at 07:32:30 UTC, Dakota wrote:
this code give error:
```d
static if( !__traits(compiles, mixin("enum v = V;")) ) {
enum v = V;
}
```
__traits(compiles, ...) can't check if a declaration is valid
directl
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 = "Dr
14 matches
Mail list logo