Destructor fixes

This commit is contained in:
Pavel Kirienko 2014-04-18 22:51:19 +04:00
parent 707c3e3ed1
commit dfc69b4b5f
4 changed files with 16 additions and 4 deletions

View File

@ -24,6 +24,8 @@ protected:
: next_(NULL)
{ }
~LinkedListNode() { }
public:
T* getNextListNode() const { return next_; }

View File

@ -151,6 +151,9 @@ private:
}
template <typename> void initialize(...) { }
protected:
~ArrayImpl() { }
public:
typedef typename StorageType<T>::Type ValueType;
typedef typename Base::SizeType SizeType;

View File

@ -20,13 +20,16 @@ class DurationBase
{
int64_t usec_;
public:
protected:
~DurationBase() { }
DurationBase()
: usec_(0)
{
StaticAssert<(sizeof(D) == 8)>::check();
}
public:
static D getInfinite() { return fromUSec(std::numeric_limits<int64_t>::max()); }
static D fromUSec(int64_t us)
@ -93,7 +96,9 @@ class TimeBase
{
uint64_t usec_;
public:
protected:
~TimeBase() { }
TimeBase()
: usec_(0)
{
@ -101,6 +106,7 @@ public:
StaticAssert<(sizeof(D) == 8)>::check();
}
public:
static T getMax() { return fromUSec(std::numeric_limits<uint64_t>::max()); }
static T fromUSec(uint64_t us)
@ -256,7 +262,7 @@ std::string TimeBase<T, D>::toString() const
template <typename Stream, typename D>
UAVCAN_EXPORT
Stream& operator<<(Stream& s, DurationBase<D> d)
Stream& operator<<(Stream& s, const DurationBase<D>& d)
{
char buf[DurationBase<D>::StringBufSize];
d.toString(buf);
@ -266,7 +272,7 @@ Stream& operator<<(Stream& s, DurationBase<D> d)
template <typename Stream, typename T, typename D>
UAVCAN_EXPORT
Stream& operator<<(Stream& s, TimeBase<T, D> t)
Stream& operator<<(Stream& s, const TimeBase<T, D>& t)
{
char buf[TimeBase<T, D>::StringBufSize];
t.toString(buf);

View File

@ -36,6 +36,7 @@ class UAVCAN_EXPORT Noncopyable
Noncopyable& operator=(const Noncopyable&);
protected:
Noncopyable() { }
~Noncopyable() { }
};
/**