0

I am trying to use std::unique_ptr on gcc4.4.x, but facing issues regarding shared_ptr.h compilations. shared_ptr.h can't be compiled with -fno-rtti compiler options.

I don't need std::shared_ptr, I am just using std::unique_ptr and some old code still uses std::auto_ptr.

Can I patch header <memory> to ensure that shared_ptr.h does not get compiled when somebody includes <memory>. Currently I am using -DSHARED_PTR_H=1 in compiler options to avoid compiling shared_ptr.h. Which seems quite a hack, can you please direct me to a better approach?

g-217
  • 2,069
  • 18
  • 33
  • 2
    Better approach? Get a modern compiler and std library (and build as C++14). And nuke those `auto_ptr`s from orbit. Ohh and just learn to live with RTTI - it's not so bad, really. – Jesper Juhl May 23 '17 at 15:18
  • I am not that lucky man, I have to live with these old compilers on embedded platforms. :( And a customer is really adamant with `-fno-rtti`. Hope you understand. – g-217 May 23 '17 at 15:22

0 Answers0