Home  >  Q&A  >  body text

c++ - 使用vector没有头文件为啥不报错?

include <opencv2/opencv.hpp>

include <iostream>

include <cassert>

include <cmath>

include <fstream>

using namespace std;
using namespace cv;

C++程序,使用了opencv,上面是头文件和命名空间,程序里有vector,为啥不报错,能正常编译运行?

黄舟黄舟2764 days ago559

reply all(4)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:07:02

    Because OpenCV has cv::vector…

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:07:02

    does not exist. .

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 13:07:02

    There should be code similar to this in opencv

    include <vector>

    namespace cv {
    using std::vector;
    }

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:07:02

    You are using cv::vector, not std::vector

    reply
    0
  • Cancelreply