digitalmars.D.learn - porting c++ code to dpl
- Mirko Pilger (6/6) Aug 06 2011 hello everybody,
- Simon (11/17) Aug 06 2011 Well I've ported quite a bit of C++ code to D.
- bearophile (4/6) Aug 06 2011 I have had some problems when the original C++ code uses struct inherita...
- Simon (10/16) Aug 06 2011 Most well written C++ only uses MI for pasting methods into classes; you...
hello everybody, i'm new to this language and plan to start learning it by porting parts of an existing c++ library to dpl. i would very much appreciate it if you have some tips & tricks, hints of pitfalls or any other experiences to share. mirko
Aug 06 2011
On 06/08/2011 17:59, Mirko Pilger wrote:hello everybody, i'm new to this language and plan to start learning it by porting parts of an existing c++ library to dpl. i would very much appreciate it if you have some tips & tricks, hints of pitfalls or any other experiences to share. mirkoWell I've ported quite a bit of C++ code to D. And on the whole I'd say that there isn't really much to say. Most of the issues I've hit have been bugs in dmd or optlink; which clearly have nothing to do with the language itself. Unless you need pointer to members/pointer to member functions, just about every bit of c++ is easier and more straight forward in D. Just plough ahead and ask questions if you hit an issue. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.uk
Aug 06 2011
Simon:Unless you need pointer to members/pointer to member functions, just about every bit of c++ is easier and more straight forward in D.I have had some problems when the original C++ code uses struct inheritance ("alias this" helps a bit) or multiple inheritance. Bye, bearophile
Aug 06 2011
On 06/08/2011 19:07, bearophile wrote:Simon:Most well written C++ only uses MI for pasting methods into classes; you can mostly re-factor code like that into template mixins. When I've come across C++ which isn't easily convertible to D, then the original code itself is badly written and badly designed anyway, so I don't even want to port it. Easier just to write it again in D -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.ukUnless you need pointer to members/pointer to member functions, just about every bit of c++ is easier and more straight forward in D.I have had some problems when the original C++ code uses struct inheritance ("alias this" helps a bit) or multiple inheritance. Bye, bearophile
Aug 06 2011