summaryrefslogtreecommitdiff
path: root/Examples/test-suite/overload_bool.i
blob: d48bfc299966863f3344a99a8dc80ad6cc3c7aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
%module overload_bool

%inline %{
const char* overloaded(bool value) { return "bool"; }
const char* overloaded(int value) { return "int"; }
const char* overloaded(const char *value) { return "string"; }

const char* boolfunction(bool value) { return value ? "true" : "false"; }
const char* intfunction(int value) { return "int"; }


// Const references
const char* overloaded_ref(bool const& value) { return "bool"; }
const char* overloaded_ref(int const& value) { return "int"; }
const char* overloaded_ref(const char *value) { return "string"; }

const char* boolfunction_ref(bool const& value) { return value ? "true" : "false"; }
const char* intfunction_ref(int const& value) { return "int"; }
%}