blob: 1293cb7e8f536064bfb541f6a988f980be8cdac7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
set cpp [C++]
$cpp cflags -std=c++11
$cpp include <vector>
$cpp proc addInCpp {int a int b} int {
std::vector<int> xs = {a, b};
int sum = 0;
for (int x : xs) {
sum += x;
}
return sum;
}
set cppLib [$cpp compile]
assert {[+ 10 3] == [$cppLib addInCpp 10 3]}
Exit! 0
|