c++ - Unorderedmap: Error in template arguments -


I am creating an unordered map: the key has three letters and the value is integer.

Here's the code:

  Namespace G {typedef std :: tuple & lt; Four, four, four> Key_t; Struct key_hash: public std :: unary_function & lt; Key_t, std :: size_t & gt; {Std :: size_t operator} (const key_t & amp; k) const {return std :: get & lt; 0 & gt; (K) ^ std :: get & lt; 1 & gt; (K) ^ std :: get & lt; 2 & gt; (K); }}; Struct key_equal: public std :: binary_function & lt; Key_t, key_t, key_t, bool & gt; {Bool operator () (const key_t and v0, const key_t and v1, const key_t and v2) const {returns (std :: get <0> (v0) == std :: get & lt; 0 & Gt; (v1) & amp; amp;; Std :: get & lt; 1 & gt; (v0) == std :: get & lt; 1 & gt; (v1) & amp; amp; std :: & Lt; 2 & gt; (v0) == std :: get <2> (v1)); }}; Structure indexGuide {int index; }; Typedef std :: unordered_map & lt; Console key_t, indexguide, key_hash, key_geal & gt; GuideDouble; }  

But when I compile the code, I get this error

  the state tab in the generator CPP: 3: 0: statatab: h: 72 : 75: Error: Wrong number of template arguments (must be 5, 3) /usr/include/c++/4.6/bits/stl_function.h:115:12: Error: 'template & lt; _Result & gt; provided for class _Arg1, class _Arg2, class Struct std :: binary_function ' 

What is Plese doing wrong to me?

I think the problem is with your key_equal , where you have three Taking the arguments binary works a binary function is a function that takes two arguments.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -