title: How to check elements in std::unique_ptr<int[]>?
body: <p>I have a function that returns a <code>std::unique_ptr&lt;int[]&gt;</code> and I would like check in a unit test that it returns the correct elements. It looks like code like the following doesn't work:</p>
  
  <pre><code>std::vector&lt;int&gt; foo = {1, 2, 3};
  std::unique_ptr&lt;int[]&gt; bar = my_func();
  EXPECT_THAT(bar, ElementsAreArray(foo))
  </code></pre>
  
  <p>I've also tried replacing <code>bar</code> with <code>bar.get()</code> in the assert, but I'm still getting strange type errors.</p>