C++ Copy Constructors

preview_player
Показать описание
Jamie King showing what copy constructors are and what the compiler generated copy constructors do.
Рекомендации по теме
Комментарии
Автор

I like the way Jamie when speaking randomly raises the volume.

agnesakne
Автор

Could somebody explain why are there so many dislikes? If you are looking for real Cows or weird stuff try somewhere else but don't dislike the video.

byteaesx
Автор

is that copy constructor the same one that is used when I call with same obj rather than two. Ex myobj.print(myobj) ??

Impulse_Photography
Автор

So about the "=" operator... say you have code like this
Cow georgy = bestsy;

Does this call the parameterless constructor for Cow (to make georgy), then just do a memberwise assign of betsy's values to georgy? the copy constructor should NOT get called, yeah?

I've seen some classes where people overload the '=' operator and call a copy constructor.

matrixugly
Автор

?

Are you asking if structs can have copy constructors?

JamieKingCS
Автор

arent copy constructors applicable to classes only

HIMANSHUGLUCOSE
Автор

I always find these dislikes hilarious. It's obviously from people that search for a specific programming concept and find your videos from your series. Sometimes I just don't understand in what way the video differed from their expectations, though... 1/3 dislikes?

SutraWasTaken
Автор

"A cow has no constructor" haha

dandano
Автор

this was painful to watch and listen to

mpho