On 09/30/2016 09:38 AM, Amos Jeffries wrote: > We now seem to have had several patches successfully use members > declared with default values and/or with the "*this = Foo();" shortcut > for a reset/clear method.
The *this assignment works for pre-C++11 v3.5 as well. The default values will not work there so we should be extra careful when backporting affected code. > So I think we can start using these to replace old C-style > initialization and clear() functions. Agreed. I wonder whether we should be consistent -- if some class data members cannot use default initialization and some can, should we initialize _all_ members in the constructor(s)? > This patch begins by replacing the Config2 use of memset(). I for one am > constantly mistaking which of the Config objects has memset() applied to > it at the global level when reconfigure happens. Now we do not need to > care, each object handles its own clearing one way or another. +1 Alex. _______________________________________________ squid-dev mailing list squid-dev@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-dev