shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include <boost/thread/lock_algorithms.hpp>
|
||||
#include <boost/thread/lock_types.hpp>
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/std::shared_ptr.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/type_traits/is_fundamental.hpp>
|
||||
#include <boost/thread/detail/is_convertible.hpp>
|
||||
@@ -236,9 +236,9 @@ namespace boost
|
||||
bool thread_was_interrupted;
|
||||
//#endif
|
||||
#if defined BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
|
||||
shared_ptr<future_continuation_base> continuation_ptr;
|
||||
std::shared_ptr<future_continuation_base> continuation_ptr;
|
||||
#else
|
||||
shared_ptr<void> continuation_ptr;
|
||||
std::shared_ptr<void> continuation_ptr;
|
||||
#endif
|
||||
future_object_base():
|
||||
done(false),
|
||||
@@ -998,11 +998,11 @@ namespace boost
|
||||
|
||||
struct registered_waiter
|
||||
{
|
||||
boost::shared_ptr<detail::future_object_base> future_;
|
||||
boost::std::shared_ptr<detail::future_object_base> future_;
|
||||
detail::future_object_base::waiter_list::iterator wait_iterator;
|
||||
count_type index;
|
||||
|
||||
registered_waiter(boost::shared_ptr<detail::future_object_base> const& a_future,
|
||||
registered_waiter(boost::std::shared_ptr<detail::future_object_base> const& a_future,
|
||||
detail::future_object_base::waiter_list::iterator wait_iterator_,
|
||||
count_type index_):
|
||||
future_(a_future),wait_iterator(wait_iterator_),index(index_)
|
||||
@@ -1236,7 +1236,7 @@ namespace boost
|
||||
{
|
||||
protected:
|
||||
|
||||
typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
|
||||
typedef boost::std::shared_ptr<detail::future_object<R> > future_ptr;
|
||||
|
||||
future_ptr future_;
|
||||
|
||||
@@ -1566,7 +1566,7 @@ namespace boost
|
||||
template <typename R>
|
||||
class promise
|
||||
{
|
||||
typedef boost::shared_ptr<detail::future_object<R> > future_ptr;
|
||||
typedef boost::std::shared_ptr<detail::future_object<R> > future_ptr;
|
||||
|
||||
future_ptr future_;
|
||||
bool future_obtained;
|
||||
@@ -1729,7 +1729,7 @@ namespace boost
|
||||
template <typename R>
|
||||
class promise<R&>
|
||||
{
|
||||
typedef boost::shared_ptr<detail::future_object<R&> > future_ptr;
|
||||
typedef boost::std::shared_ptr<detail::future_object<R&> > future_ptr;
|
||||
|
||||
future_ptr future_;
|
||||
bool future_obtained;
|
||||
@@ -1871,7 +1871,7 @@ namespace boost
|
||||
template <>
|
||||
class promise<void>
|
||||
{
|
||||
typedef boost::shared_ptr<detail::future_object<void> > future_ptr;
|
||||
typedef boost::std::shared_ptr<detail::future_object<void> > future_ptr;
|
||||
|
||||
future_ptr future_;
|
||||
bool future_obtained;
|
||||
@@ -1927,7 +1927,7 @@ namespace boost
|
||||
promise(BOOST_THREAD_RV_REF(promise) rhs) BOOST_NOEXCEPT :
|
||||
future_(BOOST_THREAD_RV(rhs).future_),future_obtained(BOOST_THREAD_RV(rhs).future_obtained)
|
||||
{
|
||||
// we need to release the future as shared_ptr doesn't implements move semantics
|
||||
// we need to release the future as std::shared_ptr doesn't implements move semantics
|
||||
BOOST_THREAD_RV(rhs).future_.reset();
|
||||
BOOST_THREAD_RV(rhs).future_obtained=false;
|
||||
}
|
||||
@@ -2461,21 +2461,21 @@ namespace boost
|
||||
template<typename R, typename ...ArgTypes>
|
||||
class packaged_task<R(ArgTypes...)>
|
||||
{
|
||||
typedef boost::shared_ptr<detail::task_base<R(ArgTypes...)> > task_ptr;
|
||||
boost::shared_ptr<detail::task_base<R(ArgTypes...)> > task;
|
||||
typedef boost::std::shared_ptr<detail::task_base<R(ArgTypes...)> > task_ptr;
|
||||
boost::std::shared_ptr<detail::task_base<R(ArgTypes...)> > task;
|
||||
#else
|
||||
template<typename R>
|
||||
class packaged_task<R()>
|
||||
{
|
||||
typedef boost::shared_ptr<detail::task_base<R()> > task_ptr;
|
||||
boost::shared_ptr<detail::task_base<R()> > task;
|
||||
typedef boost::std::shared_ptr<detail::task_base<R()> > task_ptr;
|
||||
boost::std::shared_ptr<detail::task_base<R()> > task;
|
||||
#endif
|
||||
#else
|
||||
template<typename R>
|
||||
class packaged_task
|
||||
{
|
||||
typedef boost::shared_ptr<detail::task_base<R> > task_ptr;
|
||||
boost::shared_ptr<detail::task_base<R> > task;
|
||||
typedef boost::std::shared_ptr<detail::task_base<R> > task_ptr;
|
||||
boost::std::shared_ptr<detail::task_base<R> > task;
|
||||
#endif
|
||||
bool future_obtained;
|
||||
struct dummy;
|
||||
@@ -2806,7 +2806,7 @@ namespace boost
|
||||
BOOST_THREAD_FUTURE<Rp>
|
||||
make_future_deferred_object(BOOST_THREAD_FWD_REF(Fp) f)
|
||||
{
|
||||
shared_ptr<future_deferred_object<Rp, Fp> >
|
||||
std::shared_ptr<future_deferred_object<Rp, Fp> >
|
||||
h(new future_deferred_object<Rp, Fp>(boost::forward<Fp>(f)));
|
||||
return BOOST_THREAD_FUTURE<Rp>(h);
|
||||
}
|
||||
@@ -2818,7 +2818,7 @@ namespace boost
|
||||
BOOST_THREAD_FUTURE<Rp>
|
||||
make_future_async_object(BOOST_THREAD_FWD_REF(Fp) f)
|
||||
{
|
||||
shared_ptr<future_async_object<Rp, Fp> >
|
||||
std::shared_ptr<future_async_object<Rp, Fp> >
|
||||
h(new future_async_object<Rp, Fp>(boost::forward<Fp>(f)));
|
||||
return BOOST_THREAD_FUTURE<Rp>(h);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/pthread/condition_variable_fwd.hpp>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/std::shared_ptr.hpp>
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
@@ -87,17 +87,17 @@ namespace boost
|
||||
struct thread_exit_callback_node;
|
||||
struct tss_data_node
|
||||
{
|
||||
boost::shared_ptr<boost::detail::tss_cleanup_function> func;
|
||||
boost::std::shared_ptr<boost::detail::tss_cleanup_function> func;
|
||||
void* value;
|
||||
|
||||
tss_data_node(boost::shared_ptr<boost::detail::tss_cleanup_function> func_,
|
||||
tss_data_node(boost::std::shared_ptr<boost::detail::tss_cleanup_function> func_,
|
||||
void* value_):
|
||||
func(func_),value(value_)
|
||||
{}
|
||||
};
|
||||
|
||||
struct thread_data_base;
|
||||
typedef boost::shared_ptr<thread_data_base> thread_data_ptr;
|
||||
typedef boost::std::shared_ptr<thread_data_base> thread_data_ptr;
|
||||
|
||||
struct BOOST_THREAD_DECL thread_data_base:
|
||||
enable_shared_from_this<thread_data_base>
|
||||
@@ -121,7 +121,7 @@ namespace boost
|
||||
> notify_list_t;
|
||||
notify_list_t notify;
|
||||
|
||||
typedef std::vector<shared_ptr<future_object_base> > async_states_t;
|
||||
typedef std::vector<std::shared_ptr<future_object_base> > async_states_t;
|
||||
async_states_t async_states_;
|
||||
|
||||
//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
|
||||
@@ -152,7 +152,7 @@ namespace boost
|
||||
notify.push_back(std::pair<condition_variable*, mutex*>(cv, m));
|
||||
}
|
||||
|
||||
void make_ready_at_thread_exit(shared_ptr<future_object_base> as)
|
||||
void make_ready_at_thread_exit(std::shared_ptr<future_object_base> as)
|
||||
{
|
||||
async_states_.push_back(as);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// (C) Copyright 2007-8 Anthony Williams
|
||||
|
||||
#include <boost/thread/detail/config.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/std::shared_ptr.hpp>
|
||||
#include <boost/thread/detail/thread_heap_alloc.hpp>
|
||||
|
||||
#include <boost/config/abi_prefix.hpp>
|
||||
@@ -19,11 +19,11 @@ namespace boost
|
||||
{
|
||||
virtual ~tss_cleanup_function()
|
||||
{}
|
||||
|
||||
|
||||
virtual void operator()(void* data)=0;
|
||||
};
|
||||
|
||||
BOOST_THREAD_DECL void set_tss_data(void const* key,boost::shared_ptr<tss_cleanup_function> func,void* tss_data,bool cleanup_existing);
|
||||
|
||||
BOOST_THREAD_DECL void set_tss_data(void const* key,boost::std::shared_ptr<tss_cleanup_function> func,void* tss_data,bool cleanup_existing);
|
||||
BOOST_THREAD_DECL void* get_tss_data(void const* key);
|
||||
}
|
||||
|
||||
@@ -42,16 +42,16 @@ namespace boost
|
||||
delete static_cast<T*>(data);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct run_custom_cleanup_function:
|
||||
detail::tss_cleanup_function
|
||||
{
|
||||
void (*cleanup_function)(T*);
|
||||
|
||||
|
||||
explicit run_custom_cleanup_function(void (*cleanup_function_)(T*)):
|
||||
cleanup_function(cleanup_function_)
|
||||
{}
|
||||
|
||||
|
||||
void operator()(void* data)
|
||||
{
|
||||
cleanup_function(static_cast<T*>(data));
|
||||
@@ -59,11 +59,11 @@ namespace boost
|
||||
};
|
||||
|
||||
|
||||
boost::shared_ptr<detail::tss_cleanup_function> cleanup;
|
||||
|
||||
boost::std::shared_ptr<detail::tss_cleanup_function> cleanup;
|
||||
|
||||
public:
|
||||
typedef T element_type;
|
||||
|
||||
|
||||
thread_specific_ptr():
|
||||
cleanup(detail::heap_new<delete_data>(),detail::do_heap_delete<delete_data>())
|
||||
{}
|
||||
@@ -76,7 +76,7 @@ namespace boost
|
||||
}
|
||||
~thread_specific_ptr()
|
||||
{
|
||||
detail::set_tss_data(this,boost::shared_ptr<detail::tss_cleanup_function>(),0,true);
|
||||
detail::set_tss_data(this,boost::std::shared_ptr<detail::tss_cleanup_function>(),0,true);
|
||||
}
|
||||
|
||||
T* get() const
|
||||
@@ -94,7 +94,7 @@ namespace boost
|
||||
T* release()
|
||||
{
|
||||
T* const temp=get();
|
||||
detail::set_tss_data(this,boost::shared_ptr<detail::tss_cleanup_function>(),0,false);
|
||||
detail::set_tss_data(this,boost::std::shared_ptr<detail::tss_cleanup_function>(),0,false);
|
||||
return temp;
|
||||
}
|
||||
void reset(T* new_value=0)
|
||||
|
||||
Reference in New Issue
Block a user