Boost logo

Boost Users :

Subject: [Boost-users] boost 1.37, tr1 and gcc 4.x
From: Acsoft Acsoft (ac_soft_at_[hidden])
Date: 2008-11-11 10:24:51


Hello,
I am using boost 1.37 and gcc 4.3.2.
I am getting a very nasty error when I mix up boost headers and tr1 headers in one compilation unit.

Here is my code:
#include <functional>
using namespace std;
using namespace tr1;

#include <boost/program_options.hpp>
using namespace boost;

void blub()
{
}
function<void()> i1(blub); //error: expected constructor, destructor, or type conversion before '<' token
std::function<void()> i2(blub); //Compiles fine
tr1::function<void()> i3(blub); //Compiles fine
boost::function<void()> i4(blub); //Compiles fine

I did add the 'boost/tr1/tr1/' folder to the very beginning of global include list.

What is wrong?



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