use exception specification instead of %exception to handle STL error checking

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7352 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2005-07-27 20:09:42 +00:00
commit 03a67698a9
34 changed files with 299 additions and 849 deletions

View file

@ -61,7 +61,7 @@
%swig_container_methods(Map)
%extend {
mapped_type __getitem__(const key_type& key) const {
mapped_type __getitem__(const key_type& key) const throw (std::out_of_range) {
Map::const_iterator i = self->find(key);
if (i != self->end())
return i->second;
@ -69,11 +69,11 @@
throw std::out_of_range("key not found");
}
void __setitem__(const key_type& key, const mapped_type& x) {
void __setitem__(const key_type& key, const mapped_type& x) throw (std::out_of_range) {
self->insert(Map::value_type(key,x));
}
void __delitem__(const key_type& key) {
void __delitem__(const key_type& key) throw (std::out_of_range) {
Map::iterator i = self->find(key);
if (i != self->end())
self->erase(i);