これが私が持っているものです。カスタムコンストラクターを使用して、Bar内にFooのインスタンスを作成しようとしています。Barのコンストラクターからコンストラクターを呼び出そうとすると、外部で未解決になります。
class Foo
{
public:
// The custom constructor I want to use.
Foo(const char*);
};
class Bar
{
public:
Bar();
//The instance of Foo I want to use being declared.
Foo bu(const char*);
};
int main(int argc, char* args[])
{
return 0;
}
Bar::Bar()
{
//Trying to call Foo bu's constructor.
bu("dasf");
}
Foo::Foo(const char* iLoc)
{
}