A variable not detected as not used

前端 未结 3 1966
别那么骄傲
别那么骄傲 2021-01-18 09:41

I am using g++ 4.3.0 to compile this example :

#include 

int main()
{
  std::vector< int > a;
  int b;
}

If I compile

3条回答
  •  悲哀的现实
    2021-01-18 10:45

    a is actually used after it is declared as its destructor gets called at the end of its scope.

提交回复
热议问题