class StringMapEntryBase {
unsigned StrLen;
public:
- StringMapEntryBase(unsigned Len) : StrLen(Len) {}
+ explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {}
unsigned getKeyLength() const { return StrLen; }
};
unsigned NumTombstones;
unsigned ItemSize;
protected:
- StringMapImpl(unsigned itemSize) : ItemSize(itemSize) {
+ explicit StringMapImpl(unsigned itemSize) : ItemSize(itemSize) {
// Initialize the map with zero buckets to allocation.
TheTable = 0;
NumBuckets = 0;
class StringMapEntry : public StringMapEntryBase {
ValueTy Val;
public:
- StringMapEntry(unsigned StrLen)
+ explicit StringMapEntry(unsigned StrLen)
: StringMapEntryBase(StrLen), Val() {}
StringMapEntry(unsigned StrLen, const ValueTy &V)
: StringMapEntryBase(StrLen), Val(V) {}
typedef StringMapEntry<ValueTy> MapEntryTy;
public:
StringMap() : StringMapImpl(sizeof(MapEntryTy)) {}
- StringMap(unsigned InitialSize)
+ explicit StringMap(unsigned InitialSize)
: StringMapImpl(InitialSize, sizeof(MapEntryTy)) {}
AllocatorTy &getAllocator() { return Allocator; }
protected:
StringMapImpl::ItemBucket *Ptr;
public:
- StringMapConstIterator(StringMapImpl::ItemBucket *Bucket,
- bool NoAdvance = false)
+ explicit StringMapConstIterator(StringMapImpl::ItemBucket *Bucket,
+ bool NoAdvance = false)
: Ptr(Bucket) {
if (!NoAdvance) AdvancePastEmptyBuckets();
}