Parse error in catch statement
I'm trying to do an exercise in Accelerated C++, and I'm taking this part of the code straight from the book. However, it will not compile and I can't figure out why.
Code:
double grade_aux(const Student_info& s)
{
try
{
return grade(s);
}
catch (domain_error)
{
return grade(s.midterm, s.final, 0);
}
}
Unless I'm blind, the code is typed in just the same as in the book, and is consistent with what I know of catching exceptions.
I'm using Dev-C++ on Win XP. If I comment out this function, the file compiles fine. It gives me:
" Parse error before ')' " on the bolded line when I try to compile.
Any thoughts? (Relevant to this error, anyway?)