title: How can I match one element from a C++ tuple using gmock?
body: <p>How can I match one element from a C++ tuple using gmock ?</p>
  
  <p>For example let's try to extract the <code>std::string</code> from a <code>std::tuple&lt;std::string, int&gt;</code>.</p>
  
  <p>I know I could write a custom matcher like this:</p>
  
  <pre><code>MATCHER_P(match0thOfTuple, expected, "") { return (std::get&lt;0&gt;(arg) == expected); }
  </code></pre>
  
  <p>But since I found the <code>Pair(m1, m2)</code> matcher for the <code>std::pair</code>, I expected also to find something similar for the <code>std::tuple</code>.</p>
  
  <p>Gmock has <code>Args&lt;N1, N2, ..., Nk&gt;(m)</code> for selecting a subset of tuple arguments. When using it with just 1 argument, it still expects a tuple matcher. The following attempt does not seem to compile:</p>
  
  <pre><code>struct {
    MOCK_METHOD1(mockedFunction, void(std::tuple&lt;std::string, int&gt;&amp;));
  } mock;
  EXPECT_CALL(mock, mockedFunction(testing::Args&lt;0&gt;(testing::Eq(expectedStringValue))));
  </code></pre>
  
  <p>And makes my clang give a compilation error like this:</p>
  
  <pre><code>.../gtest/googlemock/include/gmock/gmock-matchers.h:204:60: error: invalid operands to binary expression ('const std::__1::tuple&lt;std::__1::basic_string&lt;char&gt; &gt;' and 'const std::__1::basic_string&lt;char&gt;')
    bool operator()(const A&amp; a, const B&amp; b) const { return a == b; }
  ...
  </code></pre>
  
  <p>Is there a gmock solution for the <code>std::tuple</code> similar to the one for the <code>std::pair</code>, which uses the gmock <code>Pair</code> matcher?</p>