Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-21 17:29:51


Hi,

I'm looking for a legal way to cause certain constructs to fail to
compile based on what templates have been instantiated at that point in
the program. The catch is that I also want it to be legal to compile the
same constructs in other translation units (and, if I have to settle for
something permissive, earlier in the same translation unit) where the
preventing templates have not been instantiated. Most approaches to this
problem result in ODR violations, AFAIK. I'm thinking that there may be
some promise in the use of the Barton & Nackmann trick in combination
with the unnamed namespace, but I'm not very clear about it. Has anyone
already solved this puzzle?

Thanks,
Dave

+---------------------------------------------------------------+
                  David Abrahams
      C++ Booster (http://www.boost.org) O__ ==
      Pythonista (http://www.python.org) c/ /'_ ==
  resume: http://users.rcn.com/abrahams/resume.html (*) \(*) ==
          email: david.abrahams_at_[hidden]
+---------------------------------------------------------------+


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk