You are taking quiz cppquiz.org/q/ir1cy. After 0 of 10 questions, you have 0.00 points.
Question #233 Difficulty:
According to the C++23 standard, what is the output of this program?
#include <type_traits>
#include <iostream>
struct X {
int f() const&&{
return 0;
}
};
int main() {
auto ptr = &X::f;
std::cout << std::is_same_v<decltype(ptr), int()>
<< std::is_same_v<decltype(ptr), int(X::*)()>;
}
Hint:
Can you overload two otherwise identical functions based on their ref qualifier alone?
Mode : Quiz
If you want to quit the current quiz and go back to training mode, click here.