Z
zl2k
hi, there
I have
class Foo{
explicit Foo(int a);
explicit Foo(int a, int b);
}
how can I conditionally create an instance of Foo not using the
pointer?
I want something like
Foo foo; // it's already initialized, do I need a dummy explicit Foo()
in the Foo class?
if (use1var){
// initialize foo with 1 variable, how?
}
else{
// initialize foo with 2 variable
}
// play with foo
I can put //play with foo within the if else, but that will make the
code too bulky.
Thanks a lot.
zl2k
I have
class Foo{
explicit Foo(int a);
explicit Foo(int a, int b);
}
how can I conditionally create an instance of Foo not using the
pointer?
I want something like
Foo foo; // it's already initialized, do I need a dummy explicit Foo()
in the Foo class?
if (use1var){
// initialize foo with 1 variable, how?
}
else{
// initialize foo with 2 variable
}
// play with foo
I can put //play with foo within the if else, but that will make the
code too bulky.
Thanks a lot.
zl2k