Skip to content
  1. Apr 22, 2026
  2. Apr 20, 2026
  3. Apr 13, 2026
  4. Feb 03, 2026
  5. Feb 02, 2026
  6. Jan 27, 2026
  7. Jan 09, 2026
    • 邓辉's avatar
      Merge branch '404-pybind11' into 'master' · 60d90d02
      邓辉 authored
      Resolve "pybind11:接口中存在 vector | map 容器引用为参数时,并没有达到引用的效果"
      
      Closes #404
      
      See merge request !362
      60d90d02
    • mingfa.yang's avatar
      fix(pybind11): 修复接口中存在 vector,map 容器引用为参数时,并没有达到引用的效果的问题。 · e2ab0d4e
      mingfa.yang authored and 邓辉's avatar 邓辉 committed
      1. 收集接口中出现过的 `vector | map` 实例化容器引用类型
      2. 生成`pybind11_opaque.hpp`文件调用`PYBIND11_MAKE_OPAQUE(T)`,用于消除`pybind11/stl_bind.hpp`中对实例化容器类型`T`的自动cast。对于引用了`pybind11/stl_bind.hpp`的位置都需要同时引用`pybind11_opaque.hpp`,否则会出现映射错误
      3. 在`binder`接口(绑定接口统一调用入口)中调用`bind_vector<T, name>`,`pybind11::bind_map<T, name>`,完成容器的引用语义自动绑定。(pybind11不支持set的引用语义自动绑定)
      4. 在接口参数,返回值,变量翻译中,针对收集的实例化容器类型进行区分绑定: a. 若为`vector&,map& `采用引用语义绑定; b. 若为`vector,map,const vector &, const map &`,则用lambda函数包装原生接口,使用`pybind11::list` 或 `pybind11::dict`类型绑定cpp `vector`或`map`类型
      5. 对于模板嵌套类型,如`std::vector<std::vector<std::string>>>`,其中模板参数类型`std::vector<std::string>>`,会被翻译为默认类型,即若`std::vector<std::string>>`默认绑定为`ListString`,则`std::vector<std::vector<std::string>>>&` 被翻译为 `ListListString`, 内部储存`ListString`;`std::vector<std::vector<std::string>>>` 和 `const std::vector<std::vector<std::string>>> &` 被翻译为 `list[ListString]`
      e2ab0d4e
  8. Dec 19, 2025
  9. Dec 12, 2025
  10. Dec 04, 2025
  11. Sep 19, 2025
  12. Aug 22, 2025
  13. Aug 12, 2025
  14. Jul 22, 2025
  15. Jul 18, 2025
  16. Jul 09, 2025
  17. Jun 13, 2025
  18. Jun 06, 2025
  19. Jun 04, 2025
Loading