Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

gcc HEAD 11.0.1 20210228 (experimental)

Options
Warnings
Boost 1.73.0
C++17
no pedantic

Author

anonymous

over 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=c++17
In file included from /opt/wandbox/gcc-head/include/c++/11.0.1/set:60,
                 from prog.cc:3:
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h: In instantiation of 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type) [with _Key = Fruit*; _Val = Fruit*; _KeyOfValue = std::_Identity<Fruit*>; _Compare = comp; _Alloc = std::allocator<Fruit*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Link_type = const std::_Rb_tree_node<Fruit*>*]':
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h:796:22:   required from 'static const _Key& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_S_key(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr) [with _Key = Fruit*; _Val = Fruit*; _KeyOfValue = std::_Identity<Fruit*>; _Compare = comp; _Alloc = std::allocator<Fruit*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Const_Base_ptr = const std::_Rb_tree_node_base*]'
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h:2172:40:   required from 'std::pair<std::_Rb_tree_node_base*, std::_Rb_tree_node_base*> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = Fruit*; _Val = Fruit*; _KeyOfValue = std::_Identity<Fruit*>; _Compare = comp; _Alloc = std::allocator<Fruit*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Fruit*, Fruit*, std::_Identity<Fruit*>, comp, std::allocator<Fruit*> >::const_iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::key_type = Fruit*]'
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h:2232:4:   required from 'std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_unique_(std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Arg&&, _NodeGen&) [with _Arg = Fruit* const&; _NodeGen = std::_Rb_tree<Fruit*, Fruit*, std::_Identity<Fruit*>, comp, std::allocator<Fruit*> >::_Alloc_node; _Key = Fruit*; _Val = Fruit*; _KeyOfValue = std::_Identity<Fruit*>; _Compare = comp; _Alloc = std::allocator<Fruit*>; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator = std::_Rb_tree<Fruit*, Fruit*, std::_Identity<Fruit*>, comp, std::allocator<Fruit*> >::iterator; std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Fruit*, Fruit*, std::_Identity<Fruit*>, comp, std::allocator<Fruit*> >::const_iterator]'
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h:1102:23:   required from 'std::__enable_if_t<std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value, void> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert_range_unique(_InputIterator, _InputIterator) [with _InputIterator = Fruit* const*; _Key = Fruit*; _Val = Fruit*; _KeyOfValue = std::_Identity<Fruit*>; _Compare = comp; _Alloc = std::allocator<Fruit*>; std::__enable_if_t<std::is_same<_Val, typename std::iterator_traits<_InputIterator>::value_type>::value, void> = void; typename std::iterator_traits<_InputIterator>::value_type = Fruit*]'
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_set.h:247:36:   required from 'std::set<_Key, _Compare, _Alloc>::set(std::initializer_list<_Tp>, const _Compare&, const allocator_type&) [with _Key = Fruit*; _Compare = comp; _Alloc = std::allocator<Fruit*>; std::set<_Key, _Compare, _Alloc>::allocator_type = std::allocator<Fruit*>]'
prog.cc:25:67:   required from here
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h:770:15: error: static assertion failed: comparison object must be invocable as const
  770 |               is_invocable_v<const _Compare&, const _Key&, const _Key&>,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_tree.h:770:15: note: 'std::is_invocable_v<const comp&, Fruit* const&, Fruit* const&>' evaluates to false
Exit Code:
1