Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Constructors vs Initializer Lists? Message-ID: <6590191@hplsla.HP.COM> Date: 10 Jul 89 21:31:40 GMT Organization: HP Lake Stevens, WA Lines: 19 Should the following compile with and without CONSTRUCTOR defined? I can't remember reading anywhere about this. [I have an application with lots of constants where I'd prefer not to have to go through constructors at start-up.] class Trouble { public: double val1, val2; #ifdef CONSTRUCTOR Trouble(double _val1, double _val2) : val1(_val1), val2(_val2) { }; #endif }; const Trouble withInitializerList = {1.0, 2.0}; void main(){}