RE: Conventions on struct copying?
- From
Jason Pyeron <jpyeron@pdinc.us>
- Date
- Jun 19, 2014, 17:22 UTC
- Message-ID
- <5A7F0CEE2DEC4F1B825568DB8358D397@black>
- In-Reply-To
- <xmqqvbrwhlki.fsf@gitster.dls.corp.google.com>
Show 15 quoted lines
> -----Original Message----- > From: Junio C Hamano > Sent: Thursday, June 19, 2014 13:11 > > "brian m. carlson" <sandals@crustytoothpaste.net> writes: > > > I don't know of any place we explicitly copy structs like > > this,... > > which should be a reason enough. The first concrete guideline is > "just imitate the existing code". > > > but I don't know of any prohibition against it, either. > > So now you know ;-).
To expand, on that do not trust the compiler to do deep copies.
http://stackoverflow.com/questions/2302351/assign-one-struct-to-another-in-c
Hit #1 on https://www.google.com/search?q=c+assignment+of+struct
-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00.