Skip to main content

Overview

Cpp.js supports binding for most C++ constructs, including features from C++11 and C++14. The only major limitation is the lack of support for raw pointers at this time.

The table below outlines the headings discussed in this section.

Data TypesFunctionsClasses and Objects
Primitive TypesFunction CallConstructors, Member Functions
VectorFunction OverloadingInheritance
MapPolymorphism
EnumInterfaces (Abstract Classes)
Vector
Class Object

info

Embind is utilized to bind C++ functions and classes to JavaScript. In WebAssembly, this functionality is provided by Emscripten. In React Native, the binding is achieved through the @cpp.js/core-embind-jsi project, which replaces WebAssembly bindings with JavaScript Interface (JSI).

The bugra9/swig project, a fork of the original Swig project adapted to support Embind, is used to create Embind definitions.

In addition, a customized version of Embind is used to support overloaded functions. The modified version is accessible via this link.