-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoint.h
More file actions
33 lines (25 loc) · 951 Bytes
/
Point.h
File metadata and controls
33 lines (25 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#ifndef _POINT_H_
#define _POINT_H_
#include <iostream>
class Point
{
private:
int x;
int y;
public:
Point();
Point(int x, int y);
void Print();
bool operator==(const Point& other); //Перегрузка оператора ==
bool operator!=(const Point& other); //Перегрузка оператора !=
Point operator+(const Point& other); //Перегрузка оператора +
Point& operator++(); //Перегрузка префиксного инкремента
Point& operator++(int value); //Перегрузка постфиксного инкремента
//Дружественная функция
friend void ChangeX(Point& value);
//Перегрузка операторов ввода-вывода (<< и >>)
friend std::ostream& operator<<(std::ostream& os, const Point& point);
friend std::istream& operator>>(std::istream& is, Point& point);
};
#endif // !_POINT_H_