[TR1] How to say BOOST_USE_BOOST_TR1
Hi!
I'd like to
#include
I'd like to #include
while at the same time state that I am *not* interested in the compiler's TR1 implementation (vc9 ...) Any MACRO BOST_HAS_NO_TR1 I missed? The opposite (BOOST_HAS_TR1) exists.
Unfortunately you can't do that: the std::tr1 namespace has already been polluted by the vendors implementation so we can't add ours in there as well. You can of course use boost::whatever directly, rather than std::tr1::whatever. John.
John Maddock
I'd like to #include
while at the same time state that I am *not* interested in the compiler's TR1 implementation (vc9 ...) Any MACRO BOST_HAS_NO_TR1 I missed? The opposite (BOOST_HAS_TR1) exists.
Unfortunately you can't do that: the std::tr1 namespace has already been polluted by the vendors implementation so we can't add ours in there as well.
I have not included the TR1 headers of my compiler, so the pollution could be avoided. I expect boost/tr1/*.hpp to include the corresponding compiler's header only if configured in that way.
You can of course use boost::whatever directly, rather than std::tr1::whatever.
Boost::whatevers are quite different from their TR1 sisters.
(missing operator<< etc.)
So I am really interested in the implications of those differences
and want to have my code use std::* wherever possible.
Boost contains a TR1 implementation, but unfortunately I face difficulties
to enfiorce its usage. This I find odd.
Can we have the inclusion decision mechanisms be changed
to something similar to:
#if (defined(BOOST_HAS_TR1_TUPLE) && !defined(BOOST_USE_BOOST_TR1_IMPL))
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(tuple)
# else
# include
Or are we going to run into trouble because another std header might include the compiler's tr1 stuff again?
Yes, for example there are TR1 components in existing C++ std lib headers such as <utility> <cmath> etc. So there's no mechanism by which we can avoid including the vendors version if it's available. John.
I have just installed the current version of the gcc compiler on an Apple XServe/darwin platform, and then recompiled boost using the new gcc. I have found that it is still necessary to use the 'using darwin' option. However, the new gcc does not support the -no-cpp-precomp option and I had to modify line 332 of darwin.jam before it could compile. It looks as if this is only needed for old Apple compilers, and may well be removed from the new Apple compiler http://www.vtk.org/Bug/view.php?id=6267 Perhaps darwin.jam could be changed to make its use conditional on the release of the compiler? Nigel
Hi Nigel ! Well, replying to unrelated mails is the wrong way to go... On Thursday 26 February 2009, Dyer, Nigel wrote:
I have just installed the current version of the gcc compiler on an Apple XServe/darwin platform, and then recompiled boost using the new gcc.
This would be which gcc ? gcc -v might help... And Boost version, too ;-))
I have found that it is still necessary to use the 'using darwin' option. However, the new gcc does not support the -no-cpp-precomp option and I had to modify line 332 of darwin.jam before it could compile.
Please post a diff next time.
It looks as if this is only needed for old Apple compilers, and may well be removed from the new Apple compiler
http://www.vtk.org/Bug/view.php?id=6267
Perhaps darwin.jam could be changed to make its use conditional on the release of the compiler?
Of course, but please post a _new_ mail to the Boost.Build mailing list next time. And, as always: patches are appreciated... Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
John Maddock
Or are we going to run into trouble because another std header might include the compiler's tr1 stuff again?
Yes, for example there are TR1 components in existing C++ std lib headers such as <utility> <cmath> etc.
So there's no mechanism by which we can avoid including the vendors version if it's available.
[Still not giving up] What we need then is the possiblity to use the boost tr1 components from namespace boost::tr1, e.g. boost::tr1::tuple<...> // behaves like std::tr1::truple. vs. boost::tuple<...> // does not behave like std::tr1::tuple Is this feasible? Markus
AMDG Markus Werle wrote:
[Still not giving up] What we need then is the possiblity to use the boost tr1 components from namespace boost::tr1, e.g. boost::tr1::tuple<...> // behaves like std::tr1::truple. vs. boost::tuple<...> // does not behave like std::tr1::tuple
Is this feasible?
How is this better than boost::tuple directly? In Christ, Steven Watanabe
[Still not giving up] What we need then is the possiblity to use the boost tr1 components from namespace boost::tr1, e.g. boost::tr1::tuple<...> // behaves like std::tr1::truple. vs. boost::tuple<...> // does not behave like std::tr1::tuple
Is this feasible?
How is this better than boost::tuple directly?
That's the thing, I don't think it is: remember that Boost.TR1 is really just a bunch of using-directives that pull the boost:: code into std::tr1::, the only difference really is that the boost:: namespace may contain some additional features that aren't in the TR. But if that's an issue, you could just as easily cut and paste the using directives into your own namespace. John.
Markus Werle wrote:
Hi!
I'd like to #include
while at the same time state that I am *not* interested in the compiler's TR1 implementation (vc9 ...) Any MACRO BOST_HAS_NO_TR1 I missed? The opposite (BOOST_HAS_TR1) exists.
If you're specifically talking about VC9, then you can try defining _HAS_TR1 to 0 to disable the MS implementation. -- View this message in context: http://www.nabble.com/-TR1--How-to-say-BOOST_USE_BOOST_TR1-tp22205891p222077... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (6)
-
Dyer, Nigel
-
John Maddock
-
Juergen Hunold
-
Markus Werle
-
Richard Webb
-
Steven Watanabe