
Douglas Gregor wrote:
On Wednesday 18 February 2004 06:23 am, Pavel Vozenilek wrote:
[Problem with <bind.hpp> and <function.h> on BCC 6.4]
I found what;s the cause: <boost/mem_fn.hpp> is included by <function.hpp> and so if one writes:
---------------- #include <boost/function.hpp> #define BOOST_MEM_FN_ENABLE_FASTCALL #include <boost/bind.hpp> ----------------
it results with Bind using differently pre-processed <mem_fn.hpp> than it is expected.
Bellow is solution to produce clean error message when this situation happens:
Thanks. Peter, can you commit this or something like it?
I appreciate Pavel's taking the time to identify the problem, but I'm reluctant to commit his fix. The problem is not specific to BOOST_MEM_FN_ENABLE_FASTCALL; any Boost macro that affects code (and nearly all of them do) can cause a similar error when it's being inconsistently defined in one file and not in another, or in the middle of the includes, as in this case. Macros should be defined project-wide, with -D or in the project settings. I will, however, definitely mention this in the bind/mem_fn documentation. Several times. In bold. :-)