Operator Overloading (Custom Vector Class) - C++ in 2021
In this lesson, we create an implementation of our own Vector class! We do so in the context of learning operator overloading including:
Vector Addition
Vector Subtraction
Vector * Scalar
Vector / Scalar
Comparison Operators
Conversion Operators
OStream operator
Type wrapping builtin functions
In the end, we'll have a class implementation that will be usable in your own game projects!
Professional C++ by Marc Gregoire: https://amzn.to/3eVMlaU
Chapters:
0:00 Intro
0:35 Follow ups from last lesson
2:50 Code Cleanup
3:55 Create Vector3 class
5:18 THEORY - Operator Overloading
16:50 +(addition) Operator
19:00 - (substraction) Operator
19:50 ostream operator
22:37 First usage / test
25:08 Vector * Scalar (Multiplication) operator (RHS)
26:05 Vector / Scalar (Division) operator (RHS)
27:37 Changing your Left Hand Operand (Multiplication)
29:50 Comparison Operator Overloads
35:00 (BONUS) Type wrapping for overloading builtin types
-
18:06
Stephen Gardner
2 hours ago🔴Nancy Pelosi's lies FALL APART as J6 video confession LEAKS!!
1.94K79 -
1:48:28
Kim Iversen
3 hours agoCourt Rules Covid Vaccines Are NOT Vaccines, Kim Listed On New Ukraine "Enemies List”
19.6K86 -
1:11:45
Steve-O's Wild Ride! Podcast
4 days ago $0.19 earnedMarc Rebillet Is Out Of His Goddam Mind - Wild Ride #218
7.65K6 -
27:43
Man in America
8 hours agoBREAKING: Saudis Officially END Petrodollar as BRICS Makes HUGE Announcement w/ Dr. Kirk Elliott
11.1K7 -
3:03:44
Spittin' Chiclets
4 hours agoEdmonton vs Florida Game 2 Live Stream
8.61K -
10:03
LenaPetrova
6 hours ago🚨END OF PETRODOLLAR: Saudi Arabia Joins mBridge to End the Petrodollar?
2.81K4 -
1:17:31
Glenn Greenwald
5 hours agoE.U. Politics Scholar Explains Populism's Surge in Europe While Western Media Warns of Threats to Democracy | SYSTEM UPDATE #280
50.6K80 -
1:05:42
Donald Trump Jr.
11 hours agoMichael Savage is Back and He’s Ready to Save America | TRIGGERED Ep.143
94.3K249 -
1:01:32
The StoneZONE with Roger Stone
6 hours agoIs a Retaliatory Russian Nuclear Sub Attack on U.S. Imminent? w/ Col. John Mills | The StoneZONE
23K12 -
1:37:42
2 MIKES LIVE
5 hours ago2 MIKES LIVE #76 DEEP DIVE MONDAY!
32.7K8