Skip to content

Commit 3565a1a

Browse files
authored
Add string array test (#189)
1 parent 35b061c commit 3565a1a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/containers.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ std::vector<std::tuple<double,double>> make_tuple_vector()
6666
return result;
6767
}
6868

69+
std::string catstrings(jlcxx::ArrayRef<const char*> strings)
70+
{
71+
std::string result;
72+
for(const char* s : strings)
73+
{
74+
result += std::string(s);
75+
}
76+
return result;
77+
}
78+
6979
JLCXX_MODULE define_julia_module(jlcxx::Module& containers)
7080
{
7181
using namespace jlcxx;
@@ -133,4 +143,5 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& containers)
133143
containers.method("make_array_tuple", &make_array_tuple);
134144
containers.method("read_array_tuple", &read_array_tuple);
135145
containers.method("make_tuple_vector", &make_tuple_vector);
146+
containers.method("catstrings", &catstrings);
136147
}

0 commit comments

Comments
 (0)