Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2002-08-27 13:04:21


In property_map.hpp the put function for put_get_helper is implemented as

template <class PropertyMap, class Reference, class K, class V>
inline void
put(const put_get_helper<Reference, PropertyMap>& pa, K k, const V& v)
  static_cast<const PropertyMap&>(pa)[k] = v;

I do not understand why it works with const PropertyMap&. IIUC operator[]()
const would normally return a const reference. Shouldn't put work with
non-const references?



Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001

Boost list run by bdawes at, gregod at, cpdaniel at, john at