Re: [libxml++] using throw() in function declaration



Le Samedi 12 Juillet 2003 18:00, Murray Cumming Comneon com a écrit :
> By the way, here's the link to the bug discussion:
> http://sourceforge.net/tracker/index.php?func=detail&aid=769830&group_id=12
>9 99&atid=312999

Thanks for precising it, I should have done it.

>
> The comment about the failure when the standard library throws an exception
> seems important.

Yes. Writing something like :

 void my_function() throws(MyException, std::bad_alloc);

is a bit heavy (and I choosed a simple case. Some containers like vector 
throws other exception when trying to access a non existing index with at()).

> Personally I've never really figured out a policy for this, but I'm sure
> there are some documents on the web about it. It would be nice to find out
> the consensus of C++ coders on this these days.

I don't know about such a document.

From the different discussions I could read on c++ newsgroup, it seems that no 
real consensus exists. What I remind is that because compilation model of C++ 
cannot determine what exceptions can be thrown from a function, the only 
interest of this syntax is documention.

It seems also that most c++ developpers which have a clear opinion of that 
prefers not to use it. On the other hand BS has an opposite opinion.

My point is that this wouldn't bring us anything but some more work to always 
be sure that we did not forget a hidden exception.

Next week I'll try to find reference on the subject, for now I'm leaving for 
the week-end.

Best Regards,

Christophe





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]