$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: chun ping wang (cablepuff_at_[hidden])
Date: 2007-10-25 14:22:12
Hi I notice boost shared_array compares the pointer address not the pointer
themselves. What would be the best way to compare the actual value of boost
shared_array.
1.)
shared_array<T> a;
shared_array<T> b;
1.) return (a.len == b.len && (memcmp(a, b, len) == 0));
or
2.)
if (a.len != b.len)
return false;
for (ptrdiff_t i = 0; i != a.len; ++i)
if(a[i] != b[i])
return false;
One that works ALL the times.