Tuesday, December 30, 2008

comp.lang.c++ - 13 new messages in 8 topics - digest

comp.lang.c++
http://groups.google.com/group/comp.lang.c++?hl=en

comp.lang.c++@googlegroups.com

Today's topics:

* 2008 Collection Salina GM M95612 Collection - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/6d8637a801b1639d?hl=en
* What does the 'static' in "vector<static FixPt> Data1024;" stand for? - 2
messages, 2 authors
http://groups.google.com/group/comp.lang.c++/t/9c78f686d25b7ce4?hl=en
* Initializers? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/4eabc57174097969?hl=en
* MFC Golmine site updated http://mfcgoldmine.by.ru/index.html - 1 messages, 1
author
http://groups.google.com/group/comp.lang.c++/t/cd8333fd25b20df2?hl=en
* Gucci Medium Tote Bag Silver 189669 Collection - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/15ae58e5a020e03a?hl=en
* Luxury Gucci Queen - Best Gucci Handbags Collection - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c++/t/9520e0de8b84e8e2?hl=en
* why vector needs an assignable requirement for object T ? - 3 messages, 2
authors
http://groups.google.com/group/comp.lang.c++/t/6a67019f6c14af86?hl=en
* Is this copy initialization or direct initialization ? - 3 messages, 3
authors
http://groups.google.com/group/comp.lang.c++/t/bbb9bf8b25a8df90?hl=en

==============================================================================
TOPIC: 2008 Collection Salina GM M95612 Collection
http://groups.google.com/group/comp.lang.c++/t/6d8637a801b1639d?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 29 2008 5:58 pm
From: "wangxiaoxiao11@21cn.com"


2008 Collection Salina GM M95612 Collection

Handbags Collection Site : http://www.handbags-guide.com/
2008 Collection Salina GM M95612 View Full :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/2008-Collection-Salina-GM-M95612.html

2008 Collection Salina GM M95612 AdditionalInfo :

Brand : Louis Vuitton Handbags (
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.html )
Handbags Name : 2008 Collection Salina GM M95612
Code : M95612

Its generous size and delicate combination of colors and textures
confer the Neo Bucket with style and sophisfication. Reinterpreted by
Marc Jacobs, this iconic bag comes in Monogram canvas.- Monogram Rubis
canvas, red vinyl trimmings, natural cowhide and printed alligator
like calf leather, red cotton lining
<BR>- Golden brass pieces
<BR>- One zippered pocket and one patch pocket
<BR>- Carried on the arm or carried on the shoulder
<BR>- Removable, red ID holder
<BR>- Protective base stud<STRONG>Size:</STRONG> 23.8" x 13.2" x 8"
<BR><STRONG>This 2008 Collection Salina GM handbag comes with:</
STRONG>Serial and model numbers,the LV dust bag,care booklet,LV
cards,and copy of the genuine receipt from an official LV store.

The Louis Vuitton Handbags Watches Collection Series :

2008 Collection Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/LV-2008-Collection-Bags.html
Monogram Canvas Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Monogram-Canvas-Bags.html
Mahina Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Mahina-Bags.html
Monogram Multicolore Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Monogram-Multicolore-Bags.html
Tahitiennes Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Tahitiennes-Bags.html
Monogram Mirage Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Mirage-Bags.html
Monogram Denim Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Denim-Bags.html
Monogram Mini Lin Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Mini-Monogram-Bags.html
Monogram Leopard Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Mono-Leopard-Bags.html
Monogram Rivets Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Monogram-Rivets-Bags.html
Monogram Miroir Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Miroir-Bags.html
Monogram Perforation Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Monogram-Perforation-Bags.html
Monogram Vernis Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Vernis-Bags.html
Monogram Dentelle Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Dentelle-Bags.html
Damier Canvas Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Damier-Canvas-Bags.html
Damier Azur Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Damier-Azur-Bags.html
Damier Geant Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Damier-Geant-Bags.html
Taiga Leather Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Taiga-Bags.html
Suhali Leather Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Suhali-Bags.html
Epi Leather Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Epi-Bags.html
Utah Leather Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Utah-Leather-Bags.html
Nomade Leather Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Nomade-Leather-Bags.html
LV Cup 2007 Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Cup-Series-Bags.html
Monogram Tisse Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Monogram-Tisse-Bags.html
Tobago Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Tobago-Bags.html
Luggage Collection :
http://www.handbags-guide.com/Louis-Vuitton-Handbags-wholesale.htmlhttp://www.handbags-guide.com/Luggage-Bags.html

