Sunday, February 1, 2015

Digest for comp.lang.c++@googlegroups.com - 6 updates in 2 topics

JiiPee <no@notvalid.com>: Feb 01 10:59PM

On 01/02/2015 22:54, Chris Vine wrote:
>> You get my point?
> No. Read the whole of §10.3 and it is quite clear.
 
> Chris
 
can you post it here please. I dont know where to find it.
 
Again, I am talking about logic here. Yes, its possible the standard has
not been written totally logically here... true, and that is another
issue. But anyway, thats what I am discussing here.
 
In a court of law so far there is no evidence that "override" belongs
only to polynorphism :).
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 01 11:06PM

On Sun, 01 Feb 2015 22:56:39 +0000
> seen the definition still yet. What "override" is defined in
> polymorphism has been shown to me, but not what it means in
> non-polymorphism situation/case.
 
It has been explained to you concurrently by two people (me and
another) that in §10.3/2 of C++11 the word "overrides" is a defined
expression. Not an employed expression, but a _defined_ expression.
And it is defined and applied exclusively and only in relation to
virtual functions.
 
That's the the end of it, from the point of view of C++.
 
Get a good night's sleep as I think everything will become clear in the
morning. You are chasing shadows.
 
Chris
Paavo Helde <myfirstname@osa.pri.ee>: Feb 01 05:10PM -0600

> "overrides" A's foo, isnt it? am just talking about english language
> grammar here, not really C++ language. So it would be natural for me
> to say that even non-virtual function overrides.
 
In order to see the "override" effect with the non-virtual functions you
need also to use an object of another type (or a pointer or reference to
another type). It is natural that an object of another type can have
different member functions than the first type, even if they happen to
share the same name and parameter list. In this sense, you are not
overriding anything, you are just using another type.
 
With virtual functions, the aim is to use pointers or references to the
base type and get the functionality of the actual (most derived) type.
This is quote another thing (and what OOP is mostly about).
 
That said, I believe most C++ folks will understand what you mean when
you are talking about overriding of non-virtual functions, just keep in
mind this is not quite correct technically.
 
Cheers
Paavo
Paavo Helde <myfirstname@osa.pri.ee>: Feb 01 05:22PM -0600


> What am saying is that 10.3/2 there does not *define* "overriding"
> *generally* in C++, it only defines its use with virtual functions
> there. But how about for non-virtual functions, my question remains.
 
The C++ standard only defines what is there. It does not define what is not
there (that would be infinite amont of things!). And I searched through the
standard and did not find any other definitions for "override". Is that
sufficient to calm you down?
 
For C++ standard, see http://lmgtfy.com/?q=latest+c%2B%2B+standard+download
 
Cheers
Paavo
JiiPee <no@notvalid.com>: Feb 01 11:32PM

On 01/02/2015 23:22, Paavo Helde wrote:
> there (that would be infinite amont of things!). And I searched through the
> standard and did not find any other definitions for "override". Is that
> sufficient to calm you down?
 
there is nothing to calm down, we are just discussing about this matter :)
 
 
> For C++ standard, see http://lmgtfy.com/?q=latest+c%2B%2B+standard+download
 
ok, thanks. I ll download it
Paul <pepstein5@gmail.com>: Feb 01 03:22PM -0800

I am trying to rewrite text-handling code involving char* and const char* in terms of boost::scoped_array<char>
 
Could someone possibly provide a reference to this topic?
 
For example, the following function is wrong, and I don't really know why.
boost::scoped_array<char> get(const char *s)
{
int size = std::strlen(s);
boost::scoped_array<char> text(new char[size]);
for(int i = 0; i < size; i++)
text[i] = s[i];
 
return text;
}
 
 
I'm sure I just need to read up on it but google searches didn't seem to broach this topic.
 
Many thanks.
 
Paul
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: