-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvec2f.cpp
More file actions
45 lines (40 loc) · 797 Bytes
/
Copy pathvec2f.cpp
File metadata and controls
45 lines (40 loc) · 797 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
34
35
36
37
38
39
40
41
42
43
44
45
// Created by william on 2020/9/14.
//
#include "vec2f.h"
int Vec2f::constructorCount = 0;
int Vec2f::destructorCount = 0;
Vec2f::Vec2f()
{
std::cout << "constructor called" << std::endl;
constructorCount++;
}
Vec2f::Vec2f(float x, float y)
{
std::cout << "constructor called" << std::endl;
data[0] = x;
data[1] = y;
constructorCount++;
}
Vec2f::Vec2f(const Vec2f&)
{
std::cout << "copy constructor called" << std::endl;
constructorCount++;
}
Vec2f::~Vec2f()
{
destructorCount++;
std::cout << "destructor called" << std::endl;
}
Vec2f& Vec2f::operator=(const Vec2f& vec)
{
destructorCount++;
std::cout << "destructor called" << std::endl;
if (this == &vec)
{
return *this;
}
return *this;
}
void Vec2f::test(bool t)
{
}