Boost logo

Boost Users :

From: Brian Dantes (bldantes_at_[hidden])
Date: 2005-07-16 03:28:24

John Maddock wrote:
>>The thing is I have not had this problem on any other platform, or
>>indeed 2 other Mac's running an (as far as I'm aware) identical setup.
>>Does anyone have any ideas as to the possible cause of this?
> Sorry to take so long in getting back to you: I don't understand this error
> at all, the line in question doesn't instantiate any templates, just refers
> to the nested member of one that happens to be an enum. That enum type
> certainly is not used as a template argument (which would be illegal as it's
> an anonymous enum). Could this be some kind of setup problem at your end?
> Sorry, I just don't know what else to suggest at present.
> John.

I ran into this exact same problem (GCC 4.0.0, Boost 1.32, MacOS X
10.4.2 Tiger) and discovered that the culprits are the template
operator== overloaded functions starting on line 560 in
boost/function/function_base.hpp. Interestingly, the comment on line 442
for the function_base operator== methods seems to apply to these
free-standing functions as well:

   // GCC 3.3 and newer cannot copy with the global operator==, due to
   // problems with instantiation of function return types before it
   // has been verified that the argument types match up.

In other words, GCC is blowing up in instantiating the return types of
these template functions. I've read ad nauseam on the GCC bugzilla site
that anonymous enums are a no-no in template instantiations (they don't
even fall under SFINAE) - but surely this is a GCC bug that bombs out on
the return type like this alone...

So my workaround is to disable these functions completely - it seems to
work for me, although I am not building/using the entire library.


P.S. I just signed up to the Boost Users list. The only way I could find
to reply to an existing thread was through a newsreader (and my normal
news client, Entourage X, simply refused to deal with this and only this
news server with an error 130 every time - so I had to use Mozilla). Is
there an easier way?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at