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:
jfbastien 2009-03-17 18:21:12 +00:00
parent b1e0c16582
commit 433534f136
2 changed files with 10 additions and 6 deletions

View file

@ -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)
{ return !(lhs < rhs); }
// subclause 21.3.7.8:
//void swap(flex_string<E, T, A, S>& lhs, flex_string<E, T, A, S>& rhs); // to do
template <typename E, class T, class A, class S>
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>
std::basic_istream<typename flex_string<E, T, A, S>::value_type,

View file

@ -515,7 +515,7 @@ namespace Tests
template<class String>
String swap_string_string()
{
using std::swap;
// 21.3.7.8
String random1(RandomString<String>(MaxString<String>::value));
String random2(RandomString<String>(MaxString<String>::value));
swap(random1, random2);
@ -525,7 +525,7 @@ namespace Tests
template<class String>
String swap_string_string__self()
{
using std::swap;
// 21.3.7.8
String random1(RandomString<String>(MaxString<String>::value));
swap(random1, random1);
return random1;
@ -534,7 +534,7 @@ namespace Tests
template<class String>
String swap_string_string__selfcopy()
{
using std::swap;
// 21.3.7.8
String random1(RandomString<String>(MaxString<String>::value));
String copy(random1);
swap(random1, copy);
@ -544,7 +544,7 @@ namespace Tests
template<class String>
String swap_string_string__selfcopy2()
{
using std::swap;
// 21.3.7.8
String random1(RandomString<String>(MaxString<String>::value));
String copy(random1);
swap(copy, random1);