Re: BetterC issues with ErupteD Vulkan binding typedef handles

2020-12-20 Thread ParticlePeter via Digitalmars-d-learn
[snip] Forgot to add another question. The mentioned error message is not too helpful in locating the real offended code. Is there a way to get more information or additional hints about the actual cause of the problem?

Re: BetterC issues with ErupteD Vulkan binding typedef handles

2020-12-20 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 20 December 2020 at 15:52:39 UTC, Adam D. Ruppe wrote: On Sunday, 20 December 2020 at 15:45:59 UTC, ParticlePeter wrote: VkSemaphore[] wait_semaphores = [], // error: TypeInfo required does it still error if you just use = null? they work the same way but

BetterC issues with ErupteD Vulkan binding typedef handles

2020-12-20 Thread ParticlePeter via Digitalmars-d-learn
Hello, I am experimenting with betterC and Vulkan through Erupted [0] binding, but unfortunately I find myself hunting down these kind of errors: ..\ErupteD\source\erupted\types.d-mixin-77(77,1): Error: `TypeInfo` cannot be used with -betterC The issue is with Vulkan type handles. One such

Re: dub run subPackage by default

2020-09-01 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 1 September 2020 at 14:45:43 UTC, Andre Pany wrote: On Tuesday, 1 September 2020 at 11:45:34 UTC, ParticlePeter wrote: [snip] I have a enhancement for dub in my mind, which would also solve your issue. Similiar to setup.py in python you would be able to define an entry point in

dub run subPackage by default

2020-09-01 Thread ParticlePeter via Digitalmars-d-learn
Hello, I have a targetType sourceLibrary and demonstrate its usage through a subPackage. For the library itself 'dub run' is meaningless, but not for the subPackage. Is there a way to tell dub through dub.sdl or dub.json to build and run a specific subPackage by default, without having to

Re: How to create DDoc for string mixin generated functions?

2019-11-28 Thread ParticlePeter via Digitalmars-d-learn
On Thursday, 28 November 2019 at 14:00:56 UTC, Adam D. Ruppe wrote: On Wednesday, 27 November 2019 at 15:14:21 UTC, ParticlePeter wrote: I judged it being the least feasible to produce appropriate doc comments. How could this work? Just like: /// Forwards members to [Whatever] auto

Re: How to create DDoc for string mixin generated functions?

2019-11-28 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 27 November 2019 at 15:14:21 UTC, ParticlePeter wrote: On Tuesday, 26 November 2019 at 19:41:26 UTC, Adam D. Ruppe wrote: On Tuesday, 26 November 2019 at 19:27:55 UTC, ParticlePeter wrote: In may case I use the string mixin to forward outer struct property calls to members of an

Re: How to create DDoc for string mixin generated functions?

2019-11-27 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 November 2019 at 19:41:26 UTC, Adam D. Ruppe wrote: On Tuesday, 26 November 2019 at 19:27:55 UTC, ParticlePeter wrote: In may case I use the string mixin to forward outer struct property calls to members of an inner struct. Did you try opDispatch btw? It might be simpler to

Re: How to create DDoc for string mixin generated functions?

2019-11-26 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 November 2019 at 13:02:39 UTC, Jonathan M Davis wrote: On Monday, November 25, 2019 9:25:08 AM MST ParticlePeter via ... - Jonathan M Davis Thanks for that thorough explanation. In may case I use the string mixin to forward outer struct property calls to members of an inner

Anything like HPPTOD out there?

2019-11-25 Thread ParticlePeter via Digitalmars-d-learn
I would like to auto convert c++ header to d module. Is there some project aiming for this? I know of VisualD c++ to d conversion wizzard [1] and LLVM tooling based CPP2D [2], both of them aiming for whole cpp conversion. But I a searching for something lightweight like HTOD extended to C++.

How to create DDoc for string mixin generated functions?

2019-11-25 Thread ParticlePeter via Digitalmars-d-learn
I am producing a bunch of functions/methods through string mixins. I also generated DDoc comments for those functions, in the hope that they would produce proper documentation, but they don't. So how can this be accomplished?

ErupteD v2.0 + Vulkan v1.1 breaking changes and NEW transition strategy

2018-03-27 Thread ParticlePeter via Digitalmars-d-announce
The deprecated ErupteD was un-deprecated again. Version v2.0 comes with Vulkan 1.1 support and breaking changes regarding its dependency mechanism. Details in the projects dub and github [0] pages. Regarding [1]: ErupteD-V1 will be destroyed, ErupteD-V2 continued to implement a valid

