POV-Ray : Newsgroups : povray.off-topic : C++ questions : Re: C++ questions Server Time
7 Sep 2024 07:25:22 EDT (-0400)
  Re: C++ questions  
From: Invisible
Date: 29 Sep 2008 10:01:03
Message: <48e0df9f@news.povray.org>
>> What I was really interested to know is whether trying to construct a 
>> set without a comparison operator yields a compile-time error, a runtime 
>> error, or simply undefined behaviour.
> 
>   We are talking about templates here. Everything happens at compile
> time. :)

In my book, finding out at compile time that you did something wrong 
beats the **** out of finding that out at runtime. ;-)

Unfortunately, C tends to be a language that says "hey, you wanna do 
something crazy? Who am I to stop you? You know what you're doing, right?"

It's nice to see that C++ moves away from that a little.

>   (Although the error message will probably be quite obfuscated. With
> the next C++ standard compilers will have means to directly say "your
> type has no operator< but one is required".)


That's nice to have too...


Post a reply to this message

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