Below is a code snippet for an exception code, see below:
Code:
#include <iostream>
#define WIN32_MEAN_AND_LEAN
#include <winsock2.h>
#include <windows.h>
using namespace std;
class HRException
{
public:
HRException() :
m_pMessage("") {}
virtual ~HRException() {}
HRException(const char *pMessage) :
m_pMessage(pMessage) {}
const char * what() { return m_pMessage; }
private:
const char *m_pMessage;
};
int main(int argc, char* argv[])
{
// main program
}
After the first constructor, there is a colon. See below:
Code:
HRException() :
m_pMessage("") {}
My question is this, is this another way to 'inline' a function.
I've not seen it used before, can anyone care to explain? Thanks in advance.