==============================================================================
TOPIC: What does the 'static' in "vector<static FixPt> Data1024;" stand for?
http://groups.google.com/group/comp.lang.c++/t/9c78f686d25b7ce4?hl=en
==============================================================================

== 1 of 2 ==
Date: Mon, Dec 29 2008 6:06 pm
From: Cuthbert


Hi folks,

I am a newcomer to C++ and am reading a example code right now. In
this example code, the author used a lot of "vector<static DataType>
somename;". I know the static vector definition but wonder what's the
different between static vector and "vector<static xxx> xxx"? Can
anybody explain this for me? Thanks a lot.


Cuthbert


== 2 of 2 ==
Date: Mon, Dec 29 2008 7:36 pm
From: alfps


On 30 Des, 03:06, Cuthbert <cuthbert....@gmail.com> wrote:
>     I am a newcomer to C++ and am reading a example code right now. In
> this example code, the author used a lot of "vector<static DataType>
> somename;". I know the static vector definition but wonder what's the
> different between static vector and "vector<static xxx> xxx"? Can
> anybody explain this for me? Thanks a lot.

The usage

vector<static T> v;

is not valid standard C++.

If you're sure that the example was /exactly/ like that, then please
tell the group what book you're reading, and locate the nearest
fireplace.

There remains of course the possibility of some compiler-specific
language extension, and/or that you remember the example incorrectly.

Cheers & hth.,

- Alf

==============================================================================
TOPIC: Initializers?
http://groups.google.com/group/comp.lang.c++/t/4eabc57174097969?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 29 2008 6:45 pm
From: asm23


Bill wrote:
>
> I think I acquired my understanding from Stroustrup's great book: The C++
> Programming Language. I just tried both versions of the program on VC++
> (version 6.0), and both compiled without a warning. So the bottom line is
> your compiler's requirements--no matter what the language definition says!
> :)
>
> Bill
>
>
Yes.
Thanks Bill for your reply.
It's exciting to discuss on this forum, and I gain my understanding a lot.

==============================================================================
TOPIC: MFC Golmine site updated http://mfcgoldmine.by.ru/index.html
http://groups.google.com/group/comp.lang.c++/t/cd8333fd25b20df2?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 29 2008 8:03 pm
From: enter@exit.here (Labyrinth)


MFC Goldmine site updated.

http://mfcgoldmine.by.ru/index.html

It contains over 50k of articles on C++, MFC and VC in 50+
categories on all topics,
including code snippets, examples and expert views and opinions.

Site is indexed by Google, so you can find anything you can
imagine within seconds.

Do advanced search and specify site:mfcgoldmine.by.ru

If you add enough keywords, you can precisely zoom-in on
an issue you are looking for.

Example query:

Query:

"abstract class" interface OR inheritance OR polymorphism
site:javagoldmine.by.ru

all these words:

this exact wording or phrase: abstract class

one or more of these words: interface inheritance polymorphism

Search within a site or domain: mfcgoldmine.by.ru

Also, JavaGoldmine is at http://javagoldmine.by.ru/inde.html

==============================================================================
TOPIC: Gucci Medium Tote Bag Silver 189669 Collection
http://groups.google.com/group/comp.lang.c++/t/15ae58e5a020e03a?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 29 2008 9:46 pm
From: bagsbags14@gmail.com


Gucci Medium Tote Bag Silver 189669 Collection

Handbags Collection Site : http://www.handbags-guide.com/
Gucci Medium Tote Bag Silver 189669 View Full :
http://www.handbags-guide.com/Gucci-Medium-Tote-Bag-Silver-189669.html

Gucci Medium Tote Bag Silver 189669 AdditionalInfo :

Brand : Gucci Handbags ( http://www.handbags-guide.com/Gucci-Handbags.html
)
Handbags Name : Gucci Medium Tote Bag Silver 189669
Code : 189669-Silver

- Medium tote with signature web double handles,inside pocket,and cell
phone pocket.
<BR>- Blue/white GG fabric with white/brown/blue web and silver
leather trim.<STRONG>Size:</STRONG> 13.4"L x 5"W x 14"H.
<BR><STRONG>This handbag comes with:</STRONG> GUCCI Contollato
Card,GUCCI Care Card ,GUCCI Logo Dustbag.

