[prog] C++ Templates

Laurel Fan laurel at sdf.lonestar.org
Mon Jun 30 10:09:39 EST 2003


On Thu, Jun 26, 2003 at 05:06:11PM +0200, Dan Richter wrote:
> The "::" indicates membership. The ":" (which is used only in a 
> constructor) is used to call the constructors of class members. This is 
> frivolous in this case (you're calling the "constructor" of an int), but 
> when you're dealing with complex classes it can be useful.

Actually, using initializer lists in constructors to initialize
members, though not necessary (you can initialize them with = in the
function body of the constructor), is considered good style by many,
including in Scott Meyers' book "Effective C++".

-- 
laurel at sdf.lonestar.org
http://dreadnought.gorgorg.org


More information about the Programming mailing list