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

@@ -15,7 +15,7 @@
#include <boost/locale/boundary/boundary_point.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/std::shared_ptr.hpp>
#include <boost/cstdint.hpp>
#include <boost/assert.hpp>
#ifdef BOOST_MSVC
@@ -34,7 +34,7 @@
namespace boost {
namespace locale {
namespace boundary {
///
/// \defgroup boundary Boundary Analysis
@@ -88,7 +88,7 @@ namespace boost {
//
// C++0x requires that string is continious in memory and all known
// string implementations
// do this because of c_str() support.
// do this because of c_str() support.
//
if(linear_iterator_traits<char_type,IteratorType>::is_linear && b!=e)
@@ -117,8 +117,8 @@ namespace boost {
mapping(boundary_type type,
base_iterator begin,
base_iterator end,
std::locale const &loc)
:
std::locale const &loc)
:
index_(new index_type()),
begin_(begin),
end_(end)
@@ -147,12 +147,12 @@ namespace boost {
}
private:
boost::shared_ptr<index_type> index_;
boost::std::shared_ptr<index_type> index_;
base_iterator begin_,end_;
};
template<typename BaseIterator>
class segment_index_iterator :
class segment_index_iterator :
public boost::iterator_facade<
segment_index_iterator<BaseIterator>,
segment<BaseIterator>,
@@ -164,7 +164,7 @@ namespace boost {
typedef BaseIterator base_iterator;
typedef mapping<base_iterator> mapping_type;
typedef segment<base_iterator> segment_type;
segment_index_iterator() : current_(0,0),map_(0)
{
}
@@ -267,13 +267,13 @@ namespace boost {
{
size_t dist=std::distance(map_->begin(),p);
index_type::const_iterator b=map_->index().begin(),e=map_->index().end();
index_type::const_iterator
index_type::const_iterator
boundary_point=std::upper_bound(b,e,break_info(dist));
while(boundary_point != e && (boundary_point->rule & mask_)==0)
boundary_point++;
current_.first = current_.second = boundary_point - b;
if(full_select_) {
while(current_.first > 0) {
current_.first --;
@@ -318,31 +318,31 @@ namespace boost {
bool valid_offset(size_t offset) const
{
return offset == 0
return offset == 0
|| offset == size() // make sure we not acess index[size]
|| (index()[offset].rule & mask_)!=0;
}
size_t size() const
{
return index().size();
}
index_type const &index() const
{
return map_->index();
}
segment_type value_;
std::pair<size_t,size_t> current_;
mapping_type const *map_;
rule_type mask_;
bool full_select_;
};
template<typename BaseIterator>
class boundary_point_index_iterator :
class boundary_point_index_iterator :
public boost::iterator_facade<
boundary_point_index_iterator<BaseIterator>,
boundary_point<BaseIterator>,
@@ -354,7 +354,7 @@ namespace boost {
typedef BaseIterator base_iterator;
typedef mapping<base_iterator> mapping_type;
typedef boundary_point<base_iterator> boundary_point_type;
boundary_point_index_iterator() : current_(0),map_(0)
{
}
@@ -466,22 +466,22 @@ namespace boost {
bool valid_offset(size_t offset) const
{
return offset == 0
return offset == 0
|| offset + 1 >= size() // last and first are always valid regardless of mark
|| (index()[offset].rule & mask_)!=0;
}
size_t size() const
{
return index().size();
}
index_type const &index() const
{
return map_->index();
}
boundary_point_type value_;
size_t current_;
mapping_type const *map_;
@@ -498,10 +498,10 @@ namespace boost {
template<typename BaseIterator>
class boundary_point_index;
///
/// \brief This class holds an index of segments in the text range and allows to iterate over them
/// \brief This class holds an index of segments in the text range and allows to iterate over them
///
/// This class is provides \ref begin() and \ref end() member functions that return bidirectional iterators
/// to the \ref segment objects.
@@ -512,7 +512,7 @@ namespace boost {
/// various masks %as \ref word_any.
/// \n
/// The default is to select any types of boundaries.
/// \n
/// \n
/// For example: using word %boundary analysis, when the provided mask is \ref word_kana then the iterators
/// would iterate only over the words containing Kana letters and \ref word_any would select all types of
/// words excluding ranges that consist of white space and punctuation marks. So iterating over the text
@@ -533,7 +533,7 @@ namespace boost {
/// terminator "!" or "?". But changing \ref full_select() to true, the selected segment would include
/// all the text up to previous valid %boundary point and would return two expected sentences:
/// "Hello!" and "How\nare you?".
///
///
/// This class allows to find a segment according to the given iterator in range using \ref find() member
/// function.
///
@@ -555,7 +555,7 @@ namespace boost {
template<typename BaseIterator>
class segment_index {
public:
///
/// The type of the iterator used to iterate over the original text
///
@@ -591,7 +591,7 @@ namespace boost {
typedef segment<base_iterator> value_type;
///
/// Default constructor.
/// Default constructor.
///
/// \note
///
@@ -610,7 +610,7 @@ namespace boost {
base_iterator begin,
base_iterator end,
rule_type mask,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(mask),
@@ -624,7 +624,7 @@ namespace boost {
segment_index(boundary_type type,
base_iterator begin,
base_iterator end,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(0xFFFFFFFFu),
@@ -655,7 +655,7 @@ namespace boost {
///
segment_index const &operator = (boundary_point_index<base_iterator> const &);
///
/// Create a new index for %boundary analysis \ref boundary_type "type" of the text
/// in range [begin,end) for locale \a loc.
@@ -694,7 +694,7 @@ namespace boost {
}
///
/// Find a first valid segment following a position \a p.
/// Find a first valid segment following a position \a p.
///
/// If \a p is inside a valid segment this segment is selected:
///
@@ -704,7 +704,7 @@ namespace boost {
/// - "t|o be or ", would point to "to",
/// - "to be or| ", would point to end.
///
///
///
/// Preconditions: the segment_index should have a mapping and \a p should be valid iterator
/// to the text in the mapped range.
///
@@ -714,17 +714,17 @@ namespace boost {
{
return iterator(p,&map_,mask_,full_select_);
}
///
/// Get the mask of rules that are used
///
///
rule_type rule() const
{
return mask_;
}
///
/// Set the mask of rules that are used
///
///
void rule(rule_type v)
{
mask_ = v;
@@ -743,7 +743,7 @@ namespace boost {
/// following part "are you?"
///
bool full_select() const
bool full_select() const
{
return full_select_;
}
@@ -761,11 +761,11 @@ namespace boost {
/// following part "are you?"
///
void full_select(bool v)
void full_select(bool v)
{
full_select_ = v;
}
private:
friend class boundary_point_index<base_iterator>;
typedef details::mapping<base_iterator> mapping_type;
@@ -793,14 +793,14 @@ namespace boost {
/// - "Hello! How\n|are you?"
/// - "Hello! How\nare you?|"
///
/// However if \ref rule() is set to \ref sentence_term then the selected %boundary points would be:
/// However if \ref rule() is set to \ref sentence_term then the selected %boundary points would be:
///
/// - "|Hello! How\nare you?"
/// - "Hello! |How\nare you?"
/// - "Hello! How\nare you?|"
///
///
/// Such that a %boundary point defined by a line feed character would be ignored.
///
///
/// This class allows to find a boundary_point according to the given iterator in range using \ref find() member
/// function.
///
@@ -858,9 +858,9 @@ namespace boost {
/// an object that represents the selected \ref boundary_point "boundary point".
///
typedef boundary_point<base_iterator> value_type;
///
/// Default constructor.
/// Default constructor.
///
/// \note
///
@@ -871,7 +871,7 @@ namespace boost {
boundary_point_index() : mask_(0xFFFFFFFFu)
{
}
///
/// Create a segment_index for %boundary analysis \ref boundary_type "type" of the text
/// in range [begin,end) using a rule \a mask for locale \a loc.
@@ -880,7 +880,7 @@ namespace boost {
base_iterator begin,
base_iterator end,
rule_type mask,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(mask)
@@ -893,7 +893,7 @@ namespace boost {
boundary_point_index(boundary_type type,
base_iterator begin,
base_iterator end,
std::locale const &loc=std::locale())
std::locale const &loc=std::locale())
:
map_(type,begin,end,loc),
mask_(0xFFFFFFFFu)
@@ -969,7 +969,7 @@ namespace boost {
///
/// - "|to be", would return %boundary point at "|to be",
/// - "t|o be", would point to "to| be"
///
///
/// Preconditions: the boundary_point_index should have a mapping and \a p should be valid iterator
/// to the text in the mapped range.
///
@@ -979,17 +979,17 @@ namespace boost {
{
return iterator(p,&map_,mask_);
}
///
/// Get the mask of rules that are used
///
///
rule_type rule() const
{
return mask_;
}
///
/// Set the mask of rules that are used
///
///
void rule(rule_type v)
{
mask_ = v;
@@ -1002,8 +1002,8 @@ namespace boost {
mapping_type map_;
rule_type mask_;
};
/// \cond INTERNAL
/// \cond INTERNAL
template<typename BaseIterator>
segment_index<BaseIterator>::segment_index(boundary_point_index<BaseIterator> const &other) :
map_(other.map_),
@@ -1011,7 +1011,7 @@ namespace boost {
full_select_(false)
{
}
template<typename BaseIterator>
boundary_point_index<BaseIterator>::boundary_point_index(segment_index<BaseIterator> const &other) :
map_(other.map_),
@@ -1025,7 +1025,7 @@ namespace boost {
map_ = other.map_;
return *this;
}
template<typename BaseIterator>
boundary_point_index<BaseIterator> const &boundary_point_index<BaseIterator>::operator=(segment_index<BaseIterator> const &other)
{
@@ -1033,7 +1033,7 @@ namespace boost {
return *this;
}
/// \endcond
typedef segment_index<std::string::const_iterator> ssegment_index; ///< convenience typedef
typedef segment_index<std::wstring::const_iterator> wssegment_index; ///< convenience typedef
#ifdef BOOST_HAS_CHAR16_T
@@ -1042,7 +1042,7 @@ namespace boost {
#ifdef BOOST_HAS_CHAR32_T
typedef segment_index<std::u32string::const_iterator> u32ssegment_index;///< convenience typedef
#endif
typedef segment_index<char const *> csegment_index; ///< convenience typedef
typedef segment_index<wchar_t const *> wcsegment_index; ///< convenience typedef
#ifdef BOOST_HAS_CHAR16_T
@@ -1060,7 +1060,7 @@ namespace boost {
#ifdef BOOST_HAS_CHAR32_T
typedef boundary_point_index<std::u32string::const_iterator> u32sboundary_point_index;///< convenience typedef
#endif
typedef boundary_point_index<char const *> cboundary_point_index; ///< convenience typedef
typedef boundary_point_index<wchar_t const *> wcboundary_point_index; ///< convenience typedef
#ifdef BOOST_HAS_CHAR16_T

View File

@@ -20,10 +20,10 @@
namespace boost {
template<typename Type>
class shared_ptr;
class std::shared_ptr;
///
/// \brief This is the main namespace that encloses all localization classes
/// \brief This is the main namespace that encloses all localization classes
///
namespace locale {
@@ -39,7 +39,7 @@ namespace boost {
static const uint32_t character_first_facet = char_facet; ///< First facet specific for character type
static const uint32_t character_last_facet = char32_t_facet; ///< Last facet specific for character type
static const uint32_t all_characters = 0xFFFF; ///< Special mask -- generate all
typedef uint32_t character_facet_type; ///<type that specifies the character type that locales can be generated for
static const uint32_t convert_facet = 1 << 0; ///< Generate conversion facets
@@ -49,19 +49,19 @@ namespace boost {
static const uint32_t message_facet = 1 << 4; ///< Generate message facets
static const uint32_t codepage_facet = 1 << 5; ///< Generate character set conversion facets (derived from std::codecvt)
static const uint32_t boundary_facet = 1 << 6; ///< Generate boundary analysis facet
static const uint32_t per_character_facet_first = convert_facet; ///< First facet specific for character
static const uint32_t per_character_facet_last = boundary_facet; ///< Last facet specific for character
static const uint32_t calendar_facet = 1 << 16; ///< Generate boundary analysis facet
static const uint32_t information_facet = 1 << 17; ///< Generate general locale information facet
static const uint32_t non_character_facet_first = calendar_facet; ///< First character independent facet
static const uint32_t non_character_facet_last = information_facet;///< Last character independent facet
static const uint32_t non_character_facet_first = calendar_facet; ///< First character independent facet
static const uint32_t non_character_facet_last = information_facet;///< Last character independent facet
static const uint32_t all_categories = 0xFFFFFFFFu; ///< Generate all of them
typedef uint32_t locale_category_type; ///< a type used for more fine grained generation of facets
///
@@ -75,11 +75,11 @@ namespace boost {
public:
///
/// Create new generator using global localization_backend_manager
/// Create new generator using global localization_backend_manager
///
generator();
///
/// Create new generator using specific localization_backend_manager
/// Create new generator using specific localization_backend_manager
///
generator(localization_backend_manager const &);
@@ -93,7 +93,7 @@ namespace boost {
/// Get types of facets that should be generated, default all
///
locale_category_type categories() const;
///
/// Set the characters type for which the facets should be generated, default all supported
///
@@ -142,13 +142,13 @@ namespace boost {
///
/// - Under the Windows platform the path is treated as a path in the locale's encoding so
/// if you create locale "en_US.windows-1251" then path would be treated as cp1255,
/// and if it is en_US.UTF-8 it is treated as UTF-8. File name is always opened with
/// and if it is en_US.UTF-8 it is treated as UTF-8. File name is always opened with
/// a wide file name as wide file names are the native file name on Windows.
///
/// - Under POSIX platforms all paths passed as-is regardless of encoding as narrow
/// encodings are the native encodings for POSIX platforms.
///
///
///
///
void add_messages_path(std::string const &path);
///
@@ -201,7 +201,7 @@ namespace boost {
{
return generate(id);
}
///
/// Set backend specific option
///
@@ -214,7 +214,7 @@ namespace boost {
private:
void set_all_options(shared_ptr<localization_backend> backend,std::string const &id) const;
void set_all_options(std::shared_ptr<localization_backend> backend,std::string const &id) const;
generator(generator const &);
void operator=(generator const &);
@@ -231,5 +231,5 @@ namespace boost {
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4