Hi, so im building an elevator, and I decided to use a dictionary to associate each bumper switch with a certain number, so it can add its number value to an array. but for some reason, when I try to do this:
//F1 is a bumper switch that I have set up
std::map<vex::bumper, int> floorsButtons;
floorsButtons[F1] = 1;
but when I try to compile the code, it causes an error:
[info]: Saving Project …
[info]: Project saved!
unix build for platform vexv5
CXX src/main.cpp
In file included from src/main.cpp:24:
In file included from include/vex.h:16:
In file included from /Applications/VEXcode Pro V5.app/Contents/Resources/sdk/vexv5/include/v5_vcs.h:1:
In file included from /Applications/VEXcode Pro V5.app/Contents/Resources/sdk/vexv5/include/v5_cpp.h:20:
In file included from /Applications/VEXcode Pro V5.app/Contents/Resources/sdk/vexv5/include/vex_controller.h:17:
In file included from /Applications/VEXcode Pro V5.app/Contents/Resources/sdk/vexv5/gcc/include/c++/4.9.3/functional:49:
/Applications/VEXcode Pro V5.app/Contents/Resources/sdk/vexv5/gcc/include/c++/4.9.3/bits/stl_function.h:371:20: error: invalid operands to binary expression (‘const vex::bumper’ and ‘const vex::bumper’)
{ return __x < __y; }
~~~ ^ ~~~
/Applications/VEXcode Pro V5.app/Contents/Resources/sdk/vexv5/gcc/include/c++/4.9.3/bits/stl_map.h:498:22: note: in instantiation of member function ‘std::lessvex::bumper::operator()’ requested here
if (__i == end() || key_comp()(__k, (*__i).first))
^
src/main.cpp:49:16: note: in instantiation of member function ‘std::map<vex::bumper, int, std::lessvex::bumper, std::allocator<std::pair<const vex::bumper, int> > >::operator[]’ requested here
floorsButtons[F1] = 1;
^
1 error generated.
make: *** [build/src/main.o] Error 1
[error]: make process closed with exit code : 2
Does anyone know how to fix this?