POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
7 Sep 2024 09:24:17 EDT (-0400)
  Re: C++ questions  
From: Invisible
Date: 26 Sep 2008 10:44:46
Message: <48dcf55e$1@news.povray.org>
>> Also, unlike Haskell, you apparently can't make up new operators of your 
>> own, just overload the ones that already exist.
> 
>   Aren't C++ compilers already stressed enough? Think about all the problems
> they would have with user-defined operators, with their own precedence
> rules, ambiguous situations, etc... :P

Heh, yeah... I can see that. ;-)

>> 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. ;-)
> 
>   You usually use the STL data containers for dynamically allocated
> memory, and if what you need is to allocate a single object, you can
> use a smart pointer.

Fair enough.

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

Leak like a sieve! ;-)

I've never actually seen a programming environment with manual memory 
management *and* dynamically resizable collections. The two are usually 
muturally exclusive.

Then again, I'm not really sure what the story is if you try to put 
user-defined data types into a vector...


Post a reply to this message

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