• Jason Rhinelander's avatar
    Prefer non-converting argument overloads · e550589b
    Jason Rhinelander authored
    This changes the function dispatching code for overloaded functions into
    a two-pass procedure where we first try all overloads with
    `convert=false` for all arguments.  If no function calls succeeds in the
    first pass, we then try a second pass where we allow arguments to have
    `convert=true` (unless, of course, the argument was explicitly specified
    with `py::arg().noconvert()`).
    
    For non-overloaded methods, the two-pass procedure is skipped (we just
    make the overload-allowed call).  The second pass is also skipped if it
    would result in the same thing (i.e. where all arguments are
    `.noconvert()` arguments).
    e550589b
test_methods_and_attributes.cpp 13.3 KB