L
Luther Baker
Hi,
Is the order of initialization guaranteed for static members as it is
for instance members?
Namely, the order they appear the in the declaration?
ie:
foo.h:
class Foo
{
....
private:
static std::string header_label;
static size_t header_len;
};
....
foo.cpp
std::string Foo::header_label ("vendor-product-0.1.1");
//
// Can I depend on header_label to be initialized at this point?
//
size_t Foo::header_len = header_label.length() +
2*(sizeof(AddressSize));
Thanks,
-Luther
Is the order of initialization guaranteed for static members as it is
for instance members?
Namely, the order they appear the in the declaration?
ie:
foo.h:
class Foo
{
....
private:
static std::string header_label;
static size_t header_len;
};
....
foo.cpp
std::string Foo::header_label ("vendor-product-0.1.1");
//
// Can I depend on header_label to be initialized at this point?
//
size_t Foo::header_len = header_label.length() +
2*(sizeof(AddressSize));
Thanks,
-Luther