
9 Jul
2010
9 Jul
'10
3:29 a.m.
Is there any way to test at compile time, using a Boost construct, that a particular operator is not allowable for a given type, other than simply compile the code and have the compiler generate an error message when trying to use an operator on an object of that type ? I am writing some tests for an MPL library on which I am working where I want to make sure that a given operator for my template class instantiation object will fail to compile, but I would like to do this in such a way that I can generate a compile time message for the failure rather than an actual compiler error. I suspect this is not possible but I thought I would ask anyway.