2
#include <stdint.h>
class Something { ...
void put(int32_t value, int32_t scale = 0);
void put(int64_t value, int32_t scale = 0);
void put(bool value);
};
呼叫something.put(4LL)
是不明确的。 int64_t是如何定义的,以便它不是long long int constant的完美匹配,这是错误消息告诉我的吗?int64_t的整数类型歧义
也许'int64_t'是'long'。 – user2357112
只是在这里猜测,但4LL仍然是4和4将适合32位或64位整数...可能是错误的,虽然 – Thomas
@托马斯:重载分辨率的相关是类型,而不是价值。 '4LL','4L'和'4'都具有相同的数学值,但它们都是不同的类型。 –