In ILE C++, if a _DecimalT class template is a member of a
struct, that struct cannot be initialized with an
initializer list.
The structure in ILE C is shown in the following figure:
Figure 206. Example of ILE C Structure Definition that Cannot Be Ported to ILE C++
typedef struct { char s1; decimal(5,3) s2; }s_type; s_type s ={'+', 12.345d}; |
In ILE C++ you need to rewrite the code as shown in the following
figure:
struct s_type { char s1; decimal(5,3) s2; s_type (char c, decimal(5,3) d ) : s1(c), s2(d) {} }; s_type s ('+', __D("12.345")) ; |
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.