12 lines
		
	
	
		
			236 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			236 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#include <pybind11/pybind11.h>
 | 
						|
 | 
						|
int add(int a, int b) {
 | 
						|
    return a + b;
 | 
						|
}
 | 
						|
 | 
						|
PYBIND11_MODULE(example, m) {
 | 
						|
    m.def("add", &add, "A function that adds two numbers");
 | 
						|
    m.def("hello", []() {
 | 
						|
        return "Hello from C++!";
 | 
						|
    });
 | 
						|
} |