This one could probably be solved by putting a to!(double[]) or whatever the element type is in. to!(T[])(T[]) simply returns the original T[]. It doesn't copy. Therefore, adding this feature would have zero performance overhead.
import scid.matvec;
void main() {
auto v = Vector!double([1.0f, 2, 3]);
}
Error:
D:\customd\scid\vector.d(72): Error: constructor scid.storage.array.BasicArrayStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),vectorType).BasicArrayStorage.this (uint newLength) is not callable using argument types (float[])
D:\customd\scid\vector.d(72): Error: struct scid.storage.array.BasicArrayStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),vectorType).BasicArrayStorage member this is not accessible
D:\customd\scid\vector.d(71): Error: cannot implicitly convert expression (_param_0) of type float[] to RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1)
test9.d(4): Error: template instance scid.vector.BasicVector!(BasicArrayStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),vectorType)).BasicVector.__ctor!(float[]) error instantiating
This one could probably be solved by putting a to!(double[]) or whatever the element type is in. to!(T[])(T[]) simply returns the original T[]. It doesn't copy. Therefore, adding this feature would have zero performance overhead.
Error:
D:\customd\scid\vector.d(72): Error: constructor scid.storage.array.BasicArrayStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),vectorType).BasicArrayStorage.this (uint newLength) is not callable using argument types (float[]) D:\customd\scid\vector.d(72): Error: struct scid.storage.array.BasicArrayStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),vectorType).BasicArrayStorage member this is not accessible D:\customd\scid\vector.d(71): Error: cannot implicitly convert expression (_param_0) of type float[] to RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1) test9.d(4): Error: template instance scid.vector.BasicVector!(BasicArrayStorage!(RefCounted!(CowArray!(double),cast(RefCountedAutoInitialize)1),vectorType)).BasicVector.__ctor!(float[]) error instantiating