开发者

c++ weird struct and bitset error

I have this inside my private class declarations

#include "stdafx.h"
using namespace std;
    template <typename Key, typename T>
    c开发者_如何转开发lass A{
    //....
    private:
        static const unsigned int HSIZE = 32;
        struct Bucket {
            Key key;
            T value;
            bitset<HSIZE> jumpMap;
        };
    //....
    };

Gives the following errors:

Error   1   error C4430: missing type specifier - int assumed
Error   2   error C2059: syntax error : '<'
Error   3   error C2238: unexpected token(s) preceding ';'

And when i remove the bitset line, it gives me no errors. What am i doing wrong?

EDIT: Added more relevant lines


Have you included the bitset header? I think you have missed it?


Should HMAX be HSIZE instead? Otherwise make sure you include < bitset >, and that the name is in scope. You probably have a using namespace std in your code, since you don't qualify it with std::. But my bet goes to HMAX <-> HSIZE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