prog.cpp: In function ‘int main()’:
prog.cpp:13:28: error: ‘swap’ was not declared in this scope
swap(&name[1], &name[2]);
^
prog.cpp:13:28: note: suggested alternatives:
In file included from /usr/include/c++/6/string:52:0,
from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5302:5: note: ‘std::swap’
swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
^~~~
In file included from /usr/include/c++/6/bits/stl_pair.h:59:0,
from /usr/include/c++/6/bits/stl_algobase.h:64,
from /usr/include/c++/6/bits/char_traits.h:39,
from /usr/include/c++/6/string:40,
from prog.cpp:1:
/usr/include/c++/6/bits/move.h:179:5: note: ‘std::swap’
swap(_Tp& __a, _Tp& __b)
^~~~
In file included from /usr/include/c++/6/exception:172:0,
from /usr/include/c++/6/new:40,
from /usr/include/c++/6/ext/new_allocator.h:33,
from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
from /usr/include/c++/6/bits/allocator.h:46,
from /usr/include/c++/6/string:41,
from prog.cpp:1:
/usr/include/c++/6/bits/exception_ptr.h:164:5: note: ‘std::__exception_ptr::swap’
swap(exception_ptr& __lhs, exception_ptr& __rhs)
^~~~