GCC 4.1 uses the <tr1/memory>
header and GCC 4.3 uses <memory>
header, I need a portable way to use shared_ptr
with GCC 4.3.2 and with GCC 4.2.1, is there any way to do that without checking GCC version macros or using external libraries like Boost ?
views:
71answers:
2
+4
A:
<tr1/memory>
will still work with gcc 4.3. If you wan to support both versions, just use the tr1
name.
R Samuel Klatchko
2010-07-02 19:56:15
Isn't that tr1 stuff meant to be removed somewhen? I thought it was something temporary until the standard was really approved.
jdehaan
2010-07-02 20:03:32
@jedhaan - I've always assumed that even if something `tr1` made it into the standard, it would still be available in the `tr1` include files and namespaces for backwards compatibility.
R Samuel Klatchko
2010-07-02 20:31:18
+1
A:
Haven't tried this solution, but you might be able to add tr1 to the list of include directories on the gcc command line (-I or -isystem)
joesdiner
2010-07-02 19:56:28