From 3539838330190697718
X-Google-Thread: f78e5,84b1489db50fe20d
X-Google-Attributes: gidf78e5,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!62.216.30.27.MISMATCH!newsgate.cistron.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: hyrosen@mail.com (Hyman Rosen)
Newsgroups: comp.std.c++
Subject: Re: static member function and const
Date: Tue, 13 Nov 2007 16:59:55 GMT
Lines: 22
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <20071113142226.D67F8230C013@nscan3.ucar.edu>
References: <1194932017.215138.261760@e9g2000prf.googlegroups.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1194973200 2116 158.152.254.254 (13 Nov 2007 17:00:00 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 13 Nov 2007 17:00:00 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.8+Sun/8.13.8/Submit) id lADGxsLW010564;
	Wed, 14 Nov 2007 03:59:54 +1100 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@mailman.ucar.edu
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-SMTP-Auth: no
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:9604

subramanian100in@yahoo.com, India wrote:
> why can't a static member function be declared as const ?
> is there a provision to indicate that a static member
 > function does not modify the static data members but only
 > uses their values ?
> 
> Kindly explain.

Const member functions are implemented by considering the
this pointer to be a pointer to a const object. Static
methods have no this pointer, and hence can't be const
(or virtual, something else frequently asked for).

It's possible to design other interpretations of what const
should mean, but it's not going to happen for C++.

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



