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
Follow

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 @tuxcrafting Thank you for repeating back exactly what I said. Very illuminating. :blobcatsip:

re: g++ error 

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

re: g++ error 

@tuxcrafting wait. it doesn't signal an error the other way it just compiles incorrectly......... the standard requires an order to them, but I assumed it would just error if you had them out of order? please please please dont tell me it just ignores them and doesn't error if you specify in a wrong order

re: g++ error 

@caseyp looks like it ignores it...

re: g++ error 

@caseyp or maybe it's just a warning
or it errored but i didn't see it in the sea of errors
idk

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.