error C2678: binary '>' : no operator found which takes a left-hand operand of type 'const bx::BaseBodyDef::vec2u' (or there is no acceptable conversion)
Ostatnio zmodyfikowano 2014-08-01 19:35
oputyk Temat założony przez niniejszego użytkownika |
error C2678: binary '>' : no operator found which takes a left-hand operand of type 'const bx::BaseBodyDef::vec2u' (or there is no acceptable conversion) » 2014-08-01 18:25:30 Witam! Mam taki oto kod:
class vec2u { public: unsigned int a = 0; unsigned int b = 0; vec2u() = default; vec2u( unsigned int A, unsigned int B ) : a( A ) , b( B ) { } bool const operator <( const vec2u & vec ); bool const operator >( const vec2u & vec ); };
std::sort( priorities.begin(), priorities.end(), std::greater < vec2u >() );
Błąd wywala mi w std::greater<>(). Z góry dzięki za pomoc! |
|
Monika90 |
» 2014-08-01 19:07:08 masz const po złej stronie, powinno być bool operator <( const vec2u & vec ) const; bool operator >( const vec2u & vec ) const;
|
|
oputyk Temat założony przez niniejszego użytkownika |
» 2014-08-01 19:35:05 Ok, dzięki. Rozwiązane. |
|
« 1 » |