Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Raise Exception instead of ASSERT for container
Re: Raise Exception instead of ASSERT for container [message #12072 is a reply to message #12071] Wed, 10 October 2007 12:30 Go to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
benoitc wrote on Wed, 10 October 2007 04:46


Quote:

Bjarne:The C++ exception-handling mechanism is designed to support handling of errors and other exceptional condition(hence the name)... This mechanism is designed to handle only synchronous exceptions, such as array range checks...


It looks like I'm not that far from the definition of the Master.



Well, I was rather refering to the fact that STL does not check indices as well... (unless you use vector::at).

I think what is the Master up to here is rather the fact that exceptions are not to be used to handle e.g. interrupts... OTOH, nice contraargument Wink

Quote:


Quote:

Plus, you still have not explained how exceptions are going to help with multidimensional arrays...


I thought I did: How to you check nicely that j is a valid index in the v[i][j]? I personally think it is a pain to do if(i>=0&&i<v.GetCount()&& j>=0 && j<v[i].GetCount())



OK Smile

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: downloadable U++ manual
Next Topic: Vista.....
Goto Forum:
  


Current Time: Thu May 09 11:40:28 CEST 2024

Total time taken to generate the page: 0.02263 seconds