Made Fast* container constructors explicit (like the STL versions) to prevent bugs

release/4.3a0
Richard Roberts 2012-01-06 21:21:00 +00:00
parent 0ba97cc39a
commit aa31be1649
4 changed files with 6 additions and 6 deletions

View File

@ -43,7 +43,7 @@ public:
/** Constructor from a range, passes through to base class */ /** Constructor from a range, passes through to base class */
template<typename INPUTITERATOR> template<typename INPUTITERATOR>
FastList(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {} explicit FastList(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {}
/** Copy constructor from another FastList */ /** Copy constructor from another FastList */
FastList(const FastList<VALUE>& x) : Base(x) {} FastList(const FastList<VALUE>& x) : Base(x) {}

View File

@ -44,7 +44,7 @@ public:
/** Constructor from a range, passes through to base class */ /** Constructor from a range, passes through to base class */
template<typename INPUTITERATOR> template<typename INPUTITERATOR>
FastMap(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {} explicit FastMap(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {}
/** Copy constructor from another FastMap */ /** Copy constructor from another FastMap */
FastMap(const FastMap<KEY,VALUE>& x) : Base(x) {} FastMap(const FastMap<KEY,VALUE>& x) : Base(x) {}

View File

@ -55,7 +55,7 @@ public:
/** Constructor from a range, passes through to base class */ /** Constructor from a range, passes through to base class */
template<typename INPUTITERATOR> template<typename INPUTITERATOR>
FastSet(INPUTITERATOR first, INPUTITERATOR last) : explicit FastSet(INPUTITERATOR first, INPUTITERATOR last) :
Base(first, last) { Base(first, last) {
} }

View File

@ -41,14 +41,14 @@ public:
FastVector() {} FastVector() {}
/** Constructor from size */ /** Constructor from size */
FastVector(size_t size) : Base(size) {} explicit FastVector(size_t size) : Base(size) {}
/** Constructor from size and initial values */ /** Constructor from size and initial values */
FastVector(size_t size, const VALUE& initial) : Base(size, initial) {} explicit FastVector(size_t size, const VALUE& initial) : Base(size, initial) {}
/** Constructor from a range, passes through to base class */ /** Constructor from a range, passes through to base class */
template<typename INPUTITERATOR> template<typename INPUTITERATOR>
FastVector(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {} explicit FastVector(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {}
/** Copy constructor from another FastSet */ /** Copy constructor from another FastSet */
FastVector(const FastVector<VALUE>& x) : Base(x) {} FastVector(const FastVector<VALUE>& x) : Base(x) {}