James, I think the problem of requiring std::shared_ptr is that it wont
work with some older compilers without adding --std=c++0x, such as g++ 4.4.x

Brian

On Mon, Oct 6, 2014 at 8:21 AM, James Peach <jpe...@apache.org> wrote:

> On Oct 3, 2014, at 9:06 PM, Brian Geffon <briangef...@gmail.com> wrote:
>
> > Hey all,
> > So there is a weird situation we're in with the c++ api where it has a
> > dependency on shared_ptr which can exist in memory or tr1/memory and
>
> Just stop doing this. tr1 is ancient, so require std::shared_ptr in order
> to build the C++ API. Then there's no possibility of confusion and this
> problem goes away.
>
> > similarly in the namespace std:: and std;:tr1::, so in the c++ api's
> > shared_ptr.h file we have the following mess:
> >
> >
> > #include "ink_autoconf.h"
> > #if HAVE_STD_SHARED_PTR
> > #  include <memory>
> > #else
> > #  include <tr1/memory>
> > #endif
> >
> > namespace atscppapi {
> > #if HAVE_STD_SHARED_PTR
> > using std::shared_ptr;
> > #else
> > using std::tr1::shared_ptr;
> > #endif
> > }
> >
> > And we're including ink_autoconf.h only because it determines which
> > implementation of shared_ptr the user has. This can't work because this
> > file is installed and ink_autoconf.h no longer exists. amc, suggested the
> > following trick to handle the namespacing but it still falls short when
> > determining which file to include, does anyone have ideas of how we can
> > remove this dependency on ink_autoconf.h?
> >
> > namespace tr1 { }
> > namespace std_tr1 {
> > using namespace std;
> > using namespace tr1;
> > }
> >
> > namespace atscppapi {
> > using std_tr1::shared_ptr;
> > }
> >
> >
> > Brian
> >
> > On Fri, Oct 3, 2014 at 9:03 PM, Brian Geffon <briangef...@gmail.com>
> wrote:
> >
> >> Hey all,
> >> So there is a weird situation we're in with the c++ api where it has a
> >> dependency on shared_ptr which can exist in memory or tr1/memory and
> >> similarly in the namespace std:: and std;:tr1::, so in the cppapi's
> >> shared_ptr.h file we have the following mess:
> >> #include "ink_autoconf.h"
> >>
> >>
> >> #if HAVE_STD_SHARED_PTR
> >>
> >> #  include <memory>
> >> #else
> >>
> >> #  include <tr1/memory>
> >>
> >> #endif
> >>
> >>
> >> namespace atscppapi {
> >>
> >> #if HAVE_STD_SHARED_PTR
> >>
> >> using std::shared_ptr;
> >>
> >> #else
> >>
> >> using std::tr1::shared_ptr;
> >>
> >> #endif
> >>
> >>
> >> } /* atscppapi */
> >>
>
>

Reply via email to