私のコードにはこれがあります。
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
はunsignedintです。では、なぜこれが問題なのか、どうすれば回避できるのでしょうか。
コンパイル:
$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