Boost logo

Boost Users :

Subject: [Boost-users] Testing that a particular operator is not alllowed
From: Edward Diener (eldiener_at_[hidden])
Date: 2010-07-08 23:29:36


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net