
14 Sep
2011
14 Sep
'11
4:53 p.m.
On 09/14/2011 03:21 AM, Ben Robinson wrote:
But I need a way to write a run-time unit test which will demonstrate that this code will fail to compile, when instantiated by the user of the library.
Then your run-time unit test needs to invoke the compiler, right?
When instantiated by the unit-test framework, the code instead throws an exception.
How does "the code" throw an exception if it doesn't even compile? At best you're showing that some other, similar-looking, code will throw an exception. What does that really mean though? Especially for the types of things MPL is used for. - Marsh