从初始化列表创建一个simd :: float2

时间:2019-05-24 14:36:52

标签: c++ macos clang

我无法从初始化列表创建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')

有没有解决的办法?我想让我的代码向量类型尽可能多地保持不可知。

0 个答案:

没有答案