Horje
c++ overloading by ref-qualifiers Code Example
c++ overloading by ref-qualifiers
#include <stdio.h>

class My {
public:
    int get(int) & { // notice &
        printf("returning int..\n");
        return 42;
    }
    char get(int) && { // notice &&
        printf("returning char..\n");
        return 'x';
    };
};

int main() {
    My oh_my;
    oh_my.get(13); // 'oh_my' is an lvalue
    My().get(13); // 'My()' is a temporary, i.e. an rvalue
}




Cpp

Related
how to read qlistwidget in c++ Code Example how to read qlistwidget in c++ Code Example
list that doesn't allow duplicates c++ Code Example list that doesn't allow duplicates c++ Code Example
hpp files Code Example hpp files Code Example
online convert c++ code to assembly language Code Example online convert c++ code to assembly language Code Example
docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) E: Unable to correct problems, you have held broken packages Code Example docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) E: Unable to correct problems, you have held broken packages Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7