The Gucci Handbags Watches Collection Series :

Gucci Medium Tote Bag Sand 189669 :
http://www.handbags-guide.com/Gucci-Medium-Tote-Bag-Sand-189669.html
Gucci Medium Tote Bag Sand 189669 :
http://www.handbags-guide.com/Gucci-Medium-Tote-Bag-Sand-189669.html
Gucci Medium Backpack Black 181065 :
http://www.handbags-guide.com/Gucci-Medium-Backpack-Black-181065.html
Gucci 'Horsebit Nail' Small Boston Bag Beige 189 :
http://www.handbags-guide.com/Gucci-Horsebit-Nail-Small-Boston-Bag-Beige-189.html
Gucci Large Carry-on Duffel White 189688 :
http://www.handbags-guide.com/Gucci-Large-Carry-on-Duffel-White-189688.html
Gucci Tote Shoulder Bag Black 162163 :
http://www.handbags-guide.com/Gucci-Tote-Shoulder-Bag-Black-162163.html
Gucci Boston Tote Shoulder Bag Sande 131231 :
http://www.handbags-guide.com/Gucci-Boston-Tote-Shoulder-Bag-Sande-131231.html
Gucci Wave Large Boston Bag Beige 159398 :
http://www.handbags-guide.com/Gucci-Wave-Large-Boston-Bag-Beige-159398.html
Gucci Handbag Beige/ebony 131220 :
http://www.handbags-guide.com/Gucci-Handbag-Beige-ebony-131220.html
Gucci Tote Bag Gold 170004 :
http://www.handbags-guide.com/Gucci-Tote-Bag-Gold-170004.html
Gucci Luggage Bag Beige 153240 :
http://www.handbags-guide.com/Gucci-Luggage-Bag-Beige-153240.html
Gucci Shoulder Bag Beige/Ebony 114531 :
http://www.handbags-guide.com/Gucci-Shoulder-Bag-Beige-Ebony-114531.html
Gucci Shoulder Messenger Bag Silver 145857 :
http://www.handbags-guide.com/Gucci-Shoulder-Messenger-Bag-Silver-145857.html
Gucci Boston Tote Shoulder Bag Silver 131231 :
http://www.handbags-guide.com/Gucci-Boston-Tote-Shoulder-Bag-Silver-131231.html
Gucci Handbag Black 114273 :
http://www.handbags-guide.com/Gucci-Handbag-Black-114273.html
Gucci Medium Tote Bag 189669 :
http://www.handbags-guide.com/Gucci-Medium-Tote-Bag-189669.html
Gucci'Bouvier' Medium Hobo Handbag 153029 :
http://www.handbags-guide.com/Gucci-Bouvier-Medium-Hobo-Handbag-153029.html
Gucci Boston Handbag Black 153026 :
http://www.handbags-guide.com/Gucci-Boston-Handbag-Black-153026.html
Gucci Tote Bag Beige 146002 :
http://www.handbags-guide.com/Gucci-Tote-Bag-Beige-146002.html
Gucci Shoulder Bag 181092 :
http://www.handbags-guide.com/Gucci-Shoulder-Bag-181092.html

==============================================================================
TOPIC: Luxury Gucci Queen - Best Gucci Handbags Collection
http://groups.google.com/group/comp.lang.c++/t/9520e0de8b84e8e2?hl=en
==============================================================================

== 1 of 1 ==
Date: Mon, Dec 29 2008 10:08 pm
From: bagsbags04@gmail.com


Luxury Gucci Queen - Best Gucci Handbags Collection

Watches Collection : http://www.handbags-guide.com/
Gucci Handbags Watches Collection : http://www.handbags-guide.com/Gucci-Handbags.html
Gucci Queen Collection : http://www.handbags-guide.com/Gucci-Queen-Bags.html

We guarantee to provide our customers the best Gucci Gucci Queen
Handbags, purses, wallets, clutches and the most friendly customer
service. we guarantee every Gucci Queen Bags you receive will be exact
bag you ordered. Each bags sold enjoy 7 days money back and 30 days
exchange warranty. Every order from handbags-guide.com is shipped via
EMS, the customer is responsible for the shipping fees on the first
order, but you can get the free shipping since the second bag you buy
in the same item. Please note that If the total amount of payment is
over $600(USD), the customer is required to contact our customer
service before sending the money in case failed payment. Any other
questions please feel free to email us by service@handbags-guide.com

