Comentários:
- Mesmo após corrigindo o erro de compilação, o programa congela
tanto nas entradas fornecidas pelo grupo como tambem nos exemplos
que utilizei.
- O binário fornecido não funciona.
> make
In file included from ia.cpp:10:
ia.h:27: error: `first_argument_type' has not been declared
ia.h:28: error: `second_argument_type' has not been declared
ia.h:29: error: ISO C++ forbids declaration of `a' with no type
ia.h:29: error: ISO C++ forbids declaration of `b' with no type
ia.h: In member function `bool no::menor::operator()(int, int) const':
ia.h:30: error: request for member `soma' in `a', which is of non-class type `int'
ia.h:30: error: request for member `soma' in `b', which is of non-class type `int'
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_tree.h: In member function
`typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::insert_equal(const _Val&)
[with _Key = no, _Val = no, _KeyOfValue = std::_Identity,
_Compare = no::menor, _Alloc = std::allocator]':
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_multiset.h:306: instantiated
from typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, _Alloc>::const_iterator
std::multiset<_Key, _Compare, _Alloc>::insert(const _Key&)
[with _Key = no, _Compare = no::menor, _Alloc = std::allocator]'
ia.cpp:309: instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_tree.h:805: error: no match for
call to `(no::menor) (const no&, const no&)'
ia.h:29: note: candidates are: bool no::menor::operator()(int, int) const [with Type = no]
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_tree.h: In member function
`typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_insert(std::_Rb_tree_node_base*,
std::_Rb_tree_node_base*, const _Val&) [with _Key = no, _Val = no, _KeyOfValue = std::_Identity,
_Compare = no::menor, _Alloc = std::allocator]':
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_tree.h:808: instantiated from
`typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::iterator
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::insert_equal(const _Val&)
[with _Key = no, _Val = no, _KeyOfValue = std::_Identity, _Compare = no::menor,
_Alloc = std::allocator]'
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_multiset.h:306: instantiated from
`typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, _Alloc>::const_iterator
std::multiset<_Key, _Compare, _Alloc>::insert(const _Key&)
[with _Key = no, _Compare = no::menor, _Alloc = std::allocator]'
ia.cpp:309: instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/include/g++-v3/bits/stl_tree.h:784: error: no match for
call to `(no::menor) (const no&, const no&)'
ia.h:29: note: candidates are: bool no::menor::operator()(int, int) const [with Type = no]
make: *** [all] Error 1
Correção:
Em ia.h:
bool operator( ) ( first_argument_type a,
second_argument_type b ) const
deve ser:
bool operator( ) ( Type a,
Type b ) const
|