"Alex Vinokur" <> wrote in message
news: oups.com...
: Is this library safe?
The posted code is perfectly safe according to the C++
standard.
: ====== Library ======
:
: --- File foo.h ---
:
: struct Foo
: {
: static const char* s_name;
: // Stuff
: };
:
: -------------------
:
: --- File foo.cpp ---
:
: const char* Foo::s_name = "ABCD";
:
: // Stuff
:
: -------------------
:
: ====================
: Does this have to do with Position Independent Code?
Position Independent Code does not "exist" in C++.
As I understand it, PIC is an implementation detail of
generated code on some platforms, where only PC-relative
addresses are used to allow the code to be relocated
in memory without requiring any absolute address fixing.
I don't see that the above code illustrates anything
specifically related to PIC.
http://en.wikipedia.org/wiki/Position_independent_code
Cheers --Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <>
http://www.brainbench.com