Re: "Concepts" were removed from C++0x
On Jul 24, 4:58 am, Stephen Horne <sh006d3...@blueyonder.co.uk> wrote:
On Fri, 24 Jul 2009 01:37:14 +0200, "Balog Pal" <p...@lib.hu> wrote:
Interesting distinction, the meaning I know does not have the
last requirement -- it is a name introduced to an existing
object, period. Who cares what names it already has or not.
Put it this way - if I told you that "Fred" was someones
alias, you'd be pretty surprised to later discover that "Fred"
is his one and only name. You'd also be surprised to hear the
term "President of the United States" described as an alias.
Sure, it identifies a particular person (at any given time),
but it's a role or job-title, not an alias. In my mindset,
it's equivalent to having to calculate what you're referring
to rather than using an existing name.
The word "alias" has a meaning in the English language, and
that's what I was trying to use - not any other
programming-related meaning.
That said, I haven't fully thought all this through, and
certainly in my mindset, typedef is an alias - even when it
aliases something that hasn't been otherwise named, such as...
typedef std::vector<something_t> my_alias;
I may be being irrational - it happens sometimes.
Since you're discussing a language problem, it's normal. The
language itself is irrational in many ways.
Merriam-Webster gives the definition "an assumed or additional
name". For people, every one has a given name, which is neither
assumed nor additional, so an "assumed or additional name" must
be in addition to the given name. But in C++, some objects
don't have names---any name they have is "assumed or
additional". (And "The President of the United States" isn't an
alias because it's not a name.)
But of course, I just invented that argument after the facts.
It's no more "rational" than yours. You wouldn't call Jim an
alias for James, but it certainly fits the definition. Or if it
was applied to me, would it be an alias for James Albert Kanze,
the name which appears on my birth certificate? For that
matter, is James an alias for James Albert Kanze (or is there
just a "using namespace" in effect---but doesn't "using
namespace" create a set of aliases)?
Is "std::vector<something_t>" a structured name, or an
expression for deriving something that doesn't have a
(previously known) name?
I'd consider it the name of a class. Modulo typedef, it's the
only name that class has. And yes, it's also an "expression",
but then, so is something like Ortega y Gasset or Garcia Lorca.
Thinking about it, that may well be a silly question - the
only significant point is that typedef is normally considered
to provide an alias type. And the same principle could easily
be asserted for...
alias somearray [i] item_alias;
The expression is a way of identifying a
variable/value/whatever - in a sense, it's just a structured
name.
*BUT* - how sensible is that hypothetical example? What does
that alias mean? Is it an alias for the array element? Or for
the value that was contained in that element when that
statement was executed?
It's an "assumed name" for whatever is referenced. If it
references the array element, it's an alias for the array
element; if it references a temporary, it's an alias for the
temporary.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34