![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
CPP
Kort1on
这个作者很懒,什么都没留下…
展开
-
通过配置调用具体类实例方法
//main.cpp#include <iostream>#include <string>#include <map>#include <vector>#include "dispatcher.h"/*<config> <wnd> <name>m_a0</name> <method_field> <method .原创 2022-01-13 14:53:15 · 220 阅读 · 0 评论 -
std::upper_bound与std::lower_bound
#include <iostream>#include <algorithm>#include <vector>void funcLower(int num, const std::vector<int>& vec){ auto itr = std::lower_bound(vec.begin(), vec.end(), num);/*第一个不小于*/ if (itr == vec.end()) { s.原创 2022-01-04 21:05:45 · 359 阅读 · 0 评论 -
指针用作函数形参
#include <iostream>class A{public: A(){}private: int a = 10;};//指针的拷贝void Test1(A* p){ if(p == nullptr){ p = new A(); std::cout<<"new object "<<p<<std::endl; }}//指针的引用void Test2(A*& p){.原创 2021-12-31 17:50:40 · 179 阅读 · 0 评论