Deleted and Defaulted Functions
//Rectangle.h
#ifndef RECTANGLE_H
#define RECTANGLE_H
class Rectangle
{
	private:
		double width;
		double length;
	public:
		//constructor
		Rectangle() = default;
		Rectangle(double w, double l):width(w), length(l){}

		//accessor
		double getWidth() const {return width;}
		double getLength() const {return length;}
		double getArea() const {return width*length;}

		//mutator
		void setWidth(double w) {width = w;}
		void setLength(double l) {length = l;}

		Rectangle(const Rectangle&) = delete;
		Rectangle& operator=(const Rectangle &) = delete;

		//destructor
		virtual ~Rectangle() = default;
};
#endif

//main.cpp
#include <iostream>
#include "Rectangle.h"

int main(int argc, char *argv[])
{
	Rectangle r;

	r.setWidth(5);
	r.setLength(10);

	std::cout<<r.getArea()<<std::endl;

	//Rectangle r2(r);//preventing calling copy  constructor
	Rectangle r2;
	//r2 = r;//preventing calling assignment constructor

	return 0;
}
		
Reference