这可能与其他问题非常相似;我环顾了一下,但我不知道我在说什么,以至于无法确定。
我正在编写一个“应该”就地的函数,但它是通过BLAS调用实现的。BLAS呼叫不在适当的位置,所以我需要进行临时呼叫。因此:
void InPlace(ArrayClass& U, const TransformMatrix* M){
ArrayClass U_temp;
CallBLASdgemm(U, M, U_temp); //Now U_temp contains the correct output.
U = std::move(U_temp);
}这是对std::move的有效使用吗,或者我不知何故破坏了“复制省略”(或者由于其他原因它是不好的)?
编辑:请求了CallBLASDgemm的签名;它是
CallBLASdgemm(const ArrayClass& U, const TransformMatrix* M,
ArrayClass& V);https://stackoverflow.com/questions/44572903
复制相似问题