Bug 2690414: flex_string missing swap implementation
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1011 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
b1e0c16582
commit
433534f136
2 changed files with 10 additions and 6 deletions
|
@ -1305,8 +1305,12 @@ bool operator>=(const typename flex_string<E, T, A, S>::value_type* lhs,
|
||||||
const flex_string<E, T, A, S>& rhs)
|
const flex_string<E, T, A, S>& rhs)
|
||||||
{ return !(lhs < rhs); }
|
{ return !(lhs < rhs); }
|
||||||
|
|
||||||
// subclause 21.3.7.8:
|
template <typename E, class T, class A, class S>
|
||||||
//void swap(flex_string<E, T, A, S>& lhs, flex_string<E, T, A, S>& rhs); // to do
|
inline void swap(flex_string<E, T, A, S>& lhs, flex_string<E, T, A, S>& rhs)
|
||||||
|
{
|
||||||
|
// 21.3.7.8
|
||||||
|
lhs.swap(rhs);
|
||||||
|
}
|
||||||
|
|
||||||
template <typename E, class T, class A, class S>
|
template <typename E, class T, class A, class S>
|
||||||
std::basic_istream<typename flex_string<E, T, A, S>::value_type,
|
std::basic_istream<typename flex_string<E, T, A, S>::value_type,
|
||||||
|
|
|
@ -515,7 +515,7 @@ namespace Tests
|
||||||
template<class String>
|
template<class String>
|
||||||
String swap_string_string()
|
String swap_string_string()
|
||||||
{
|
{
|
||||||
using std::swap;
|
// 21.3.7.8
|
||||||
String random1(RandomString<String>(MaxString<String>::value));
|
String random1(RandomString<String>(MaxString<String>::value));
|
||||||
String random2(RandomString<String>(MaxString<String>::value));
|
String random2(RandomString<String>(MaxString<String>::value));
|
||||||
swap(random1, random2);
|
swap(random1, random2);
|
||||||
|
@ -525,7 +525,7 @@ namespace Tests
|
||||||
template<class String>
|
template<class String>
|
||||||
String swap_string_string__self()
|
String swap_string_string__self()
|
||||||
{
|
{
|
||||||
using std::swap;
|
// 21.3.7.8
|
||||||
String random1(RandomString<String>(MaxString<String>::value));
|
String random1(RandomString<String>(MaxString<String>::value));
|
||||||
swap(random1, random1);
|
swap(random1, random1);
|
||||||
return random1;
|
return random1;
|
||||||
|
@ -534,7 +534,7 @@ namespace Tests
|
||||||
template<class String>
|
template<class String>
|
||||||
String swap_string_string__selfcopy()
|
String swap_string_string__selfcopy()
|
||||||
{
|
{
|
||||||
using std::swap;
|
// 21.3.7.8
|
||||||
String random1(RandomString<String>(MaxString<String>::value));
|
String random1(RandomString<String>(MaxString<String>::value));
|
||||||
String copy(random1);
|
String copy(random1);
|
||||||
swap(random1, copy);
|
swap(random1, copy);
|
||||||
|
@ -544,7 +544,7 @@ namespace Tests
|
||||||
template<class String>
|
template<class String>
|
||||||
String swap_string_string__selfcopy2()
|
String swap_string_string__selfcopy2()
|
||||||
{
|
{
|
||||||
using std::swap;
|
// 21.3.7.8
|
||||||
String random1(RandomString<String>(MaxString<String>::value));
|
String random1(RandomString<String>(MaxString<String>::value));
|
||||||
String copy(random1);
|
String copy(random1);
|
||||||
swap(copy, random1);
|
swap(copy, random1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue