From: stephan b. <sg...@us...> - 2004-12-27 22:51:18
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19841/include/pclasses/Util Modified Files: SimplePropertyStore.h Log Message: Now at least basically works. It is compatible enough with std::map to use the standard s11n map proxies :). Index: SimplePropertyStore.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/Util/SimplePropertyStore.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SimplePropertyStore.h 27 Dec 2004 22:32:44 -0000 1.1 +++ SimplePropertyStore.h 27 Dec 2004 22:51:04 -0000 1.2 @@ -65,12 +65,19 @@ /** std::string propval = props["bar"] is functionally - identical to get("bar"). Unlike std::map and - the like, calling this operator with a key which is - not in the object does not create a new entry - it - simply returns an empty string in that case. + identical to get("bar"). It simply returns an empty + string if key is not found. + */ - const key_type operator[] ( const key_type & key ) const; + const mapped_type operator[] ( const key_type & key ) const; + + /** + Subtypes which override get() should ensure that their implementation + works with this function. To do that they simply must ensure that find(key) + will return the same map iterator that get(key) will work with. + */ + + mapped_type & operator[] ( const key_type & key ); /** For compatibility with std::map. Inserts a |