随笔分类 -  stl

C++17:结构化绑定(Structured binding)
摘要:https://stubbornhuang.blog.csdn.net/article/details/120740713 #include <iostream> #include <map> #include <tuple> std::pair<int, std::string> getPair( 阅读全文

posted @ 2022-11-02 09:57 OctoberKey 阅读(42) 评论(0) 推荐(0)

c++ std::string转大、小写
摘要:#include <iostream> #include <algorithm> int main() { std::string src = "HELLO, WORLD!"; std::string dst; std::transform(src.begin(), src.end(), std:: 阅读全文

posted @ 2022-10-19 15:42 OctoberKey 阅读(170) 评论(0) 推荐(0)

STL学习(1)——std::equal_to
摘要:说明 std::equal_to 作用 用于比较两个对象或两个值,它能像函数一样被调用,因此可以把它当作参数进行传递。运算符“==”是无法像参数一样被传递的。 用法 可以直接对c++原生类型进行比较,也可以对自定义类型进行比较,自定义类型需要重载“==”运算符。 示例 // equal_to exa 阅读全文

posted @ 2022-08-03 16:53 OctoberKey 阅读(875) 评论(0) 推荐(0)

导航