reftrack: remove inline operator[]
Use of class static member 'zero' in an inline'd method is causing DLL confusion in dependent modules.
This commit is contained in:
@@ -67,7 +67,6 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
static const Count zero;
|
||||
typedef std::map<std::string, Count> cnt_map_t;
|
||||
cnt_map_t counts;
|
||||
public:
|
||||
@@ -80,11 +79,7 @@ public:
|
||||
*/
|
||||
void update();
|
||||
|
||||
const Count& operator[](const std::string& name) const
|
||||
{
|
||||
cnt_map_t::const_iterator it(counts.find(name));
|
||||
return it==counts.end() ? zero : it->second;
|
||||
}
|
||||
const Count& operator[](const std::string& name) const;
|
||||
|
||||
iterator begin() const { return counts.begin(); }
|
||||
iterator end() const { return counts.end(); }
|
||||
|
||||
@@ -94,7 +94,14 @@ size_t readRefCounter(const char *name)
|
||||
#endif
|
||||
}
|
||||
|
||||
const RefSnapshot::Count RefSnapshot::zero;
|
||||
const RefSnapshot::Count&
|
||||
RefSnapshot::operator[](const std::string& name) const
|
||||
{
|
||||
static const Count zero;
|
||||
|
||||
cnt_map_t::const_iterator it(counts.find(name));
|
||||
return it==counts.end() ? zero : it->second;
|
||||
}
|
||||
|
||||
void RefSnapshot::update()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user