C++ how can I refactor this?
<p>I have the code below in my test code in many places:</p>

<pre><code>  //
  // Make a function call while expecting an exception should be thrown
  //
  bool exceptionThrown = false;
  try
  {
    expectNotEqual(someData, anotherData, methodName);
  }
  catch(std::logic_error&amp;)
  {
    exceptionThrown = true;
  }
  if(!exceptionThrown)
    throw std::logic_error(methodName+"exception not thrown");
</code></pre>

<p>It would be nice (more readable, concise) if I could encapsulate all that, and do something like:</p>

<pre><code>  exceptionShouldBeThrown(expectNotEqual(someData, anotherData, methodName));
</code></pre>

<p>I dont want to use macro ...does anyone know how I could achieve the one-liner above with C++? </p>
