Author
anonymous
over 4 years ago
Language
C++
Compiler
gcc HEAD 11.0.0 20201003 (experimental)
Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic
Author
anonymous
over 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:8:19: error: no matching function for call to 'swap(main()::S&, main()::S&)'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:59,
from /opt/wandbox/gcc-head/include/c++/11.0.0/utility:70,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/move.h:189:5: note: candidate: 'template<class _Tp> constexpr std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)'
189 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/move.h:189:5: note: template argument deduction/substitution failed:
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/move.h:57,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:59,
from /opt/wandbox/gcc-head/include/c++/11.0.0/utility:70,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits: In substitution of 'template<bool _Cond, class _Tp> using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]':
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits:2197:11: required by substitution of 'template<class ... _Cond> using _Require = std::__enable_if_t<std::__and_< <template-parameter-1-1> >::value, void> [with _Cond = {std::__not_<std::__is_tuple_like<main()::S> >, std::is_move_constructible<main()::S>, std::is_move_assignable<main()::S>}]'
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/move.h:189:5: required by substitution of 'template<class _Tp> constexpr std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = main()::S]'
prog.cc:8:19: required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits:2194:11: error: no type named 'type' in 'struct std::enable_if<false, void>'
2194 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~~~
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:59,
from /opt/wandbox/gcc-head/include/c++/11.0.0/utility:70,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/move.h:213:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::__enable_if_t<std::__is_swappable<_Tp>::value, void> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
213 | swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/move.h:213:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: mismatched types '_Tp [_Nm]' and 'main()::S'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/utility:70,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:533:5: note: candidate: 'template<class _T1, class _T2> constexpr typename std::enable_if<std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)'
533 | swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:533:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::pair<_T1, _T2>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/utility:70,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:60,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:541:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<(! std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value)>::type std::swap(std::pair<_T1, _T2>&, std::pair<_T1, _T2>&)' (deleted)
541 | swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_pair.h:541:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::pair<_T1, _T2>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/string:55,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/locale_classes.h:40,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/ios_base.h:41,
from /opt/wandbox/gcc-head/include/c++/11.0.0/streambuf:41,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/streambuf_iterator.h:35,
from /opt/wandbox/gcc-head/include/c++/11.0.0/iterator:66,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algobase.h:36,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/ranges_algo.h:35,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:64,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/basic_string.h:6427:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> void std::swap(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
6427 | swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/basic_string.h:6427:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/tuple:39,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:54,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/array:325:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr typename std::enable_if<typename std::__array_traits<_Tp, _Nm>::_Is_swappable::value>::type std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&)'
325 | swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/array:325:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::array<_Tp, _Nm>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/tuple:39,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:54,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/array:333:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> typename std::enable_if<(! typename std::__array_traits<_Tp, _Nm>::_Is_swappable::value)>::type std::swap(std::array<_Tp, _Nm>&, std::array<_Tp, _Nm>&)' (deleted)
333 | swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&) = delete;
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/array:333:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::array<_Tp, _Nm>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:54,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/tuple:1712:5: note: candidate: 'template<class ... _Elements> constexpr typename std::enable_if<std::__and_<std::__is_swappable<_Elements>...>::value>::type std::swap(std::tuple<_Tps ...>&, std::tuple<_Tps ...>&)'
1712 | swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/tuple:1712:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::tuple<_Tps ...>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:54,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/tuple:1720:5: note: candidate: 'template<class ... _Elements> constexpr typename std::enable_if<(! std::__and_<std::__is_swappable<_Elements>...>::value)>::type std::swap(std::tuple<_Tps ...>&, std::tuple<_Tps ...>&)' (deleted)
1720 | swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/tuple:1720:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::tuple<_Tps ...>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:59,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/std_function.h:691:5: note: candidate: 'template<class _Res, class ... _Args> void std::swap(std::function<_Res(_ArgTypes ...)>&, std::function<_Res(_ArgTypes ...)>&)'
691 | swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y) noexcept
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/std_function.h:691:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::function<_Res(_ArgTypes ...)>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/node_handle.h:39,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/hashtable.h:37,
from /opt/wandbox/gcc-head/include/c++/11.0.0/unordered_map:46,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:61,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/optional:1219:5: note: candidate: 'template<class _Tp> std::enable_if_t<(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>), void> std::swap(std::optional<_Tp>&, std::optional<_Tp>&)'
1219 | swap(optional<_Tp>& __lhs, optional<_Tp>& __rhs)
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/optional:1219:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::optional<_Tp>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/node_handle.h:39,
from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/hashtable.h:37,
from /opt/wandbox/gcc-head/include/c++/11.0.0/unordered_map:46,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:61,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/optional:1225:5: note: candidate: 'template<class _Tp> std::enable_if_t<(!(is_move_constructible_v<_Tp> && is_swappable_v<_Tp>)), void> std::swap(std::optional<_Tp>&, std::optional<_Tp>&)' (deleted)
1225 | swap(optional<_Tp>&, optional<_Tp>&) = delete;
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/optional:1225:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::optional<_Tp>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/unordered_map:47,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:61,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unordered_map.h:2026:5: note: candidate: 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> void std::swap(std::unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, std::unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)'
2026 | swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unordered_map.h:2026:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::unordered_map<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/unordered_map:47,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:61,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unordered_map.h:2033:5: note: candidate: 'template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> void std::swap(std::unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&, std::unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>&)'
2033 | swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unordered_map.h:2033:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::unordered_multimap<_Key1, _Tp1, _Hash1, _Pred1, _Alloc1>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/vector:67,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:62,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_vector.h:1962:5: note: candidate: 'template<class _Tp, class _Alloc> void std::swap(std::vector<_Tp, _Alloc>&, std::vector<_Tp, _Alloc>&)'
1962 | swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_vector.h:1962:5: note: template argument deduction/substitution failed:
prog.cc:8:19: note: 'main()::S' is not derived from 'std::vector<_Tp, _Alloc>'
8 | std::swap(a, b);
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/vector:68,
from /opt/wandbox/gcc-head/include/c++/11.0.0/functional:62,
from /opt/wandbox/gcc-head/include/c++/11.0.0/pstl/glue_algorithm_defs.h:13,
from /opt/wandbox/gcc-head/include/c++/11.0.0/algorithm:74,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_bvector.h:118:3: note: candidate: 'void std::swap(std::_Bit_reference, std::_Bit_reference)'
118 | swap(_Bit_reference __x, _Bit_reference __y) noexcept
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_bvector.h:118:23: note: no known conversion for argument 1 from 'main()::S' to 'std::_Bit_reference'
118 | swap(_Bit_reference __x, _Bit_reference __y) noexcept
| ~~~~~~~~~~~~~~~^~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_bvector.h:126:3: note: candidate: 'void std::swap(std::_Bit_reference, bool&)'
126 | swap(_Bit_reference __x, bool& __y) noexcept
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_bvector.h:126:23: note: no known conversion for argument 1 from 'main()::S' to 'std::_Bit_reference'
126 | swap(_Bit_reference __x, bool& __y) noexcept
| ~~~~~~~~~~~~~~~^~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_bvector.h:134:3: note: candidate: 'void std::swap(bool&, std::_Bit_reference)'
134 | swap(bool& __x, _Bit_reference __y) noexcept
| ^~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/stl_bvector.h:134:14: note: no known conversion for argument 1 from 'main()::S' to 'bool&'
134 | swap(bool& __x, _Bit_reference __y) noexcept
| ~~~~~~^~~
Exit Code:
1