Re: Using a C++ class in a D associative array

2018-09-12 Thread joe654 via Digitalmars-d
In C++ programming you can call any kind of array it may be associative or dissociative one, and, with declaration fo the array, you can easily input mad output with a string and it can be integer or float format. And you can take some help from https://hpsupports.co/hp-support-assistant/ to ge

Re: Using a C++ class in a D associative array

2018-08-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-22 23:00, kinke wrote: It could be simpler (and slower ;)) by using `m_flags & ClassFlags.isCPPclass`. There's Objective-C classes as well, which does not seem to have an entry in TypeInfo_Class.ClassFlags. -- /Jacob Carlborg

Re: Using a C++ class in a D associative array

2018-08-22 Thread kinke via Digitalmars-d
On Wednesday, 22 August 2018 at 19:25:40 UTC, Jacob Carlborg wrote: This could be solved, I think, with having "TypeInfo.getHash" a template taking the actual type and not void*. That template can then inspect if the passed type is a D class or any other type of class and act accordingly. It

Re: Using a C++ class in a D associative array

2018-08-22 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-21 02:07, kinke wrote: On Monday, 20 August 2018 at 22:16:09 UTC, Jacob Carlborg wrote: At the third line there's a call from object.TypeInfo_Class.getHash. I looked up to see what the "getHash" method is doing in druntime [2], the method looks like this: override size_t getHash(sc

Re: Using a C++ class in a D associative array

2018-08-20 Thread Paul O'Neil via Digitalmars-d
Potentially related: https://issues.dlang.org/show_bug.cgi?id=13875

Re: Using a C++ class in a D associative array

2018-08-20 Thread kinke via Digitalmars-d
On Monday, 20 August 2018 at 22:16:09 UTC, Jacob Carlborg wrote: At the third line there's a call from object.TypeInfo_Class.getHash. I looked up to see what the "getHash" method is doing in druntime [2], the method looks like this: override size_t getHash(scope const void* p) @trusted const

Using a C++ class in a D associative array

2018-08-20 Thread Jacob Carlborg via Digitalmars-d
I'm playing around with using the DMD frontend as a library. I wanted to store some nodes from the AST in a set. Since there doesn't seem to be a set container that is shipped with Phobos I wrapped an associative array and added some functions to use the AA as a set. To my surprise when I did