digitalmars.D.learn - memmove C++ -> D
- Clay Smith (8/8) Nov 25 2007 C++ memmove:
- Clay Smith (3/16) Nov 25 2007 Oh, and bounds in the C++ version is a pointer, while in the D version
- Bill Baxter (4/21) Nov 25 2007 Looks ok, unless b2Bound is a class. Then the sizeof would be giving
C++ memmove: memmove(bounds + upperIndex + 2, bounds + upperIndex, (edgeCount - upperIndex) * sizeof(b2Bound)); D memmove: memmove(bounds.ptr + upperIndex + 2, bounds.ptr + upperIndex, (edgeCount - upperIndex) * b2Bound.sizeof); Is this a correct translation to D? Thanks. ~ Clay
Nov 25 2007
Clay Smith wrote:C++ memmove: memmove(bounds + upperIndex + 2, bounds + upperIndex, (edgeCount - upperIndex) * sizeof(b2Bound)); D memmove: memmove(bounds.ptr + upperIndex + 2, bounds.ptr + upperIndex, (edgeCount - upperIndex) * b2Bound.sizeof); Is this a correct translation to D? Thanks. ~ ClayOh, and bounds in the C++ version is a pointer, while in the D version is an array.
Nov 25 2007
Clay Smith wrote:Clay Smith wrote:Looks ok, unless b2Bound is a class. Then the sizeof would be giving you the size of just the reference to the class. --bbC++ memmove: memmove(bounds + upperIndex + 2, bounds + upperIndex, (edgeCount - upperIndex) * sizeof(b2Bound)); D memmove: memmove(bounds.ptr + upperIndex + 2, bounds.ptr + upperIndex, (edgeCount - upperIndex) * b2Bound.sizeof); Is this a correct translation to D? Thanks. ~ ClayOh, and bounds in the C++ version is a pointer, while in the D version is an array.
Nov 25 2007