Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!nelson From: nelson@melodian.cs.uiuc.edu (Taed Nelson) Newsgroups: comp.lang.c++ Subject: arrays of objects with multiple initializers Message-ID: <1990Jul30.222115.2232@brutus.cs.uiuc.edu> Date: 30 Jul 90 22:21:15 GMT Sender: news@brutus.cs.uiuc.edu Reply-To: nelson@melodian.cs.uiuc.edu (Taed Nelson) Organization: Picasso Group, University of Illinois at Urbana-Champaign Lines: 18 Over the weekend, I was working with a Matrix Class (courtesy of Bob Olson), and it was a pain to initialize a matrix by setting each element. Would it be possible to use a constructor that somehow behaved like the autoinitialization of arrays? I'm looking for something like: Vector :: Vector (float ...) <-- any number of elems Matrix :: Matrix (Vector ...) <-- any number of vectors so that I could type Matrix fred = ((11, 12, 13), (21, 22, 23), (31, 32, 33)); I realize that this syntax is totally illegal, but could I somehow use a similar syntax? Or could C++ recognize that the extra-parened things fit the constructor for a Vector, and that a Matrix takes Vector parameters? GNU mentioned a Matrix library in their upcoming C++ library. How do they do it???