Gucci Queen All Hot Luxury Handbags Collection :

Gucci Queen Medium Hobo Bag Black Collection :
http://www.handbags-guide.com/Gucci-Queen-Medium-Hobo-Bag-Black.html
Gucci Queen Handbag Black 181454 Collection :
http://www.handbags-guide.com/Gucci-Queen-Handbag-Black-181454.html
Gucci Queen Large Bag Black 181508 Collection :
http://www.handbags-guide.com/Gucci-Queen-Large-Bag-Black-181508.html

Other Gucci Handbags Series Collection :

2008 Collection Collection :
http://www.handbags-guide.com/Gucci-2008-Collection-Bags.html

Gucci Canvas Collection :
http://www.handbags-guide.com/Gucci-Canvas-Bags.html

Gucci Indy Collection :
http://www.handbags-guide.com/Indy-Bags.html

Gucci Race Collection :
http://www.handbags-guide.com/Race-Bags.html

Gucci Aviatrix Collection :
http://www.handbags-guide.com/Gucci-Aviatrix-Bags.html

Gucci Duchessa Collection :
http://www.handbags-guide.com/Gucci-Duchessa-Bags.html

Gucci Singnoria Collection :
http://www.handbags-guide.com/Signoria-Bags.html

Gucci Snow Glam Collection :
http://www.handbags-guide.com/Gucci-Snow-Glam-Bags.html

Gucci Royal Collection :
http://www.handbags-guide.com/Gucci-Royal-Bags.html

Gucci Queen Collection :
http://www.handbags-guide.com/Gucci-Queen-Bags.html

Gucci Leather Collection :
http://www.handbags-guide.com/Gucci-Leather-Bags.html

Gucci Peggy Collection :
http://www.handbags-guide.com/Peggy-Bags.html

Gucci Joy Collection :
http://www.handbags-guide.com/Gucci-Joy-Bags.html

Gucci D Gold Collection :
http://www.handbags-guide.com/Gucci-D-Gold-Bags.html

Gucci Messenger Collection :
http://www.handbags-guide.com/Gucci-Messenger-Bags.html

Gucci Hysteria Collection :
http://www.handbags-guide.com/Gucci-Hysteria-Bags.html

Gucci Sabrina Collection :
http://www.handbags-guide.com/Gucci-Sabrina-Bags.html

Gucci Crystal Collection :
http://www.handbags-guide.com/Gucci-Crystal-Bags.html

Gucci Trophy Collection :
http://www.handbags-guide.com/Gucci-Trophy-Bags.html

Gucci Jolicoeur Collection :
http://www.handbags-guide.com/Gucci-Jolicoeur-Bags.html

Gucci Abbey Collection :
http://www.handbags-guide.com/Gucci-Abbey-Bags.html

Gucci Britt Collection :
http://www.handbags-guide.com/Britt-Bags.html

Gucci Princy Collection :
http://www.handbags-guide.com/Gucci-Princy-Bags.html

Gucci Pelham Collection :
http://www.handbags-guide.com/Pelham-Bags.html

Gucci Chain Collection :
http://www.handbags-guide.com/Gucci-Chain-Bags.html

Gucci Positano Collection :
http://www.handbags-guide.com/Gucci-Positano-Bags.html


==============================================================================
TOPIC: why vector needs an assignable requirement for object T ?
http://groups.google.com/group/comp.lang.c++/t/6a67019f6c14af86?hl=en
==============================================================================

== 1 of 3 ==
Date: Mon, Dec 29 2008 10:09 pm
From: abir


Hi
I am using an object with a const member like ,
struct Foo{
const int x_;
explicit Foo(int x) : x_(x){}
};
I am happy with default copy ctor ...
but as its member is const, i can't make it assignable.

if i have std::vector<Foo> FV;
FV v; v.push_back(Foo(1));
Now i can't store it in vector. push_back internally calls insert and
which somewhere needs fill.
Why it is required at all,?
I have a handcrafted vector class where push_back does not need
assignment (not even copy ctor, an move op is sufficient)
I don't know where it is required apart from v[i] = Foo(3); or
equivalently *it = Foo(3); kind of statement.
even for insert at the mid i can transfer the mid elements at the
tail and copy /move construct the new elements at the raw memory at
mid.

