Closed StephenAshmore closed 8 years ago
Pushed a fix. Here's how it can be used: GAssert(1 < 0, "One is not less than zero.");
You can still use the old GAssert with no messages, and this is completely backwards compatible with the old version. There may be some issues with Visual Studio 2010, but this version should handle that just fine. I can't test on Windows/Mac, so this may get re-opened if it does not work on those systems.
GAssert can't take a custom string to output when a GAssert fails. We should definitely allow it to print a custom message. For example, in trainIncremental, we want the method to check if beginIncrementalLearning has been called, here's the code:
GAssert(m_ready);
If beginIncrementalLearning has not been called, the message we are going to get is not very clear. However, if we could give a message to GAssert the code might look like this:
GAssert(m_ready, "beginIncrementalLearning must be called before you can call trainIncremental");
Not only will the user know where the program failed, but they will have a nice message pointing out exactly how to fix it.