1
System / Using std::map and sf::Vector as key?
« on: August 28, 2012, 02:00:58 pm »
Yoho all, Is it possible to use a sf::Vector*<*> as the key for a std::map? I've been trying to use it and I keep getting errors about it attempting to compare them past checking the x/y/z matches up.
The Error being " /usr/include/c++/4.6/bits/stl_function.h|236|error: no match for ‘operator<’ in ‘__x < __y’| "
Here's minimal code just to show it.
Is there any solution for me or should I just use strings or something as the key instead (obviously putting the numbers together in a stringstream).
The Error being " /usr/include/c++/4.6/bits/stl_function.h|236|error: no match for ‘operator<’ in ‘__x < __y’| "
Here's minimal code just to show it.
#include <SFML/System.hpp>
#include <map>
int main()
{
std::map<sf::Vector3i,int> mymap;
mymap[sf::Vector3i(1,1,1)] = 1;
return 0;
}
#include <map>
int main()
{
std::map<sf::Vector3i,int> mymap;
mymap[sf::Vector3i(1,1,1)] = 1;
return 0;
}
Is there any solution for me or should I just use strings or something as the key instead (obviously putting the numbers together in a stringstream).