Can anybody help me here?
Thanks


== 2 of 3 ==
Date: Mon, Dec 29 2008 11:30 pm
From: alfps


On 30 Des, 07:09, abir <abirba...@gmail.com> wrote:
> Hi
>  I am using an object with a const member like ,
> struct Foo{
>     const int x_;
>     explicit Foo(int x) : x_(x){}};
>
> I am happy with default copy ctor ...
> but as its member is const, i can't make it assignable.
>
> if i have std::vector<Foo> FV;
> FV v; v.push_back(Foo(1));
> Now i can't store it in vector. push_back internally calls insert and
> which somewhere needs fill.
> Why it is required at all,?
> I have a handcrafted vector class where push_back does not need
> assignment (not even copy ctor, an move op is sufficient)
> I don't know where it is required apart from v[i] = Foo(3); or
> equivalently *it = Foo(3); kind of statement.
>  even for insert at the mid i can transfer the mid elements at the
> tail and copy /move construct the new elements at the raw memory at
> mid.

When you use a non-assignable element type you're violating the
promise that that type gives: if you have a pointer or reference or
iterator to such an element you have a right to expect that it won't
change.

Removing or inserting in a vector can however change the elements
beyond the removal/insertion point.

And there is no separate class for "constant vector".

In the end it's an issue of complexity.

std::vector would have to be more complicated to deal with the issue
of non-assignable element type (but note that the restriction to
assignable is just a specification bug for std::list, corrected in C+
+0x).


Cheers & hth.,

- Alf


== 3 of 3 ==
Date: Tues, Dec 30 2008 12:06 am
From: abir


On Dec 30, 12:30 pm, alfps <alf.p.steinb...@gmail.com> wrote:
> On 30 Des, 07:09, abir <abirba...@gmail.com> wrote:
>
>
>
> > Hi
> > I am using an object with a const member like ,
> > struct Foo{
> > const int x_;
> > explicit Foo(int x) : x_(x){}};
>
> > I am happy with default copy ctor ...
> > but as its member is const, i can't make it assignable.
>
> > if i have std::vector<Foo> FV;
> > FV v; v.push_back(Foo(1));
> > Now i can't store it in vector. push_back internally calls insert and
> > which somewhere needs fill.
> > Why it is required at all,?
> > I have a handcrafted vector class where push_back does not need
> > assignment (not even copy ctor, an move op is sufficient)
> > I don't know where it is required apart from v[i] = Foo(3); or
> > equivalently *it = Foo(3); kind of statement.
> > even for insert at the mid i can transfer the mid elements at the
> > tail and copy /move construct the new elements at the raw memory at
> > mid.
>
> When you use a non-assignable element type you're violating the
> promise that that type gives: if you have a pointer or reference or
> iterator to such an element you have a right to expect that it won't
> change.
I am not sure what promise the type need to give. The only promise i
can think of is that the container can rearrange the elements in any
memory in any order (for vector even the memory order is specified as
for any ith element &v[i+1] == &v[i]+1)
Why the type need to promise that it need to be copy ctor'able apart
from that it can be moved inside the vector's memory (through copy,
through move, through direct construct or whatever other way
possible). I think c++0x removed that requirement, as in latest gcc
build i can write
v.push_back(1,2); for a struct which can take 2 args, and do inplace
construction.
or even a move ctor if i had externally constructed the object.
After that it can only rearrange the elements, or place them in some
new memory etc.
Why i need to give a promise that the vector (or any other container)
can change the state of the object which i requested it to store only?
one can always move an object with const state (or const object) in
another memory.
raw memory
> Removing or inserting in a vector can however change the elements
> beyond the removal/insertion point.
>
> And there is no separate class for "constant vector".
>
> In the end it's an issue of complexity.
>
It may be issue of complexity, but why it is a requirement?
> std::vector would have to be more complicated to deal with the issue
> of non-assignable element type (but note that the restriction to
> assignable is just a specification bug for std::list, corrected in C+
> +0x).
>
> Cheers & hth.,
>
> - Alf


==============================================================================
TOPIC: Is this copy initialization or direct initialization ?
http://groups.google.com/group/comp.lang.c++/t/bbb9bf8b25a8df90?hl=en
==============================================================================

