Boost logo

Boost :

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


Hi,

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

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?

TIA

--Thomas

-- 
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk