Forbid class recopy.

Prevent from unwanted recopy.

private

See version :

Pas de dépendances

Download :

#include <iostream>
#include <cstdlib>

using namespace std;

class Test
{
protected:
    int a;
private:
    //Test(const Test& t){}
    //Test& operator=(const Test& t){return *this;}
public:
    Test(){a=5;}
    ~Test(){}
};



void fonc(Test t)    // l3
{


}


int main()
{
    Test t,u;
    Test v(t);  // l1
    t = u;      // l2
    fonc(t);
    return 0;
}




Explanations

	No explanations yet.