views:

170

answers:

1

I'm an experienced unmanaged C++ developer, new to C++\CLI.

How come managed C++ doesnt allow exception specification?

Example link

What's the best practice for specifying exceptions my methods throw then?

+1  A: 

Presumably because the CLR doesn't use exception specifications; this in turn is presumably because Microsoft looked at Java and decided that they are far more trouble than they are worth. So the best practice for specifying what exceptions your methods throw is to not bother, ie remove your exception specs. It's worth pointing out that even in the normal C++ (ie native) world most people either eschew exception specifications entirely, or only use the empty specification to indicate that the method does not throw.

tragomaskhalos