R
Richard Herring
Protoman schrieb:
[ SmrtPtr said:OK, I fixed the above, but, now I'm wondering: is SmrtPtr<T> safe to
use in a container, such as a linked list? Is it thread safe?
Depends on the container, if it can be used with it.
For the standard container classes, the values have to have
value-semantics. If your smart pointer works as it should, then its safe
to use in on of them.
For thread safety: Don't ask here, since C++ doesn't know about threads
(you should know this already)
OK, but how do I access this:
class Data
{
public:
Data()lus(new long double),mult(new long double),pow(new long
double){}
SmrtPtr<long double> plus;
Why? It appears to be a simple value class, so why do you have yet
another level of indirection just to access public data members?
tuple->memberSmrtPtr<long double> mult;
SmrtPtr<long double> pow;
};
SmrtPtr<Data> tuple(new Data);
//how do I access the members of tuple?