|
|
Wolfgang Wieser <wwi### [at] gmxde> wrote:
> Pointers are the most useful thing in C and you cannot get around
> them in C++ if you want to keep fast performance.
In C++ there's less need to use pointers everywhere. For instance, often
a reference is better than a pointer (a reference is more secure and
easier to use syntax-wise).
And if you are going to use dynamically allocated memory, abstracting
the pointer is a good idea anyways. For instance most (if not all)
STL data containers are classes which contain just one member
variable: A pointer. Which means that these data containers are
basically a pointer. However, they are 100 times more secure than
using a pointer directly, 100 times easier to use and in no way less
efficient.
Using 'new' outside an abstract type is usually a bad idea. Honestly.
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
|