C++ 的 Python 绑定 pybind11

码农软件 · 软件分类 · 常用工具包 · 2019-08-14 18:42:47

软件介绍

pybind11 可实现 C++11 和 Python 之间的无缝操作。

pybind11 是一个轻量级的只包含一组头文件的 C++ 库,可以在 Python 中使用 C++ 类型。主要用于创建已有 C++ 代码的 Python 封装版本。其目的和语法类似于 Boost.Python 库。为什么要创建这个项目的原因就是因为 Boost 。作者认为 Boost 很大很复杂。而目前的 C++11 兼容的编译器使用已经非常广泛,所以希望开发一个更轻量级更具备兼容性的项目。

除去注释之外,该项目的核心头文件只有 2500 行左右代码,依赖于 Python (2.7 或者 3.x) 和标准 C++ 库。这么精简的实现有赖于新的 C++11 语言特性。特别是元组、Lambda 函数以及可变模板。自从项目创建以来,其增长已经超过了 Boost.Python。

核心特性

  • Functions accepting and returning custom data structures per value, reference, or pointer

  • Instance methods and static methods

  • Overloaded functions

  • Instance attributes and static attributes

  • Exceptions

  • Enumerations

  • Callbacks

  • Custom operators

  • STL data structures

  • Iterators and ranges

  • Smart pointers with reference counting like std::shared_ptr

  • Internal references with correct reference counting

  • C++ classes with virtual (and pure virtual) methods can be extended in Python

支持的编译器:

  1. Clang/LLVM (any non-ancient version with C++11 support)

  2. GCC (any non-ancient version with C++11 support)

  3. Microsoft Visual Studio 2015 or newer

  4. Intel C++ compiler v15 or newer

本文地址:https://codercto.com/soft/d/12367.html

2小时品牌素养

2小时品牌素养

邓德隆 / 2009-1 / 38.00元

《2小时品牌素养(第2版)》第一次系统发布有关中国企业的品牌竞争力分析报告,揭示了中国一流企业在品牌战略上面临的深重危机,提出了定位突围之道和实践方法。全书分上下两篇,上篇详细分析了定位的原理,给出定位的三种方法,并特别为中国企业走向世界指出了三条出路;下篇以王老吉品牌战略历程为例,细致论述了一个品牌打造的完整过程,并就品牌实践中的许多关键问题进行了阐述和研讨。作为兼顾理论和实践的第2版,《2小时......一起来看看 《2小时品牌素养》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具