swig/Examples/ocaml/stl/example.h
Zackery Spytz a851e0a9ac [OCaml] Re-enable the using_protected unit test
Use the [member-variable] syntax in using_protected_runme.ml as
required by the OCaml module's documentation and implementation.

Fix the return type for vec_write() in example.h in the OCaml stl
example.
2019-01-11 17:59:23 -07:00

17 lines
364 B
C++

/* File : example.h -- stolen from the guile std_vector example */
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
using std::string;
void vec_write(std::vector<string> v) {
int n = 0;
for( std::vector<string>::iterator i = v.begin();
i != v.end();
i++ )
printf( "%04d: %s\n", ++n, i->c_str() );
}