template <typename T>
class SmallVectorTemplateCommon : public SmallVectorBase {
protected:
- void setEnd(T *P) { this->EndX = P; }
-public:
SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(Size) {}
+ void setEnd(T *P) { this->EndX = P; }
+public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T value_type;
/// implementations that are designed to work with non-POD-like T's.
template <typename T, bool isPodLike>
class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
-public:
+protected:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
static void destroy_range(T *S, T *E) {
/// implementations that are designed to work with POD-like T's.
template <typename T>
class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
-public:
+protected:
SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
// No need to do a destroy loop for POD's.
typedef typename SuperClass::iterator iterator;
typedef typename SuperClass::size_type size_type;
+protected:
// Default ctor - Initialize to empty.
explicit SmallVectorImpl(unsigned N)
: SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T)) {
}
+public:
~SmallVectorImpl() {
// Destroy the constructed elements in the vector.
this->destroy_range(this->begin(), this->end());