newbie question

2024-10-31 Thread f via Digitalmars-d-learn
since i am converting from c# to d : 1. how to check template inheritance c# code interface I class A : I { void run(){}} class B : A {} void D\ (T t) : where T:B, new T() { t.run(); } d code //there should be has several check such as hasBase, hasImplements on std.traits void D(T) (int a) if

interfacing cpp

2024-10-22 Thread f via Digitalmars-d-learn
std.cpp -- #include \ #include \ #include \ using namespace std; void a(string a) { cout\<\<" hello " \<\libstdc++ std::__cxx11::basic_string is not yet supported; the struct contains an interior pointer which breaks D move semantics! but with options AA="-D_GLIBC

Re: assert

2024-09-10 Thread f via Digitalmars-d-learn
i mean , is this a bug?

assert

2024-09-10 Thread f via Digitalmars-d-learn
void main() { assert(false); } dmd -release a.d dmd version 2.109.1 debian bookworm x64 illegal instruction thanks

Converting a list of words or array of values to variables at compile time

2015-11-25 Thread Louie F via Digitalmars-d-learn
I found out that compile time optimization is quite useful specially for database queries, instead of it being generated at every call, it can be generated like I typed it using compile time optimizations... so I thought, Is it possible to convert an array of values or a list from a file to v

Re: How would you dive into a big codebase

2014-10-22 Thread Nicolas F via Digitalmars-d-learn
On Wednesday, 22 October 2014 at 02:09:53 UTC, Jonathan M Davis wrote: The usual suggestion that I've heard given (without any particular language in mind) is to start by tracking down and fixing a bug in it This is how I usually do it too, though you don't even need to find a bug in it. Picki

Re: generate unique variable names?

2014-10-08 Thread Nicolas F. via Digitalmars-d-learn
On Wednesday, 8 October 2014 at 02:53:08 UTC, K.K. wrote: On Wednesday, 8 October 2014 at 02:06:28 UTC, Brian Schott wrote: I'm 99% sure you actually want an array or associative array. Something like this maybe? ImageType[string] images; images[format("image%03d", i)] = new ImagefromFile(u

Re: How to detect start of Unicode symbol and count amount of graphemes

2014-10-06 Thread Nicolas F. via Digitalmars-d-learn
Unicode is hard to deal with properly as how you deal with it is very context dependant. One grapheme is a visible character and consists of one or more codepoints. One codepoint is one mapping of a byte sequence to a meaning, and consists of one or more bytes. This you do not want to deal with

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Nicolas F. via Digitalmars-d-learn
On Wednesday, 24 September 2014 at 16:36:29 UTC, csmith wrote: I came from web development, you're meaning to tell me there's coding outside of writing boilerplate? Jokes aside, figured if I took the time to learn a modern language, I'd be consistent with adding in newer technologies :) In t

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Nicolas F. via Digitalmars-d-learn
Whoops, I just saw that my earlier answer was totally inaccurate. I was on my phone at the time, so didn't look at the code in detail. On Wednesday, 24 September 2014 at 13:59:41 UTC, csmith wrote: On Wednesday, 24 September 2014 at 11:07:56 UTC, Mike Parker wrote: You're using deprecated OpenGL

Re: Trying to get Derelict.opengl3.gl3 and derelict.glfw3.glfw3 to work together

2014-09-24 Thread Nicolas F. via Digitalmars-d-learn
Make sure to call DerelictGL3.reload() to get "all" the OpenGL calls, if you don't, you only get OpenGL 1.1