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:
void_17
2026-03-02 15:58:20 +07:00
parent d63f79325f
commit 7074f35e4b
1373 changed files with 12054 additions and 12054 deletions

View File

@@ -147,7 +147,7 @@ struct grammar_definition
typedef typename grammar_definition<DerivedT, ScannerT>::type definition_t;
typedef grammar_helper<grammar_t, derived_t, scanner_t> helper_t;
typedef boost::shared_ptr<helper_t> helper_ptr_t;
typedef boost::std::shared_ptr<helper_t> helper_ptr_t;
typedef boost::weak_ptr<helper_t> helper_weak_ptr_t;
grammar_helper*

View File

@@ -11,7 +11,7 @@
#define BOOST_SPIRIT_OBJECT_WITH_ID_IPP
#include <vector>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#ifdef BOOST_SPIRIT_THREADSAFE
#include <boost/thread/mutex.hpp>
@@ -64,7 +64,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
static void mutex_init();
#endif
boost::shared_ptr<object_with_id_base_supply<IdT> > id_supply;
boost::std::shared_ptr<object_with_id_base_supply<IdT> > id_supply;
};
//////////////////////////////////
@@ -141,7 +141,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
boost::mutex &mutex = mutex_instance();
boost::mutex::scoped_lock lock(mutex);
#endif
static boost::shared_ptr<object_with_id_base_supply<IdT> >
static boost::std::shared_ptr<object_with_id_base_supply<IdT> >
static_supply;
if (!static_supply.get())
@@ -174,7 +174,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
//////////////////////////////////
#ifdef BOOST_SPIRIT_THREADSAFE
template <typename TagT, typename IdT>
inline void
inline void
object_with_id_base<TagT, IdT>::mutex_init()
{
mutex_instance();

View File

@@ -12,7 +12,7 @@
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/non_terminal/impl/rule.ipp>
#include <boost/spirit/home/classic/dynamic/rule_alias.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/spirit/home/classic/dynamic/stored_rule_fwd.hpp>
@@ -27,7 +27,7 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
//
///////////////////////////////////////////////////////////////////////////
template <
typename T0
typename T0
, typename T1
, typename T2
, bool EmbedByValue
@@ -113,10 +113,10 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
private:
#endif
stored_rule(shared_ptr<abstract_parser_t> const& ptr)
stored_rule(std::shared_ptr<abstract_parser_t> const& ptr)
: ptr(ptr) {}
shared_ptr<abstract_parser_t> ptr;
std::shared_ptr<abstract_parser_t> ptr;
};
///////////////////////////////////////////////////////////////////////////////

View File

@@ -177,7 +177,7 @@ public:
inline file_iterator& operator=(const base_t& iter);
file_iterator make_end(void);
// operator bool. This borrows a trick from boost::shared_ptr to avoid
// operator bool. This borrows a trick from boost::std::shared_ptr to avoid
// to interfere with arithmetic operations.
bool operator_bool(void) const
{ return this->base(); }

View File

@@ -17,7 +17,7 @@
#endif
#include <cstdio>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#ifdef BOOST_SPIRIT_FILEITERATOR_WINDOWS
# include <boost/type_traits/remove_pointer.hpp>
@@ -48,7 +48,7 @@ namespace fileiter_impl {
// the base components on which the iterator is built (through the
// iterator adaptor library).
//
// The opened file stream (FILE) is held with a shared_ptr<>, whose
// The opened file stream (FILE) is held with a std::shared_ptr<>, whose
// custom deleter invokes fcose(). This makes the syntax of the class
// very easy, especially everything related to copying.
//
@@ -93,7 +93,7 @@ public:
}
// Nasty bug in Comeau up to 4.3.0.1, we need explicit boolean context
// for shared_ptr to evaluate correctly
// for std::shared_ptr to evaluate correctly
operator bool() const
{ return m_file ? true : false; }
@@ -140,7 +140,7 @@ public:
}
private:
boost::shared_ptr<std::FILE> m_file;
boost::std::shared_ptr<std::FILE> m_file;
std::size_t m_pos;
CharT m_curChar;
bool m_eof;
@@ -236,7 +236,7 @@ public:
// a reference is hold by the filemap object).
::CloseHandle(hFile);
// Store the handles inside the shared_ptr (with the custom destructors)
// Store the handles inside the std::shared_ptr (with the custom destructors)
m_mem.reset(static_cast<CharT*>(pMem), ::UnmapViewOfFile);
// Start of the file
@@ -256,7 +256,7 @@ public:
}
// Nasty bug in Comeau up to 4.3.0.1, we need explicit boolean context
// for shared_ptr to evaluate correctly
// for std::shared_ptr to evaluate correctly
operator bool() const
{ return m_mem ? true : false; }
@@ -291,7 +291,7 @@ private:
typedef void handle_t;
#endif
boost::shared_ptr<CharT> m_mem;
boost::std::shared_ptr<CharT> m_mem;
std::size_t m_filesize;
CharT* m_curChar;
};
@@ -403,7 +403,7 @@ public:
}
// Nasty bug in Comeau up to 4.3.0.1, we need explicit boolean context
// for shared_ptr to evaluate correctly
// for std::shared_ptr to evaluate correctly
operator bool() const
{ return m_mem ? true : false; }
@@ -432,7 +432,7 @@ public:
private:
boost::shared_ptr<mapping> m_mem;
boost::std::shared_ptr<mapping> m_mem;
CharT const* m_curChar;
};

View File

@@ -10,7 +10,7 @@
#define BOOST_SPIRIT_CHSET_HPP
///////////////////////////////////////////////////////////////////////////////
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/spirit/home/classic/namespace.hpp>
#include <boost/spirit/home/classic/core/primitives/primitives.hpp>
#include <boost/spirit/home/classic/utility/impl/chset/basic_chset.hpp>
@@ -26,7 +26,7 @@ namespace utility { namespace impl {
// template functions. And we don't want to put the whole algorithm
// in the chset constructor in the class definition.
template <typename CharT, typename CharT2>
void construct_chset(boost::shared_ptr<basic_chset<CharT> >& ptr,
void construct_chset(boost::std::shared_ptr<basic_chset<CharT> >& ptr,
CharT2 const* definition);
}} // namespace utility::impl
@@ -84,7 +84,7 @@ public:
private:
boost::shared_ptr<basic_chset<CharT> > ptr;
boost::std::shared_ptr<basic_chset<CharT> > ptr;
};
///////////////////////////////////////////////////////////////////////////////

View File

