13
0
livetrax/libs/lua/LuaBridge/detail
Sam Thursfield e37b250d4d Use correct type of std::map::count
Compiling Ardour commit ec8a4de015 with GCC
6.1.1 (on Fedora 24) gave this build failure:

    In file included from /home/sam/ardour/libs/lua/LuaBridge/LuaBridge.h:154:0,
                     from ../tools/luadevel/devel.cc:16:
    /home/sam/ardour/libs/lua/LuaBridge/detail/Namespace.h: In instantiation of ‘luabridge::Namespace::Class<std::map<K, V> > luabridge::Namespace::beginStdMap(const char*) [with K = std::__cxx11::basic_string<char>; V = std::__cxx11::basic_string<char>]’:
    ../tools/luadevel/devel.cc:89:60:   required from here
    /home/sam/ardour/libs/lua/LuaBridge/detail/Namespace.h:1666:30: error: no matches converting function ‘count’ to type ‘void (class std::map<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > > >::*)()’
           .addFunction ("count", (void (LT::*)())&LT::count)
                                  ^~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/c++/6.1.1/map:61:0,
                     from /home/sam/ardour/libs/lua/LuaBridge/LuaBridge.h:45,
                     from ../tools/luadevel/devel.cc:16:
    /usr/include/c++/6.1.1/bits/stl_map.h:1131:2: note: candidates are: template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_count_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::count(const _Kt&) const [with _Kt = _Kt; _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >]
      count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
      ^~~~~
    /usr/include/c++/6.1.1/bits/stl_map.h:1125:7: note:                 std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::count(const key_type&) const [with _Key = std::__cxx11::basic_string<char>; _Tp = std::__cxx11::basic_string<char>; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> > >; std::map<_Key, _Tp, _Compare, _Alloc>::size_type = long unsigned int; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = std::__cxx11::basic_string<char>]
           count(const key_type& __x) const
           ^~~~~

Casting std::map::count to the correct type instead of a fake void()
type fixes the compile failure.
2016-06-26 16:18:34 +02:00
..
CFunctions.h add lua/C++ dynamic_cast<> 2016-06-01 13:59:31 +02:00
ClassInfo.h Change LuaBridge_API to be __declspec(dllexport) or __declspec(dllimport, as required 2016-04-12 17:55:16 +01:00
Constructor.h
dump.h customize LuaBridge 2016-02-22 22:06:47 +01:00
FuncArgs.h LuaBridge: support argument references via table return 2016-02-22 22:06:47 +01:00
FuncTraits.h allow lua binding functions with up to 9 parameters 2016-05-31 23:51:22 +02:00
Iterator.h
LuaException.h
LuaHelpers.h
LuaRef.h customize LuaBridge 2016-02-22 22:06:47 +01:00
Namespace.h Use correct type of std::map::count 2016-06-26 16:18:34 +02:00
Stack.h LuaBridge: support argument references via table return 2016-02-22 22:06:47 +01:00
TypeList.h
TypeTraits.h customize LuaBridge 2016-02-22 22:06:47 +01:00
Userdata.h Modify 'getIdentityKey()' function to have LuaBridge_API linkage when building with MSVC (rather than simply 'extern') 2016-04-12 17:55:17 +01:00