g++ error 

[…]/tuple:1394:33: error: no match for 'operator==' (operand types are […] {aka 'const ternary::uter<9>'} and […] {aka 'const ternary::uter<9>'}) 1394 | return bool(std::get<__i>(__t) == std::get<__i>(__u)) In file included from ../test.cxx:7: ../ternary.hxx:133:20: note: candidate: 'constexpr bool ternary::uter::operator==(ternary::uter) [with int Trits = 9]' 133 | constexpr bool operator==(uter b) noexcept ../ternary.hxx:133:20: note: passing […] {aka 'const ternary::uter<9>*'} as 'this' argument discards qualifiers

what the absolute wank

g++ error 

@tuxcrafting your equals method isnt 'const', so you can't use a const value with it

re: g++ error 

@tuxcrafting @caseyp

constexpr applies to the function and means "compiler may execute this at compile time if it feels like it or has to" and it applies to the function. This error seems to be about the "this" argument, the special hidden argument every member function has, that you can qualify with const/volatile/ref(&)/rvalue_ref(&&) after the parameter list, usually before noexcept (though not sure if that last part is a hard rule). Default is reference (not const, not volatile, not rvalue).

Examples:

// const ref
bool operator==(uter) const;

// rvalue ref
bool operator==(uter) &&;

// explicit ref to overload rvalue ref
bool operator==(uter) &;

re: g++ error 

@namark @caseyp it works as a method if the const goes before noexcept, huh
Follow

re: g++ error 

@tuxcrafting @caseyp

Guess I never even tried const after noexcept myself, but would expect a different error if that's not allowed.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.