Skip to content

Commit

Permalink
enable_if as template typename instead of auto return value
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Bühler authored and stbuehler committed Mar 23, 2017
1 parent 6ee3b8e commit 7289963
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/LuaContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1617,9 +1617,8 @@ class LuaContext {
Binder<TCallback, const TFirstType&> binder{ callback, *firstElem };
return readIntoFunction(state, retValueTag, binder, index + 1, tag<TTypes...>());
}
template<typename TRetValue, typename TCallback, typename TFirstType, typename... TTypes>
static auto readIntoFunction(lua_State* state, tag<TRetValue> retValueTag, TCallback&& callback, int index, tag<TFirstType, TTypes...>)
-> typename std::enable_if<!IsOptional<TFirstType>::value, TRetValue>::type
template<typename TRetValue, typename TCallback, typename TFirstType, typename... TTypes, typename = typename std::enable_if<!IsOptional<TFirstType>::value>::type>
static TRetValue readIntoFunction(lua_State* state, tag<TRetValue> retValueTag, TCallback&& callback, int index, tag<TFirstType, TTypes...>)
{
if (index >= 0)
throw std::logic_error("Wrong number of parameters");
Expand Down

0 comments on commit 7289963

Please sign in to comment.