別のクラスの定義内で定数引数を持つクラスのインスタンスを宣言するのに問題があります。
class Foo
{
private:
const int m_a, m_b;
public:
Foo(int a, int b) : m_a(a), m_b(b) {}
};
class Bar
{
public:
Foo foo1(1,2);
Foo foo2(2,3);
};
これから私はエラーを取得します:
"error: expected identifier before numeric constant"
"error: expected ',' or '...' before numeric constant"