Bunu kodumda var.En fazla iki size_t değişkenini hesapladım
vector<unsigned int> import;
vector<unsigned int> aquired;
. . .
size_t new_size = max(import.size(),aquired.size());
ve bu hatayı alıyorum:
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)
benim anlayış size_t
işaretsiz int olmasıdır. Öyleyse neden bu bir problem ve nasıl etrafta dolaşacağım. derlenmesi
:
$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
'size_t' mutlaka bir' unsigned' değil, adayların geliyor nerede acaba: En az
Kullanım std :: max ++ g - Ben kendi türü değil, bir typedef şüpheli dan? – UncleBens
Bunu gcc'de üretemiyorum 4.4.1. Tam bir test programı gönderebilir misin? – ssegvic
Std :: max eklemek için problemi çözdüm max'in başka bir başlık veya başka bir şey tarafından maskelenmiş olduğunu düşünüyorum. –