What is ONE possible use case for the const&& method qualifier?

52 Views Asked by At

I award 100 reputation to the person who can show me one sensible example of how a const && method-qualifier could be used in real world code which cannot be done more elegantly by using just const& or && overloads.

Nonsensible example

#include <cstdio>
#include <utility>


struct entity
{
    auto print() const&& {
        printf("Hello World!\n");
    }
};

int main()
{
    const entity e{};
    std::move(e).print();
}
0

There are 0 best solutions below