satoren / kaguya

C++ binding to Lua
Boost Software License 1.0
345 stars 70 forks source link

Compile failure for const-member functions #49

Closed Flamefire closed 8 years ago

Flamefire commented 8 years ago

The compilation (with an older apple-crosscompiler) fails when instantiating int kaguya::nativefunction::FunctorType::FunInvoker<F>::invoke(lua_State*) [with F = Nation (LuaPlayerBase::*)()const] as this results in instantiation of kaguya::traits::is_object<Nation ()()const> which ultimately fails with 'const' qualifiers added to function type 'Team ()()const' [...] In instantiation of 'kaguya::traits::remove_const<Nation ()()const>'

I tried to change the traits to:

        using standard::remove_const;
        using standard::remove_volatile;
        using standard::remove_cv;
        using standard::is_pointer;

But that fails too: pointer to function type 'int () const' cannot have 'const' qualifier for is_pointer from kaguya::traits::is_object<int () const> from 'call' [with MemType = int () const, T = kaguya_test_util::TestClass]

You probably can replace all this by is_member_object_pointer http://www.boost.org/doc/libs/1_58_0/libs/type_traits/doc/html/boost_typetraits/reference/is_member_object_pointer.html

satoren commented 8 years ago

I know it but can't fixed this https://ci.appveyor.com/project/satoren/kaguya/build/1.0.648/job/jc3x47f5c1d0f9kg

https://github.com/satoren/kaguya/commit/339a6457d35205813e977241c76a674c0c58230b

Flamefire commented 8 years ago

Ah. Just found that :( I'll try to work something out that works everywhere.