[lambda][tr1] Are the native std::tr1::function in Visual Studio and boost::lambda compatible?
I am using Visual Studio 2008 SP1 with the Intel 11.0 compiler and
boost 1.38.
I am compiling with the pre-processor directive: BOOST_HAS_TR1 (though
I am not sure this does what I thought it did does since I see
boost::tuples is used below).
When I use the native tr1 function, I am unable to put a boost::lambda
into it (which worked fine with boost::function), I get an errors.
Any ideas?
Here is the sample code:
using boost::lambda::_1;
auto f = _1;
std::tr1::function
I am using Visual Studio 2008 SP1 with the Intel 11.0 compiler and boost 1.38.
I am compiling with the pre-processor directive: BOOST_HAS_TR1 (though I am not sure this does what I thought it did does since I see boost::tuples is used below).
When I use the native tr1 function, I am unable to put a boost::lambda into it (which worked fine with boost::function), I get an errors. Any ideas?
I'm not sure of the ins and outs of this, but you will be using Microsoft's implementation of std::tr1::function here. I'm not sure if boost::function does something special to work with lambda's or if this is a bug in the implementation. John.
On Jul 29, 4:57 am, "John Maddock"
I'm not sure of the ins and outs of this, but you will be using Microsoft's implementation of std::tr1::function here. I'm not sure if boost::function does something special to work with lambda's or if this is a bug in the implementation.
Thanks. Sounds like the dinkumware implementation Microsoft has licensed has some bugs/incompatibilities.The Intel compiler doesn't ship with its own standard libraries, so I assume this is an Microsoft issue when on Windows. I posted on Visual C++ support, but I am perfectly happy using the boost::tr1 implementation. How can I setup my environment (intel 11.0, Windows VisualStudio2008SP1, boost1.38) to use the boost tr1 instead of the native when I #include<memory>, etc.? I can figure out from the boost tr1 and boost::build docs how to tell boost to use the native tr1, but is it possible to go the other direction and force it to use the boost libraries with the standard include method? I am especially worried about going cross-platform to Intel 11.0 on linux which I think uses the GNU standard libraries. -Jesse
How can I setup my environment (intel 11.0, Windows VisualStudio2008SP1, boost1.38) to use the boost tr1 instead of the native when I #include<memory>, etc.? I can figure out from the boost tr1 and boost::build docs how to tell boost to use the native tr1, but is it possible to go the other direction and force it to use the boost libraries with the standard include method? I am especially worried about going cross-platform to Intel 11.0 on linux which I think uses the GNU standard libraries.
You can't do that I'm afraid: only one library can lay claim over namespace std::tr1, so once Dinkumware have done so we have to step out of the way :-( If you want to force use of the Boost implementation then use boost::function rather than std::tr1::function. HTH, John.
participants (3)
-
jesseperla
-
John Maddock
-
jp