Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Visual Studio 2012中的IntelliSence:在类模板中没有可用于内部类的成员?_C++_Visual Studio 2012_Intellisense_Inner Classes - Fatal编程技术网

C++ Visual Studio 2012中的IntelliSence:在类模板中没有可用于内部类的成员?

C++ Visual Studio 2012中的IntelliSence:在类模板中没有可用于内部类的成员?,c++,visual-studio-2012,intellisense,inner-classes,C++,Visual Studio 2012,Intellisense,Inner Classes,我想知道为什么在Visual Studio 2012桌面中键入: struct a { struct b { int foo; }; b bar; bar. }; IntelliSense调用:“没有可用的成员”。当我在结构a中键入“bar.”时。 我的问题是——这是VisualStudio2012的bug,还是我的愚蠢?对我来说,这是非常烦人的,我祈祷有什么可以解决这一问题 编辑

我想知道为什么在Visual Studio 2012桌面中键入:

    struct a
    {
        struct b
        {
            int foo;
        };

    b bar;
    bar.
    };
IntelliSense调用:“没有可用的成员”。当我在结构a中键入“bar.”时。 我的问题是——这是VisualStudio2012的bug,还是我的愚蠢?对我来说,这是非常烦人的,我祈祷有什么可以解决这一问题

编辑: 尽管我在编写这样的代码时表现得很愚蠢,但即使在函数中,我仍然存在这个问题。但我发现了一个很大的要求——它必须是类模板。 所以真正的代码是:

    template<typename def>
    class lista
    {
    private:
     struct wezel
     {
             int poprz;
     };
     wezel* current;
    public:
     void do_tylu()
     {
         current->
     }
    };
模板
lista类
{
私人:
结构韦泽尔
{
int-poprz;
};
韦泽尔*电流;
公众:
void do_tylu()
{
当前->
}
};

然后IntelliSense开始崩溃…

在本例中,您正在方法(或字段初始值设定项)之外键入表达式。这在C++中是不允许的,所以智能感知算法没有提供有用的信息。 请尝试以下操作:

struct a
{
    struct b
    {
        int foo;
    };

    b bar;

    void SomeMethod()
    {
        bar.
    }
};

这个问题实际上是关于C++的,但是答案也适用于该语言:对不起,我没有说我在C++中写,我的坏。@这个问题被标记为C++;我应该注意到标签的。我编辑了这篇文章,但答案实际上还是一样的。是啊,又是我的错,真是太傻了。。。我也明白了我的问题所在,所以我要编辑这个问题