
I've noticed that the put function that takes a generic put_get_helper map,
takes a key param. The question is: why the key param is passed by value? Is any reason for this? The key value is not modified setting the property map.
The original application of keys for property maps only covered some fairly trivial data types (ints, pointers, and pairs thereof). Passing by value is perfectly acceptable in these cases.
It's likely that the compiler won't actually generate a copy anyways. The compiler is allowed to "elide" or omit a copy construction if it feels that one isn't necessary. There's a good possibility that your key isn't being copied anyways. Dave Abrahams gives a good account of copy elision here: http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/. Andrew Sutton andrew.n.sutton@gmail.com