疑似コードはあなたの意図を説明するかもしれませんが、あなたが説明した方法でエラーが発生しないため、エラーを説明しません:
class foo {
type arg1, arg2;
foo (type _arg1, type _arg2) {
_arg1=arg1;
_arg2=arg2;
}
}
class foo2 {
foo member;
foo2(type _arg1, type _arg2) {
member(_arg1, _arg2);
}
}
それは役に立つ診断をもたらしますが:
gcc -Wall junk.cc
junk.cc: In constructor ‘foo2::foo2(int, int)’:
junk.cc:12:32: error: no matching function for call to ‘foo::foo()’
junk.cc:3:5: note: candidates are: foo::foo(int, int)
junk.cc:1:11: note: foo::foo(const foo&)
junk.cc:13:28: error: no match for call to ‘(foo) (int&, int&)’
junk.cc: At global scope:
junk.cc:14:5: error: expected unqualified-id at end of input
これは、ここに「ちょっと似た」コードを投稿して有用な回答を期待するべきではないことを示しています。