Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambiguous initialize_list arguments #822

Merged
merged 1 commit into from
Apr 28, 2017

Commits on Apr 28, 2017

  1. Fix ambiguous initialize_list arguments

    This removes the convert-from-arithemtic-scalar constructor of
    any_container as it can result in ambiguous calls, as in:
    
        py::array_t<float>({ 1, 2 })
    
    which could be intepreted as either of:
    
        py::array_t<float>(py::array_t<float>(1, 2))
        py::array_t<float>(py::detail::any_container({ 1, 2 }))
    
    Removing the convert-from-arithmetic constructor reduces the number of
    implicit conversions, avoiding the ambiguity for array and array_t.
    This also re-adds the array/array_t constructors taking a scalar
    argument for backwards compatibility.
    jagerman committed Apr 28, 2017
    Configuration menu
    Copy the full SHA
    ec7332e View commit details
    Browse the repository at this point in the history