The compiler reports 292 errors refering to error C2252 and C2258
- --------------------Configuration: client - Win32 Debug--------------------
Compiling...
Util.cpp
g:\projects\dcplusplus-0.262-src-mod\client\util.h(52) : error C2258: illegal pure syntax, must be '= 0'
g:\projects\dcplusplus-0.262-src-mod\client\util.h(57) : see reference to class template instantiation 'PointerHash<T>' being compiled
g:\projects\dcplusplus-0.262-src-mod\client\util.h(52) : error C2252: 'bucket_size' : pure specifier can only be specified for functions
g:\projects\dcplusplus-0.262-src-mod\client\util.h(57) : see reference to class template instantiation 'PointerHash<T>' being compiled
g:\projects\dcplusplus-0.262-src-mod\client\util.h(53) : error C2258: illegal pure syntax, must be '= 0'
g:\projects\dcplusplus-0.262-src-mod\client\util.h(57) : see reference to class template instantiation 'PointerHash<T>' being compiled
g:\projects\dcplusplus-0.262-src-mod\client\util.h(53) : error C2252: 'min_buckets' : pure specifier can only be specified for functions
g:\projects\dcplusplus-0.262-src-mod\client\util.h(57) : see reference to class template instantiation 'PointerHash<T>' being compiled
Error executing cl.exe.
Util.obj - 4 error(s), 0 warning(s)
Code: Select all
static const size_t bucket_size = 4;
static const size_t min_buckets = 8;It's a bug in VC6++.
- The compiler does not support in-place initialization of static const integral member data as specified in the C++ standard (section 9.2) quoted in the following:
4 - A member-declarator can contain a constant-initializer only if it declares a static member of integral or enumeration type.
Code: Select all
#if _MSC_VER == 1200
enum {bucket_size = 4};
enum {min_buckets = 8};
#else
static const size_t bucket_size = 4;
static const size_t min_buckets = 8;
#endif // _MSC_VER == 1200Hope it helps someone than me ...