According to cppreference.com, std::ios_base::failure has two inheritance hierarchies:

Question
Why and what is the difference?
Background
Using g++ 4.7.1 I ran into this error and so far I know that it is because of the first inheritance hierarchy:
error: ‘const class std::ios_base::failure’ has no member named ‘code’
UPDATE
With gcc, ios_base::failure still inherits from exception even in C++11 mode. Quote from here:
ios_base::failure is not derived from system_error.
That’s because std::system_error was introduced in C++11.
std::ios_base::failurederived directly fromstd::exceptionbefore.Since the code() method is a member of
std::system_error,std::ios_base::failuredoes not expose it in environments that do not support C++11.