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

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -25,7 +25,7 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
// do not derive from the classes below. If you want to extend this functionality
@@ -33,10 +33,10 @@ namespace archive {
// preserve correct static polymorphism.
// same as binary_iarchive below - without the shared_ptr_helper
class naked_binary_iarchive :
class naked_binary_iarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_iarchive,
std::istream::char_type,
boost::archive::naked_binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>
{
@@ -56,22 +56,22 @@ public:
} // namespace archive
} // namespace boost
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
namespace boost {
namespace boost {
namespace archive {
// do not derive from this class. If you want to extend this functionality
// via inhertance, derived from binary_iarchive_impl instead. This will
// preserve correct static polymorphism.
class binary_iarchive :
class binary_iarchive :
public binary_iarchive_impl<
boost::archive::binary_iarchive,
std::istream::char_type,
boost::archive::binary_iarchive,
std::istream::char_type,
std::istream::traits_type
>,
public detail::shared_ptr_helper

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// binary_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -25,29 +25,29 @@
#include <boost/archive/binary_iarchive_impl.hpp>
#include <boost/archive/detail/register_archive.hpp>
namespace boost {
namespace boost {
namespace archive {
// same as binary_wiarchive below - without the shared_ptr_helper
class naked_binary_wiarchive :
class naked_binary_wiarchive :
public binary_iarchive_impl<
boost::archive::naked_binary_wiarchive,
std::wistream::char_type,
boost::archive::naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>
{
public:
naked_binary_wiarchive(std::wistream & is, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(is, flags)
{}
naked_binary_wiarchive(std::wstreambuf & bsb, unsigned int flags = 0) :
binary_iarchive_impl<
naked_binary_wiarchive,
std::wistream::char_type,
naked_binary_wiarchive,
std::wistream::char_type,
std::wistream::traits_type
>(bsb, flags)
{}
@@ -56,16 +56,16 @@ public:
} // namespace archive
} // namespace boost
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
namespace boost {
namespace boost {
namespace archive {
class binary_wiarchive :
class binary_wiarchive :
public binary_iarchive_impl<
binary_wiarchive, std::wistream::char_type, std::wistream::traits_type
>

View File

@@ -40,7 +40,7 @@ namespace std{
namespace boost {
template<class T>
class shared_ptr;
class std::shared_ptr;
namespace serialization {
class extended_type_info;
} // namespace serialization
@@ -155,9 +155,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>

View File

@@ -39,7 +39,7 @@ namespace std{
namespace boost {
template<class T>
class shared_ptr;
class std::shared_ptr;
namespace serialization {
class extended_type_info;
} // namespace serialization

View File

@@ -22,7 +22,7 @@
#include <cstddef> // NULL
#include <boost/config.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/type_traits/is_polymorphic.hpp>
#include <boost/serialization/type_info_implementation.hpp>
@@ -35,16 +35,16 @@
#include <boost/archive/detail/abi_prefix.hpp> // must be the last headern
namespace boost_132 {
template<class T> class shared_ptr;
template<class T> class std::shared_ptr;
}
namespace boost {
template<class T> class shared_ptr;
template<class T> class std::shared_ptr;
namespace serialization {
class extended_type_info;
template<class Archive, class T>
inline void load(
Archive & ar,
boost::shared_ptr< T > &t,
boost::std::shared_ptr< T > &t,
const unsigned int file_version
);
}
@@ -57,14 +57,14 @@ namespace detail {
class shared_ptr_helper {
struct collection_type_compare {
bool operator()(
const shared_ptr<const void> &lhs,
const shared_ptr<const void> &rhs
const std::shared_ptr<const void> &lhs,
const std::shared_ptr<const void> &rhs
)const{
return lhs.get() < rhs.get();
}
};
typedef std::set<
boost::shared_ptr<const void>,
boost::std::shared_ptr<const void>,
collection_type_compare
> collection_type;
typedef collection_type::const_iterator iterator_type;
@@ -72,7 +72,7 @@ class shared_ptr_helper {
// is used to "match up" shared pointers loaded at different
// points in the archive. Note, we delay construction until
// it is actually used since this is by default included as
// a "mix-in" even if shared_ptr isn't used.
// a "mix-in" even if std::shared_ptr isn't used.
collection_type * m_pointers;
struct null_deleter {
@@ -95,7 +95,7 @@ public:
template<class Archive, class T>
friend inline void boost::serialization::load(
Archive & ar,
boost::shared_ptr< T > &t,
boost::std::shared_ptr< T > &t,
const unsigned int file_version
);
#endif
@@ -109,44 +109,44 @@ public:
// new system which is disjoint from this set. This is implemented
// by a change in load_construct_data below. It makes this file suitable
// only for loading pointers into a 1.33 or later boost system.
std::list<boost_132::shared_ptr<const void> > * m_pointers_132;
std::list<boost_132::std::shared_ptr<const void> > * m_pointers_132;
// #endif
// returns pointer to object and an indicator whether this is a
// new entry (true) or a previous one (false)
BOOST_ARCHIVE_DECL(shared_ptr<void>)
BOOST_ARCHIVE_DECL(std::shared_ptr<void>)
get_od(
const void * od,
const boost::serialization::extended_type_info * true_type,
const boost::serialization::extended_type_info * true_type,
const boost::serialization::extended_type_info * this_type
);
BOOST_ARCHIVE_DECL(void)
append(const boost::shared_ptr<const void> &);
append(const boost::std::shared_ptr<const void> &);
template<class T>
struct non_polymorphic {
static const boost::serialization::extended_type_info *
static const boost::serialization::extended_type_info *
get_object_identifier(T &){
return & boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
>::get_const_instance();
}
};
template<class T>
struct polymorphic {
static const boost::serialization::extended_type_info *
static const boost::serialization::extended_type_info *
get_object_identifier(T & t){
return boost::serialization::singleton<
BOOST_DEDUCED_TYPENAME
BOOST_DEDUCED_TYPENAME
boost::serialization::type_info_implementation< T >::type
>::get_const_instance().get_derived_extended_type_info(t);
}
};
public:
template<class T>
void reset(shared_ptr< T > & s, T * t){
void reset(std::shared_ptr< T > & s, T * t){
if(NULL == t){
s.reset();
return;
@@ -175,9 +175,9 @@ public:
this_type->get_debug_info()
)
);
shared_ptr<void> r =
std::shared_ptr<void> r =
get_od(
static_cast<const void *>(t),
static_cast<const void *>(t),
true_type,
this_type
);
@@ -188,11 +188,11 @@ public:
*this_type,
static_cast<const void *>(t)
);
shared_ptr<const void> sp(s, od);
std::shared_ptr<const void> sp(s, od);
append(sp);
}
else{
s = shared_ptr< T >(
s = std::shared_ptr< T >(
r,
static_cast<T *>(r.get())
);
@@ -201,7 +201,7 @@ public:
// #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
BOOST_ARCHIVE_DECL(void)
append(const boost_132::shared_ptr<const void> & t);
append(const boost_132::std::shared_ptr<const void> & t);
// #endif
public:
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// text_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -32,11 +32,11 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class Archive>
class text_iarchive_impl :
class text_iarchive_impl :
public basic_text_iprimitive<std::istream>,
public basic_text_iarchive<Archive>
{
@@ -62,16 +62,16 @@ protected:
load(v);
t = boost::serialization::item_version_type(v);
}
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(char * t);
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(wchar_t * t);
#endif
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(std::string &s);
#ifndef BOOST_NO_STD_WSTRING
BOOST_ARCHIVE_DECL(void)
BOOST_ARCHIVE_DECL(void)
load(std::wstring &ws);
#endif
// note: the following should not needed - but one compiler (vc 7.1)
@@ -85,10 +85,10 @@ protected:
load_override(class_name_type & t, int);
BOOST_ARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
text_iarchive_impl(std::istream & is, unsigned int flags);
// don't import inline definitions! leave this as a reminder.
//BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
//BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
~text_iarchive_impl(){};
};
@@ -97,7 +97,7 @@ protected:
// preserve correct static polymorphism.
// same as text_iarchive below - without the shared_ptr_helper
class naked_text_iarchive :
class naked_text_iarchive :
public text_iarchive_impl<naked_text_iarchive>
{
public:
@@ -117,9 +117,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -128,10 +128,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class text_iarchive :
class text_iarchive :
public text_iarchive_impl<text_iarchive>,
public detail::shared_ptr_helper
{

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// text_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -36,11 +36,11 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class Archive>
class text_wiarchive_impl :
class text_wiarchive_impl :
public basic_text_iprimitive<std::wistream>,
public basic_text_iarchive<Archive>
{
@@ -84,7 +84,7 @@ protected:
void load_override(T & t, BOOST_PFTO int){
basic_text_iarchive<Archive>::load_override(t, 0);
}
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
text_wiarchive_impl(std::wistream & is, unsigned int flags);
~text_wiarchive_impl(){};
};
@@ -94,7 +94,7 @@ protected:
// preserve correct static polymorphism.
// same as text_wiarchive below - without the shared_ptr_helper
class naked_text_wiarchive :
class naked_text_wiarchive :
public text_wiarchive_impl<naked_text_wiarchive>
{
public:
@@ -113,9 +113,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -124,10 +124,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class text_wiarchive :
class text_wiarchive :
public text_wiarchive_impl<text_wiarchive>,
public detail::shared_ptr_helper
{

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// xml_iarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -32,7 +32,7 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class CharType>
@@ -40,7 +40,7 @@ class basic_xml_grammar;
typedef basic_xml_grammar<char> xml_grammar;
template<class Archive>
class xml_iarchive_impl :
class xml_iarchive_impl :
public basic_text_iprimitive<std::istream>,
public basic_xml_iarchive<Archive>
{
@@ -64,13 +64,13 @@ protected:
void load(T & t){
basic_text_iprimitive<std::istream>::load(t);
}
void
void
load(version_type & t){
unsigned int v;
load(v);
t = version_type(v);
}
void
void
load(boost::serialization::item_version_type & t){
unsigned int v;
load(v);
@@ -96,7 +96,7 @@ protected:
load_override(class_name_type & t, int);
BOOST_ARCHIVE_DECL(void)
init();
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
xml_iarchive_impl(std::istream & is, unsigned int flags);
BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY())
~xml_iarchive_impl();
@@ -107,7 +107,7 @@ protected:
// preserve correct static polymorphism.
// same as xml_iarchive below - without the shared_ptr_helper
class naked_xml_iarchive :
class naked_xml_iarchive :
public xml_iarchive_impl<naked_xml_iarchive>
{
public:
@@ -126,9 +126,9 @@ public:
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -137,10 +137,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class xml_iarchive :
class xml_iarchive :
public xml_iarchive_impl<xml_iarchive>,
public detail::shared_ptr_helper
{

View File

@@ -9,7 +9,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// xml_wiarchive.hpp
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to 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)
@@ -37,7 +37,7 @@
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
template<class CharType>
@@ -45,7 +45,7 @@ class basic_xml_grammar;
typedef basic_xml_grammar<wchar_t> xml_wgrammar;
template<class Archive>
class xml_wiarchive_impl :
class xml_wiarchive_impl :
public basic_text_iprimitive<std::wistream>,
public basic_xml_iarchive<Archive>
{
@@ -65,17 +65,17 @@ protected:
return is;
}
template<class T>
void
void
load(T & t){
basic_text_iprimitive<std::wistream>::load(t);
}
void
void
load(version_type & t){
unsigned int v;
load(v);
t = version_type(v);
}
void
void
load(boost::serialization::item_version_type & t){
unsigned int v;
load(v);
@@ -99,11 +99,11 @@ protected:
}
BOOST_WARCHIVE_DECL(void)
load_override(class_name_type & t, int);
BOOST_WARCHIVE_DECL(void)
BOOST_WARCHIVE_DECL(void)
init();
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
xml_wiarchive_impl(std::wistream & is, unsigned int flags) ;
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
BOOST_WARCHIVE_DECL(BOOST_PP_EMPTY())
~xml_wiarchive_impl();
};
@@ -112,7 +112,7 @@ protected:
// preserve correct static polymorphism.
// same as xml_wiarchive below - without the shared_ptr_helper
class naked_xml_wiarchive :
class naked_xml_wiarchive :
public xml_wiarchive_impl<naked_xml_wiarchive>
{
public:
@@ -126,14 +126,14 @@ public:
} // namespace boost
#ifdef BOOST_MSVC
# pragma warning(pop)
# pragma warning(pop)
#endif
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
// note special treatment of shared_ptr. This type needs a special
// note special treatment of std::shared_ptr. This type needs a special
// structure associated with every archive. We created a "mix-in"
// class to provide this functionality. Since shared_ptr holds a
// class to provide this functionality. Since std::shared_ptr holds a
// special esteem in the boost library - we included it here by default.
#include <boost/archive/shared_ptr_helper.hpp>
@@ -142,10 +142,10 @@ public:
# pragma warning(disable : 4511 4512)
#endif
namespace boost {
namespace boost {
namespace archive {
class xml_wiarchive :
class xml_wiarchive :
public xml_wiarchive_impl<xml_wiarchive>,
public detail::shared_ptr_helper
{