pva2pva  1.4.1
 All Classes Functions Variables Pages
Public Member Functions | Friends | List of all members
weak_value_map< K, V, C >::element_proxy Class Reference

#include <weakmap.h>

Public Member Functions

value_pointer & operator= (value_pointer &v)
 
V & operator* () const
 Support: *map[k].
 
V * operator-> () const
 Support: map[k]->mem.
 
 operator value_pointer () const
 Support: value_pointer V(map[k])
 
bool operator== (const value_pointer &v) const
 
bool operator!= (const value_pointer &v) const
 

Friends

class weak_value_map
 

Detailed Description

template<typename K, typename V, typename C = std::less<K>>
class weak_value_map< K, V, C >::element_proxy

proxy class for lookup of non-const Supports assignment and deref. implicitly castable to value_pointer (aka shared_ptr<V>)

Definition at line 155 of file weakmap.h.

Member Function Documentation

template<typename K, typename V, typename C = std::less<K>>
value_pointer& weak_value_map< K, V, C >::element_proxy::operator= ( value_pointer &  v)
inline

Support: map[k] = v The value_pointer passed in will be replaced with a wrapped reference

Returns
the argument

Definition at line 166 of file weakmap.h.

167  {
168  if(!v.unique())
169  throw std::invalid_argument("Only unique() references may be inserted");
170  value_pointer chainptr(v.get(), dtor(M._data, k, v));
171  M._data->store[k] = chainptr;
172  v.swap(chainptr);
173  return v;
174  }

The documentation for this class was generated from the following file: