Commit 4c18f450 authored by Joe Snyder's avatar Joe Snyder
Browse files

Add default arguments to constructor

Add to the simple test a constructor with a default argument.  This will
demonstrate that the constructor arguments are passed correctly.

Fixes #145
parent 8f76d597
......@@ -4,6 +4,10 @@
simple::simple()
{
}
simple::simple(int var1, int optional)
{
std::cout << optional << "\n";
}
int simple::hello()
{
......
......@@ -4,6 +4,7 @@ class simple
{
public:
simple();
simple(int var1, int optional=10);
int hello();
};
......
......@@ -2,6 +2,11 @@ import simpleTest
s = simpleTest.simple()
r = s.hello()
print("hello returned " + str(r) + "\n")
q = simpleTest.simple(var1=1, optional=2);
q1 = simpleTest.simple(1)
if r == 10:
exit(0)
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment