Jul 28, 2011
C++ trick
const T& get() { const static T empty_value; return condition ? real_value : empty_value;}
it's helpful when T is std::container or so on.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment