阅读背景:

为什么这是非法的初始化语法?

来源:互联网 
template<typename T>    
void func(T* arr, size_t length)
{
    size_t size_half = length / 2;
    T* left = arr, right = arr + size_half; // Cannot initialize a variable of type 'int' with an rvalue of type 'int *'
}
template<typename T>    
void func(T* arr, size



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: