thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King, III (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-2221) Generate c++ code with std::shared_ptr instead of boost::shared_ptr.
Date Sun, 23 Apr 2017 14:33:04 GMT

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

James E. King, III commented on THRIFT-2221:
--------------------------------------------

Things a developer shouldn't say:

{quote}It should be fairly easy to to.{quote}

Not that it isn't fun, but oh boy is boost embedded into everything we have...

{noformat}
#include <boost/algorithm/string.hpp>
#include <boost/assert.hpp>
#include <boost/atomic.hpp>
#include <boost/chrono/duration.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/date_time/posix_time/posix_time_duration.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/detail/endian.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
#include <boost/locale.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/special_functions/sign.hpp>
#include <boost/move/unique_ptr.hpp>
#include <boost/mpl/list.hpp>
#include <boost/noncopyable.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/program_options.hpp>
#include <boost/random.hpp>
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/scope_exit.hpp>
#include <boost/shared_array.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/static_assert.hpp>
#include <boost/test/auto_unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test_suite.hpp>
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/once.hpp>
#include <boost/thread/thread.hpp>
#include <boost/tokenizer.hpp>
#include <boost/tr1/functional.hpp>
#include <boost/type_traits.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/utility.hpp>
#include <boost/version.hpp>
{noformat}

There are places we could do much better; our current mutex implementation isn't even polymorphic
(there's no base class) - we just compile in different classes.  We could have a single Mutex
class for std and boost that uses the same technique as this ticket.  I don't see us being
divorced from boost any time soon... so we have to focus on making our interfaces use as many
C++11 compatible items as possible, such as this ticket does.

> 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)

Mime
View raw message