[lug] C++ question, without buying expensive doc.s

Tkil tkil at scrye.com
Mon Jan 10 19:02:22 MST 2005


>>>>> "Paul" == Paul E Condon <pecondon at mesanetworks.net> writes:

Paul> There is a predefined in GNU C++ whose name is __FUNCTION__.
Paul> This evaluates to the name of the function that is currently
Paul> being compiled.  I think this can be used to store the name of a
Paul> class in the date contained in its instances. This is useful for
Paul> serialize/deserialize.

Interesting.

Paul> a. is this standards compliant

It appears it's not...

Paul> b. is there some other standards compliant predefine that would
Paul>    be better

Paul> My experience is that when one finds the section on predefines
Paul> in the manual, the docment 'the more important predefined names'
Paul> and often leave out some of the ones that are required by the
Paul> standard.

Yeah, I know that pain.

Paul> It's not being a language lawyer. Serialize/deserialize really
Paul> needs a linkage (_not_ in the compiler technical sense) from an
Paul> object back to its text name, otherwise such linkage must be
Paul> hand crafted for each individual object that is to be
Paul> serialized.

Huh.  In my very limited exposure to environments that try to do
serialization "automagically" in C++, I was never very happy with the
results.

I wonder what Tom Tromey has to say about it...

Good luck!

t.




More information about the LUG mailing list