Re: dub build doesn't work

2019-10-23 Thread OiseuKodeur via Digitalmars-d-learn
BTW if you prefer using optlink and the digitalmars C runtime, you can instruct dub to do so with: --arch=x86 how can i add --arch=x86 flag to the dub.json so it do it automatically ?

Re: dub build doesn't work

2019-10-23 Thread OiseuKodeur via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 22:06:28 UTC, SrMordred wrote: On Tuesday, 22 October 2019 at 22:14:02 UTC, OiseuKodeur wrote: Hello, i am having a problem with dub build with this project https://github.com/OiseauKodeur/cervelet/tree/master/source when i try to compile everything go well

Re: undefined symbol: _D3std7variant...

2019-10-23 Thread Johan via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 20:45:55 UTC, baz wrote: On Tuesday, 22 October 2019 at 13:07:54 UTC, Andrey wrote: On Tuesday, 22 October 2019 at 12:57:45 UTC, Daniel Kozak wrote: Have you try to clean all caches? Try to remove .dub folder I removed .dub folder but this error appears

Re: dub build doesn't work

2019-10-23 Thread SrMordred via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 22:14:02 UTC, OiseuKodeur wrote: Hello, i am having a problem with dub build with this project https://github.com/OiseauKodeur/cervelet/tree/master/source when i try to compile everything go well but when i click to run the .exe it give my an error missing

Re: dub build doesn't work

2019-10-23 Thread OiseuKodeur via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 18:37:10 UTC, kinke wrote: On Wednesday, 23 October 2019 at 16:55:37 UTC, OiseuKodeur wrote: On Wednesday, 23 October 2019 at 06:40:47 UTC, Seb wrote: You won't need Visual Studio for this, but something which ships msvcr100.dll. So sth. like this should be

Re: undefined symbol: _D3std7variant...

2019-10-23 Thread baz via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 13:07:54 UTC, Andrey wrote: On Tuesday, 22 October 2019 at 12:57:45 UTC, Daniel Kozak wrote: Have you try to clean all caches? Try to remove .dub folder I removed .dub folder but this error appears again. Try the "-allinst" option. It's possibly a bug with

Re: dub build doesn't work

2019-10-23 Thread kinke via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 16:55:37 UTC, OiseuKodeur wrote: On Wednesday, 23 October 2019 at 06:40:47 UTC, Seb wrote: You won't need Visual Studio for this, but something which ships msvcr100.dll. So sth. like this should be enough:

Re: ... use of ... is hidden by ...; use alias ... to introduce base class overload set ??

2019-10-23 Thread Ali Çehreli via Digitalmars-d-learn
On 10/23/2019 02:43 AM, Robert M. Münch wrote: >> Unfortunately, member function template instances are never virtual >> functions, so you can't override them. > > What I don't understand is: > > 1. The RX lib has a member function template and than an instance of it > using type Oberver!E. > >

Re: dub build doesn't work

2019-10-23 Thread OiseuKodeur via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 06:40:47 UTC, Seb wrote: On Tuesday, 22 October 2019 at 22:14:02 UTC, OiseuKodeur wrote: Hello, i am having a problem with dub build with this project https://github.com/OiseauKodeur/cervelet/tree/master/source when i try to compile everything go well but when

[DTrace probe] is there a [portable] way to add section to elf executable?

2019-10-23 Thread drug via Digitalmars-d-learn
I'd like to add (and modify) section to ELF executable to implement DTrace probes. DTrace does it in probe assembly: ``` __asm__ __volatile__ ( "990: nop .pushsection .note.stapsdt,\"?\",\"note\" .balign 4 .4byte 992f-991f, 994f-993f, 3 991: .asciz

Re: Eliding of slice range checking

2019-10-23 Thread kinke via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 13:08:34 UTC, Per Nordlöw wrote: Is it possible to remove cluttering? godbolt.org supports D as well and is way more powerful than run.dlang.io, besides offering way more LDC versions to choose from. It can also be used to remove the 'cluttering':

Re: Eliding of slice range checking

2019-10-23 Thread kinke via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 13:08:34 UTC, Per Nordlöw wrote: The ASM- and IR-output from the following code is pretty messy for You call this messy?! cmpq%rdi, %rdx jae .LBB0_2 xorl%eax, %eax retq .LBB0_2: movq%rdi, %rax testq

Re: Eliding of slice range checking

2019-10-23 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:33:56 UTC, kinke wrote: Simply check the IR or asm, e.g., on run.dlang.io. If there's a call to `_d_arraybounds` in the function of interest, bounds checks are enabled. The ASM- and IR-output from the following code is pretty messy for ldc with flags

Re: Eliding of slice range checking

2019-10-23 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:33:56 UTC, kinke wrote: For your example, the template is inferred to be @safe, and `-release` only elides bounds checks in @system functions (corresponding to `-boundscheck=safeonly`). Use `-boundscheck=off` to elide it in all functions. Thanks. But I'm

Re: Error: need this for method of type

2019-10-23 Thread Dennis via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:48:29 UTC, Dennis wrote: You can change `method(1)` into `x.method(1)` and it should work. Wait, but that's only because the local alias and member function have the same name 'method'. I think you just have to keep the method name as a string instead of

Re: Error: need this for method of type

2019-10-23 Thread Dennis via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:40:09 UTC, Márcio Martins wrote: This is a bug, right? If not, why, and how can I get around it and call `method`? An alias refers just to a symbol, in this case a member function of struct X. The fact that you polled it on instance 'x' is not something an

Error: need this for method of type

2019-10-23 Thread Márcio Martins via Digitalmars-d-learn
Hi! Consider this simplified program: ``` import std.stdio; struct X { void method(int x) { writeln("method called"); } } void main() { X x; foreach (member; __traits(allMembers, X)) { alias method = __traits(getMember, x, member); method(1); } }

Re: Eliding of slice range checking

2019-10-23 Thread kinke via Digitalmars-d-learn
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote: How can I investigate the codegen myself here? Simply check the IR or asm, e.g., on run.dlang.io. If there's a call to `_d_arraybounds` in the function of interest, bounds checks are enabled. For your example, the template

Eliding of slice range checking

2019-10-23 Thread Per Nordlöw via Digitalmars-d-learn
Does DMD/LDC avoid range-checking in slice-expressions such as the one in my array-overload of `startsWith` defined as bool startsWith(T)(scope const(T)[] haystack, scope const(T)[] needle) { if (haystack.length >= needle.length) { return haystack[0 ..

Re: What do you think about About C++20 Concepts?

2019-10-23 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 14:30:32 UTC, lili wrote: Hi: In C++20 Concepts is great idear. but I thinks it is too difficult to write. I like Rust traits simple and elegancy. Andrei Alexandrescou's keynote from CppCon 2018 [1] explains why D's existing template restrictions

Re: ... use of ... is hidden by ...; use alias ... to introduce base class overload set ??

2019-10-23 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-10-22 20:59:41 +, Ali ‡ehreli said: That says "private paste" for me. Ups, sorry and thanks for letting me know. But I think you have a member function template in the base class. This the lib I use: https://github.com/lempiji/rx/blob/dev/source/rx/subject.d and which

Re: dub build doesn't work

2019-10-23 Thread Seb via Digitalmars-d-learn
On Tuesday, 22 October 2019 at 22:14:02 UTC, OiseuKodeur wrote: Hello, i am having a problem with dub build with this project https://github.com/OiseauKodeur/cervelet/tree/master/source when i try to compile everything go well but when i click to run the .exe it give my an error missing