Re: How can I execute C++ functions from Dlang?

2023-08-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 14 August 2023 at 06:40:04 UTC, thePengüin wrote: hola a todos quisiera ejecutar este codigo de c++ ` #include \ using namespace std; int main() { return 0; } int foo(int i, int j) { cout \<\< i\<\ ?Tu usas ambos de 64 bit o 32 bit para compiladores? No pu

Re: How can I execute C++ functions from Dlang?

2023-08-14 Thread Sergey via Digitalmars-d-learn
On Monday, 14 August 2023 at 06:40:04 UTC, thePengüin wrote: hola a todos quisiera ejecutar este codigo de c++ Error: linker exited with status 1 Hola. On the page https://dlang.org/spec/cpp_interface.html commands to run also have different flags. Did you try them? g++ -c foo.cpp dmd bar.d fo

Re: std.experimental.allocator

2023-08-14 Thread IchorDev via Digitalmars-d-learn
On Sunday, 13 August 2023 at 16:00:51 UTC, Richard (Rikki) Andrew Cattermole wrote: Yeah you're right Ternary should probably be replaced, although amazingly it has never caused problems so far. But I cannot agree about RAII. Its a valid tool for managing lifetimes of memory allocators. Memory

Re: std.experimental.allocator

2023-08-14 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 13 August 2023 at 16:10:32 UTC, ryuukk_ wrote: Core API should subscribe to the premise: give memory allocation control (and therefore dealocation) back to the user I'm not sure about why RAII is an issue, but I fully agree with your stance about a simpler allocator, and one we

Adding to a global AliasSeq

2023-08-14 Thread repr_man via Digitalmars-d-learn
Consider the following template mixin: ```d mixin template Base() { int x(){ return 10; } } ``` It could be used in a variety of structs as follows: ```d struct Child { mixin Base!(); } ``` Now, let's suppose we write a function with a parameter that should only be able to take items that