Boost logo

Boost :

From: larsbj_at_[hidden]
Date: 2001-06-12 10:03:45


Douglas Gregor <gregod_at_[hidden]> writes:

| On Tuesday 12 June 2001 07:47, you wrote:
| > I am having some problems with boost::function, from the documentation
| > I suppose this should work:
| >
| > #include <iostream>
| >
| > // I have moved some include files slightly
| > #include "function.hpp"
| >
| >
| > void foo()
| > {
| > std::cout << "Hello!" << std::endl;
| > }
| >
| >
| > int main()
| > {
| > boost::function<void> f;
| > f = &foo;
| > f();
| > }
| >
| >
| > However with gcc 2.96 I get these errors:
|
| Ah, the infamous GCC 2.96 :)

but better than 2.95.x in almost all C++ aspects...
 
| It appears that the compiler is doing partial ordering of function templates
| incorrectly (2.95.x also had this problem), so you'll need to define
| BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING.
|
| You can either:
| 1) add -DBOOST_WEAK_FUNCTION_TEMPLATE_ORDERING to the command line when
| compiling, or,
| 2) modify boost/detail/function_base.hpp: where the test is done for GCC
| 2.95.x, (if __GNUC__ == 2 && __GNUC_MINOR__ <= 95), change the 95 to 96.

... and suddenly everything worked...

Hmm... shouldn't this be done in config.hpp?
(alternatively the check in function_base.hpp changed to <= 96?)
(oops... I forget that function isn't in boost proper yet..)

thanks a lot.

-- 
	Lgb

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