nanahan
nanahan copied to clipboard
static const data members don't have any definition
Static const data members should be defined.
In nanahan::Map
class template, the following static data members are declared;
static const size_t INITIAL_SIZE = 8;
static const size_t SLOTSIZE = sizeof(Slot) * 8;
static const size_t HOP_RANGE = SLOTSIZE * 8;
However, corresponding definitions are missing. Although they are not used (odr-used), it is not guaranteed that non-used variables make their definitions not necessary. Therefore, it would be best to adopt a conservative but simple "providing-the-definition-for-all-declarations" rule.
A static const size_t member variable is treated as a integral constant expression (see ISO/IEC 14882:1998 9.4.2-4). No namespace level definition needed.