Yeah, sorry guys...I don't know wtf I was thikning when I wrote that
question.
The only two languages I know anything about are C++ and Java. I know
what I want to do is possible in Java, and I'm hoping it is in C++.
In Java, I can say:
class Blah {
private static ArrayList arrayList;
static {
arrayList = new ArrayList();
arrayList.add("aaa");
arrayList.add("bbb");
arrayList.add("sakdljflaks");
... (etc.)
}
}
Can I do this type of initialization of static data in C++? I was
just saying I can do this with an array because I can specify its
contents at construction-time, but not so with a vector. I don't want
to have to clutter my code with "initialize()" function calls which
execute code like that in the above "static" block.
Thank you.
On Sat, 05 Mar 2005 14:08:28 -0800, junger <> wrote:
If a member object is static, is it possible to initialize it with
function calls? E.g., if I want my class to contain a static vector
filled with other static objects, can I fill this vector statically
without having tyo make a function call? Right now I'm using an array
because I can specify an array's exact contents statically, but it
seems stupid to have to use an array.
Thank you.