@@ -27,16 +27,16 @@ BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
namespace utility { namespace impl {
template <typename CharT>
inline void
detach(boost::shared_ptr<basic_chset<CharT> >& ptr)
detach(boost::std::shared_ptr<basic_chset<CharT> >& ptr)
{
if (!ptr.unique())
ptr = boost::shared_ptr<basic_chset<CharT> >
ptr = boost::std::shared_ptr<basic_chset<CharT> >
(new basic_chset<CharT>(*ptr));
}
template <typename CharT>
inline void
detach_clear(boost::shared_ptr<basic_chset<CharT> >& ptr)
detach_clear(boost::std::shared_ptr<basic_chset<CharT> >& ptr)
{
if (ptr.unique())
ptr->clear();
@@ -45,7 +45,7 @@ namespace utility { namespace impl {
}
template <typename CharT, typename CharT2>
void construct_chset(boost::shared_ptr<basic_chset<CharT> >& ptr,
void construct_chset(boost::std::shared_ptr<basic_chset<CharT> >& ptr,
CharT2 const* definition)
{
CharT2 ch = *definition++;
@@ -76,7 +76,7 @@ namespace utility { namespace impl {
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
template <typename CharT, typename FakeT>
void chset_negated_set(boost::shared_ptr<basic_chset<CharT> > &ptr, chlit<CharT> const &ch,
void chset_negated_set(boost::std::shared_ptr<basic_chset<CharT> > &ptr, chlit<CharT> const &ch,
FakeT)
{
if(ch.ch != (std::numeric_limits<CharT>::min)()) {
@@ -86,9 +86,9 @@ namespace utility { namespace impl {
ptr->set(ch.ch + 1, (std::numeric_limits<CharT>::max)());
}
}
template <typename CharT, typename FakeT>
void chset_negated_set(boost::shared_ptr<basic_chset<CharT> > &ptr,
void chset_negated_set(boost::std::shared_ptr<basic_chset<CharT> > &ptr,
spirit::range<CharT> const &rng, FakeT)
{
if(rng.first != (std::numeric_limits<CharT>::min)()) {
@@ -255,7 +255,7 @@ inline void
chset<CharT>::set(negated_char_parser<chlit<CharT> > const& arg_)
{
utility::impl::detach(ptr);
if(arg_.positive.ch != (std::numeric_limits<CharT>::min)()) {
ptr->set((std::numeric_limits<CharT>::min)(), arg_.positive.ch - 1);
}
@@ -269,7 +269,7 @@ inline void
chset<CharT>::set(negated_char_parser<range<CharT> > const& arg_)
{
utility::impl::detach(ptr);
if(arg_.positive.first != (std::numeric_limits<CharT>::min)()) {
ptr->set((std::numeric_limits<CharT>::min)(), arg_.positive.first - 1);
}

View File

@@ -21,7 +21,7 @@
#include <boost/spirit/home/karma/detail/get_casetag.hpp>
#include <boost/spirit/home/karma/detail/string_generate.hpp>
#include <boost/config.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/mpl/if.hpp>
#include <map>
#include <set>
@@ -451,7 +451,7 @@ namespace boost { namespace spirit { namespace karma
adder add;
remover remove;
shared_ptr<Lookup> lookup;
std::shared_ptr<Lookup> lookup;
std::string name_;
};
@@ -710,7 +710,7 @@ namespace boost { namespace spirit { namespace karma
adder add;
remover remove;
shared_ptr<Lookup> lookup;
std::shared_ptr<Lookup> lookup;
std::string name_;
};

View File

@@ -2,7 +2,7 @@
Copyright (c) 2005-2007 Dan Marsden
Copyright (c) 2005-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
@@ -33,8 +33,8 @@
#include <memory>
namespace boost {
template<typename T> class shared_ptr;
namespace boost {
template<typename T> class std::shared_ptr;
template<typename T> class scoped_ptr;
namespace phoenix {
@@ -42,7 +42,7 @@ namespace phoenix {
{
template<typename T>
struct member_type;
template<typename Class, typename MemberType>
struct member_type<MemberType (Class::*)>
{
@@ -52,7 +52,7 @@ namespace phoenix {
namespace meta
{
template<typename T>
template<typename T>
struct pointed_type;
template<typename T>
@@ -62,11 +62,11 @@ namespace phoenix {
};
template<typename T>
struct pointed_type<shared_ptr<T> >
struct pointed_type<std::shared_ptr<T> >
{
typedef T type;
};
template<typename T>
struct pointed_type<scoped_ptr<T> >
{
@@ -116,7 +116,7 @@ namespace phoenix {
member_object_eval, actor<T0>,
typename as_actor<MemObjPtr>::type>::type> >::type
operator->*(
const actor<T0>& ptrActor,
const actor<T0>& ptrActor,
MemObjPtr memObjPtr)
{
return compose<member_object_eval>(

View File

@@ -27,7 +27,7 @@
#include <boost/fusion/include/at.hpp>
#include <boost/range.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#if defined(BOOST_MSVC)
# pragma warning(push)
@@ -373,7 +373,7 @@ public:
adder add;
remover remove;
shared_ptr<Lookup> lookup;
std::shared_ptr<Lookup> lookup;
std::string name_;
};

View File

@@ -15,10 +15,10 @@
#include <boost/fusion/include/at.hpp>
namespace boost { namespace spirit { namespace repository { namespace qi { namespace detail {
// Variant visitor class which handles dispatching the parsing to the selected parser
// This also handles passing the correct attributes and flags/counters to the subject parsers
// This also handles passing the correct attributes and flags/counters to the subject parsers
template<typename T>
struct is_distinct : T::distinct { };
template<typename T, typename Action>
struct is_distinct< spirit::qi::action<T,Action> > : T::distinct { };
@@ -38,22 +38,22 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
typedef Skipper skipper_type;
typedef Elements elements_type;
typedef typename add_reference<Attribute>::type attr_reference;
typedef typename add_reference<Attribute>::type attr_reference;
public:
parse_dispatcher(const Elements &elements,Iterator& first, Iterator const& last
, Context& context, Skipper const& skipper
, Flags &flags, Counters &counters, attr_reference attr) :
, Flags &flags, Counters &counters, attr_reference attr) :
elements(elements), first(first), last(last)
, context(context), skipper(skipper)
, flags(flags),counters(counters), attr(attr)
{}
template<typename T> bool operator()(T& idx) const
{
{
return call(idx,typename traits::not_is_unused<Attribute>::type());
}
template <typename Subject,typename Index>
template <typename Subject,typename Index>
bool call_subject_unused(
Subject const &subject, Iterator &first, Iterator const &last
, Context& context, Skipper const& skipper
@@ -62,25 +62,25 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
Iterator save = first;
skipper_keyword_marker<Skipper,NoCasePass>
marked_skipper(skipper,flags[Index::value],counters[Index::value]);
if(subject.parse(first,last,context,marked_skipper,unused))
{
return true;
}
save = save;
return false;
}
template <typename Subject,typename Index>
}
template <typename Subject,typename Index>
bool call_subject(
Subject const &subject, Iterator &first, Iterator const &last
, Context& context, Skipper const& skipper
, Index& idx ) const
{
Iterator save = first;
skipper_keyword_marker<Skipper,NoCasePass>
skipper_keyword_marker<Skipper,NoCasePass>
marked_skipper(skipper,flags[Index::value],counters[Index::value]);
if(subject.parse(first,last,context,marked_skipper,fusion::at_c<Index::value>(attr)))
{
@@ -91,8 +91,8 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
}
// Handle unused attributes
template <typename T> bool call(T &idx, mpl::false_) const{
template <typename T> bool call(T &idx, mpl::false_) const{
typedef typename mpl::at<Elements,T>::type ElementType;
if(
(!is_distinct<ElementType>::value)
@@ -114,7 +114,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
}
return false;
}
const Elements &elements;
Iterator &first;
const Iterator &last;
@@ -132,7 +132,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
typedef typename
spirit::detail::as_variant<
IndexList >::type parser_index_type;
///////////////////////////////////////////////////////////////////////////
// build_char_type_sequence
//
@@ -351,7 +351,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
{
typedef int result_type;
keyword_entry_adder(shared_ptr<keywords_type> lookup,FlagsType &flags, Elements &elements) :
keyword_entry_adder(std::shared_ptr<keywords_type> lookup,FlagsType &flags, Elements &elements) :
lookup(lookup)
,flags(flags)
,elements(elements)
@@ -421,7 +421,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
shared_ptr<keywords_type> lookup;
std::shared_ptr<keywords_type> lookup;
FlagsType & flags;
Elements &elements;
};
@@ -443,7 +443,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
{
if(parser_index_type* val_ptr =
lookup->find(first,last,first_pass_filter_type()))
{
{
if(!apply_visitor(parse_visitor,*val_ptr)){
return false;
}
@@ -481,7 +481,7 @@ namespace boost { namespace spirit { namespace repository { namespace qi { names
}
return false;
}
shared_ptr<keywords_type> lookup;
std::shared_ptr<keywords_type> lookup;
};