J
jose luis fernandez diaz
Hi,
In the next class:
template<class T> class Set_controller
{
Set<T>* rep;
Lock lock;
public:
void insert(T* p) { Lock_ptr x(lock); rep->insert(p); }
void remove(T* p) { Lock_ptr x(lock); rep->remove(p); }
int is_member(T *p) { return rep->is_member(p); }
T get_first() { T* p=rep->first(); return p ? *p : T(); }
T get_next() { T* p=rep->next(); return p ? *p : T(); }
T first() { Lock_ptr x(lock); T tmp = *rep->first(); return tmp; }
T next() { Lock_ptr x(lock); T tmp = *rep->next(); return tmp; }
// . . .
};
What is the difference between:
T first() { Lock_ptr x(lock); T tmp = *rep->first(); return tmp; }
and
T first() { Lock_ptr x(lock); return *rep->first(); }
Thanks,
Jose Luis.
In the next class:
template<class T> class Set_controller
{
Set<T>* rep;
Lock lock;
public:
void insert(T* p) { Lock_ptr x(lock); rep->insert(p); }
void remove(T* p) { Lock_ptr x(lock); rep->remove(p); }
int is_member(T *p) { return rep->is_member(p); }
T get_first() { T* p=rep->first(); return p ? *p : T(); }
T get_next() { T* p=rep->next(); return p ? *p : T(); }
T first() { Lock_ptr x(lock); T tmp = *rep->first(); return tmp; }
T next() { Lock_ptr x(lock); T tmp = *rep->next(); return tmp; }
// . . .
};
What is the difference between:
T first() { Lock_ptr x(lock); T tmp = *rep->first(); return tmp; }
and
T first() { Lock_ptr x(lock); return *rep->first(); }
Thanks,
Jose Luis.