From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 24616 invoked from network); 16 Nov 1998 14:45:36 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 16 Nov 1998 14:45:36 -0000 Received: from landsraad.net (caladan.arrakis.es [195.5.65.34]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id JAA24068 for ; Mon, 16 Nov 1998 09:45:31 -0500 Received: from dinamicmultimedia.es (id-12.arrakis.es [195.5.73.12]) by landsraad.net (8.9.1a/8.9.1) with ESMTP id PAA25075 for ; Mon, 16 Nov 1998 15:46:42 +0100 (MET) Message-ID: <36503A1C.20C4140@dinamicmultimedia.es> Date: Mon, 16 Nov 1998 15:43:40 +0100 From: Leo X-Mailer: Mozilla 4.05 [en] (WinNT; I) MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Any C++ on Alpha gfurus out there? References: <3650257A.15FB7483@iis.fhg.de> <19981116084516.A15882@xcski.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Paul Tomblin wrote: > Quoting Stefan Schroepfer (scr@iis.fhg.de): > > Brian E.W. Wood wrote: > > > > > > _wd * wd = (_wd *)m_menuFactoryItems[k].callback_action; > > > > I'm definitely not a C++ guru, but please can someone > > explain me > > - Where is the l-value in that line? For what concept will > > I have to search in Stroustroup (after I got mine back)? > > - Why does one write such a counter-intuitive construct > > even if it is a valid one? > > What's so hard to understand? _wd is obviously a class or a typedef. wd is a > pointer to that class. m_menuFactoryItems is an array of structs or class > instances, which has a data field (or method) of type (pointer to _wd) called > callback_action. > > If you find this counter-intuitive, you should stick to simple languages like > VB. > What is hard to understand is the so l-value there; can't see any!? I suppose the line should be: (_wd *) wd = (_wd *)m_menuFactoryItems[k].callback_action; If this is the case, there is no l-value here. If you want this to compile, you should write: (_wd * &) wd = (_wd *)m_menuFactoryItems[k].callback_action; Now the l-value is the expression on the left of the = sign. Under Stroustroup, You should look for l-value in the index, or the references section, I guess. Leo