S
Stoian
hey how is it goin,
i've got this problem - declared a template but it doesn't work
properly, here is the code:
53 std::map<Config, Config> seen;
54 Config new();
55 seen.insert(new, new);
i need to do it that way but the code brakes when i write the command
"seen.insert(new, new);"
i can assure you that everything else is working, just this - > i've
declared the template properly, cause i've used it in other parts of
the code, and i've also included the <map> library. by the way this is
the error, that i get - i also can't understand the error:
bash-2.05$ make
g++ -ggdb -c clock.cpp
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:
In member function `void std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::insert_unique(_II, _II) [with _InputIterator =
ClockConfig (*)(), _Key = ClockConfig, _Val = std:air<const
ClockConfig, ClockConfig>, _KeyOfValue =
std::_Select1st<std:air<const ClockConfig, ClockConfig> >, _Compare
= std::less<ClockConfig>, _Alloc = std::allocator<std:air<const
ClockConfig, ClockConfig> >]':
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_map.h:397:
instantiated from `void std::map<_Key, _Tp, _Compare,
_Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator =
ClockConfig (*)(), _Key = ClockConfig, _Tp = ClockConfig, _Compare =
std::less<ClockConfig>, _Alloc = std::allocator<std:air<const
ClockConfig, ClockConfig> >]'
Solver.cpp:55: instantiated from `void Solver<Config>::solve() [with
Config = ClockConfig]'
clock.cpp:60: instantiated from here
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:993:
error: ISO C++ forbids incrementing a pointer of type `ClockConfig
(*)()'
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:994:
error: no matching function for call to `std::_Rb_tree<ClockConfig,
std:air<const ClockConfig, ClockConfig>,
std::_Select1st<std:air<const ClockConfig, ClockConfig> >,
std::less<ClockConfig>, std::allocator<std:air<const ClockConfig,
ClockConfig> > >::insert_unique(ClockConfig (&)())'
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:862:
note: candidates are: std:air<typename std::_Rb_tree<_Key, _Val,
_KeyOfValue, _Compare, _Alloc>::iterator, bool> std::_Rb_tree<_Key,
_Val, _KeyOfValue, _Compare, _Alloc>::insert_unique(const _Val&) [with
_Key = ClockConfig, _Val = std:air<const ClockConfig, ClockConfig>,
_KeyOfValue = std::_Select1st<std:air<const ClockConfig,
ClockConfig> >, _Compare = std::less<ClockConfig>, _Alloc =
std::allocator<std:air<const ClockConfig, ClockConfig> >]
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:888:
note: typename std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::insert_unique(std::_Rb_tree_iterator<_Val>, const
_Val&) [with _Key = ClockConfig, _Val = std:air<const ClockConfig,
ClockConfig>, _KeyOfValue = std::_Select1st<std:air<const
ClockConfig, ClockConfig> >, _Compare = std::less<ClockConfig>, _Alloc
= std::allocator<std:air<const ClockConfig, ClockConfig> >]
*** Error code 1
make: Fatal error: Command failed for target `clock.o'
any help will be really appreciated!!!!
thanks a lot!!!
i've got this problem - declared a template but it doesn't work
properly, here is the code:
53 std::map<Config, Config> seen;
54 Config new();
55 seen.insert(new, new);
i need to do it that way but the code brakes when i write the command
"seen.insert(new, new);"
i can assure you that everything else is working, just this - > i've
declared the template properly, cause i've used it in other parts of
the code, and i've also included the <map> library. by the way this is
the error, that i get - i also can't understand the error:
bash-2.05$ make
g++ -ggdb -c clock.cpp
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:
In member function `void std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::insert_unique(_II, _II) [with _InputIterator =
ClockConfig (*)(), _Key = ClockConfig, _Val = std:air<const
ClockConfig, ClockConfig>, _KeyOfValue =
std::_Select1st<std:air<const ClockConfig, ClockConfig> >, _Compare
= std::less<ClockConfig>, _Alloc = std::allocator<std:air<const
ClockConfig, ClockConfig> >]':
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_map.h:397:
instantiated from `void std::map<_Key, _Tp, _Compare,
_Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator =
ClockConfig (*)(), _Key = ClockConfig, _Tp = ClockConfig, _Compare =
std::less<ClockConfig>, _Alloc = std::allocator<std:air<const
ClockConfig, ClockConfig> >]'
Solver.cpp:55: instantiated from `void Solver<Config>::solve() [with
Config = ClockConfig]'
clock.cpp:60: instantiated from here
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:993:
error: ISO C++ forbids incrementing a pointer of type `ClockConfig
(*)()'
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:994:
error: no matching function for call to `std::_Rb_tree<ClockConfig,
std:air<const ClockConfig, ClockConfig>,
std::_Select1st<std:air<const ClockConfig, ClockConfig> >,
std::less<ClockConfig>, std::allocator<std:air<const ClockConfig,
ClockConfig> > >::insert_unique(ClockConfig (&)())'
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:862:
note: candidates are: std:air<typename std::_Rb_tree<_Key, _Val,
_KeyOfValue, _Compare, _Alloc>::iterator, bool> std::_Rb_tree<_Key,
_Val, _KeyOfValue, _Compare, _Alloc>::insert_unique(const _Val&) [with
_Key = ClockConfig, _Val = std:air<const ClockConfig, ClockConfig>,
_KeyOfValue = std::_Select1st<std:air<const ClockConfig,
ClockConfig> >, _Compare = std::less<ClockConfig>, _Alloc =
std::allocator<std:air<const ClockConfig, ClockConfig> >]
/usr/local/gnu/lib/gcc/sparc-sun-solaris2.9/3.4.1/../../../../include/c++/3.4.1/bits/stl_tree.h:888:
note: typename std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::insert_unique(std::_Rb_tree_iterator<_Val>, const
_Val&) [with _Key = ClockConfig, _Val = std:air<const ClockConfig,
ClockConfig>, _KeyOfValue = std::_Select1st<std:air<const
ClockConfig, ClockConfig> >, _Compare = std::less<ClockConfig>, _Alloc
= std::allocator<std:air<const ClockConfig, ClockConfig> >]
*** Error code 1
make: Fatal error: Command failed for target `clock.o'
any help will be really appreciated!!!!
thanks a lot!!!