From -1270717889612805118
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,df0f8d484c0311f9
X-Google-Attributes: gidf78e5,public
Path: controlnews3.google.com!news1.google.com!news.glorb.com!newsrout1.ntli.net!news-in.ntli.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: meang@post.com (Meang Akira Tanaka)
Newsgroups: comp.std.c++
Subject: Re: Proposal for default values when declaring the class
Date: Sat, 1 May 2004 16:51:24 +0000 (UTC)
Organization: UNI2 Internet Kunde
Lines: 55
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <mdc5909kmdthl86561p2q96r896hgr40uc@4ax.com>
References: <am50909691td3473pkvng203rts78gt08i@4ax.com> <tX2k7eKnGjkAFwvc@robinton.demon.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1083430284 6640 10.0.0.1 (1 May 2004 16:51:24 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 1 May 2004 16:51:24 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 1BJxhz-0001ix-00
	for mail2news@news.news.demon.net; Sat, 01 May 2004 16:51:24 +0000
X-Received: from mulga.cs.mu.OZ.AU (localhost [127.0.0.1]) by mulga.cs.mu.OZ.AU with ESMTP
	id i41GpMi2013201; Sun, 2 May 2004 02:51:22 +1000 (EST)
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i41GpLWe013192;
	Sun, 2 May 2004 02:51:21 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-Newsreader: Forte Agent 1.93/32.576 English (American)
X-NNTP-Posting-Date: Fri, 30 Apr 2004 22:15:04 CEST
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=0.0 required=5.2 tests=none autolearn=no 
	version=2.60-mulga_r1
Xref: controlnews3.google.com comp.std.c++:65

On Fri, 30 Apr 2004 15:04:49 +0000 (UTC), francis@robinton.demon.co.uk
(Francis Glassborow) wrote:

<*snip*>
>Using forwarding ctors the above becomes:
>
>class foo {
>  int var1;
>  bool var2;
>  char var3;
>public:
>  foo(int v1 = 100, bool v2 = true, char v3 = 'a');
>    // that covers your first two ctors
>  foo(bool v2) : foo(105, v2){}
>
>
>
>This change (forwarding ctors) does not quite do what you were proposing
>but it is much simpler to incorporate into the language and simpler for
>the implementors to implement.

It has it charms... and definitly better than nothing, but I think it
isn't as clear as the one I proposed...

how are the arguments mapped?

It isn't clear from the variable names you used v1, v2 etc.. or did
you mean var1 = 100, var2 = true etc...

if that is not the case

how do you know which variable should be mapped to which attribute?

class foo
{
	int var1;
	int var2;
	int var3;

public: 
	 foo(int v1 = 100, bool v2 = 105, char v3 = 107 );
}

but I am definitly looking forward to compilers who will support it...

br

Meang

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



