我的代码中有这个。
vector<unsigned int> import;
vector<unsigned int> aquired;
. . .
size_t new_size = max(import.size(),aquired.size());
我得到这个错误:
error: more than one instance of
overloaded function "max" matches the
argument list:
function "max(int, int)"
function "max(unsigned int, unsigned int)"
function "max(int, unsigned int)"
function "max(unsigned int, int)"
function "max(long long, long long)"
function "max(unsigned long long, unsigned long long)"
function "max(long long, unsigned long long)"
function "max(unsigned long long, long long)"
function "max(float, float)"
function "max(double, double)"
function "max(float, double)"
function "max(double, float)"
argument types are: (size_t, size_t)
我的理解是这size_t
是一个无符号整数。那么为什么这是一个问题,我该如何解决它。
编译:
$gcc --version
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
$nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2010 NVIDIA Corporation
Built on Wed_Sep__8_17:12:45_PDT_2010
Cuda compilation tools, release 3.2, V0.2.1221