Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Chad Joan via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 21:25:07 UTC, Steven Schveighoffer wrote: ... Object.factory is a really old poorly supported type of reflection. I would not depend on it for anything. Roger that. Will avoid :) You are better off using your own registration system. As far as choosing

Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, September 26, 2018 10:20:58 PM MDT Chad Joan via Digitalmars- d-learn wrote: > On Wednesday, 26 September 2018 at 23:32:36 UTC, Jonathan M Davis > > wrote: > > On Wednesday, September 26, 2018 3:24:07 PM MDT Adam D. Ruppe > > > > via Digitalmars-d-learn wrote: > >> Object.factory

Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Chad Joan via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 21:24:07 UTC, Adam D. Ruppe wrote: On Wednesday, 26 September 2018 at 20:41:38 UTC, Chad Joan wrote: I'm implementing a deep-copy method for a tree of templated class instances. As part of this, I need some way to copy each node. [...] that isn't already

Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Chad Joan via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 23:32:36 UTC, Jonathan M Davis wrote: On Wednesday, September 26, 2018 3:24:07 PM MDT Adam D. Ruppe via Digitalmars-d-learn wrote: Object.factory kinda sux and I'd actually like to remove it (among other people). There's no plan to actually do that, but

Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, September 26, 2018 3:24:07 PM MDT Adam D. Ruppe via Digitalmars-d-learn wrote: > Object.factory kinda sux and I'd actually like to remove it > (among other people). There's no plan to actually do that, but > still, just on principle I want to turn people away. While there may not

Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/26/18 4:41 PM, Chad Joan wrote: Hi all, I'm implementing a deep-copy method for a tree of templated class instances.  As part of this, I need some way to copy each node. I want to avoid code that does things like casting objects into byte arrays and then copying raw bytes; I want all

Re: Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 20:41:38 UTC, Chad Joan wrote: I'm implementing a deep-copy method for a tree of templated class instances. As part of this, I need some way to copy each node. [...] that isn't already handled by their deepCopy method. I would strongly suggest just using

Is there a way to use Object.factory with templated classes? Or some way to construct templated classes given RTTI of an instance?

2018-09-26 Thread Chad Joan via Digitalmars-d-learn
Hi all, I'm implementing a deep-copy method for a tree of templated class instances. As part of this, I need some way to copy each node. I want to avoid code that does things like casting objects into byte arrays and then copying raw bytes; I want all operations to be memory safe things

Weird compilation error only as static library

2018-09-26 Thread Márcio Martins via Digitalmars-d-learn
Hi! I am getting this error when compiling my code as a static library. It works fine as an executable. I have no idea what's happening. Has someone seen something like this before? What could be different? This is the error: /usr/include/dmd/druntime/import/core/stdc/stdint.d(159,26):

Re: Can I create static c callable library?

2018-09-26 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 09:54:22 UTC, John Burton wrote: Is there any documentation anywhere that deals with calling D from C? I could find plenty the other way round. I think I'll give up on the idea though, and rewrite the whole thing in D :) Rewriting it in D is a great idea

Re: Can I create static c callable library?

2018-09-26 Thread John Burton via Digitalmars-d-learn
On Tuesday, 25 September 2018 at 12:05:21 UTC, Jonathan M Davis wrote: [...] Thanks everyone. Is there any documentation anywhere that deals with calling D from C? I could find plenty the other way round. I think I'll give up on the idea though, and rewrite the whole thing in D :)

Re: is there something like `stm32-rs` in D?

2018-09-26 Thread Radu via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 05:55:49 UTC, dangbinghoo wrote: On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote: On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote: hi, https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang?

Re: is there something like `stm32-rs` in D?

2018-09-26 Thread dangbinghoo via Digitalmars-d-learn
On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote: On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo wrote: hi, https://github.com/adamgreig/stm32-rs looks great, is there something like this in Dlang? thanks! --- dangbinghoo You might take a look at