with get functions, use pointer or declare function as?

Started by
12 comments, last by johnnyBravo 19 years, 12 months ago
a simple rule I follow for accessors is for pods return by value for udts return by const reference
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
Advertisement
quote:Original post by ChaosEngine
a simple rule I follow for accessors is for pods return by value for udts return by const reference


sorry could you put that into simpler terms?
quote:Original post by johnnyBravo
quote:Original post by ChaosEngine
a simple rule I follow for accessors is for pods return by value for udts return by const reference


sorry could you put that into simpler terms?


if return is not class thingo I no use & on type. If I define a clas thing I use squigily and sign thing
if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
If you''re returning an objects, return by const reference. For plain old data types, return by value.
std::string const& GetName();int GetID(); 


quote:Original post by ChaosEngine
quote:Original post by johnnyBravo
quote:Original post by ChaosEngine
a simple rule I follow for accessors is for pods return by value for udts return by const reference


sorry could you put that into simpler terms?


if return is not class thingo I no use & on type. If I define a clas thing I use squigily and sign thing


Could you define the terms "squigily" and "thingo"? Thank you.

This topic is closed to new replies.

Advertisement