1 2 3 4 5 ··· 106 下一页
摘要: 1.括号字符串 https://www.cnblogs.com/BlueBlueSea/p/14030412.html 2.二分应用题 https://www.cnblogs.com/BlueBlueSea/p/14030538.html 3.DFS+BFS共同可解 https://www.cnbl 阅读全文
posted @ 2020-11-24 15:14 lypbendlf 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/pandamohist/p/13854504.html,https://cplusplus.com/reference/algorithm/any_of/ 1.介绍 template <class InputIterator, class Una 阅读全文
posted @ 2024-06-04 00:54 lypbendlf 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 转自:chatgpt 1.介绍 struct Person{ uint32_t age; }; Person* getP(){ Person* p =new Person(); p->age = 5; return p; } int main() { const auto & pp = getP() 阅读全文
posted @ 2024-05-31 01:14 lypbendlf 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1.引用和拷贝对象 int main() { shared_ptr<Person> p=make_shared<Person>(); p->age = 5; cout<<"age: "<<p->age<<", use: "<<p.use_count()<<"\n\n"; cout<<"after B 阅读全文
posted @ 2024-05-30 00:42 lypbendlf 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1.介绍 // 指针类型参数 void funB(map<uint32_t,string>* mp){ (*mp)[5]="a";// 先解引用指针,然后再进行索引操作。[]优先级更高,所以*时要加括号 cout<<"funB: "<<static_cast<void *>(mp)<<"\n";// 阅读全文
posted @ 2024-05-30 00:03 lypbendlf 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/cpp_learner/article/details/118912592,chatgpt 1.介绍 智能指针就是帮管理动态分配的内存的,它会帮助我们自动释放new出来的内存,从而避免内存泄漏!使用智能指针可以自动调用对象的析构函数。 例子: cla 阅读全文
posted @ 2024-05-21 00:03 lypbendlf 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/cpp_learner/article/details/118912592,chatgpt 1.auto_ptr存在的问题 复制或者赋值都会改变资源的所有权;auto_ptr 的设计有一些缺陷,特别是其所有权转移语义(transfer of owne 阅读全文
posted @ 2024-05-20 23:54 lypbendlf 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.cnblogs.com/qicosmos/p/4325949.html,讲的很好 1.介绍 C++11的新特性--可变模版参数(variadic templates)对参数进行了高度泛化,它能表示0到任意个数、任意类型的参数。 要用三个点来定义: template <c 阅读全文
posted @ 2024-05-17 23:34 lypbendlf 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/wangshubo1989/article/details/49134235 1.介绍 std::function是一个函数对象类,可以接受并存储任何符合其签名的可调用对象,它包装其它任意的函数对象,被包装的函数对象具有类型为T1, …,TN的N个参 阅读全文
posted @ 2024-05-09 01:23 lypbendlf 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 转自:https://cplusplus.com/reference/vector/vector/cbegin/ 1.例子 返回一个指向容器首个元素的常量类型迭代器const_iterator: int main() { std::vector<int> myvector = {10,20,30,4 阅读全文
posted @ 2024-05-08 00:04 lypbendlf 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/janeqi1987/article/details/103542802 1.介绍 const和constexpr都可以来修饰对象和函数。constexpr表达式是指值不会改变并且在编译过程就能得到计算结果的表达式。声明为constexpr的变量一定 阅读全文
posted @ 2024-05-07 23:56 lypbendlf 阅读(12) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 106 下一页