What does this C ++ code do?

Found here: https://github.com/tpaviot/oce/blob/master/src/BRepAdaptor/BRepAdaptor_Curve.cxx

The line I'm interested in is:

((GeomAdaptor_Curve*) (void*) &myCurve)->Load(C,First,Last);

myCurvealready defined as GeomAdaptor_Curve. So it looks like he is casting a pointer to myCurvehow void*, and then it sheds it like GeomAdaptor_Curve*, and then he looks for it and calls Loadon it. What is the possible reason for this, rather than just calling myCurve.Load?

+4
source share
2 answers

, const. , &myCurve GeomAdaptor_Curve const*.

const_cast<GeomAdaptor_Curve&>(myCurve).Load(C,First,Last);

, , , "" , C- const.

+6

, , , , "" GeomAdaptor_Curve " Load .

void*, GeomAdaptor_Curve*, , , .

, , , , , , , .

, dbarbier GitHub, , , ( ).

, , , GitHub, , (. Remi LEQUETTE).

0

All Articles