J
Jim Langston
I am using ms c++ express 10 which has some early c++0x implementations I
understand. What I would like to do is have the best of both worlds with
POD and classes for initialization. For example, with a POD I can do:
Foo bar[] = { 12, 23, 44 };
but, with a class with a constructor I can say:
somefunc( bar( 12, 23, 44 ) );
which will create a temporary bar and pass that which works as long as it's
a constant parameter.
I can't seem to be able to do both at the same time however. If I create a
constructor the first form doesn't produce the expected object. (I tried
with 1, 2, 3 and displayed the first value and it was 0.
Is there anythign in C++0x that helps me here?
understand. What I would like to do is have the best of both worlds with
POD and classes for initialization. For example, with a POD I can do:
Foo bar[] = { 12, 23, 44 };
but, with a class with a constructor I can say:
somefunc( bar( 12, 23, 44 ) );
which will create a temporary bar and pass that which works as long as it's
a constant parameter.
I can't seem to be able to do both at the same time however. If I create a
constructor the first form doesn't produce the expected object. (I tried
with 1, 2, 3 and displayed the first value and it was 0.
Is there anythign in C++0x that helps me here?