POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
7 Sep 2024 09:21:36 EDT (-0400)
  Re: C++ questions  
From: Invisible
Date: 26 Sep 2008 10:30:37
Message: <48dcf20d$1@news.povray.org>
>> Heh. I get the impression that most of the stuff I'm reading about now 
>> is stuff that "you won't normally need". ;-)
> 
>   It's not like you don't need copy constructors (and copy assignment).
> It's just that a beginner doesn't usually need them. When you start needing
> copy constructors, your code will be a bit more advanced.

Well, yeah. And *I* am unlikely to be writing anything "advanced" any 
time soon! ;-)

>> (E.g., apparently you can overload the "->" operator... GAH! >_< OK, I 
>> am *so* not trying that out!)
> 
>   You can overload almost any operator, including 'new' (it's considered
> an operator in C++) and the prefix-&.
> 
>   I think the only operator you can't overload is the dot operator.

And .* (apparently).

Also, unlike Haskell, you apparently can't make up new operators of your 
own, just overload the ones that already exist.

>> Anyway, the main reason I haven't written a Third C++ Program yet is 
>> that I'm trying to think of something I actually want to write that's 
>> implementable without automatic memory management...
> 
>   Hmm, is that sentence correct? Everything is implementable without
> automatic memory management. Perhaps you meant something else?-)

Well, yeah, but it's a touch harder to implement heap-allocated data in 
such a way that your program doesn't leak like a sieve. ;-)

[I'm actually surprised that using std::vector doesn't do this already...]


Post a reply to this message

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