8template <
typename T>
class uuid_ptr {
10 typedef typename std::remove_const<T>::type T_without_const;
13 uuid_ptr() : ptr(
nullptr)
16 uuid_ptr(
const UUID &uu) : ptr(
nullptr), uuid(uu)
19 uuid_ptr(T *p,
const UUID &uu) : ptr(p), uuid(uu)
22 uuid_ptr(T *p) : ptr(p), uuid(p ? p->get_uuid() :
UUID())
29 uuid_ptr(std::nullptr_t) : ptr(
nullptr), uuid(
UUID())
36 assert(ptr->get_uuid() == uuid);
46 assert(ptr->get_uuid() == uuid);
56 assert(ptr->get_uuid() == uuid);
64 template <
typename U>
void update(std::map<UUID, U> &map)
67 if (map.count(uuid)) {
75 template <
typename U>
void update(
const std::map<UUID, U> &map)
78 if (map.count(uuid)) {