Re: Vulkan ErupteD breaking changes and transition strategy

2018-03-27 Thread ParticlePeter via Digitalmars-d-announce
On Sunday, 25 March 2018 at 22:23:06 UTC, Peter Particle wrote: ErupteD [0] is deprecated (one of its major modules). [snip] Rewind and Undo --- I must apologize for the mess I have created, ErupteD is un-deprecated again. It will be further developed until ErupteD-V2 has a

Re: Vulkan ErupteD breaking changes and transition strategy

2018-03-26 Thread ParticlePeter via Digitalmars-d-announce
On Monday, 26 March 2018 at 12:22:25 UTC, Anton Fediushin wrote: On Monday, 26 March 2018 at 11:13:03 UTC, ParticlePeter wrote: [snip] Here I was hoping for a little more attentive reading, the bugfix (if any bugs happen in the end) for v1.1.70 would be v1.1.71 (as in "point seven ONE")

Re: Vulkan ErupteD breaking changes and transition strategy

2018-03-26 Thread ParticlePeter via Digitalmars-d-announce
On Monday, 26 March 2018 at 09:50:16 UTC, Anton Fediushin wrote: On Monday, 26 March 2018 at 09:20:13 UTC, ParticlePeter wrote: First of all, don't worry, don't panic, we will figure it out, together ;-). Everything will be alright in the end, and if not, its not the end. [snip] The bug then

Re: Vulkan ErupteD breaking changes and transition strategy

2018-03-26 Thread ParticlePeter via Digitalmars-d-announce
First of all, don't worry, don't panic, we will figure it out, together ;-). Everything will be alright in the end, and if not, its not the end. On Monday, 26 March 2018 at 07:04:00 UTC, Anton Fediushin wrote: 1. This breaks semver. You shouldn't just use Vulkan's versions. If you release

Re: mixed in struct constructor is ignored when another (non mixed in) constructor is specified

2018-02-26 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 26 February 2018 at 14:42:58 UTC, Adam D. Ruppe wrote: On Monday, 26 February 2018 at 14:38:22 UTC, ParticlePeter wrote: This cool, I didn't know that we can name mixins when instantiating but also never taught that there could be any purpose for naming. Works, thanks. oh yes,

Re: mixed in struct constructor is ignored when another (non mixed in) constructor is specified

2018-02-26 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 26 February 2018 at 14:02:56 UTC, Adam D. Ruppe wrote: On Monday, 26 February 2018 at 12:30:24 UTC, ParticlePeter wrote: Is this expected behavior? yes sort of, but there are bugs associated with it too... I wrote about this in the "Tip of the Week" section here before

Re: mixed in struct constructor is ignored when another (non mixed in) constructor is specified

2018-02-26 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 26 February 2018 at 12:47:48 UTC, Jonathan M Davis wrote: On Monday, February 26, 2018 12:30:24 ParticlePeter via Digitalmars-d-learn wrote: mixin template Common() { private int m_member; this( int m ) { m_member = m; } } struct Foo { mixin Common; } struct Bar { mixin

mixed in struct constructor is ignored when another (non mixed in) constructor is specified

2018-02-26 Thread ParticlePeter via Digitalmars-d-learn
mixin template Common() { private int m_member; this( int m ) { m_member = m; } } struct Foo { mixin Common; } struct Bar { mixin Common; this( int m, float n ) { m_member = m * n; } } auto foo = Foo(1); // ok auto b_1 = Bar( 1, 2 ); // ok auto b_2 = Bar( 3 ); // Error:

Re: How to instantiate a template struct with a template constructor without relying on auto deduction?

2018-02-21 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 21 February 2018 at 14:29:31 UTC, Simen Kjærås wrote: On Wednesday, 21 February 2018 at 14:11:10 UTC, ParticlePeter wrote: struct Foo(T) { T bar; this(S)(S s) { bar = convert(s); } } auto foo = Foo!int(some_float); this works because S is deduced as

How to instantiate a template struct with a template constructor without relying on auto deduction?

2018-02-21 Thread ParticlePeter via Digitalmars-d-learn
struct Foo(T) { T bar; this(S)(S s) { bar = convert(s); } } auto foo = Foo!int(some_float); this works because S is deduced as typeof(some_float), but how would I instantiate the struct without relying on auto deduction? Suppose we would have this kind of constructor where auto

Re: Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 17 December 2017 at 20:09:02 UTC, ParticlePeter wrote: On Sunday, 17 December 2017 at 19:29:00 UTC, ParticlePeter wrote: On Sunday, 17 December 2017 at 19:16:02 UTC, ParticlePeter [snip] LINKCMD=%VCINSTALLDIR%\bin\HostX32\x64\link.exe or

Re: Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 17 December 2017 at 19:29:00 UTC, ParticlePeter wrote: On Sunday, 17 December 2017 at 19:16:02 UTC, ParticlePeter wrote: On Sunday, 17 December 2017 at 17:56:47 UTC, John wrote: I don't think so, all that would need to be changed is this line:

Re: Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 17 December 2017 at 19:16:02 UTC, ParticlePeter wrote: On Sunday, 17 December 2017 at 17:56:47 UTC, John wrote: I don't think so, all that would need to be changed is this line: https://github.com/dlang/dmd/blob/v2.077.1/ini/windows/bin/sc.ini#L53 Not very many people use it I

Re: Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 17 December 2017 at 17:56:47 UTC, John wrote: I don't think so, all that would need to be changed is this line: https://github.com/dlang/dmd/blob/v2.077.1/ini/windows/bin/sc.ini#L53 Not very many people use it I guess if it's been there for 8 months lol. Hm, actually that line

Re: Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 17 December 2017 at 16:40:46 UTC, John wrote: Yah the sc.ini file is wrong for Environment64. [Environment64] LIB="%@P%\..\lib64" . . . ; Windows installer uncomments the version detected LINKCMD=%VCINSTALLDIR%\bin\HostX86\x86\link.exe Thanks! Is this a known, reported bug?

Re: Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 17 December 2017 at 15:57:08 UTC, ParticlePeter wrote: I upgraded from DMD 2.074.1 (!) to 2.077.1 and tried to compile a mixed c++/d project (DMD links to one c++ lib). Here is the full error message: Forgot most important info, ita an x64 project those used VS linker by default

Linker error since upgrade to DMD 2.077.1: fatal error C1905: Front end and back end not compatible

2017-12-17 Thread ParticlePeter via Digitalmars-d-learn
I upgraded from DMD 2.074.1 (!) to 2.077.1 and tried to compile a mixed c++/d project (DMD links to one c++ lib). Here is the full error message: fatal error C1905: Front end and back end not compatible (must target same processor). LINK : fatal error LNK1257: code generation failed Error:

Re: How you guys go about -BetterC Multithreading?

2017-11-27 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 10 November 2017 at 11:55:57 UTC, Guillaume Piolat wrote: For now we do have some @nogc alternatives for mutex, condition variables, thread-pool, file reading, etc... (dplug:core package) for use with the runtime disabled - the middle ground that's way more usable than -betterC.

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread ParticlePeter via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:19:00 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports or general suggestions? I've used only D threads so far. It would be far easier if you use druntime + @nogc and/or

Re: How you guys go about -BetterC Multithreading?

2017-11-09 Thread ParticlePeter via Digitalmars-d-learn
On Thursday, 9 November 2017 at 12:43:54 UTC, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 12:30:49 UTC, rikki cattermole wrote: On 09/11/2017 12:19 PM, Petar Kirov [ZombineDev] wrote: On Thursday, 9 November 2017 at 11:08:21 UTC, ParticlePeter wrote: Any experience reports

How you guys go about -BetterC Multithreading?

2017-11-09 Thread ParticlePeter via Digitalmars-d-learn
Any experience reports or general suggestions? I've used only D threads so far.

Re: DCompute is now in the master branch of LDC

2017-05-31 Thread ParticlePeter via Digitalmars-d-announce
On Tuesday, 30 May 2017 at 18:06:56 UTC, Walter Bright wrote: On 5/30/2017 5:12 AM, Nicholas Wilson wrote: Ah, isn't English wonderful. I guess Walter is suffering the inverse of the Calvin & Hobbes "Verbing nouns weirds the language", nouning verbs does weird the language, but only to those

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 22 May 2017 at 14:01:56 UTC, Jerry wrote: IIRC the problem is that it isn't a POD type. ImVec2 has its own default constructor. The problem now is that because it no longer is POD, Window's ABI handles it different and doesn't put the value in a register. Now with D is that you

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 22 May 2017 at 13:03:17 UTC, evilrat wrote: On Monday, 22 May 2017 at 11:25:31 UTC, ParticlePeter wrote: Then I am not getting your hack, this function here, does not exist on the C++ side. HACK --- // extern(C++) of course void GetCursorPos(ImVec2* v);

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 22 May 2017 at 08:25:45 UTC, evilrat wrote: On Monday, 22 May 2017 at 08:03:07 UTC, ParticlePeter wrote: No, no, this (other) way around :-), still C++ to D. It actually works btw: HACK --- // original C++ ImVec2 GetCursorPos(); // C++ helper void

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 22 May 2017 at 07:24:20 UTC, evilrat wrote: On Monday, 22 May 2017 at 06:33:37 UTC, ParticlePeter wrote: On Monday, 22 May 2017 at 01:39:04 UTC, evilrat wrote: And this is actually D problem. In fact first bug report on this thing was dated back to 2014. Still not fixed. Thanks

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 22 May 2017 at 01:39:04 UTC, evilrat wrote: On Monday, 22 May 2017 at 01:27:22 UTC, Nicholas Wilson wrote: Probably because the D side is expecting to have the struct returned in a pointer allocated by the callee and then the C++ puts it in regs and BOOM. If you wrap the C++

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 22 May 2017 at 01:27:22 UTC, Nicholas Wilson wrote: On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote: I am statically linking to ImGui [1] on Win 10 x64, quite successfully till this issue came up. The noticed error so far comes when an ImGui function returns an ImVec2, a

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-21 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 21 May 2017 at 19:58:32 UTC, Stefan Koch wrote: On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote: I am statically linking to ImGui [1] on Win 10 x64, quite successfully till this issue came up. The noticed error so far comes when an ImGui function returns an ImVec2, a

C++ binding issues with C++ function returning a simple POD struct.

2017-05-21 Thread ParticlePeter via Digitalmars-d-learn
I am statically linking to ImGui [1] on Win 10 x64, quite successfully till this issue came up. The noticed error so far comes when an ImGui function returns an ImVec2, a simple POD struct of two float members. I can use this struct as argument to functions but when it is returned from a

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 29 April 2017 at 10:17:47 UTC, Atila Neves wrote: On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote: On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote: On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote: [...] The worst part about that is mangling

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson wrote: If you are having problems with the linker with Ali's you can do ``` extern(C++) bool cppFunc( float[3] color ); // correct signature, but causes compiler error pragma(mangle, cppFunc.mangleof) float cppFunc(float * color);

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote: On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote: On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote: Interesting, your example corresponds to my third case, the linker error. I am on Window, building an x64 App,

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote: On 04/28/2017 08:56 AM, ParticlePeter wrote: > C++ Function: > bool cppFunc( float[3] color ); > > D binding: > extern(C++) bool cppFunc( float[3] color ); > > Using with: > float[3] my_color; > cppFunc( my_color ); > > -> Error:

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 28 April 2017 at 17:57:34 UTC, Ali Çehreli wrote: On 04/28/2017 08:56 AM, ParticlePeter wrote: > C++ Function: > bool cppFunc( float[3] color ); > > D binding: > extern(C++) bool cppFunc( float[3] color ); > > Using with: > float[3] my_color; > cppFunc( my_color ); > > -> Error:

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
On Friday, 28 April 2017 at 17:15:54 UTC, kinke wrote: On Friday, 28 April 2017 at 15:56:17 UTC, ParticlePeter wrote: So what next? How can I interface to the cpp function? *** C++: bool cppFunc(float ()[3]) { color[0] = 1; color[1] = 2; color[2] = 3; return true; } *** D:

C++ Interfacing:'static' array function parameter contradiction

