1 #ifndef CMSSW_mayown_ptr_H 2 #define CMSSW_mayown_ptr_H 12 template<
typename T,
int N=sizeof(T*)>
18 if (
nullptr==p)
return;
19 unsigned char buff[
N]; memcpy(buff,&p,
N);
20 assert((buff[
N-1]&1)==0);
26 unsigned char buff[
N]; memcpy(buff,&p,
N);
27 return 1==(buff[
N-1]&1);
31 unsigned char buff[
N]; memcpy(buff,&p,
N);
33 assert((buff[
N-1]&1)==0);
58 bool empty()
const {
return nullptr==
p;}
60 T const *
raw()
const {
return p;}
65 return rh.
raw() == lh.
raw();
69 return rh.raw() <
lh.raw();
mayown_ptr & operator=(mayown_ptr &)=delete
T const * operator->() const
bool operator==(mayown_ptr< T > const &rh, mayown_ptr< T > const &lh)
T const & operator*() const
mayown_ptr(mayown_ptr &&rh)
mayown_ptr(T *ip=nullptr)
mayown_ptr & operator=(mayown_ptr &&rh)
T const * pointer() const