• Jason Rhinelander's avatar
    Fix ambiguous initialize_list arguments · 51d18aa2
    Jason Rhinelander authored
    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.
    51d18aa2
test_numpy_array.cpp 10.9 KB