ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Allow references to be used as scalar operands

Open zackangelo opened this issue 3 years ago • 2 comments
trafficstars

Fixes #1200

Relaxes the type constraint on StaticOperand so that it may be used for references.

This example now works:

let arr1 = array!([1, 2, 3]);
let four: i32 = 4;
let arr2 = arr1 + &four; //previously errored on lack of an Add<> impl

zackangelo avatar Aug 28 '22 22:08 zackangelo

The CI failure appears to be unrelated to the code change:

docker: Error response from daemon: Duplicate mount point: /home/runner/work/ndarray/ndarray.

zackangelo avatar Aug 28 '22 22:08 zackangelo

Removing 'static is a breaking change. 'static implies that one can use Any and ad hoc type based "specialization", which is why we have snuck in 'static in a few places. We would like to continue to have 'static in all places where we'd like to insert explicit SIMD or BLAS etc operations.

bluss avatar Jul 27 '23 18:07 bluss

closing for now because keeping 'static is preferred

bluss avatar Mar 12 '24 16:03 bluss