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

Mike Gresens commented on THRIFT-2221:
--------------------------------------

In my option std::unique_ptr is always available if C++11.
See http://en.cppreference.com/w/cpp/memory/unique_ptr
See 
http://www.boost.org/doc/libs/1_64_0/libs/config/doc/html/boost_config/boost_macro_reference.html
 @ BOOST_NO_CXX11_SMART_PTR

So the block
{code}
+  #if __cplusplus >= 201103L && (defined(__clang__) || __cpp_alias_templates 
>= 200704)
+    using scoped_ptr = std::unique_ptr;
+  #else
+    using ::boost::scoped_ptr;
{code}
can be replaced by
{code}
template <typename T> using scoped_ptr = std::unique_ptr<T>;
{code}

And remove the block

{code}
+  #if __cplusplus < 201103L
+    #include <boost/scoped_ptr.hpp>
+  #endif
{code}

Mike...

> Generate c++ code with std::shared_ptr instead of boost::shared_ptr.
> --------------------------------------------------------------------
>
>                 Key: THRIFT-2221
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2221
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Compiler
>    Affects Versions: 0.9.1
>         Environment: C++11 compilers with std::shared_ptr support
>            Reporter: Chris Stylianou
>            Assignee: James E. King, III
>              Labels: c++11, compiler, thrift
>
> Most modern compilers now have full support for std::shared_ptr when enable 
> with c++11 flags. It would be nice to have the option to generate code that 
> uses this instead of boost::shared_ptr. This would enable us to remove 
> another boost dependency, on the road to a dependency-free thrift library :)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to