悉野小楼

导航

2023年8月25日

一个引用没效果错误示范

摘要: #include <iostream> #include <unordered_map> using namespace std; class TestClass { public: std::unordered_map<int, int>& GetData() { return m_data; } 阅读全文

posted @ 2023-08-25 18:59 悉野 阅读(3) 评论(0) 推荐(0) 编辑

c++ stl std::sort使用例子

摘要: 例子1: class User { public: int32_t m_fight_power; private: int32_t m_level; }; bool CenterData::compare(const User *left, const User *right) { if(left- 阅读全文

posted @ 2023-08-25 10:15 悉野 阅读(17) 评论(0) 推荐(0) 编辑