The C++ ISO standard says: A function defined within a class definition is an inline function.
But look at the code as follows: leveldb-skiplist
class template <typename Key, class Comparator>
class SkipList{
public:
/*
...
*/
private:
inline int GetMaxHeight() const {
return max_height_.load(std::memory_order_relaxed);
}
};
there is still an explicit inline specifier when GetMaxHeight is defined inside class.
So, I want to know why we still need an explicit inline when a function defined within a class?
Aucun commentaire:
Enregistrer un commentaire