随笔分类 -  C++

摘要:今天又学到了一个关于关联容器map小技巧:通过值(Value)来寻找对应的键(Key),这个功能通过std::find_if实现,代码如下 template <class T, class U> T findKeyByValue(const U Val, const std::map<T, U>& 阅读全文
posted @ 2022-10-14 20:47 Fitanium 阅读(2424) 评论(0) 推荐(0)
摘要:本文将用一个小的示例来展示如何通过Boost.Python 来实现 C++/Python 混合编程从而将两种语言的优势整合到一起。 1. CMakeLists.txt cmake_minimum_required(VERSION 3.5) project(test_boost_python LANG 阅读全文
posted @ 2022-04-23 20:40 Fitanium 阅读(1288) 评论(0) 推荐(0)
摘要:C++ unordered_map 使用自定义类作为键类型 C++ unordered_map using a custom class type as the key 阅读全文
posted @ 2022-04-19 08:50 Fitanium 阅读(152) 评论(0) 推荐(0)