我无法从初始化列表创建simd::float2
:
#include <simd/simd.h>
void f(simd::float2) { }
int main() {
f({0.0f,0.0f}); // Doesn't work
f(simd::float2{0.0f,0.0f}); // Works
}
错误是:
candidate function not viable: cannot convert initializer list argument
to 'simd::float2' (aka 'simd_float2')
有没有解决的办法?我想让我的代码向量类型尽可能多地保持不可知。