POV-Ray : Newsgroups : povray.off-topic : Quick C++ question... : Re: Quick C++ question... Server Time
5 Sep 2024 03:25:32 EDT (-0400)
  Re: Quick C++ question...  
From: clipka
Date: 11 Nov 2009 21:05:03
Message: <4afb6d4f$1@news.povray.org>
Darren New schrieb:

> I'm not sure how to cleanly turn that into a class without wrapping 
> every single function. None of those functions take a pointer to your 
> own class, so there's a bunch of casting on every creation at a minimum, 
> and you have to hope your class is laid out the same as the parent 
> struct and all that.

Fun fact about structs in C++: They /are/ classes. Only major difference 
(IIRC) being that their members default to "public:".

Classes only start to really diverge from classic C structs when you go 
for stuff like virtual methods or multiple inheritance. In the former 
case there'll be a few hidden data members that C++ will automatically 
add, while in the latter case... heck, I have not the slightest clue :-)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.