_DecimalT Class Template Runtime Exceptions

In ILE C, a packed decimal is implemented as a native data type. This approach allows an error, such as a decimal format that is not valid, to be detected at compile time. In ILE C++, detection of a similar error is deferred until runtime.

Figure 1. _DecimalT Class Template Runtime Exceptions
#include <bcd.h>
void main()
{
   _DecimalT<10,20> b = __D("ABC"); // Runtime exception is raised
}


#include <bcd.h>
void main()
{
   _DecimalT<65,2> a;                     // Max. dig. allow is 63. Again,
                                          // runtime exception is raised
}