When you want to inherit from a class in C++, is it illegal to have std declared in the first line below?
#ifndef HWEXCEPTION_H
#define HWEXCEPTION_H
#include <stdexcept>
class HWException : public std::run_time_error
{
void testException(int num);
};
#endif
vs
using std::run_time_error
class MyClass : public run_time_error
This is assuming you have #include at the top. I get compile errors for having std::run_time_error, but do not seem to by doing it the second way and was wondering why.
error C2039: 'run_time_error' : is not a member of 'std'
'run_time_error' : base class undefined
1>main.cpp
error C2039: 'run_time_error' : is not a member of 'std'
error C2504: 'run_time_error' : base class undefined