[C#] Discarding overloads using typecheck

Rokas Kupstys via Swig-user <[email protected]> Sat, 31 Aug 2024 09:12:24 +0300
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>
Hi,

Does anyone know how to have SWIG automatically discard overloads of 
compatible types? For example, we get this behavior for "const char*" 
and "std::string", where functions differing only with these types of 
corresponding parameters are treated as same. std_string.i has 
"%typemap(typecheck) string = char *;" which i thought is responsible 
for discarding overloads. I added typemaps for string_view, but 
"%typemap(typecheck) std::string_view = char *;" does not work. I also 
am dealing with two STL libraries - standard one and EASTL, so i need to 
treat types from both libraries as equal as well. All these types should 
be considered as strings: std::string, std::string_view, eastl::string, 
eastl::string_view, const char* (and corresponding const-ref variants, 
omitted for brevity). I know i can ignore those functions, but this 
would be very tedious, i would rather use a built in mechanism to 
discard these overloads. Please advice.

Thanks

-- 
-- Rokas Kupstys