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 #12051 is a reply to message #12035] Tue, 09 October 2007 18:26 Go to previous messageGo to previous message
benoitc is currently offline  benoitc
Messages: 17
Registered: July 2007
Location: Nice (France)
Promising Member
The goal of exceptions in C++ is to clearly separate nominal code with exceptional errors management, instead of adding a bunch of test before calling any API just in case an error occurs.

Without exception you need to check first that "i" in inside the bound then get a reference to array[i] and then check than "j" is inside the bound of the array[i] container.

Don't you think that it might be easier to use exception to handle potential error on array access?

The usage of exception is more a matter of taste than anything else, so if you're not convince that it might be useful for that kind of stuff, I'm fine with that.

Regards,
Benoit
 
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 06:33:30 CEST 2024

Total time taken to generate the page: 0.02615 seconds