私は次の宣言を持っていますKey.h
typedef uint64_t KeyHash;
私のFinder
クラスでは、C++
次のように宣言されたマップがあります。
std::map<std::pair<uint64_t, KeyHash>, Foo> table;
したがって、私は新しいペアを作成しようとしています。オブジェクトには とのFoo
2 つのフィールドがstartKeyHash
ありfoo_id
、どちらもタイプはuint64_t
:
std::pair<uint64_t, KeyHash> key (foo.foo_id,
foo.start_key_hash());
table[key] = tablet;
関数uint64_t Foo:start_key_hash()
は を返しますstartKeyHash
。ただし、コードをコンパイルすると、次のエラーが発生します。
error: no matching function for call to ‘std::pair<long unsigned int, long unsigned int>::pair(<unresolved overloaded function type>, google::protobuf::uint64)’
/usr/lib/gcc/x86_64-redhat-`linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_pair.h:111: note:
candidates are: std::pair<_T1, _T2>::pair(_U1&&, _Arg0&&, _Args&& ...) [with _U1 =
google::protobuf::uint64, _Args = , _T1 = long unsigned int, _T2 = long unsigned int]`
何かご意見は?