aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2006-10-17 11:56:21 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2006-10-17 11:56:21 +0000
commit46db415941fcc2edcfdb7d9de4480484ce28b76f (patch)
tree85502d16217ebc971d63c61ffa4e0143fa5ed212 /libstdc++-v3/include/ext
parente4fd3c844119075907e31d9f0179e7be661dbe95 (diff)
downloadgcc-46db415941fcc2edcfdb7d9de4480484ce28b76f.zip
gcc-46db415941fcc2edcfdb7d9de4480484ce28b76f.tar.gz
gcc-46db415941fcc2edcfdb7d9de4480484ce28b76f.tar.bz2
re PR libstdc++/28514 (libstdc++ vs. anonymous namespaces)
2006-10-17 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/28514 * include/bits/cpp_type_traits.h (__detail): Uglify namespace. * include/ext/rope: Remove global-scope anonymous namespace, use nested __detail. Fixup resulting formatting issues. * include/ext/ropeimpl.h: Same. * include/tr1/hashtable_policy.h: Remove anonymous namespace nesting for __detail. * include/tr1/random: Revert anonymous namespace to nested __detail namespace. * include/tr1/random.tcc: Same. * src/ext-inst.cc: Fixups for above. From-SVN: r117824
Diffstat (limited to 'libstdc++-v3/include/ext')
-rw-r--r--libstdc++-v3/include/ext/rope153
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h118
2 files changed, 134 insertions, 137 deletions
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index d24366c..0cfd21e 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -67,14 +67,14 @@
#include <ext/memory> // For uninitialized_copy_n
-namespace
-{
- enum { _S_max_rope_depth = 45 };
- enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
-} // anonymous namespace
-
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
+ namespace __detail
+ {
+ enum { _S_max_rope_depth = 45 };
+ enum _Tag {_S_leaf, _S_concat, _S_substringfn, _S_function};
+ } // namespace __detail
+
using std::size_t;
using std::ptrdiff_t;
using std::allocator;
@@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
class char_producer
{
public:
- virtual ~char_producer() {};
+ virtual ~char_producer() { };
virtual void
operator()(size_t __start_pos, size_t __len,
@@ -302,7 +302,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// compile-time would do. Hence this should all be private
// for now.
// The symmetry with char_producer is accidental and temporary.
- virtual ~_Rope_char_consumer() {};
+ virtual ~_Rope_char_consumer() { };
virtual bool
operator()(const _CharT* __buffer, size_t __len) = 0;
@@ -535,7 +535,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{ return *static_cast<const _Alloc*>(this); }
_Rope_rep_base(size_t __size, const allocator_type&)
- : _M_size(__size) {}
+ : _M_size(__size) { }
size_t _M_size;
@@ -558,7 +558,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
# endif
{
public:
- _Tag _M_tag:8;
+ __detail::_Tag _M_tag:8;
bool _M_is_balanced:8;
unsigned char _M_depth;
__GC_CONST _CharT* _M_c_string;
@@ -574,7 +574,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
using _Rope_rep_base<_CharT, _Alloc>::get_allocator;
- _Rope_RopeRep(_Tag __t, int __d, bool __b, size_t __size,
+ _Rope_RopeRep(__detail::_Tag __t, int __d, bool __b, size_t __size,
allocator_type __a)
: _Rope_rep_base<_CharT, _Alloc>(__size, __a),
#ifndef __GC
@@ -592,7 +592,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#endif
#ifdef __GC
void
- _M_incr () {}
+ _M_incr () { }
#endif
static void
_S_free_string(__GC_CONST _CharT*, size_t __len,
@@ -640,11 +640,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__t->_M_free_tree();
}
# else /* __GC */
- void _M_unref_nonnil() {}
- void _M_ref_nonnil() {}
- static void _S_unref(_Rope_RopeRep*) {}
- static void _S_ref(_Rope_RopeRep*) {}
- static void _S_free_if_unref(_Rope_RopeRep*) {}
+ void _M_unref_nonnil() { }
+ void _M_ref_nonnil() { }
+ static void _S_unref(_Rope_RopeRep*) { }
+ static void _S_ref(_Rope_RopeRep*) { }
+ static void _S_free_if_unref(_Rope_RopeRep*) { }
# endif
protected:
_Rope_RopeRep&
@@ -691,7 +691,7 @@ protected:
_Rope_RopeLeaf(__GC_CONST _CharT* __d, size_t __size,
allocator_type __a)
- : _Rope_RopeRep<_CharT, _Alloc>(_S_leaf, 0, true,
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_leaf, 0, true,
__size, __a), _M_data(__d)
{
if (_S_is_basic_char_type((_CharT *)0))
@@ -733,7 +733,7 @@ protected:
_Rope_RopeConcatenation(_Rope_RopeRep<_CharT, _Alloc>* __l,
_Rope_RopeRep<_CharT, _Alloc>* __r,
allocator_type __a)
- : _Rope_RopeRep<_CharT, _Alloc>(::_S_concat,
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_concat,
std::max(__l->_M_depth,
__r->_M_depth) + 1,
false,
@@ -781,7 +781,7 @@ protected:
_Rope_RopeFunction(char_producer<_CharT>* __f, size_t __size,
bool __d, allocator_type __a)
- : _Rope_RopeRep<_CharT, _Alloc>(::_S_function, 0, true, __size, __a)
+ : _Rope_RopeRep<_CharT, _Alloc>(__detail::_S_function, 0, true, __size, __a)
, _M_fn(__f)
#ifndef __GC
, _M_delete_when_done(__d)
@@ -832,15 +832,15 @@ protected:
{
switch(_M_base->_M_tag)
{
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
{
char_producer<_CharT>* __fn =
((_Rope_RopeFunction<_CharT,_Alloc>*)_M_base)->_M_fn;
(*__fn)(__start_pos + _M_start, __req_len, __buffer);
}
break;
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
__GC_CONST _CharT* __s =
((_Rope_RopeLeaf<_CharT,_Alloc>*)_M_base)->_M_data;
@@ -864,7 +864,7 @@ protected:
#ifndef __GC
_M_base->_M_ref_nonnil();
#endif
- this->_M_tag = ::_S_substringfn;
+ this->_M_tag = __detail::_S_substringfn;
}
virtual ~_Rope_RopeSubstring() throw()
{
@@ -893,12 +893,12 @@ protected:
~_Rope_self_destruct_ptr()
{ _Rope_RopeRep<_CharT, _Alloc>::_S_unref(_M_ptr); }
#ifdef __EXCEPTIONS
- _Rope_self_destruct_ptr() : _M_ptr(0) {};
+ _Rope_self_destruct_ptr() : _M_ptr(0) { };
#else
- _Rope_self_destruct_ptr() {};
+ _Rope_self_destruct_ptr() { };
#endif
_Rope_self_destruct_ptr(_Rope_RopeRep<_CharT, _Alloc>* __p)
- : _M_ptr(__p) {}
+ : _M_ptr(__p) { }
_Rope_RopeRep<_CharT, _Alloc>&
operator*()
@@ -941,18 +941,18 @@ protected:
_My_rope* _M_root; // The whole rope.
public:
_Rope_char_ref_proxy(_My_rope* __r, size_t __p)
- : _M_pos(__p), _M_current(), _M_current_valid(false), _M_root(__r) {}
+ : _M_pos(__p), _M_current(), _M_current_valid(false), _M_root(__r) { }
_Rope_char_ref_proxy(const _Rope_char_ref_proxy& __x)
- : _M_pos(__x._M_pos), _M_current(__x._M_current), _M_current_valid(false),
- _M_root(__x._M_root) {}
+ : _M_pos(__x._M_pos), _M_current(__x._M_current),
+ _M_current_valid(false), _M_root(__x._M_root) { }
// Don't preserve cache if the reference can outlive the
// expression. We claim that's not possible without calling
// a copy constructor or generating reference to a proxy
// reference. We declare the latter to have undefined semantics.
_Rope_char_ref_proxy(_My_rope* __r, size_t __p, _CharT __c)
- : _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) {}
+ : _M_pos(__p), _M_current(__c), _M_current_valid(true), _M_root(__r) { }
inline operator _CharT () const;
@@ -985,12 +985,12 @@ protected:
rope<_CharT,_Alloc>* _M_root; // The whole rope.
public:
_Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
- : _M_pos(__x._M_pos), _M_root(__x._M_root) {}
+ : _M_pos(__x._M_pos), _M_root(__x._M_root) { }
_Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x)
- : _M_pos(__x._M_pos), _M_root(__x._M_root) {}
+ : _M_pos(__x._M_pos), _M_root(__x._M_root) { }
- _Rope_char_ptr_proxy() {}
+ _Rope_char_ptr_proxy() { }
_Rope_char_ptr_proxy(_CharT* __x)
: _M_root(0), _M_pos(0) { }
@@ -1074,10 +1074,10 @@ protected:
static void _S_setcache_for_incr(_Rope_iterator_base& __x);
// As above, but assumes path
// cache is valid for previous posn.
- _Rope_iterator_base() {}
+ _Rope_iterator_base() { }
_Rope_iterator_base(_RopeRep* __root, size_t __pos)
- : _M_current_pos(__pos), _M_root(__root), _M_buf_ptr(0) {}
+ : _M_current_pos(__pos), _M_root(__root), _M_buf_ptr(0) { }
void _M_incr(size_t __n);
void _M_decr(size_t __n);
@@ -1114,7 +1114,7 @@ protected:
: _Rope_iterator_base<_CharT, _Alloc>(const_cast<_RopeRep*>(__root),
__pos)
// Only nonconst iterators modify root ref count
- {}
+ { }
public:
typedef _CharT reference; // Really a value. Returning a reference
// Would be a mess, since it would have
@@ -1122,7 +1122,7 @@ protected:
typedef const _CharT* pointer;
public:
- _Rope_const_iterator() {};
+ _Rope_const_iterator() { };
_Rope_const_iterator(const _Rope_const_iterator& __x)
: _Rope_iterator_base<_CharT,_Alloc>(__x) { }
@@ -1267,13 +1267,13 @@ protected:
protected:
typedef typename _Rope_iterator_base<_CharT, _Alloc>::_RopeRep _RopeRep;
rope<_CharT, _Alloc>* _M_root_rope;
- // root is treated as a cached version of this,
- // and is used to detect changes to the underlying
- // rope.
- // Root is included in the reference count.
- // This is necessary so that we can detect changes reliably.
- // Unfortunately, it requires careful bookkeeping for the
- // nonGC case.
+
+ // root is treated as a cached version of this, and is used to
+ // detect changes to the underlying rope.
+
+ // Root is included in the reference count. This is necessary
+ // so that we can detect changes reliably. Unfortunately, it
+ // requires careful bookkeeping for the nonGC case.
_Rope_iterator(rope<_CharT, _Alloc>* __r, size_t __pos)
: _Rope_iterator_base<_CharT, _Alloc>(__r->_M_tree_ptr, __pos),
_M_root_rope(__r)
@@ -1287,7 +1287,6 @@ protected:
typedef _Rope_char_ref_proxy<_CharT, _Alloc> reference;
typedef _Rope_char_ref_proxy<_CharT, _Alloc>* pointer;
- public:
rope<_CharT, _Alloc>&
container()
{ return *_M_root_rope; }
@@ -1450,9 +1449,9 @@ protected:
// The one in _Base may not be visible due to template rules.
_Rope_base(_RopeRep* __t, const allocator_type&)
- : _M_tree_ptr(__t) {}
+ : _M_tree_ptr(__t) { }
- _Rope_base(const allocator_type&) {}
+ _Rope_base(const allocator_type&) { }
// The only data member of a rope:
_RopeRep *_M_tree_ptr;
@@ -1554,8 +1553,8 @@ protected:
{ _RopeRep::_S_ref(__t); }
#else /* __GC */
- static void _S_unref(_RopeRep*) {}
- static void _S_ref(_RopeRep*) {}
+ static void _S_unref(_RopeRep*) { }
+ static void _S_ref(_RopeRep*) { }
#endif
#ifdef __GC
@@ -1711,7 +1710,7 @@ protected:
_CharT* __buffer);
static const unsigned long
- _S_min_len[::_S_max_rope_depth + 1];
+ _S_min_len[__detail::_S_max_rope_depth + 1];
static bool
_S_is_balanced(_RopeRep* __r)
@@ -1818,9 +1817,9 @@ protected:
const allocator_type& __a = allocator_type());
rope(const allocator_type& __a = allocator_type())
- : _Base(0, __a) {}
+ : _Base(0, __a) { }
- // Construct a rope from a function that can compute its members
+ // Construct a rope from a function that can compute its members
rope(char_producer<_CharT> *__fn, size_t __len, bool __delete_fn,
const allocator_type& __a = allocator_type())
: _Base(__a)
@@ -1866,9 +1865,8 @@ protected:
pop_back()
{
_RopeRep* __old = this->_M_tree_ptr;
- this->_M_tree_ptr =
- _S_substring(this->_M_tree_ptr,
- 0, this->_M_tree_ptr->_M_size - 1);
+ this->_M_tree_ptr = _S_substring(this->_M_tree_ptr,
+ 0, this->_M_tree_ptr->_M_size - 1);
_S_unref(__old);
}
@@ -1961,7 +1959,7 @@ protected:
{
if (0 == this->_M_tree_ptr)
return;
- if (::_S_leaf == this->_M_tree_ptr->_M_tag &&
+ if (__detail::_S_leaf == this->_M_tree_ptr->_M_tag &&
((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
this->_M_tree_ptr->_M_c_string)
{
@@ -2013,7 +2011,7 @@ protected:
size_type
max_size() const
{
- return _S_min_len[int(::_S_max_rope_depth) - 1] - 1;
+ return _S_min_len[int(__detail::_S_max_rope_depth) - 1] - 1;
// Guarantees that the result can be sufficirntly
// balanced. Longer ropes will probably still work,
// but it's harder to make guarantees.
@@ -2049,12 +2047,13 @@ protected:
template<class _CharT2, class _Alloc2>
friend rope<_CharT2, _Alloc2>
operator+(const rope<_CharT2, _Alloc2>& __left, _CharT2 __right);
- // The symmetric cases are intentionally omitted, since they're presumed
- // to be less common, and we don't handle them as well.
- // The following should really be templatized.
- // The first argument should be an input iterator or
- // forward iterator with value_type _CharT.
+ // The symmetric cases are intentionally omitted, since they're
+ // presumed to be less common, and we don't handle them as well.
+
+ // The following should really be templatized. The first
+ // argument should be an input iterator or forward iterator with
+ // value_type _CharT.
rope&
append(const _CharT* __iter, size_t __n)
{
@@ -2576,9 +2575,9 @@ protected:
return (*this)[__pos];
}
- void resize(size_type __n, _CharT __c) {}
- void resize(size_type __n) {}
- void reserve(size_type __res_arg = 0) {}
+ void resize(size_type __n, _CharT __c) { }
+ void resize(size_type __n) { }
+ void reserve(size_type __res_arg = 0) { }
size_type
capacity() const
@@ -2747,21 +2746,21 @@ protected:
__x._M_current_pos + __n); }
template <class _CharT, class _Alloc>
- inline _Rope_iterator<_CharT,_Alloc>
+ inline _Rope_iterator<_CharT, _Alloc>
operator+(ptrdiff_t __n, const _Rope_iterator<_CharT, _Alloc>& __x)
{ return _Rope_iterator<_CharT, _Alloc>(__x._M_root_rope,
__x._M_current_pos + __n); }
template <class _CharT, class _Alloc>
- inline rope<_CharT,_Alloc>
+ inline rope<_CharT, _Alloc>
operator+(const rope<_CharT, _Alloc>& __left,
const rope<_CharT, _Alloc>& __right)
{
- return rope<_CharT, _Alloc>(rope<_CharT, _Alloc>::
- _S_concat(__left._M_tree_ptr,
- __right._M_tree_ptr));
// Inlining this should make it possible to keep __left and
// __right in registers.
+ typedef rope<_CharT, _Alloc> rope_type;
+ return rope_type(rope_type::_S_concat(__left._M_tree_ptr,
+ __right._M_tree_ptr));
}
template <class _CharT, class _Alloc>
@@ -2778,9 +2777,9 @@ protected:
operator+(const rope<_CharT, _Alloc>& __left,
const _CharT* __right)
{
- size_t __rlen = rope<_CharT,_Alloc>::_S_char_ptr_len(__right);
- return rope<_CharT, _Alloc>(rope<_CharT, _Alloc>::
- _S_concat_char_iter(__left._M_tree_ptr,
+ typedef rope<_CharT, _Alloc> rope_type;
+ size_t __rlen = rope_type::_S_char_ptr_len(__right);
+ return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
__right, __rlen));
}
@@ -2797,8 +2796,8 @@ protected:
inline rope<_CharT, _Alloc>
operator+(const rope<_CharT, _Alloc>& __left, _CharT __right)
{
- return rope<_CharT, _Alloc>(rope<_CharT, _Alloc>::
- _S_concat_char_iter(__left._M_tree_ptr,
+ typedef rope<_CharT, _Alloc> rope_type;
+ return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
&__right, 1));
}
@@ -2887,7 +2886,6 @@ protected:
operator()(const crope& __str) const
{
size_t __size = __str.size();
-
if (0 == __size)
return 0;
return 13 * __str[0] + 5 * __str[__size - 1] + __size;
@@ -2902,7 +2900,6 @@ protected:
operator()(const wrope& __str) const
{
size_t __size = __str.size();
-
if (0 == __size)
return 0;
return 13 * __str[0] + 5 * __str[__size - 1] + __size;
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index c7827e3..bbe6b997 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -78,13 +78,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
switch(__leaf->_M_tag)
{
- case ::_S_leaf:
+ case __detail::_S_leaf:
__x._M_buf_start = ((_Rope_RopeLeaf<_CharT, _Alloc>*)__leaf)->_M_data;
__x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
__x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
break;
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
{
size_t __len = _S_iterator_buf_len;
size_t __buf_start_pos = __leaf_pos;
@@ -117,7 +117,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_Rope_iterator_base<_CharT, _Alloc>::
_S_setcache(_Rope_iterator_base<_CharT, _Alloc>& __x)
{
- const _RopeRep* __path[int(::_S_max_rope_depth) + 1];
+ const _RopeRep* __path[int(__detail::_S_max_rope_depth) + 1];
const _RopeRep* __curr_rope;
int __curr_depth = -1; /* index into path */
size_t __curr_start_pos = 0;
@@ -147,12 +147,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__path[__curr_depth] = __curr_rope;
switch(__curr_rope->_M_tag)
{
- case ::_S_leaf:
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_leaf:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
__x._M_leaf_pos = __curr_start_pos;
goto done;
- case ::_S_concat:
+ case __detail::_S_concat:
{
_Rope_RopeConcatenation<_CharT, _Alloc>* __c =
(_Rope_RopeConcatenation<_CharT, _Alloc>*)__curr_rope;
@@ -234,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__current_node = __c->_M_right;
__x._M_path_end[++__current_index] = __current_node;
__dirns |= 1;
- while (::_S_concat == __current_node->_M_tag)
+ while (__detail::_S_concat == __current_node->_M_tag)
{
++__current_index;
if (int(_S_path_cache_len) == __current_index)
@@ -378,7 +378,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
switch(_M_tag)
{
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
_Rope_RopeLeaf<_CharT, _Alloc>* __l
= (_Rope_RopeLeaf<_CharT, _Alloc>*)this;
@@ -386,7 +386,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_L_deallocate(__l, 1);
break;
}
- case ::_S_concat:
+ case __detail::_S_concat:
{
_Rope_RopeConcatenation<_CharT,_Alloc>* __c
= (_Rope_RopeConcatenation<_CharT, _Alloc>*)this;
@@ -395,7 +395,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_C_deallocate(__c, 1);
break;
}
- case ::_S_function:
+ case __detail::_S_function:
{
_Rope_RopeFunction<_CharT, _Alloc>* __f
= (_Rope_RopeFunction<_CharT, _Alloc>*)this;
@@ -403,7 +403,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_F_deallocate(__f, 1);
break;
}
- case ::_S_substringfn:
+ case __detail::_S_substringfn:
{
_Rope_RopeSubstring<_CharT, _Alloc>* __ss =
(_Rope_RopeSubstring<_CharT, _Alloc>*)this;
@@ -503,7 +503,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
if (__depth > 20
&& (__result->_M_size < 1000
- || __depth > size_t(::_S_max_rope_depth)))
+ || __depth > size_t(__detail::_S_max_rope_depth)))
{
_RopeRep* __balanced;
@@ -541,14 +541,14 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
- if (__r->_M_tag == ::_S_leaf
+ if (__r->_M_tag == __detail::_S_leaf
&& __r->_M_size + __slen <= size_t(_S_copy_max))
{
__result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
- if (::_S_concat == __r->_M_tag
- && ::_S_leaf == ((_RopeConcatenation*) __r)->_M_right->_M_tag)
+ if (__detail::_S_concat == __r->_M_tag
+ && __detail::_S_leaf == ((_RopeConcatenation*) __r)->_M_right->_M_tag)
{
_RopeLeaf* __right =
(_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
@@ -605,17 +605,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return __r;
}
if (__orig_size + __slen <= size_t(_S_copy_max)
- && ::_S_leaf == __r->_M_tag)
+ && __detail::_S_leaf == __r->_M_tag)
{
__result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s,
__slen);
return __result;
}
- if (::_S_concat == __r->_M_tag)
+ if (__detail::_S_concat == __r->_M_tag)
{
_RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)
__r)->_M_right);
- if (::_S_leaf == __right->_M_tag
+ if (__detail::_S_leaf == __right->_M_tag
&& __right->_M_size + __slen <= size_t(_S_copy_max))
{
_RopeRep* __new_right =
@@ -665,17 +665,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__left->_M_ref_nonnil();
return __left;
}
- if (::_S_leaf == __right->_M_tag)
+ if (__detail::_S_leaf == __right->_M_tag)
{
- if (::_S_leaf == __left->_M_tag)
+ if (__detail::_S_leaf == __left->_M_tag)
{
if (__right->_M_size + __left->_M_size <= size_t(_S_copy_max))
return _S_leaf_concat_char_iter((_RopeLeaf*)__left,
((_RopeLeaf*)__right)->_M_data,
__right->_M_size);
}
- else if (::_S_concat == __left->_M_tag
- && ::_S_leaf == ((_RopeConcatenation*)
+ else if (__detail::_S_concat == __left->_M_tag
+ && __detail::_S_leaf == ((_RopeConcatenation*)
__left)->_M_right->_M_tag)
{
_RopeLeaf* __leftright =
@@ -740,7 +740,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
switch(__base->_M_tag)
{
- case ::_S_concat:
+ case __detail::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__base;
_RopeRep* __left = __c->_M_left;
@@ -762,7 +762,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__result = _S_concat(__left_result, __right_result);
return __result;
}
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__base;
_RopeLeaf* __result;
@@ -786,7 +786,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
#endif
return __result;
}
- case ::_S_substringfn:
+ case __detail::_S_substringfn:
// Avoid introducing multiple layers of substring nodes.
{
_RopeSubstring* __old = (_RopeSubstring*)__base;
@@ -805,7 +805,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
} // *** else fall through: ***
}
- case ::_S_function:
+ case __detail::_S_function:
{
_RopeFunction* __f = (_RopeFunction*)__base;
_CharT* __section;
@@ -930,7 +930,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return true;
switch(__r->_M_tag)
{
- case ::_S_concat:
+ case __detail::_S_concat:
{
_RopeConcatenation* __conc = (_RopeConcatenation*)__r;
_RopeRep* __left = __conc->_M_left;
@@ -952,13 +952,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
}
return true;
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __c(__l->_M_data + __begin, __end - __begin);
}
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
size_t __len = __end - __begin;
@@ -1081,7 +1081,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return __buffer;
switch(__r->_M_tag)
{
- case ::_S_concat:
+ case __detail::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
@@ -1089,13 +1089,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
_CharT* __rest = _S_flatten(__left, __buffer);
return _S_flatten(__right, __rest);
}
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return copy_n(__l->_M_data, __l->_M_size, __buffer).second;
}
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
// We don't yet do anything with substring nodes.
// This needs to be fixed before ropefiles will work well.
{
@@ -1147,13 +1147,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
switch (__r->_M_tag)
{
- case ::_S_leaf:
+ case __detail::_S_leaf:
__kind = "Leaf";
break;
- case ::_S_function:
+ case __detail::_S_function:
__kind = "Function";
break;
- case ::_S_substringfn:
+ case __detail::_S_substringfn:
__kind = "Function representing substring";
break;
default:
@@ -1186,7 +1186,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
template <class _CharT, class _Alloc>
const unsigned long
rope<_CharT, _Alloc>::
- _S_min_len[int(::_S_max_rope_depth) + 1] = {
+ _S_min_len[int(__detail::_S_max_rope_depth) + 1] = {
/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21,
/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377,
/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181,
@@ -1205,7 +1205,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
rope<_CharT, _Alloc>::
_S_balance(_RopeRep* __r)
{
- _RopeRep* __forest[int(::_S_max_rope_depth) + 1];
+ _RopeRep* __forest[int(__detail::_S_max_rope_depth) + 1];
_RopeRep* __result = 0;
int __i;
// Invariant:
@@ -1214,12 +1214,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// __forest[__i]._M_depth = __i
// References from forest are included in refcount.
- for (__i = 0; __i <= int(::_S_max_rope_depth); ++__i)
+ for (__i = 0; __i <= int(__detail::_S_max_rope_depth); ++__i)
__forest[__i] = 0;
try
{
_S_add_to_forest(__r, __forest);
- for (__i = 0; __i <= int(::_S_max_rope_depth); ++__i)
+ for (__i = 0; __i <= int(__detail::_S_max_rope_depth); ++__i)
if (0 != __forest[__i])
{
#ifndef __GC
@@ -1234,12 +1234,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
catch(...)
{
- for(__i = 0; __i <= int(::_S_max_rope_depth); __i++)
+ for(__i = 0; __i <= int(__detail::_S_max_rope_depth); __i++)
_S_unref(__forest[__i]);
__throw_exception_again;
}
- if (__result->_M_depth > int(::_S_max_rope_depth))
+ if (__result->_M_depth > int(__detail::_S_max_rope_depth))
__throw_length_error(__N("rope::_S_balance"));
return(__result);
}
@@ -1307,7 +1307,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
}
- if (__i == int(::_S_max_rope_depth)
+ if (__i == int(__detail::_S_max_rope_depth)
|| __insertee->_M_size < _S_min_len[__i+1])
{
__forest[__i] = __insertee;
@@ -1330,7 +1330,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
switch(__r->_M_tag)
{
- case ::_S_concat:
+ case __detail::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
@@ -1345,13 +1345,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__r = __left;
}
break;
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
return __l->_M_data[__i];
}
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
{
_RopeFunction* __f = (_RopeFunction*)__r;
_CharT __result;
@@ -1371,7 +1371,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
rope<_CharT, _Alloc>::
_S_fetch_ptr(_RopeRep* __r, size_type __i)
{
- _RopeRep* __clrstack[::_S_max_rope_depth];
+ _RopeRep* __clrstack[__detail::_S_max_rope_depth];
size_t __csptr = 0;
for(;;)
@@ -1380,7 +1380,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return 0;
switch(__r->_M_tag)
{
- case ::_S_concat:
+ case __detail::_S_concat:
{
_RopeConcatenation* __c = (_RopeConcatenation*)__r;
_RopeRep* __left = __c->_M_left;
@@ -1397,7 +1397,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
__r = __left;
}
break;
- case ::_S_leaf:
+ case __detail::_S_leaf:
{
_RopeLeaf* __l = (_RopeLeaf*)__r;
if (__l->_M_c_string != __l->_M_data && __l->_M_c_string != 0)
@@ -1411,8 +1411,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
}
return __l->_M_data + __i;
}
- case ::_S_function:
- case ::_S_substringfn:
+ case __detail::_S_function:
+ case __detail::_S_substringfn:
return 0;
}
}
@@ -1437,10 +1437,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return -1;
__left_len = __left->_M_size;
__right_len = __right->_M_size;
- if (::_S_leaf == __left->_M_tag)
+ if (__detail::_S_leaf == __left->_M_tag)
{
_RopeLeaf* __l = (_RopeLeaf*) __left;
- if (::_S_leaf == __right->_M_tag)
+ if (__detail::_S_leaf == __right->_M_tag)
{
_RopeLeaf* __r = (_RopeLeaf*) __right;
return lexicographical_compare_3way(__l->_M_data,
@@ -1461,7 +1461,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
{
const_iterator __lstart(__left, 0);
const_iterator __lend(__left, __left_len);
- if (::_S_leaf == __right->_M_tag)
+ if (__detail::_S_leaf == __right->_M_tag)
{
_RopeLeaf* __r = (_RopeLeaf*) __right;
return lexicographical_compare_3way(__lstart, __lend,
@@ -1637,7 +1637,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
return _S_empty_c_str;
}
__GC_CONST _CharT* __old_c_string = this->_M_tree_ptr->_M_c_string;
- if (::_S_leaf == this->_M_tree_ptr->_M_tag
+ if (__detail::_S_leaf == this->_M_tree_ptr->_M_tag
&& 0 != __old_c_string)
return(__old_c_string);
size_t __s = size();