Hello, under vc7.1 this code compiles:
if (!parent.fillTo ol)
parent.fillTool .dispose;
where dispose is a method of fillTool.
Notice that dispose does not have ( ) behind it.
Under vc8, this generates an error.
The question is, what is it doing under vc7.1?
Is it actually doing the function call? Or does it think this is just
some function reference and not doing the call?
Thanks. 9 1986
oddvark wrote:
Hello, under vc7.1 this code compiles:
if (!parent.fillTo ol)
parent.fillTool .dispose;
where dispose is a method of fillTool.
Notice that dispose does not have ( ) behind it.
Under vc8, this generates an error.
The question is, what is it doing under vc7.1?
Is it actually doing the function call? Or does it think this is just
some function reference and not doing the call?
My guess is that it's evaluating the rvalue for the address of {whatever
class fillTool is}::dispose, and ignoring it.
"oddvark" <dg*****@yahoo. comwrote in message
news:11******** **************@ i13g2000prf.goo glegroups.com.. .
Hello, under vc7.1 this code compiles:
if (!parent.fillTo ol)
parent.fillTool .dispose;
where dispose is a method of fillTool.
Notice that dispose does not have ( ) behind it.
Under vc8, this generates an error.
The question is, what is it doing under vc7.1?
Is it actually doing the function call? Or does it think this is just
some function reference and not doing the call?
Well, a function name is a pointer. And you can do things with pointers.
But in this case, it seems like it's just evaluating the pointer and doing
nothing with it. The same thing as a statement like:
12;
It compiles, but basically does nothing.
On Jun 1, 4:15 am, "Jim Langston" <tazmas...@rock etmail.comwrote :
"oddvark" <dgrd...@yahoo. comwrote in message
news:11******** **************@ i13g2000prf.goo glegroups.com.. .
Hello, under vc7.1 this code compiles:
if (!parent.fillTo ol)
parent.fillTool .dispose;
where dispose is a method of fillTool.
Notice that dispose does not have ( ) behind it.
Under vc8, this generates an error.
The question is, what is it doing under vc7.1?
Is it actually doing the function call? Or does it think this is just
some function reference and not doing the call?
Well, a function name is a pointer. And you can do things with pointers.
But in this case, it seems like it's just evaluating the pointer and doing
nothing with it. The same thing as a statement like:
12;
It compiles, but basically does nothing.
member function pointer are not combined with object pointers to
esablish a pointer to function in C++.there is nothing such as
delegates in standard C++(in MS C# this would have a meaning).So the
question is still on.why should that line generate an error in a
compiler?.
On Jun 1, 9:19 am, terminator <farid.mehr...@ gmail.comwrote:
>why should that line generate an error in a compiler?.
- Hide quoted text -
>
- Show quoted text -
Sorry.why should that line not generate an error in a compiler?.
terminator wrote:
On Jun 1, 9:19 am, terminator <farid.mehr...@ gmail.comwrote:
>why should that line generate an error in a compiler?.
- Hide quoted text -
>- Show quoted text -
Sorry.why should that line not generate an error in a compiler?.
Because it's a nop.
--
Ian Collins.
terminator wrote:
Sorry.why should that line not generate an error in a compiler?.
Because C++ allows rvalues which are not used for anything in
a sentence.
Jim Langston wrote:
>
Well, a function name is a pointer.
That's almost true for ordinary functions, but not for member functions.
For ordinary funtions, the name of the function decays into a pointer to
the function in most contexts. There is no such rule for member function
names.
And you can do things with pointers.
But in this case, it seems like it's just evaluating the pointer and doing
nothing with it. The same thing as a statement like:
12;
It compiles, but basically does nothing.
That is, in fact, what MS's compilers used to do. But the code is
ill-formed.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Ian Collins wrote:
terminator wrote:
>On Jun 1, 9:19 am, terminator <farid.mehr...@ gmail.comwrote:
>>why should that line generate an error in a compiler?.
- Hide quoted text -
>>- Show quoted text -
Sorry.why should that line not generate an error in a compiler?.
Because it's a nop.
No, it's illegal.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book)
Juha Nieminen wrote:
terminator wrote:
>Sorry.why should that line not generate an error in a compiler?.
Because C++ allows rvalues which are not used for anything in
a sentence.
But the name of a member function is not an rvalue. The reason it
doesn't generate a diagnostic in MS's older compilers is that those
compilers are wrong.
--
-- Pete
Roundhouse Consulting, Ltd. ( www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." ( www.petebecker.com/tr1book) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Brandon J. Van Every |
last post by:
What's better about Ruby than Python? I'm sure there's something. What is
it?
This is not a troll. I'm language shopping and I want people's answers. I
don't know beans about Ruby or have any preconceived ideas about it. I have
noticed, however, that every programmer I talk to who's aware of Python is
also talking about Ruby. So it seems that Ruby has the potential to compete
with and displace Python. I'm curious on what basis it...
|
by: Reed L. O'Brien |
last post by:
I see rotor was removed for 2.4 and the docs say use an AES module
provided separately... Is there a standard module that works alike or
an AES module that works alike but with better encryption?
cheers,
reed
|
by: Sarah Tanembaum |
last post by:
Beside its an opensource and supported by community, what's the fundamental
differences between PostgreSQL and those high-price commercial database (and
some are bloated such as Oracle) from software giant such as Microsoft SQL
Server, Oracle, and Sybase?
Is PostgreSQL reliable enough to be used for high-end commercial
application? Thanks
|
by: Charlie |
last post by:
Hello,
As only doing research in academic (working on IR), I have no idea of
what is going on in industry, and what is in demand. Answering any of
the following questions would be very helpful!!
1>I wonder what is the job market for compiler writters?
- from www.compilerjobs.com, I see only Embedded/media processor is
creating job openings..?
|
by: typingcat |
last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so
on. I've tried many PHP IDEs today, but almost non of them supported
Unicode (UTF-8) file.
I've found that the only Unicode support IDEs are DreamWeaver 8 and
Zend PHP Studio.
DreamWeaver provides full support for Unicode. However, DreamWeaver is
a web editor rather than a PHP IDE. It only supports basic IntelliSense
(or code completion) and doesn't have anything...
| |
by: Keith K |
last post by:
Having developed with VB since 1992, I am now VERY
interested in C#. I've written several applications with
C# and I do enjoy the language.
What C# Needs:
There are a few things that I do believe MSFT should do to
improve C#, however.
I know that in the "Whidbey" release of VS.NET currently
|
by: Jason Huang |
last post by:
Hi,
Would someone explain the following coding more detail for me? What's the
( ) for?
CurrentText = (TextBox)e.Item.Cells.Controls;
Thanks.
Jason
|
by: Nathan Sokalski |
last post by:
What is the difference between the Page_Init and Page_Load events? When I
was debugging my code, they both seemed to get triggered on every postback.
I am assuming that there is some difference, and I would like to know what
it is so that I can take advantage of it in my code. Thanks.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/
|
by: watkinsdev |
last post by:
Hi,
I have created a mesh class in visual studio 6.0 c++.
I can create a device, render objects and can edit the objects by for
instancnce selecting a cluster of vertices and processing the vertices
and can do this multiple times on a sinlge vertex cluster.
The problem I have been encoutering is that, if I select a second
vertex cluster and try to edit that , the program crashes.
|
by: timor.super |
last post by:
Hi all,
Imagine I've an array of int :
int anArray = new int;
I want to extract all the integer that are superior to 500
I can do :
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |