summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/basic_string.h
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-20 21:54:22 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-20 21:54:22 +0000
commit7ec7b3beb46afcc2cc34f5a09ec6ce5034086cde (patch)
treed9f0a70cd63a05ff0f5897ee3af169de24b15bd4 /libstdc++-v3/include/bits/basic_string.h
parentd384ff481dc275ec7e1a4342669348a61b852e96 (diff)
downloadppe42-gcc-7ec7b3beb46afcc2cc34f5a09ec6ce5034086cde.tar.gz
ppe42-gcc-7ec7b3beb46afcc2cc34f5a09ec6ce5034086cde.zip
2009-10-20 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/41773 Revert: 2009-10-20 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/basic_string.h (_S_construct(const _CharT*, size_type, const _Alloc&)): New, declare. (_S_construct(_CharT*, _CharT*, const _Alloc&), _S_construct(const _CharT*, const _CharT*, const _Alloc&), _S_construct(iterator, iterator, const _Alloc&), _S_construct(const_iterator, const_iterator, const _Alloc&)): New, forward to the latter. * include/bits/basic_string.tcc (_S_construct(const _CharT*, size_type, const _Alloc&)): Define. (basic_string(const basic_string&, size_type, size_type), basic_string(const basic_string&, size_type, size_type, const _Alloc&), basic_string(const _CharT*, size_type, const _Alloc&), basic_string(const _CharT*, const _Alloc&), basic_string(initializer_list<>, const _Alloc&)): Call the latter. * config/abi/pre/gnu.ver: Remove recently added exports. * src/string-inst.cc: Remove instantiations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153040 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/basic_string.h')
-rw-r--r--libstdc++-v3/include/bits/basic_string.h54
1 files changed, 13 insertions, 41 deletions
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 5ef6f007f40..9d44dc4fdfc 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -419,13 +419,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/**
* @brief Default constructor creates an empty string.
*/
- basic_string()
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
- : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc())
-#else
- : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc())
-#endif
- { }
+ inline
+ basic_string();
/**
* @brief Construct an empty string using allocator @a a.
@@ -1551,8 +1546,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* max_size(), length_error is thrown. The value of the string doesn't
* change if an error is thrown.
*/
- basic_string&
- replace(iterator __i1, iterator __i2, initializer_list<_CharT> __l)
+ basic_string& replace(iterator __i1, iterator __i2,
+ initializer_list<_CharT> __l)
{ return this->replace(__i1, __i2, __l.begin(), __l.end()); }
#endif // __GXX_EXPERIMENTAL_CXX0X__
@@ -1603,35 +1598,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return _S_construct_aux(__beg, __end, __a, _Integral());
}
- static _CharT*
- _S_construct(_CharT* __beg, _CharT* __end, const _Alloc& __a)
- {
- __glibcxx_requires_valid_range(__beg, __end);
- return _S_construct(__beg, __end - __beg, __a);
- }
-
- static _CharT*
- _S_construct(const _CharT* __beg, const _CharT* __end, const _Alloc& __a)
- {
- __glibcxx_requires_valid_range(__beg, __end);
- return _S_construct(__beg, __end - __beg, __a);
- }
-
- static _CharT*
- _S_construct(iterator __beg, iterator __end, const _Alloc& __a)
- {
- __glibcxx_requires_valid_range(__beg, __end);
- return _S_construct(__beg.base(), __end - __beg, __a);
- }
-
- static _CharT*
- _S_construct(const_iterator __beg, const_iterator __end,
- const _Alloc& __a)
- {
- __glibcxx_requires_valid_range(__beg, __end);
- return _S_construct(__beg.base(), __end - __beg, __a);
- }
-
// For Input Iterators, used in istreambuf_iterators, etc.
template<class _InIterator>
static _CharT*
@@ -1648,9 +1614,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
static _CharT*
_S_construct(size_type __req, _CharT __c, const _Alloc& __a);
- static _CharT*
- _S_construct(const _CharT* __s, size_type __n, const _Alloc& __a);
-
public:
/**
@@ -2216,6 +2179,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
size_type __n2) const;
};
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ inline basic_string<_CharT, _Traits, _Alloc>::
+ basic_string()
+#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
+ : _M_dataplus(_S_empty_rep()._M_refdata(), _Alloc()) { }
+#else
+ : _M_dataplus(_S_construct(size_type(), _CharT(), _Alloc()), _Alloc()) { }
+#endif
+
// operator+
/**
* @brief Concatenate two strings.
OpenPOWER on IntegriCloud