MSVC++ compiler error C2143

前端 未结 3 765
孤独总比滥情好
孤独总比滥情好 2021-01-25 12:45

The following code excerpt is responsible for a cryptic MSVC++ compiler error:

template class Vec : public vector{
  public:
    Vec() :          


        
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 13:08

    From MSDN: Compiler Error C2143 (C++)

    An unqualified call is made to a type in the Standard C++ Library:
    // C2143g.cpp
    // compile with: /EHsc /c
    #include 
    static vector bad;   // C2143
    static std::vector good;   // OK
    

    This just bit me. You just have to fix your references to vector, replacing them with std::vector.

提交回复
热议问题