I have the following type of card ...
std::map<D3DXCOLOR, ID3DXMesh*>
At compile time, xfunctional complains that it cannot resolve the ambiguity regarding the type of key;
error C2593: 'operator <' is ambiguous
Candidate operators detected by the compiler are as follows:
- built-in operator C ++ <(DWORD, DWORD)
- built-in operator C ++ <(FLOAT, FLOAT)
- C ++ built-in operator <(D3DCOLORVALUE, D3DCOLORVALUE)
The D3DXCOLOR structure consists of 4 floats r , g , b and a , but do not define the operator <. However, it does provide throw functions for DWORD FLOAT and D3DCOLORVALUE, therefore, entries in the candidate list.
I am considering the best way to solve this problem. I could write my own built-in operator for D3DXCOLOR, wrap the color inside a new class that provides my own <operator, or can I somehow hint at the compiler, which implementation should I choose from the list of candidates? The DWORD <operator will satisfy my requirements adequately.
source
share