问题描述
我有一个函数应该总是返回 A[0][1]。但我使用 std::async 和 gcc 说:
test_fibonacci_method/1/main.cpp:147:1: 警告:控制到达非空函数的结尾 [-Wreturn-type]
Integer Fib_iterative_n_Matrix(const unsigned& n) {
if (n < 2) return n; // Fib(0):=0 and Fib(1):=1
std::array<std::array<Integer,2>,2> A = {1,1},FIB = {1,1,0};
auto a = std::async(std::launch::async,[&]() { Matrixpower_A_time_B_pow_x(A,FIB,n); return true; });
if (a.get()) { // blocks
return A[0][1]; // fib(n)
}
}
如何使用 A[0][1] 更改最后一个 IF?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)