Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

PriQTel2

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.41 sec, absolute service time: 0,54 sec 
latest |  history
Error(s):
93280161/source.cpp: In function ‘bool operator<(Tel, Tel)’:
93280161/source.cpp:62:23: error: passing ‘const Tel’ as ‘this’ argument discards qualifiers [-fpermissive]
   return tel1.getName()<tel2.getName();
                       ^
93280161/source.cpp:54:13: note:   in call to ‘std::__cxx11::string Tel::getName()’
 std::string getName(){return name;}
             ^~~~~~~
93280161/source.cpp:62:38: error: passing ‘const Tel’ as ‘this’ argument discards qualifiers [-fpermissive]
   return tel1.getName()<tel2.getName();
                                      ^
93280161/source.cpp:54:13: note:   in call to ‘std::__cxx11::string Tel::getName()’
 std::string getName(){return name;}
             ^~~~~~~
93280161/source.cpp: In function ‘int main()’:
93280161/source.cpp:96:15: error: binding reference of type ‘Tel&’ to ‘const value_type {aka const Tel}’ discards qualifiers
 Tel tele=Q.top();
          ~~~~~^~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~
In file included from /usr/include/c++/7/queue:62:0,
                 from 93280161/source.cpp:15:
/usr/include/c++/7/bits/stl_heap.h: In instantiation of ‘void std::push_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Tel*, std::vector<Tel, std::allocator<Tel> > >; _Compare = std::less<Tel>]’:
/usr/include/c++/7/bits/stl_queue.h:598:16:   required from ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = Tel; _Sequence = std::vector<Tel, std::allocator<Tel> >; _Compare = std::less<Tel>; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = Tel]’
93280161/source.cpp:85:10:   required from here
/usr/include/c++/7/bits/stl_heap.h:206:18: error: cannot bind non-const lvalue reference of type ‘Tel&’ to an rvalue of type ‘std::remove_reference<Tel&>::type {aka Tel}’
       _ValueType __value = _GLIBCXX_MOVE(*(__last - 1));
                  ^~~~~~~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~
In file included from /usr/include/c++/7/queue:62:0,
                 from 93280161/source.cpp:15:
/usr/include/c++/7/bits/stl_heap.h:207:23: error: cannot bind non-const lvalue reference of type ‘Tel&’ to an rvalue of type ‘std::remove_reference<Tel&>::type {aka Tel}’
       std::__push_heap(__first, _DistanceType((__last - __first) - 1),
       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          _DistanceType(0), _GLIBCXX_MOVE(__value), __cmp);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~
In file included from /usr/include/c++/7/queue:62:0,
                 from 93280161/source.cpp:15:
/usr/include/c++/7/bits/stl_heap.h:128:5: note:   initializing argument 4 of ‘void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Tel*, std::vector<Tel, std::allocator<Tel> > >; _Distance = long int; _Tp = Tel; _Compare = __gnu_cxx::__ops::_Iter_comp_val<std::less<Tel> >]’
     __push_heap(_RandomAccessIterator __first,
     ^~~~~~~~~~~
/usr/include/c++/7/bits/stl_heap.h: In instantiation of ‘void std::__pop_heap(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Tel*, std::vector<Tel, std::allocator<Tel> > >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::less<Tel> >]’:
/usr/include/c++/7/bits/stl_heap.h:320:19:   required from ‘void std::pop_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Tel*, std::vector<Tel, std::allocator<Tel> > >; _Compare = std::less<Tel>]’
/usr/include/c++/7/bits/stl_queue.h:633:15:   required from ‘void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = Tel; _Sequence = std::vector<Tel, std::allocator<Tel> >; _Compare = std::less<Tel>]’
93280161/source.cpp:97:7:   required from here
/usr/include/c++/7/bits/stl_heap.h:251:18: error: cannot bind non-const lvalue reference of type ‘Tel&’ to an rvalue of type ‘std::remove_reference<Tel&>::type {aka Tel}’
       _ValueType __value = _GLIBCXX_MOVE(*__result);
                  ^~~~~~~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~
In file included from /usr/include/c++/7/queue:62:0,
                 from 93280161/source.cpp:15:
/usr/include/c++/7/bits/stl_heap.h:253:25: error: cannot bind non-const lvalue reference of type ‘Tel&’ to an rvalue of type ‘std::remove_reference<Tel&>::type {aka Tel}’
       std::__adjust_heap(__first, _DistanceType(0),
       ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
     _DistanceType(__last - __first),
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     _GLIBCXX_MOVE(__value), __comp);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~
In file included from /usr/include/c++/7/queue:62:0,
                 from 93280161/source.cpp:15:
/usr/include/c++/7/bits/stl_heap.h:214:5: note:   initializing argument 4 of ‘void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Tel*, std::vector<Tel, std::allocator<Tel> > >; _Distance = long int; _Tp = Tel; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<std::less<Tel> >]’
     __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex,
     ^~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33:0,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/string:41,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from 93280161/source.cpp:11:
/usr/include/c++/7/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Tel; _Args = {const Tel&}; _Tp = Tel]’:
/usr/include/c++/7/bits/alloc_traits.h:475:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Tel; _Args = {const Tel&}; _Tp = Tel; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Tel>]’
/usr/include/c++/7/bits/stl_vector.h:943:30:   required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Tel; _Alloc = std::allocator<Tel>; std::vector<_Tp, _Alloc>::value_type = Tel]’
/usr/include/c++/7/bits/stl_queue.h:597:2:   required from ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = Tel; _Sequence = std::vector<Tel, std::allocator<Tel> >; _Compare = std::less<Tel>; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = Tel]’
93280161/source.cpp:85:10:   required from here
/usr/include/c++/7/ext/new_allocator.h:136:4: error: binding reference of type ‘Tel&’ to ‘const Tel’ discards qualifiers
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~
In file included from /usr/include/c++/7/deque:62:0,
                 from /usr/include/c++/7/queue:60,
                 from 93280161/source.cpp:15:
/usr/include/c++/7/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_T1*, _Args&& ...) [with _T1 = Tel; _Args = {Tel}]’:
/usr/include/c++/7/bits/stl_uninitialized.h:83:18:   required from ‘static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<Tel*>; _ForwardIterator = Tel*; bool _TrivialValueTypes = false]’
/usr/include/c++/7/bits/stl_uninitialized.h:134:15:   required from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<Tel*>; _ForwardIterator = Tel*]’
/usr/include/c++/7/bits/stl_uninitialized.h:289:37:   required from ‘_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = std::move_iterator<Tel*>; _ForwardIterator = Tel*; _Tp = Tel]’
/usr/include/c++/7/bits/stl_uninitialized.h:311:2:   required from ‘_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = Tel*; _ForwardIterator = Tel*; _Allocator = std::allocator<Tel>]’
/usr/include/c++/7/bits/vector.tcc:426:6:   required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const Tel&}; _Tp = Tel; _Alloc = std::allocator<Tel>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<Tel*, std::vector<Tel, std::allocator<Tel> > >; typename std::_Vector_base<_Tp, _Alloc>::pointer = Tel*]’
/usr/include/c++/7/bits/stl_vector.h:948:21:   required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Tel; _Alloc = std::allocator<Tel>; std::vector<_Tp, _Alloc>::value_type = Tel]’
/usr/include/c++/7/bits/stl_queue.h:597:2:   required from ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = Tel; _Sequence = std::vector<Tel, std::allocator<Tel> >; _Compare = std::less<Tel>; std::priority_queue<_Tp, _Sequence, _Compare>::value_type = Tel]’
93280161/source.cpp:85:10:   required from here
/usr/include/c++/7/bits/stl_construct.h:75:7: error: cannot bind non-const lvalue reference of type ‘Tel&’ to an rvalue of type ‘Tel’
     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93280161/source.cpp:52:1: note:   initializing argument 1 of ‘Tel::Tel(Tel&)’
 Tel(Tel& c){l=c.l;name=c.name;update=c.update;}
 ^~~

        

    
                
λ
.NET NoSQL database for rapid development