Skip to content

Issues with C++17 and Lambda expressions #114

@lyn19417

Description

@lyn19417

Context

I'm trying to have all my projects use a common version of C++ for consistency. However it seems that Kaguya doesn't well support C++17.

Kaguya Version: master branch
Environment: MSVC (v143)

Example

I have functions which I expose to lua defined through the use of lambda expressions.

state["testLambda"].setFunction([](int a) -> int {
    return a + 10;
});

This code will not compile under Kaguya with C++17 and give the following error (along some more which are only side effects of the first one):

use of undefined type 'kaguya::util::FunctionSignature<kaguya::nativefunction::call::ftype,void>'

More trouble...

After some digging, I got to fix THIS error by modifying utility_cxx11.hpp but now I'm faced with a second issue with detail::invoke_helper which cannot find a matching overload. I tried a bunch of things but none really worked.

I tried with replacing the util::invoke to the one from the standard library std::invoke but it gives exactly the same issues. Probably something related with how Kaguya handles things.

For now I will stick with C++14 until this (hopefully) gets fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions