
c++
mmeeeee
这个作者很懒,什么都没留下…
展开
-
c++函数返回值return时到底需不需要move
先定义一个测试类,定义了默认构造函数,析构函数,复制构造函数和移动构造函数。在类外定义了一个int值,用于记录构造函数调用次数,默认是1。int si = 1;class T{public: T(const std::string& n) { name = n; std::cout << "create T " << name << std::endl; } T(const T& t) { name = t.name + s原创 2021-09-15 09:58:12 · 778 阅读 · 0 评论 -
2021-08-10
PDAL读las ply测试lasplylasvoid readLas(){ pdal::Option las_opt("filename", "D:/test_data/8gblas/1_500_000.las");//参数1:"filename"(键) pdal::Options las_opts; las_opts.add(las_opt); pdal::PointTable table; pdal::LasReader las_reader; las_reader.setOpt原创 2021-08-10 08:45:13 · 165 阅读 · 0 评论 -
c++ vector下标和指针查找
听说vector用指针查找会比用下标快,今天特地实践了一下std::vector<int> int_arr = { 0, 1, 2, 3, 4, 5, 6, 7 };int int_arr_size = int_arr.size();int nn = 100'000;//执行次数int i = 0;int temp;//下标查找void findByIndex() { int n1 = nn; while (n1--) { for (i = 0; i < int_原创 2021-03-24 10:25:21 · 1850 阅读 · 0 评论