samedi 26 mars 2016

Prioritizing exception handling in c++

I was wondering if it's possible to prioritize exceptions in C++ or I just need to reorder my code

Let's say we do have a switch case

switch(a):

case 0:
(This case has the medium priority) <- MEDIUM

case 1:
(This case has the lowest priority) <- LOW

case 2:
(This case has the highest priority) <- HIGH

Inside these cases I'm reading from a file line by line(specific format), so I couldn't just reorder them, but what I could do is read all this and then do the check, what directly means more code.

In order to avoid writing more code I was wondering if such a thing exists in C++?

Thanks

Aucun commentaire:

Enregistrer un commentaire