| 1 | initial version |
In Python (1, 2, 3) is a tuple. There is no way a program will automatically convert it into a std::vector<int> in Python. The reason is that it does not make much sense: tuple are heterogeneous ((1, "hello", 3.0) is valid), Python integer type supports arbitrary precision integers such as 3**100 which would not fit to a C++ int, etc.
Secondly, if you have a main in your C++ file then the compiler will generate you an executable. Which is not what you want here.
That being said it is very easy to use C++ from Python. You just want to use Cython. That works perfectly fine in Jupyter.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.