2017-04-28 Thread ParticlePeter via Digitalmars-d-learn
C++ Function: bool cppFunc( float[3] color ); D binding: extern(C++) bool cppFunc( float[3] color ); Using with: float[3] my_color; cppFunc( my_color ); -> Error: Internal Compiler Error: unable to pass static array to extern(C++) function. Error: Use pointer instead. Using with: cppFunc(

Re: How to overload member function pointer and a regualr member function

2017-04-26 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 26 April 2017 at 08:24:08 UTC, Basile B. wrote: On Tuesday, 25 April 2017 at 18:58:58 UTC, Ali Çehreli wrote: On 04/25/2017 11:54 AM, Ali Çehreli wrote: My analysis is wrong because that writefln() is for the bar(float) overload but I still think what you want is achieved. Ali

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 16:27:43 UTC, Basile B. wrote: On Tuesday, 25 April 2017 at 15:43:48 UTC, ParticlePeter wrote: On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote: On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote: Thanks for your reply, but that's what I

Re: How to overload member function pointer and a regualr member function

2017-04-25 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 09:50:14 UTC, Basile B. wrote: On Monday, 24 April 2017 at 16:46:21 UTC, ParticlePeter wrote: I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) {

How to overload member function pointer and a regualr member function

2017-04-24 Thread ParticlePeter via Digitalmars-d-learn
I would like to have this kind of struct: struct Foo { private int i; void function( int i, float f ) bar; // will be defined at runtime void bar( float f ) { bar( i, f ); } } But apparently the function pointer and the member function cannot have the same name: Error: function

Re: Search elemnt in Compile-time Argument List of strings

2016-07-26 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 21:20:18 UTC, ParticlePeter wrote: ... First of all there seems to be a typo, it should not be: else static if(i + 1 == arg.length) ignore must be used instead of arg, as arg.length is the length of a string: else static if(i + 1 == ignore.length) if ignore is

Re: Search elemnt in Compile-time Argument List of strings

2016-07-26 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 21:01:19 UTC, Ali Çehreli wrote: On 07/26/2016 01:58 PM, ParticlePeter wrote: On Tuesday, 26 July 2016 at 20:18:48 UTC, Steven Schveighoffer wrote: ... void processMember( T, ignore... )() { foreach( member; __traits( allMembers, T )) { // this is a compile-time

Re: Search elemnt in Compile-time Argument List of strings

2016-07-26 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 20:18:48 UTC, Steven Schveighoffer wrote: ... void processMember( T, ignore... )() { foreach( member; __traits( allMembers, T )) { // this is a compile-time list, so it's a static foreach. foreach(i, arg; ignore ){ // i is the index into the ignore tuple

Re: Search elemnt in Compile-time Argument List of strings

2016-07-26 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 20:18:48 UTC, Steven Schveighoffer wrote: ... Thanks a lot for this really cool and detailed explanation (upvoting!). It's a bit weird to work on these compile-time things, but they are so cool when you look at what is available in std.meta and std.traits :)

Re: Search elemnt in Compile-time Argument List of strings

2016-07-26 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 19:30:18 UTC, ParticlePeter wrote: // Second approach, get warnings for every skipped member // and every line after the return statement: // Warning: statement is not reachable void processMember( T, ignore... )() { foreach( member; __traits( allMembers, T )) {

Search elemnt in Compile-time Argument List of strings

2016-07-26 Thread ParticlePeter via Digitalmars-d-learn
I want to generate one function for any struct data member, but also want to be able to skip few of the members. The first part works, but I have some trouble with the skipping. I pass the struct type and a Compile-time Argument List of strings as template arguments to a template function,

Re: Transform/Compile to C/CPP as a target

2016-07-24 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 23 July 2016 at 19:20:10 UTC, Jacob Carlborg wrote: On 2016-07-23 14:27, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? No idea about the status but: https://github.com/adamdruppe/tools/blob/dtoh/dtoh.d Thanks, I am looking

Re: Transform/Compile to C/CPP as a target

2016-07-23 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 23 July 2016 at 12:29:45 UTC, rikki cattermole wrote: On 24/07/2016 12:27 AM, ParticlePeter wrote: Is there any kind of project or workflow that converts D (subset) to C/CPP ? This probably will interest you for ldc:

Transform/Compile to C/CPP as a target

2016-07-23 Thread ParticlePeter via Digitalmars-d-learn
Is there any kind of project or workflow that converts D (subset) to C/CPP ?

Re: Enum that can be 0 or null

2016-06-07 Thread ParticlePeter via Digitalmars-d-learn
On Tuesday, 7 June 2016 at 14:31:40 UTC, Alex Parrill wrote: I don't think opCast gets called for implicit conversions; it only gets called for explicit casts. I'll test it later. It does for type bool, but I fear that's the only exception.

Re: Enum that can be 0 or null

2016-06-06 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 6 June 2016 at 20:32:23 UTC, Alex Parrill wrote: They'd be the same type, since you would define the vulkan functions to take these structures instead of pointer or integer types. It relies on a lot of assumptions about the ABI that make a raw pointer work the same as a structure

Re: Enum that can be 0 or null

2016-06-06 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 21 May 2016 at 06:36:53 UTC, tsbockman wrote: ... As an example, if VK_NULL_HANDLE only ever needs to be assigned to opaque types on the D side (that is, types that serve only as an ID or address for communicating with the C side), you could do this: private struct VkNullHandle

Re: Emulate C's (polymorphic) NULL type

2016-06-06 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 6 June 2016 at 18:33:36 UTC, ParticlePeter wrote: On Monday, 6 June 2016 at 16:19:02 UTC, Alex Parrill wrote: On Monday, 6 June 2016 at 09:43:23 UTC, ParticlePeter wrote: In C NULL can be used as integer as well as null pointer. Is there a way to create such a type in D? The type

Re: Emulate C's (polymorphic) NULL type

2016-06-06 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 6 June 2016 at 16:19:02 UTC, Alex Parrill wrote: On Monday, 6 June 2016 at 09:43:23 UTC, ParticlePeter wrote: In C NULL can be used as integer as well as null pointer. Is there a way to create such a type in D? The type should have only one value which is obviously (0/null). A

Re: Emulate C's (polymorphic) NULL type

2016-06-06 Thread ParticlePeter via Digitalmars-d-learn
On Monday, 6 June 2016 at 11:40:11 UTC, Anonymouse wrote: On Monday, 6 June 2016 at 09:43:23 UTC, ParticlePeter wrote: In C NULL can be used as integer as well as null pointer. Is there a way to create such a type in D? The type should have only one value which is obviously (0/null). A

Emulate C's (polymorphic) NULL type

2016-06-06 Thread ParticlePeter via Digitalmars-d-learn
In C NULL can be used as integer as well as null pointer. Is there a way to create such a type in D? The type should have only one value which is obviously (0/null). A extern( C ) function should be able to take it as either one. Overloaded enum pops into my mind as example: enum NULL = 0; enum

Re: Why does std.container.array does not work with foraech( i, a; array ) {} ?

2016-05-29 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 29 May 2016 at 09:07:07 UTC, Jonathan M Davis wrote: On Sunday, May 29, 2016 07:14:12 ParticlePeter via Digitalmars-d-learn wrote: Which of the op(Index) operators is responsible for enabling this kind of syntax? Would it be possible to get it work with UFCS or would I have

Why does std.container.array does not work with foraech( i, a; array ) {} ?

2016-05-29 Thread ParticlePeter via Digitalmars-d-learn
Which of the op(Index) operators is responsible for enabling this kind of syntax? Would it be possible to get it work with UFCS or would I have to wrap the array?

Introspect alias name of an aliased type

2016-05-23 Thread ParticlePeter via Digitalmars-d-learn
alias uint32_t = uint; struct Offset() { uint32_t x; uint32_t y; } // Introspect with: void printStructInfo( T )( T info ) { import std.stdio : writefln; foreach (memb; __traits(allMembers, T)) { writefln(typeof(__traits(getMember, info, memb)).stringof); } } // Result is uint

Re: Game Development Using D

2016-05-21 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 21 May 2016 at 16:01:26 UTC, Stefan Koch wrote: On Saturday, 21 May 2016 at 15:53:18 UTC, David wrote: Hi, I want to try to create a game using D. I'm a complete newbie though (other than having C/C++ experience). Where would I start? Does D have an openGL binding? I am assuming

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-21 Thread ParticlePeter via Digitalmars-d
Test worked, now supporting dub packages xcb-d, xlib-d, wayland-client-d.

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-21 Thread ParticlePeter via Digitalmars-d
On Friday, 20 May 2016 at 18:52:35 UTC, maik klein wrote: On Thursday, 19 May 2016 at 15:44:27 UTC, ParticlePeter wrote: I am a bit slow, how do I add xcb as a dependency? /source/erupted/types.d(3335,16): Error: module xcb is in file 'xcb/xcb.d' which cannot be read Can I add dependencies

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-19 Thread ParticlePeter via Digitalmars-d
On Wednesday, 18 May 2016 at 20:28:09 UTC, Manuel König wrote: Am Wed, 18 May 2016 18:57:48 + schrieb ParticlePeter : On Wednesday, 18 May 2016 at 15:09:50 UTC, Mike Parker wrote: > On Wednesday, 18 May 2016 at 13:26:14 UTC, Manuel König > wrote: > >> I think I will

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-19 Thread ParticlePeter via Digitalmars-d
On Thursday, 19 May 2016 at 00:09:42 UTC, Alex Parrill wrote: Apparently GitHub didn't add my own repo to my list of watch repos, meaning no notifications for them... I'll look over the pull request. Let's not split this project. Depends on how far you want to catch up. Lets discuss this in

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-18 Thread ParticlePeter via Digitalmars-d
On Wednesday, 18 May 2016 at 15:09:50 UTC, Mike Parker wrote: On Wednesday, 18 May 2016 at 13:26:14 UTC, Manuel König wrote: I think I will use glfw3 later. I don't know if the original problem of using multiple configurations (xcb, xlib, glfw3, ...) is possible with only dub's internal

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-17 Thread ParticlePeter via Digitalmars-d
On Tuesday, 17 May 2016 at 16:17:39 UTC, Manuel König wrote: had to update the function loading names I chose differently. This bugged me a little, v1.1.0 has the EruptedLoader struct removed so that the loading functions are called without EruptedLoader. prefix and can be renamed at

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-17 Thread ParticlePeter via Digitalmars-d
On Tuesday, 17 May 2016 at 20:34:17 UTC, Manuel König wrote: > What I want to do is to tell dub that erupted should depend > on xcb-d in my project's dub.json, is that possible? I am not very confident with dub, but think that it would not work. Maybe you ask in the dub forum? [...]

Re: Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-17 Thread ParticlePeter via Digitalmars-d
On Tuesday, 17 May 2016 at 16:17:39 UTC, Manuel König wrote: Hi, Kalua here :) First, thanks again for fixing vulkanizeD, now I don't have to use my locally patched version anymore ;) Welcome :-) Giving you some input for how your lib works on my posix sytem (arch linux): My simple

Discuss vulkan erupted, the other auto-generated vulkan binding

2016-05-16 Thread ParticlePeter via Digitalmars-d
This is in respect to announce thread: https://forum.dlang.org/post/mdpjqdkenrnuxvruw...@forum.dlang.org Please let me know if you had the chance to test the functionality as requested in the announce thread. All other question are welcome here as well of course. Cheers, ParticlePeter

Re: Anonther auto-generated vulkan binding

2016-05-16 Thread ParticlePeter via Digitalmars-d-announce
Please discuss here: https://forum.dlang.org/post/mclrqnwwrhmbxumgj...@forum.dlang.org

Anonther auto-generated vulkan binding

2016-05-16 Thread ParticlePeter via Digitalmars-d-announce
ErupteD is based on D-Vulkan, but goes further: * Platform surface extensions * DerelictLoader for Posix Systems * With respect to [API without Secrets](https://software.intel.com/en-us/api-without-secrets-introduction-to-vulkan-part-1) D-Vulkan function loading system is partially broken

Cannot link daimos glfw using x64

2016-05-01 Thread ParticlePeter via Digitalmars-d-learn
I am failing to link statically to glfw library with deimos glfw. The repo includes an example for glfw2. I downloaded the latest glfw2.lib and tried build the example with -m64 and got these errors: C:\ ... \deimos-glfw>dmd GLFW.lib examples/glfw2/openwindow/openwindow.d -m64

Re: Getting all struct members and values with introspection avoiding string mixins

2016-05-01 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 1 May 2016 at 10:13:47 UTC, H. S. Teoh wrote: On Sun, May 01, 2016 at 09:42:37AM +, ParticlePeter via Digitalmars-d-learn wrote: I am logging arbitrary POD struct types with member names and data: void printStructInfo( T )( T info ) { foreach( i, A; typeof( T.tupleof

Getting all struct members and values with introspection avoiding string mixins

2016-05-01 Thread ParticlePeter via Digitalmars-d-learn
I am logging arbitrary POD struct types with member names and data: void printStructInfo( T )( T info ) { foreach( i, A; typeof( T.tupleof )) { enum attribName = T.tupleof[i].stringof; writefln( "%s : %s", attribName, mixin( "info." ~ attribName )); } } Is there is some other way

Re: What is the state of multiple alias this (DIP66) ?

2016-04-10 Thread ParticlePeter via Digitalmars-d
On Sunday, 10 April 2016 at 14:34:17 UTC, hilop wrote: On Sunday, 10 April 2016 at 14:28:35 UTC, ParticlePeter wrote: Last modification was about one and a half years ago, is it going somewhere? read this: https://github.com/D-Programming-Language/dmd/pull/3998 tl;dr the state right now

What is the state of multiple alias this (DIP66) ?

2016-04-10 Thread ParticlePeter via Digitalmars-d
Last modification was about one and a half years ago, is it going somewhere?

Re: std.format.formattedRead docs example does not work with a string literal as input, why?

2016-03-31 Thread ParticlePeter via Digitalmars-d-learn
On Thursday, 31 March 2016 at 18:25:45 UTC, H. S. Teoh wrote: On Thu, Mar 31, 2016 at 06:23:21PM +, ParticlePeter via Digitalmars-d-learn wrote: Example from docs: string s = "hello!124:34.5"; string a; int b; double c; formattedRead(s, "%s!%s:%s", , , ); assert(a ==

std.format.formattedRead docs example does not work with a string literal as input, why?

2016-03-31 Thread ParticlePeter via Digitalmars-d-learn
Example from docs: string s = "hello!124:34.5"; string a; int b; double c; formattedRead(s, "%s!%s:%s", , , ); assert(a == "hello" && b == 124 && c == 34.5); now changing the first formattedRead argument to a string literal: formattedRead("hello!124:34.5", "%s!%s:%s", , , ); results in this

Re: Does something like std.algorithm.iteration:splitter with multiple seperators exist?

2016-03-27 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 23 March 2016 at 20:00:55 UTC, wobbles wrote: Again, totally untested, but I think logically it should work. ( No D compiler on this machine so it mightn't even compile :] ) Thanks Wobbles, I took your approach. There were some minor issues, here is a working version: auto

Re: Does something like std.algorithm.iteration:splitter with multiple seperators exist?

2016-03-23 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 23 March 2016 at 15:23:38 UTC, Simen Kjaeraas wrote: Without a bit more detail, it's a bit hard to help. std.algorithm.splitter has an overload that takes a function instead of a separator: import std.algorithm; auto a = "a,b;c"; auto b = a.splitter!(e => e == ';'

Re: Does something like std.algorithm.iteration:splitter with multiple seperators exist?

2016-03-23 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 23 March 2016 at 14:20:12 UTC, Andrea Fontana wrote: Any input => output example? Sure, it is ensight gold case file format: FORMAT type: ensight gold GEOMETRY model: 1exgold2.geo** VARIABLE scalar per node: 1 Stress

Re: Does something like std.algorithm.iteration:splitter with multiple seperators exist?

2016-03-23 Thread ParticlePeter via Digitalmars-d-learn
On Wednesday, 23 March 2016 at 11:57:49 UTC, ParticlePeter wrote: Stupid typos: I need to parse an ascii file with multiple tokens. ... ... to do this with a lazy result range and without new allocations.

Does something like std.algorithm.iteration:splitter with multiple seperators exist?

2016-03-23 Thread ParticlePeter via Digitalmars-d-learn
I need to parse an ascii with multiple tokens. The tokens can be seen as keys. After every token there is a bunch of lines belonging to that token, the values. The order of tokens is unknown. I would like to read the file in as a whole string, and split the string with: splitter(fileString,

Re: How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread ParticlePeter via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:28:33 UTC, JR wrote: On Sunday, 13 March 2016 at 20:13:03 UTC, Basile B. wrote: On Sunday, 13 March 2016 at 20:10:57 UTC, Basile B. wrote: [...] Basile beat me to it. Yes, ref const(Array!T) accessor. http://dpaste.dzfl.pl/cb2bc5cf9917 Thank you very much,

How to return a const handle (view) to a mutable member of an agregate

2016-03-13 Thread ParticlePeter via Digitalmars-d-learn
I have a struct that privately warps an std.container.array. I would like to return a read-only reference of this array, it should not be duplicated. How can I do this? Cheers, ParticlePeter

Re: Vulkan bindings

2016-02-20 Thread ParticlePeter via Digitalmars-d
On Tuesday, 16 February 2016 at 19:01:58 UTC, Satoshi wrote: Hello Vulkan API 1.0 is here and I just wrapped it into D. https://github.com/Rikarin/VulkanizeD Have fun! I think your usage of const pointer is wrong. E.g. c const char* maps to d const(char)* etc.

Re: Vulkan bindings

2016-02-20 Thread ParticlePeter via Digitalmars-d
On Friday, 19 February 2016 at 01:49:12 UTC, Alex Parrill wrote: On Thursday, 18 February 2016 at 03:39:30 UTC, Kapps wrote: On Thursday, 18 February 2016 at 03:38:42 UTC, Kapps wrote: This is what I did with OpenGL for my own bindings. It had some nice benefits like having the documentation

  1   2   >