[ 
https://issues.apache.org/jira/browse/MESOS-706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838441#comment-13838441
 ] 

Till Toenshoff commented on MESOS-706:
--------------------------------------

Currently I also am looking into this area. My motivation: getting clang + 
libc++ compatibility. For achieving those goals, something as you drafted 
appears to be super helpful.

I have been looking into alternatives, but so far the only "non-leaking 
namespace" variant that I found was the way that the boost guys handle it. They 
however go a step further by wrapping everything into their own namespace. I am 
currently unsure if they invoke autotools for partially achieving that or if 
everything comes down to the preprocessor. 

> enable tr1/c++11/c++14 compiler checks where possible.
> ------------------------------------------------------
>
>                 Key: MESOS-706
>                 URL: https://issues.apache.org/jira/browse/MESOS-706
>             Project: Mesos
>          Issue Type: Bug
>    Affects Versions: 0.15.0
>            Reporter: Timothy St. Clair
>            Priority: Minor
>
> This is more of a nit, but it would be nice to enable tr1/c++11/c++14 checks 
> into autoconf , and isolate the dependencies on boost or prefer the standard 
> if/where possible. 
> ----------------------------------
> e.g.  _shared_ptr.h
> #ifndef ___SHARED_PTR_H__
> #define ___SHARED_PTR_H__
> // drop'd file by configure.
> #include "config.h" 
> #ifdef PREFER_CPP11
>       #include <memory>
>       #define _weak_ptr std::weak_ptr
>       #define _shared_ptr std::shared_ptr
> #elif defined(PREFER_TR1)
>       #include <tr1/memory>
>       #define _weak_ptr std::tr1::weak_ptr
>       #define _shared_ptr std::tr1::shared_ptr 
> #else
>       #include <boost/shared_ptr.hpp>
>       #include <boost/weak_ptr.hpp>
>       #define _weak_ptr boost::weak_ptr
>       #define _shared_ptr boost::shared_ptr
> #endif
> #endif
> ---------------------------------
> in .cpp files:
> #include "_shared_ptr.h"
> ...
> _shared_ptr<foo> bar;
> This isolates the namespace leakage into the primary code base, and allows an 
> easy shift over time. 
>  



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to