开发者

Portable way to use shared_ptr in GCC

开发者 https://www.devze.com 2023-01-06 08:16 出处:网络
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 th

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 ?


<tr1/memory> will still work with gcc 4.3. If you wan to support both versions, just use the tr1 name.


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号