Skip to content

Commit

Permalink
Fixed issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka committed Mar 1, 2014
1 parent 5485b01 commit ee75dd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/LuaContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,10 +1855,10 @@ struct LuaContext::Pusher<TReturnType (TParameters...)>
return lua_error(state);
}

boost::optional<typename Reader<std::tuple<TParameters...>>::ReturnType> parameters;
std::unique_ptr<typename Reader<std::tuple<TParameters...>>::ReturnType> parameters;
// reading parameters from the stack
try {
parameters = Reader<std::tuple<TParameters...>>::readSafe(*me, -argumentsCount, argumentsCount);
parameters.reset(new typename Reader<std::tuple<TParameters...>>::ReturnType(Reader<std::tuple<TParameters...>>::readSafe(*me, -argumentsCount, argumentsCount)));

} catch (const WrongTypeException& ex) {
// wrong parameter type, using lua_error to return an error
Expand Down
4 changes: 2 additions & 2 deletions tests/functions_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TEST(FunctionsWrite, ConstRefParameters)
EXPECT_EQ(4, context.executeCode<int>("return f('test')"));
}

/*TEST(FunctionsWrite, VariantParameters)
TEST(FunctionsWrite, VariantParameters)
{
LuaContext context;

Expand All @@ -47,7 +47,7 @@ TEST(FunctionsWrite, ConstRefParameters)

EXPECT_EQ(1, context.executeCode<int>("return f(foo)"));
EXPECT_EQ(0, context.executeCode<int>("return f(3)"));
}*/
}

TEST(FunctionsWrite, FunctionObjects) {
struct Foo {
Expand Down

0 comments on commit ee75dd8

Please sign in to comment.