== 1 of 3 ==
Date: Mon, Dec 29 2008 10:27 pm
From: "subramanian100in@yahoo.com, India"


Suppose 'Test' is a class.

Suppose I create an instance 'obj' of the 'Test' class:

Test obj;

Now, suppose I write

Test another = obj;

My question: is this last line called 'direct -initialization' or
'copy-initialization' ?

Kindly clarify.

Thanks
V.Subramanian


== 2 of 3 ==
Date: Mon, Dec 29 2008 10:53 pm
From: amrollahi.saeed@gmail.com


On Dec 30, 9:27 am, "subramanian10...@yahoo.com, India"
<subramanian10...@yahoo.com> wrote:
> Suppose 'Test' is a class.
>
> Suppose I create an instance 'obj' of the 'Test' class:
>
> Test obj;
>
> Now, suppose I write
>
> Test another = obj;
>
> My question: is this last line called 'direct -initialization' or
> 'copy-initialization' ?
>
> Kindly clarify.
>
> Thanks
> V.Subramanian

Hi

AFAIK, there isn't "direct -initialization" terminology in standard C+
+. I think the term "copy-initialization"
isn't standard too. What is clear is, in the following statements:
Test obj;
Test another = obj;
first an object (obj) is created using default constructor, then
another object (another) is created using
copy constructor. The second one is called "initialization", because
another is initialized using obj.

Cheers,
Saeed Amrollahi


== 3 of 3 ==
Date: Mon, Dec 29 2008 11:28 pm
From: blargg.h4g@gishpuppy.com (blargg)


subramanian100in wrote:
> Suppose 'Test' is a class.
>
> Suppose I create an instance 'obj' of the 'Test' class:
>
> Test obj;
>
> Now, suppose I write
>
> Test another = obj;
>
> My question: is this last line called 'direct -initialization' or
> 'copy-initialization' ?

It's copy-initialization, but since obj is the same type as another,
it has the semantics of direct-initialization (that is, it constructs
another using Test's copy constructor, without any temporary). See
section 8.5 paragraphs 12 and 14 (shown below).

ISO/IEC 14882:2003

8.5 Initializers
[...]
11 The form of initialization (using parentheses or =) is generally
insignificant, but does matter when the entity being initialized has a
class type; see below. A parenthesized initializer can be a list of
expressions only when the entity being initialized has a class type.

12 The initialization that occurs in argument passing, function return,
throwing an exception (15.1), handling an exception (15.3), and
brace-enclosed initializer lists (8.5.1) is called copy-initialization
and is equivalent to the form

T x = a;

The initialization that occurs in new expressions (5.3.4), static_cast
expressions (5.2.9), functional notation type conversions (5.2.3), and
base and member initializers (12.6.2) is called direct-initialization
and is equivalent to the form

T x(a);

[...]

14 The semantics of initializers are as follows.
[...]
‹ If the destination type is a (possibly cv-qualified) class type:

‹ If the class is an aggregate (8.5.1), and the initializer is a
brace-enclosed list, see 8.5.1.

‹ If the initialization is direct-initialization, or if it is
copy-initialization where the cv-unqualified version of the source
type is the same class as, or a derived class of, the class of the
destination, constructors are considered. The applicable
constructors are enumerated (13.3.1.3), and the best one is chosen
through overload resolution (13.3). The constructor so selected is
called to initialize the object, with the initializer
expression(s) as its argument(s). If no constructor applies, or
the overload resolution is ambiguous, the initialization is
ill-formed.

‹ Otherwise (i.e., for the remaining copy-initialization cases),
user-defined conversion sequences that can convert from the source
type to the destination type or (when a conversion function is
used) to a derived class thereof are enumerated as described in
13.3.1.4, and the best one is chosen through overload resolution
(13.3). If the conversion cannot be done or is ambiguous, the
initialization is ill-formed. The function selected is called with
the initializer expression as its argument; if the function is a
constructor, the call initializes a temporary of the destination
type. The result of the call (which is the temporary for the
constructor case) is then used to direct-initialize, according to
the rules above, the object that is the destination of the
copy-initialization. In certain cases, an implementation is
permitted to eliminate the copying inherent in this
direct-initialization by constructing the intermediate result
directly into the object being initialized; see 12.2, 12.8.


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c++"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c++?hl=en

To unsubscribe from this group, send email to comp.lang.c+++unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c++/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

No comments: