sci-visus/OpenVisus

SharedPtr define in namespace

ptbremer opened this issue · 2 comments

In the latest master we use

#define SharedPtr std::shared_ptr

But in the downstream code I usually try to avoid a
using namespace Visus;
to avoid polluting my namespace

Instead, I think the more correct usage (I think) is

Visus::SharedPtr pFoo;

But this now lead to an error on my system.

error: no member named 'std' in namespace 'Visus'; did you mean simply 'std'?

The reason is that we are using a #define rather than a typedef which means that my statement get expanded into

Visus::std::SharedPtr pFoo;

which does not compile.

I propose to simply switch to a typedef in Kernel.h, i.e.

typedef SharedPtr std::shared_ptr;

which should fix this

Yes this compiles